'Config', 'Results' projects added, includes iPerl opto logging bug-fixes, builds OK, cannot open DB, version 2.0.158.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
@@ -125,13 +126,13 @@ namespace TBF.UiControls
|
||||
|
||||
MyItem selectedItem = (MyItem)SelectedItems[0].Tag;
|
||||
|
||||
if ((selectedItem as Entities.IHasItemNr).Id != 0) ToBeRemovedItems.Add(selectedItem);
|
||||
if ((selectedItem as IHasItemNr).Id != 0) ToBeRemovedItems.Add(selectedItem);
|
||||
MyItems.RemoveAt(removeItemNr);
|
||||
if (selectedItem is Entities.IHasItemNr)
|
||||
if (selectedItem is IHasItemNr)
|
||||
{
|
||||
for (int i = removeItemNr; i < MyItems.Count; i++)
|
||||
{
|
||||
(MyItems[i] as Entities.IHasItemNr).ItemNr--;
|
||||
(MyItems[i] as IHasItemNr).ItemNr--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,8 +162,8 @@ namespace TBF.UiControls
|
||||
|
||||
MyItem item1 = (MyItem)(Items[ix - 1].Tag);
|
||||
MyItem item2 = (MyItem)(Items[ix].Tag);
|
||||
(item1 as Entities.IHasItemNr).ItemNr++;
|
||||
(item2 as Entities.IHasItemNr).ItemNr--;
|
||||
(item1 as IHasItemNr).ItemNr++;
|
||||
(item2 as IHasItemNr).ItemNr--;
|
||||
MyItems.RemoveAt(ix);
|
||||
MyItems.Insert(ix - 1, item2);
|
||||
|
||||
@@ -184,8 +185,8 @@ namespace TBF.UiControls
|
||||
|
||||
MyItem item1 = (MyItem)(Items[ix].Tag);
|
||||
MyItem item2 = (MyItem)(Items[ix + 1].Tag);
|
||||
(item1 as Entities.IHasItemNr).ItemNr++;
|
||||
(item2 as Entities.IHasItemNr).ItemNr--;
|
||||
(item1 as IHasItemNr).ItemNr++;
|
||||
(item2 as IHasItemNr).ItemNr--;
|
||||
MyItems.RemoveAt(ix + 1);
|
||||
MyItems.Insert(ix, item2);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using NHibernate;
|
||||
using log4net;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
using TBF.UiBridge;
|
||||
|
||||
namespace TBF.UiControls
|
||||
@@ -113,7 +113,7 @@ namespace TBF.UiControls
|
||||
|
||||
string oriTestName = testComboBox.Text;
|
||||
|
||||
IList<Procedure> procedures = FluentCommon.CreateSession(Database.Procedures)
|
||||
IList<Procedure> procedures = Config.FluentCommon.CreateSession(Config.Database.Procedures)
|
||||
.CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' AND Name = :name")
|
||||
.SetParameter("name", Program.MainWnd.ProcedureName)
|
||||
.List<Procedure>();
|
||||
@@ -144,7 +144,7 @@ namespace TBF.UiControls
|
||||
}
|
||||
else if (procedures[0].Tests.Count > 0)
|
||||
{
|
||||
Entities.Test test = procedures[0].Tests[0];
|
||||
Test test = procedures[0].Tests[0];
|
||||
string title;
|
||||
if (test.Repeats == 1)
|
||||
{
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace TBF.UiControls
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
Entities.Component MeterEntity { get; set; }
|
||||
Config.Entities.Component MeterEntity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
IList<Entities.MeasurementCorrection> ToBeRemoved { get; set; }
|
||||
IList<Config.Entities.MeasurementCorrection> ToBeRemoved { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
@@ -18,22 +19,22 @@ namespace TBF.UiControls
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
public Entities.Component MeterEntity
|
||||
public Component MeterEntity
|
||||
{
|
||||
get { return meterEntity; }
|
||||
set { meterEntity = value; }
|
||||
}
|
||||
Entities.Component meterEntity;
|
||||
Component meterEntity;
|
||||
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
public IList<Entities.MeasurementCorrection> ToBeRemoved
|
||||
public IList<MeasurementCorrection> ToBeRemoved
|
||||
{
|
||||
get { return toBeRemoved; }
|
||||
set { toBeRemoved = value; }
|
||||
}
|
||||
IList<Entities.MeasurementCorrection> toBeRemoved;
|
||||
IList<MeasurementCorrection> toBeRemoved;
|
||||
|
||||
MetrologyDlg parent;
|
||||
bool unlocked;
|
||||
@@ -43,7 +44,7 @@ namespace TBF.UiControls
|
||||
public MetrologyDlgBalanceTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
toBeRemoved = new List<Entities.MeasurementCorrection>();
|
||||
toBeRemoved = new List<MeasurementCorrection>();
|
||||
unlocked = false;
|
||||
}
|
||||
|
||||
@@ -84,7 +85,7 @@ namespace TBF.UiControls
|
||||
foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr);
|
||||
}
|
||||
|
||||
void AddOneLVI(Entities.MeasurementCorrection corr)
|
||||
void AddOneLVI(MeasurementCorrection corr)
|
||||
{
|
||||
int nr = listViewEx.Items.Count + 1;
|
||||
ListViewItem lvi = new ListViewItem(nr.ToString());
|
||||
@@ -111,12 +112,12 @@ namespace TBF.UiControls
|
||||
float value;
|
||||
if (e.SubItem == 1 && Utils.TryParseEFloat(e.DisplayText, out value) && value >= 0)
|
||||
{
|
||||
(e.Item.Tag as Entities.MeasurementCorrection).Measurement = value;
|
||||
(e.Item.Tag as MeasurementCorrection).Measurement = value;
|
||||
return;
|
||||
}
|
||||
else if (e.SubItem == 2 && Utils.TryParseEFloat(e.DisplayText, out value))
|
||||
{
|
||||
(e.Item.Tag as Entities.MeasurementCorrection).Correction = value / 1000.0f;
|
||||
(e.Item.Tag as MeasurementCorrection).Correction = value / 1000.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -147,7 +148,7 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
Entities.MeasurementCorrection corr = new Entities.MeasurementCorrection();
|
||||
MeasurementCorrection corr = new MeasurementCorrection();
|
||||
MeterEntity.Corrections.Add(corr);
|
||||
AddOneLVI(corr);
|
||||
|
||||
@@ -163,8 +164,8 @@ namespace TBF.UiControls
|
||||
|
||||
int removeItemNr = listViewEx.SelectedIndices[0];
|
||||
|
||||
Entities.MeasurementCorrection selected =
|
||||
(Entities.MeasurementCorrection)listViewEx.SelectedItems[0].Tag;
|
||||
MeasurementCorrection selected =
|
||||
(MeasurementCorrection)listViewEx.SelectedItems[0].Tag;
|
||||
if (selected.Id != 0) toBeRemoved.Add(selected);
|
||||
MeterEntity.Corrections.RemoveAt(removeItemNr);
|
||||
RefreshAll();
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
@@ -18,7 +19,7 @@ namespace TBF.UiControls
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
public Entities.Component MeterEntity
|
||||
public Component MeterEntity
|
||||
{
|
||||
get { return null; }
|
||||
set { }
|
||||
@@ -27,12 +28,12 @@ namespace TBF.UiControls
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
public IList<Entities.MeasurementCorrection> ToBeRemoved
|
||||
public IList<MeasurementCorrection> ToBeRemoved
|
||||
{
|
||||
get { return toBeRemoved; }
|
||||
set { toBeRemoved = value; }
|
||||
}
|
||||
IList<Entities.MeasurementCorrection> toBeRemoved;
|
||||
IList<MeasurementCorrection> toBeRemoved;
|
||||
|
||||
MetrologyDlg parent;
|
||||
bool unlocked;
|
||||
@@ -40,7 +41,7 @@ namespace TBF.UiControls
|
||||
public MetrologyDlgDensityTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
toBeRemoved = new List<Entities.MeasurementCorrection>();
|
||||
toBeRemoved = new List<MeasurementCorrection>();
|
||||
unlocked = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
@@ -18,8 +19,8 @@ namespace TBF.UiControls
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
Entities.Component meterEntity;
|
||||
public Entities.Component MeterEntity
|
||||
Component meterEntity;
|
||||
public Component MeterEntity
|
||||
{
|
||||
get { return meterEntity; }
|
||||
set { meterEntity = value; }
|
||||
@@ -28,12 +29,12 @@ namespace TBF.UiControls
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
public IList<Entities.MeasurementCorrection> ToBeRemoved
|
||||
public IList<MeasurementCorrection> ToBeRemoved
|
||||
{
|
||||
get { return toBeRemoved; }
|
||||
set { toBeRemoved = value; }
|
||||
}
|
||||
IList<Entities.MeasurementCorrection> toBeRemoved;
|
||||
IList<MeasurementCorrection> toBeRemoved;
|
||||
|
||||
MetrologyDlg parent;
|
||||
bool unlocked;
|
||||
@@ -43,7 +44,7 @@ namespace TBF.UiControls
|
||||
public MetrologyDlgFlowMeterTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
toBeRemoved = new List<Entities.MeasurementCorrection>();
|
||||
toBeRemoved = new List<MeasurementCorrection>();
|
||||
}
|
||||
|
||||
private void MetrologyDlgFlowMeterTab_Load(object sender, System.EventArgs e)
|
||||
@@ -83,7 +84,7 @@ namespace TBF.UiControls
|
||||
foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr);
|
||||
}
|
||||
|
||||
void AddOneLVI(Entities.MeasurementCorrection corr)
|
||||
void AddOneLVI(MeasurementCorrection corr)
|
||||
{
|
||||
int nr = listViewEx.Items.Count + 1;
|
||||
ListViewItem lvi = new ListViewItem(nr.ToString());
|
||||
@@ -110,12 +111,12 @@ namespace TBF.UiControls
|
||||
float value;
|
||||
if (e.SubItem == 1 && Utils.TryParseEFloat(e.DisplayText, out value) && value >= 0)
|
||||
{
|
||||
(e.Item.Tag as Entities.MeasurementCorrection).Measurement = value;
|
||||
(e.Item.Tag as MeasurementCorrection).Measurement = value;
|
||||
return;
|
||||
}
|
||||
else if (e.SubItem == 2 && Utils.TryParseEFloat(e.DisplayText, out value))
|
||||
{
|
||||
(e.Item.Tag as Entities.MeasurementCorrection).Correction = value / 1000.0f;
|
||||
(e.Item.Tag as MeasurementCorrection).Correction = value / 1000.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,7 +147,7 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
Entities.MeasurementCorrection corr = new Entities.MeasurementCorrection();
|
||||
MeasurementCorrection corr = new MeasurementCorrection();
|
||||
MeterEntity.Corrections.Add(corr);
|
||||
AddOneLVI(corr);
|
||||
|
||||
@@ -162,8 +163,8 @@ namespace TBF.UiControls
|
||||
|
||||
int removeItemNr = listViewEx.SelectedIndices[0];
|
||||
|
||||
Entities.MeasurementCorrection selected =
|
||||
(Entities.MeasurementCorrection)listViewEx.SelectedItems[0].Tag;
|
||||
MeasurementCorrection selected =
|
||||
(MeasurementCorrection)listViewEx.SelectedItems[0].Tag;
|
||||
if (selected.Id != 0) toBeRemoved.Add(selected);
|
||||
MeterEntity.Corrections.RemoveAt(removeItemNr);
|
||||
RefreshAll();
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
@@ -18,8 +19,8 @@ namespace TBF.UiControls
|
||||
/// Component entity that has a list of 'measurement-correction' pairs
|
||||
/// to be updated in the database on OK.
|
||||
/// </summary>
|
||||
Entities.Component meterEntity;
|
||||
public Entities.Component MeterEntity
|
||||
Component meterEntity;
|
||||
public Component MeterEntity
|
||||
{
|
||||
get { return meterEntity; }
|
||||
set { meterEntity = value; }
|
||||
@@ -28,12 +29,12 @@ namespace TBF.UiControls
|
||||
/// <summary>
|
||||
/// A list of 'measurement-correction' pairs to be deleted from the database on OK.
|
||||
/// </summary>
|
||||
public IList<Entities.MeasurementCorrection> ToBeRemoved
|
||||
public IList<MeasurementCorrection> ToBeRemoved
|
||||
{
|
||||
get { return toBeRemoved; }
|
||||
set { toBeRemoved = value; }
|
||||
}
|
||||
IList<Entities.MeasurementCorrection> toBeRemoved;
|
||||
IList<MeasurementCorrection> toBeRemoved;
|
||||
|
||||
MetrologyDlg parent;
|
||||
bool unlocked;
|
||||
@@ -43,7 +44,7 @@ namespace TBF.UiControls
|
||||
public MetrologyDlgPressMeterTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
toBeRemoved = new List<Entities.MeasurementCorrection>();
|
||||
toBeRemoved = new List<MeasurementCorrection>();
|
||||
}
|
||||
|
||||
private void MetrologyDlgPressMeterTab_Load(object sender, System.EventArgs e)
|
||||
@@ -83,7 +84,7 @@ namespace TBF.UiControls
|
||||
foreach (var corr in MeterEntity.Corrections) AddOneLVI(corr);
|
||||
}
|
||||
|
||||
void AddOneLVI(Entities.MeasurementCorrection corr)
|
||||
void AddOneLVI(MeasurementCorrection corr)
|
||||
{
|
||||
int nr = listViewEx.Items.Count + 1;
|
||||
ListViewItem lvi = new ListViewItem(nr.ToString());
|
||||
@@ -110,12 +111,12 @@ namespace TBF.UiControls
|
||||
float value;
|
||||
if (e.SubItem == 1 && Utils.TryParseEFloat(e.DisplayText, out value) && value >= 0)
|
||||
{
|
||||
(e.Item.Tag as Entities.MeasurementCorrection).Measurement = value;
|
||||
(e.Item.Tag as MeasurementCorrection).Measurement = value;
|
||||
return;
|
||||
}
|
||||
else if (e.SubItem == 2 && Utils.TryParseEFloat(e.DisplayText, out value))
|
||||
{
|
||||
(e.Item.Tag as Entities.MeasurementCorrection).Correction = value / 1000.0f;
|
||||
(e.Item.Tag as MeasurementCorrection).Correction = value / 1000.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,7 +147,7 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
Entities.MeasurementCorrection corr = new Entities.MeasurementCorrection();
|
||||
MeasurementCorrection corr = new MeasurementCorrection();
|
||||
MeterEntity.Corrections.Add(corr);
|
||||
AddOneLVI(corr);
|
||||
|
||||
@@ -162,8 +163,8 @@ namespace TBF.UiControls
|
||||
|
||||
int removeItemNr = listViewEx.SelectedIndices[0];
|
||||
|
||||
Entities.MeasurementCorrection selected =
|
||||
(Entities.MeasurementCorrection)listViewEx.SelectedItems[0].Tag;
|
||||
MeasurementCorrection selected =
|
||||
(MeasurementCorrection)listViewEx.SelectedItems[0].Tag;
|
||||
if (selected.Id != 0) toBeRemoved.Add(selected);
|
||||
MeterEntity.Corrections.RemoveAt(removeItemNr);
|
||||
RefreshAll();
|
||||
|
||||
@@ -11,7 +11,7 @@ using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public class PathsBenchCtrl : BaseWithListViewEx<Entities.BenchPath>, ITabWithListViewEx
|
||||
public class PathsBenchCtrl : BaseWithListViewEx<Config.Entities.BenchPath>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PathsBenchCtrl));
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace TBF.UiControls
|
||||
/// Load the paths
|
||||
MyItems = parent.Session
|
||||
.CreateQuery("FROM BenchPath ORDER BY ItemNr")
|
||||
.List<Entities.BenchPath>();
|
||||
.List<Config.Entities.BenchPath>();
|
||||
|
||||
SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
|
||||
SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
|
||||
@@ -119,8 +119,8 @@ namespace TBF.UiControls
|
||||
void listViewEx_SubItemClicked(object sender, SubItemEventArgs e)
|
||||
{
|
||||
if (!Unlocked || e.SubItem >= editors.Length) return;
|
||||
if ((e.Item.Tag is Entities.IHasItemNr) &&
|
||||
((e.Item.Tag as Entities.IHasItemNr).ItemNr < FixedRowsCount) &&
|
||||
if ((e.Item.Tag is Config.Entities.IHasItemNr) &&
|
||||
((e.Item.Tag as Config.Entities.IHasItemNr).ItemNr < FixedRowsCount) &&
|
||||
(e.SubItem < fixedColumnsCount))
|
||||
{
|
||||
return;
|
||||
@@ -134,7 +134,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.BenchPath entity =(Entities.BenchPath)myItem;
|
||||
Config.Entities.BenchPath entity =(Config.Entities.BenchPath)myItem;
|
||||
BenchControl.BenchPath path = new BenchControl.BenchPath(entity, parent.TbfComponents);
|
||||
|
||||
ListViewItem lvi = new ListViewItem(entity.Name);
|
||||
@@ -171,7 +171,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.BenchPath entity = (Entities.BenchPath)myItem;
|
||||
Config.Entities.BenchPath entity = (Config.Entities.BenchPath)myItem;
|
||||
|
||||
entity.Name = lvi.Text;
|
||||
|
||||
@@ -223,11 +223,11 @@ namespace TBF.UiControls
|
||||
/// Update the database
|
||||
foreach (var entity in ToBeRemovedItems)
|
||||
{
|
||||
FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
}
|
||||
foreach (var entity in MyItems)
|
||||
{
|
||||
FluentCommon.SaveToDb(parent.Session, entity);
|
||||
Config.FluentCommon.SaveToDb(parent.Session, entity);
|
||||
}
|
||||
|
||||
/// Update the column widths
|
||||
@@ -241,11 +241,11 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
Entities.BenchPath entity;
|
||||
Config.Entities.BenchPath entity;
|
||||
|
||||
if (MyItems.Count < FixedRowsCount)
|
||||
{
|
||||
entity = new Entities.BenchPath(new BenchControl.BenchPath(Strings._none_, MyItems.Count));
|
||||
entity = new Config.Entities.BenchPath(Strings._none_, MyItems.Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -258,7 +258,7 @@ namespace TBF.UiControls
|
||||
foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false;
|
||||
if (notUsed) break;
|
||||
}
|
||||
entity = new Entities.BenchPath(new BenchControl.BenchPath(newName, MyItems.Count));
|
||||
entity = new Config.Entities.BenchPath(newName, MyItems.Count);
|
||||
}
|
||||
|
||||
base.AddOne(entity);
|
||||
|
||||
@@ -5,13 +5,14 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public class PathsFeedingCtrl : BaseWithListViewEx<Entities.FeedingPath>, ITabWithListViewEx
|
||||
public class PathsFeedingCtrl : BaseWithListViewEx<Config.Entities.FeedingPath>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PathsFeedingCtrl));
|
||||
|
||||
@@ -46,7 +47,7 @@ namespace TBF.UiControls
|
||||
/// Load the paths
|
||||
MyItems = parent.Session
|
||||
.CreateQuery("FROM FeedingPath ORDER BY ItemNr")
|
||||
.List<Entities.FeedingPath>();
|
||||
.List<Config.Entities.FeedingPath>();
|
||||
|
||||
SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
|
||||
SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
|
||||
@@ -99,8 +100,8 @@ namespace TBF.UiControls
|
||||
void listViewEx_SubItemClicked(object sender, SubItemEventArgs e)
|
||||
{
|
||||
if (!Unlocked || e.SubItem >= editors.Length) return;
|
||||
if ((e.Item.Tag is Entities.IHasItemNr) &&
|
||||
((e.Item.Tag as Entities.IHasItemNr).ItemNr < FixedRowsCount) &&
|
||||
if ((e.Item.Tag is IHasItemNr) &&
|
||||
((e.Item.Tag as IHasItemNr).ItemNr < FixedRowsCount) &&
|
||||
(e.SubItem < fixedColumnsCount))
|
||||
{
|
||||
return;
|
||||
@@ -114,7 +115,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.FeedingPath entity =(Entities.FeedingPath)myItem;
|
||||
Config.Entities.FeedingPath entity = (Config.Entities.FeedingPath)myItem;
|
||||
BenchControl.FeedingPath path = new BenchControl.FeedingPath(entity, parent.TbfComponents);
|
||||
|
||||
ListViewItem lvi = new ListViewItem(entity.Name);
|
||||
@@ -148,7 +149,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.FeedingPath entity = (Entities.FeedingPath)myItem;
|
||||
Config.Entities.FeedingPath entity = (Config.Entities.FeedingPath)myItem;
|
||||
|
||||
entity.Name = lvi.Text;
|
||||
|
||||
@@ -201,11 +202,11 @@ namespace TBF.UiControls
|
||||
/// Update the database
|
||||
foreach (var entity in ToBeRemovedItems)
|
||||
{
|
||||
FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
}
|
||||
foreach (var entity in MyItems)
|
||||
{
|
||||
FluentCommon.SaveToDb(parent.Session, entity);
|
||||
Config.FluentCommon.SaveToDb(parent.Session, entity);
|
||||
}
|
||||
|
||||
/// Update the column widths
|
||||
@@ -219,11 +220,11 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
Entities.FeedingPath entity;
|
||||
Config.Entities.FeedingPath entity;
|
||||
|
||||
if (MyItems.Count < FixedRowsCount)
|
||||
{
|
||||
entity = new Entities.FeedingPath(new BenchControl.FeedingPath(Strings._none_, MyItems.Count));
|
||||
entity = new Config.Entities.FeedingPath(Strings._none_, MyItems.Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -236,7 +237,7 @@ namespace TBF.UiControls
|
||||
foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false;
|
||||
if (notUsed) break;
|
||||
}
|
||||
entity = new Entities.FeedingPath(new BenchControl.FeedingPath(newName, MyItems.Count));
|
||||
entity = new Config.Entities.FeedingPath(newName, MyItems.Count);
|
||||
}
|
||||
|
||||
base.AddOne(entity);
|
||||
|
||||
@@ -11,7 +11,7 @@ using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public class PathsMetersCtrl : BaseWithListViewEx<Entities.MetersPath>, ITabWithListViewEx
|
||||
public class PathsMetersCtrl : BaseWithListViewEx<Config.Entities.MetersPath>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PathsMetersCtrl));
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace TBF.UiControls
|
||||
/// Load the paths
|
||||
MyItems = parent.Session
|
||||
.CreateQuery("FROM MetersPath ORDER BY ItemNr")
|
||||
.List<Entities.MetersPath>();
|
||||
.List<Config.Entities.MetersPath>();
|
||||
|
||||
SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
|
||||
SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
|
||||
@@ -61,20 +61,20 @@ namespace TBF.UiControls
|
||||
Columns.Add(Strings.Q_from_m3h, (ls.MetersColumnCount > 1) ? ls.MetersColumnWidths[1] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
Columns.Add(Strings.Q_to_m3h, (ls.MetersColumnCount > 2) ? ls.MetersColumnWidths[2] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
int clmn = (int)Column.FixedColumnsCount;
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
Columns.Add(Strings.Sensor_ + (i + 1).ToString(), (ls.MetersColumnCount > clmn) ? ls.MetersColumnWidths[clmn] : 50 * parent.Dpi / PathsDlg.Dpi100pct);
|
||||
clmn++;
|
||||
}
|
||||
|
||||
/// Editors
|
||||
editors = new Control[fixedColumnsCount + Program.WMsCount];
|
||||
editors = new Control[fixedColumnsCount + Config.Data.WMsCount];
|
||||
///
|
||||
editors[(int)Column.Name] = new TextBox(); /// Name
|
||||
editors[(int)Column.Qfrom] = new TextBox(); /// Q_from
|
||||
editors[(int)Column.Qto] = new TextBox(); /// Q_to
|
||||
/// Prepare valve combo-boxes (max. 64 valves)
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
ComboBox cb = new ComboBox();
|
||||
foreach (var rr in readers) cb.Items.Add(rr.Cfg.Name);
|
||||
@@ -98,14 +98,14 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.MetersPath entity =(Entities.MetersPath)myItem;
|
||||
Config.Entities.MetersPath entity =(Config.Entities.MetersPath)myItem;
|
||||
BenchControl.MetersPath path = new BenchControl.MetersPath(entity, parent.TbfComponents);
|
||||
|
||||
ListViewItem lvi = new ListViewItem(entity.Name);
|
||||
lvi.SubItems.Add(path.Qfrom.ToString());
|
||||
lvi.SubItems.Add(path.Qto.ToString());
|
||||
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
if (path.RegisterReaders != null && path.RegisterReaders[i] != null)
|
||||
{
|
||||
@@ -124,7 +124,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.MetersPath entity = (Entities.MetersPath)myItem;
|
||||
Config.Entities.MetersPath entity = (Config.Entities.MetersPath)myItem;
|
||||
|
||||
entity.Name = lvi.Text;
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace TBF.UiControls
|
||||
allOk &= Utils.TryParseUFloat(lvi.SubItems[(int)Column.Qto].Text, out Qto);
|
||||
entity.Qto = Qto;
|
||||
|
||||
for (int j = 0; j < Program.WMsCount; j++)
|
||||
for (int j = 0; j < Config.Data.WMsCount; j++)
|
||||
{
|
||||
entity.SetSensor(j, lvi.SubItems[fixedColumnsCount + j].Text);
|
||||
}
|
||||
@@ -152,11 +152,11 @@ namespace TBF.UiControls
|
||||
/// Update the database
|
||||
foreach (var entity in ToBeRemovedItems)
|
||||
{
|
||||
FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
}
|
||||
foreach (var entity in MyItems)
|
||||
{
|
||||
FluentCommon.SaveToDb(parent.Session, entity);
|
||||
Config.FluentCommon.SaveToDb(parent.Session, entity);
|
||||
}
|
||||
|
||||
/// Update the column widths
|
||||
@@ -180,7 +180,7 @@ namespace TBF.UiControls
|
||||
if (notUsed) break;
|
||||
}
|
||||
|
||||
Entities.MetersPath entity = new Entities.MetersPath(new BenchControl.MetersPath(newName, MyItems.Count));
|
||||
Config.Entities.MetersPath entity = new Config.Entities.MetersPath(newName, MyItems.Count);
|
||||
|
||||
base.AddOne(entity);
|
||||
}
|
||||
|
||||
@@ -5,13 +5,14 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public class PathsOutputCtrl : BaseWithListViewEx<Entities.OutputPath>, ITabWithListViewEx
|
||||
public class PathsOutputCtrl : BaseWithListViewEx<Config.Entities.OutputPath>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PathsOutputCtrl));
|
||||
|
||||
@@ -53,7 +54,7 @@ namespace TBF.UiControls
|
||||
/// Load the paths
|
||||
MyItems = parent.Session
|
||||
.CreateQuery("FROM OutputPath ORDER BY ItemNr")
|
||||
.List<Entities.OutputPath>();
|
||||
.List<Config.Entities.OutputPath>();
|
||||
|
||||
SubItemClicked += new SubItemEventHandler(listViewEx_SubItemClicked);
|
||||
SubItemEndEditing += new SubItemEndEditingEventHandler(listViewEx_SubItemEndEditing);
|
||||
@@ -141,8 +142,8 @@ namespace TBF.UiControls
|
||||
void listViewEx_SubItemClicked(object sender, SubItemEventArgs e)
|
||||
{
|
||||
if (!Unlocked || e.SubItem >= editors.Length) return;
|
||||
if ((e.Item.Tag is Entities.IHasItemNr) &&
|
||||
((e.Item.Tag as Entities.IHasItemNr).ItemNr < FixedRowsCount) &&
|
||||
if ((e.Item.Tag is IHasItemNr) &&
|
||||
((e.Item.Tag as IHasItemNr).ItemNr < FixedRowsCount) &&
|
||||
(e.SubItem < fixedColumnsCount))
|
||||
{
|
||||
return;
|
||||
@@ -156,7 +157,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.OutputPath entity =(Entities.OutputPath)myItem;
|
||||
Config.Entities.OutputPath entity =(Config.Entities.OutputPath)myItem;
|
||||
BenchControl.OutputPath path = new BenchControl.OutputPath(entity, parent.TbfComponents);
|
||||
|
||||
ListViewItem lvi = new ListViewItem(entity.Name);
|
||||
@@ -197,7 +198,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.OutputPath entity = (Entities.OutputPath)myItem;
|
||||
Config.Entities.OutputPath entity = (Config.Entities.OutputPath)myItem;
|
||||
|
||||
entity.Name = lvi.Text;
|
||||
|
||||
@@ -257,11 +258,11 @@ namespace TBF.UiControls
|
||||
/// Update the database
|
||||
foreach (var entity in ToBeRemovedItems)
|
||||
{
|
||||
FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
Config.FluentCommon.DeleteFromDb(parent.Session, entity);
|
||||
}
|
||||
foreach (var entity in MyItems)
|
||||
{
|
||||
FluentCommon.SaveToDb(parent.Session, entity);
|
||||
Config.FluentCommon.SaveToDb(parent.Session, entity);
|
||||
}
|
||||
|
||||
/// Update the column widths
|
||||
@@ -275,11 +276,11 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
Entities.OutputPath entity;
|
||||
Config.Entities.OutputPath entity;
|
||||
|
||||
if (MyItems.Count < FixedRowsCount)
|
||||
{
|
||||
entity = new Entities.OutputPath(new BenchControl.OutputPath(Strings._none_, MyItems.Count));
|
||||
entity = new Config.Entities.OutputPath(Strings._none_, MyItems.Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -292,7 +293,7 @@ namespace TBF.UiControls
|
||||
foreach (var t in MyItems) if (t.Name.Equals(newName)) notUsed = false;
|
||||
if (notUsed) break;
|
||||
}
|
||||
entity = new Entities.OutputPath(new BenchControl.OutputPath(newName, MyItems.Count));
|
||||
entity = new Config.Entities.OutputPath(newName, MyItems.Count);
|
||||
}
|
||||
|
||||
base.AddOne(entity);
|
||||
|
||||
@@ -7,13 +7,14 @@ using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using NHibernate;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public class ProceduresCtrl : BaseWithListViewEx<Entities.Procedure>, ITabWithListViewEx
|
||||
public class ProceduresCtrl : BaseWithListViewEx<Procedure>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ProceduresCtrl));
|
||||
|
||||
@@ -66,9 +67,9 @@ namespace TBF.UiControls
|
||||
void ReloadAndRedrawAll()
|
||||
{
|
||||
/// Load the procedures
|
||||
session = FluentCommon.CreateSession(Database.Procedures);
|
||||
session = Config.FluentCommon.CreateSession(Config.Database.Procedures);
|
||||
MyItems = session.CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' ORDER BY ItemNr")
|
||||
.List<Entities.Procedure>();
|
||||
.List<Procedure>();
|
||||
|
||||
base.RedrawAll();
|
||||
}
|
||||
@@ -83,7 +84,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.Procedure entity = (Entities.Procedure)myItem;
|
||||
Procedure entity = (Procedure)myItem;
|
||||
|
||||
ListViewItem lvi = new ListViewItem(entity.Name);
|
||||
lvi.SubItems.Add(entity.Description);
|
||||
@@ -94,7 +95,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.Procedure entity = (Entities.Procedure)myItem;
|
||||
Procedure entity = (Procedure)myItem;
|
||||
entity.Name = lvi.Text;
|
||||
entity.Description = lvi.SubItems[(int)Column.Description].Text;
|
||||
}
|
||||
@@ -108,13 +109,13 @@ namespace TBF.UiControls
|
||||
|
||||
foreach (var entity in ToBeRemovedItems)
|
||||
{
|
||||
FluentCommon.DeleteFromDb(session, entity);
|
||||
Config.FluentCommon.DeleteFromDb(session, entity);
|
||||
}
|
||||
int itemNr = 0;
|
||||
foreach (var entity in MyItems)
|
||||
{
|
||||
(entity as Entities.Procedure).ItemNr = itemNr++;
|
||||
FluentCommon.SaveToDb(session, entity);
|
||||
(entity as Procedure).ItemNr = itemNr++;
|
||||
Config.FluentCommon.SaveToDb(session, entity);
|
||||
}
|
||||
|
||||
/// Update the column widths
|
||||
@@ -140,12 +141,12 @@ namespace TBF.UiControls
|
||||
if (notUsed) break;
|
||||
}
|
||||
|
||||
Entities.Procedure newProcedure = new Entities.Procedure(newName, MyItems.Count);
|
||||
newProcedure.ProcedureState = Entities.ProcedureState.Active;
|
||||
Procedure newProcedure = new Procedure(newName, MyItems.Count);
|
||||
newProcedure.ProcedureState = ProcedureState.Active;
|
||||
newProcedure.Revision = 1;
|
||||
newProcedure.PredecessorId = 0;
|
||||
newProcedure.ObtainedByCopy = false;
|
||||
newProcedure.CreationUser = Entities.User.CurrentUser.Name;
|
||||
newProcedure.CreationUser = User.CurrentUser.Name;
|
||||
newProcedure.CreationTime = DateTime.Now;
|
||||
|
||||
if (new ProcedureDlg(newProcedure).ShowDialog() == DialogResult.OK)
|
||||
@@ -157,7 +158,7 @@ namespace TBF.UiControls
|
||||
{
|
||||
try
|
||||
{
|
||||
newProcedure.LastChgUser = Entities.User.CurrentUser.Name;
|
||||
newProcedure.LastChgUser = User.CurrentUser.Name;
|
||||
newProcedure.LastChgTime = DateTime.Now;
|
||||
|
||||
base.AddOne(newProcedure);
|
||||
@@ -191,8 +192,8 @@ namespace TBF.UiControls
|
||||
{
|
||||
if (SelectedItems.Count != 1) return;
|
||||
|
||||
Entities.Procedure originalProcedure = SelectedItems[0].Tag as Entities.Procedure;
|
||||
Entities.Procedure modifiedProcedure = originalProcedure.Clone();
|
||||
Procedure originalProcedure = SelectedItems[0].Tag as Procedure;
|
||||
Procedure modifiedProcedure = originalProcedure.Clone();
|
||||
|
||||
modifiedProcedure.ItemNr = originalProcedure.ItemNr;
|
||||
modifiedProcedure.Revision = originalProcedure.Revision + 1;
|
||||
@@ -207,8 +208,8 @@ namespace TBF.UiControls
|
||||
{
|
||||
try
|
||||
{
|
||||
originalProcedure.ProcedureState = Entities.ProcedureState.History;
|
||||
modifiedProcedure.LastChgUser = Entities.User.CurrentUser.Name;
|
||||
originalProcedure.ProcedureState = ProcedureState.History;
|
||||
modifiedProcedure.LastChgUser = User.CurrentUser.Name;
|
||||
modifiedProcedure.LastChgTime = DateTime.Now;
|
||||
|
||||
session.SaveOrUpdate(originalProcedure);
|
||||
@@ -236,18 +237,18 @@ namespace TBF.UiControls
|
||||
{
|
||||
if (SelectedItems.Count != 1) return;
|
||||
|
||||
Entities.Procedure selectedProcedure = (Entities.Procedure)SelectedItems[0].Tag;
|
||||
Procedure selectedProcedure = (Procedure)SelectedItems[0].Tag;
|
||||
|
||||
/// Make a copy of the selected procedure
|
||||
Entities.Procedure newProcedure = selectedProcedure.Clone();
|
||||
Procedure newProcedure = selectedProcedure.Clone();
|
||||
|
||||
newProcedure.Name = selectedProcedure.Name + Strings.New_name_copy;
|
||||
newProcedure.ItemNr = MyItems.Count;
|
||||
newProcedure.ProcedureState = Entities.ProcedureState.Active;
|
||||
newProcedure.ProcedureState = ProcedureState.Active;
|
||||
newProcedure.Revision = 1;
|
||||
newProcedure.PredecessorId = selectedProcedure.Id;
|
||||
newProcedure.ObtainedByCopy = true;
|
||||
newProcedure.CreationUser = Entities.User.CurrentUser.Name;
|
||||
newProcedure.CreationUser = User.CurrentUser.Name;
|
||||
newProcedure.CreationTime = DateTime.Now;
|
||||
|
||||
if ((new ProcedureDlg(newProcedure)).ShowDialog() == DialogResult.OK)
|
||||
@@ -257,7 +258,7 @@ namespace TBF.UiControls
|
||||
|
||||
using (var transaction = session.BeginTransaction())
|
||||
{
|
||||
newProcedure.LastChgUser = Entities.User.CurrentUser.Name;
|
||||
newProcedure.LastChgUser = User.CurrentUser.Name;
|
||||
newProcedure.LastChgTime = DateTime.Now;
|
||||
|
||||
base.AddOne(newProcedure);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
@@ -58,20 +59,20 @@ namespace TBF.UiControls
|
||||
Middle,
|
||||
}
|
||||
|
||||
public Grp.GID RequiredGroupMembership;
|
||||
public Config.Grp.GID RequiredGroupMembership;
|
||||
|
||||
Entities.User originalUser;
|
||||
Config.Entities.User originalUser;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
public SharedButtons()
|
||||
{
|
||||
originalUser = Entities.User.CurrentUser;
|
||||
originalUser = Config.Entities.User.CurrentUser;
|
||||
lockState = LockState.Locked;
|
||||
MoreActive = false;
|
||||
OptionalButtons = Buttons.None;
|
||||
RequiredGroupMembership = Grp.GID.None;
|
||||
RequiredGroupMembership = Config.Grp.GID.None;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -198,7 +199,7 @@ namespace TBF.UiControls
|
||||
|
||||
void RestoreUser()
|
||||
{
|
||||
Entities.User.CurrentUser = originalUser;
|
||||
User.CurrentUser = originalUser;
|
||||
Program.MainWnd.UpdateUser();
|
||||
}
|
||||
|
||||
@@ -228,13 +229,13 @@ namespace TBF.UiControls
|
||||
{
|
||||
if (lockState == LockState.Locked)
|
||||
{
|
||||
if (!Entities.User.CurrentUser.IsMemberOf(RequiredGroupMembership))
|
||||
if (!User.CurrentUser.IsMemberOf(RequiredGroupMembership))
|
||||
{
|
||||
if ((new LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return;
|
||||
}
|
||||
else if (Program.LocalSettings.AlwaysAskPasswdWhenUnlocking)
|
||||
{
|
||||
if ((new LoginDlg(Entities.User.CurrentUser.Name, RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return;
|
||||
if ((new LoginDlg(User.CurrentUser.Name, RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return;
|
||||
}
|
||||
|
||||
UnlockButtons();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -155,11 +156,11 @@ namespace TBF.UiControls
|
||||
listViewEx.Items.Add(lvi);
|
||||
}
|
||||
|
||||
public void AddOne(Entities.Test test)
|
||||
public void AddOne(Test test)
|
||||
{
|
||||
if (test.Method == cmpnt.Cfg.Name)
|
||||
{
|
||||
Entities.ComponentTest entity = new Entities.ComponentTest();
|
||||
ComponentTest entity = new ComponentTest();
|
||||
entity.CmpntName = test.Method;
|
||||
entity.Test = test;
|
||||
IParamsProvider testParams = cmpnt.Cfg.CreateTestParams(test); /// Load or create ComponentTest entity
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public partial class TransitionStepsCtrl : BaseWithListViewEx<Entities.TransitionStep>, ITabWithListViewEx
|
||||
public partial class TransitionStepsCtrl : BaseWithListViewEx<TransitionStep>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(TransitionStepsCtrl));
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace TBF.UiControls
|
||||
}
|
||||
readonly int fixedCount = (int)Column.FixedColumnsCount;
|
||||
|
||||
Entities.TransitionSequence sequence;
|
||||
TransitionSequence sequence;
|
||||
|
||||
TransitionsDlg parent;
|
||||
Control parentControl;
|
||||
@@ -41,7 +42,7 @@ namespace TBF.UiControls
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialize(Entities.TransitionSequence sequence, TransitionsDlg parent, Control parentControl)
|
||||
public void Initialize(TransitionSequence sequence, TransitionsDlg parent, Control parentControl)
|
||||
{
|
||||
this.sequence = sequence;
|
||||
this.parent = parent;
|
||||
@@ -99,9 +100,9 @@ namespace TBF.UiControls
|
||||
/// End condition
|
||||
ComboBox condCombo = new ComboBox();
|
||||
condCombo.Items.Add("---");
|
||||
for (int i = 1; i < (int)Entities.StepCondition.Count; i++)
|
||||
for (int i = 1; i < (int)StepCondition.Count; i++)
|
||||
{
|
||||
condCombo.Items.Add(((Entities.StepCondition)i).ToString());
|
||||
condCombo.Items.Add(((StepCondition)i).ToString());
|
||||
}
|
||||
editors[(int)Column.Condition] = condCombo;
|
||||
parent.Controls.Add(editors[(int)Column.Condition]);
|
||||
@@ -226,7 +227,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.TransitionStep step = (Entities.TransitionStep)myItem;
|
||||
TransitionStep step = (TransitionStep)myItem;
|
||||
|
||||
IList<IValve> valvesOpen = new List<IValve>();
|
||||
if (step.ValvesOpen != null)
|
||||
@@ -244,7 +245,7 @@ namespace TBF.UiControls
|
||||
|
||||
ListViewItem lvi = new ListViewItem(step.Duration.ToString());
|
||||
lvi.SubItems.Add(string.IsNullOrEmpty(step.Message) ? string.Empty : step.Message);
|
||||
lvi.SubItems.Add((step.EndCondition == Entities.StepCondition.None) ? "---" : step.EndCondition.ToString());
|
||||
lvi.SubItems.Add((step.EndCondition == StepCondition.None) ? "---" : step.EndCondition.ToString());
|
||||
|
||||
string[] fmPumpsStr = (step.PumpWithFMPcts != null) ? step.PumpWithFMPcts.Split(new char[] { ';' })
|
||||
: new string[0];
|
||||
@@ -286,7 +287,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.TransitionStep step = (Entities.TransitionStep)myItem;
|
||||
TransitionStep step = (TransitionStep)myItem;
|
||||
|
||||
///
|
||||
/// Duration
|
||||
@@ -308,12 +309,12 @@ namespace TBF.UiControls
|
||||
///
|
||||
/// Condition
|
||||
///
|
||||
step.EndCondition = Entities.StepCondition.None; /// When item text is "---" or a wrong value
|
||||
for (int cond = 1; cond < (int)Entities.StepCondition.Count; cond++)
|
||||
step.EndCondition = StepCondition.None; /// When item text is "---" or a wrong value
|
||||
for (int cond = 1; cond < (int)StepCondition.Count; cond++)
|
||||
{
|
||||
if (lvi.SubItems[(int)Column.Condition].Text.Equals(((Entities.StepCondition)cond).ToString()))
|
||||
if (lvi.SubItems[(int)Column.Condition].Text.Equals(((StepCondition)cond).ToString()))
|
||||
{
|
||||
step.EndCondition = (Entities.StepCondition)cond;
|
||||
step.EndCondition = (StepCondition)cond;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -404,7 +405,7 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
base.AddOne(new Entities.TransitionStep(MyItems.Count, sequence));
|
||||
base.AddOne(new TransitionStep(MyItems.Count, sequence));
|
||||
}
|
||||
|
||||
public new void RemoveSelected()
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.UiControls
|
||||
{
|
||||
public partial class VirtualBenchStepsCtrl : BaseWithListViewEx<Entities.VirtualBenchStep>, ITabWithListViewEx
|
||||
public partial class VirtualBenchStepsCtrl : BaseWithListViewEx<VirtualBenchStep>, ITabWithListViewEx
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(VirtualBenchStepsCtrl));
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace TBF.UiControls
|
||||
}
|
||||
readonly int fixedCount = (int)Column.FixedColumnsCount;
|
||||
|
||||
Entities.VirtualBenchSequence sequence;
|
||||
VirtualBenchSequence sequence;
|
||||
|
||||
TransitionsDlg parent;
|
||||
Control parentControl;
|
||||
@@ -39,7 +40,7 @@ namespace TBF.UiControls
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialize(Entities.VirtualBenchSequence sequence, TransitionsDlg parent, Control parentControl)
|
||||
public void Initialize(VirtualBenchSequence sequence, TransitionsDlg parent, Control parentControl)
|
||||
{
|
||||
this.sequence = sequence;
|
||||
this.parent = parent;
|
||||
@@ -177,7 +178,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void DrawOne(object myItem)
|
||||
{
|
||||
Entities.VirtualBenchStep step = (Entities.VirtualBenchStep)myItem;
|
||||
VirtualBenchStep step = (VirtualBenchStep)myItem;
|
||||
|
||||
ListViewItem lvi = new ListViewItem(step.Duration.ToString());
|
||||
|
||||
@@ -190,7 +191,7 @@ namespace TBF.UiControls
|
||||
|
||||
public override void UpdateOne(ListViewItem lvi, object myItem)
|
||||
{
|
||||
Entities.VirtualBenchStep step = (Entities.VirtualBenchStep)myItem;
|
||||
VirtualBenchStep step = (VirtualBenchStep)myItem;
|
||||
|
||||
/// Duration
|
||||
int duration;
|
||||
@@ -212,7 +213,7 @@ namespace TBF.UiControls
|
||||
|
||||
public void AddOne()
|
||||
{
|
||||
base.AddOne(new Entities.VirtualBenchStep(MyItems.Count, sequence));
|
||||
base.AddOne(new VirtualBenchStep(MyItems.Count, sequence));
|
||||
}
|
||||
|
||||
public new void RemoveSelected()
|
||||
|
||||
Reference in New Issue
Block a user