Everything works OK after serious changes:
- all components, componentCfg-s and parameter providers use base classes - less boilerplate code, simpler access to test/procedure parameters from code - CreateTestParams(test), CreateProcedureParams(procedure) methods added - TestBenchSim class is made static, it is not inheritted by any device anymore
This commit is contained in:
@@ -6,21 +6,12 @@ using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Munich
|
||||
{
|
||||
public class EntryForm : Generic.IComponent, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasProtocolTitle
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasProtocolTitle
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Name={0}", Name);
|
||||
}
|
||||
|
||||
public override string ToString() { return string.Format("DataEntry.Munich({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return entryFormCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return entryFormCfg.Name; } }
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin and the End form
|
||||
@@ -34,18 +25,11 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
public string ProtocolTitle { get { return protocolTitle; } }
|
||||
string protocolTitle;
|
||||
|
||||
/// <summary> Not supported in Munich </summary>
|
||||
public string SerialNr(int wmNr) { return string.Empty; }
|
||||
|
||||
/// <summary> Not supported in Munich </summary>
|
||||
public string SerialNr(int wmNr)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// <summary> Not supported in Munich </summary>
|
||||
public float WMState(int wmNr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public float WMState(int wmNr) { return 0; }
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
@@ -63,12 +47,12 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
public string ProtocolTitle2;
|
||||
public string ProtocolTitle3;
|
||||
|
||||
/// Parameterless constructor
|
||||
public EntryFormCfg()
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
Name = "DataEntryForm-Munich";
|
||||
ParentName = string.Empty;
|
||||
@@ -29,7 +29,7 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Protocol1={2}, Protocol2={3}, Protocol3={4}",
|
||||
return string.Format("Name={0}, Protocol1={1}, Protocol2={2}, Protocol3={3}",
|
||||
Name,
|
||||
(string.IsNullOrEmpty(ProtocolTitle1) ? "-" : ProtocolTitle1),
|
||||
(string.IsNullOrEmpty(ProtocolTitle2) ? "-" : ProtocolTitle2),
|
||||
|
||||
@@ -6,10 +6,6 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
public class EntryFormFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "DataEntryForm-Munich"; } }
|
||||
public bool HasProcedureParams { get { return false; } }
|
||||
public bool HasTestParams { get { return false; } }
|
||||
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
|
||||
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
|
||||
|
||||
/// <summary>Max. number of components of this class in the system</summary>
|
||||
public int MaxCount { get { return 1; } }
|
||||
|
||||
@@ -6,21 +6,12 @@ using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Munich3
|
||||
{
|
||||
public class EntryForm : Generic.IComponent, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasProtocolTitle
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasCycleBeginForm, IHasCycleEndForm, IHasProtocolTitle
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Name={0}", Name);
|
||||
}
|
||||
public override string ToString() { return string.Format("DataEntry.Munich3({0})", Cfg.ToString(1)); }
|
||||
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return entryFormCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return entryFormCfg.Name; } }
|
||||
|
||||
/// <summary>
|
||||
/// Properties set by the Begin and the End form
|
||||
@@ -28,18 +19,11 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
public string ProtocolTitle { get { return protocolTitle; } }
|
||||
string protocolTitle;
|
||||
|
||||
/// <summary> Not supported in Munich </summary>
|
||||
public string SerialNr(int wmNr) { return string.Empty; }
|
||||
|
||||
/// <summary> Not supported in Munich </summary>
|
||||
public string SerialNr(int wmNr)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// <summary> Not supported in Munich </summary>
|
||||
public float WMState(int wmNr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public float WMState(int wmNr) { return 0; }
|
||||
|
||||
|
||||
System.Windows.Forms.Form modelessDlg;
|
||||
@@ -57,12 +41,12 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
entryFormCfg = cfg;
|
||||
currentOp = CurrentOp.None;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
public string ProtocolTitle2;
|
||||
public string ProtocolTitle3;
|
||||
|
||||
/// Parameterless constructor
|
||||
public EntryFormCfg()
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
Name = "DataEntryForm-3";
|
||||
ParentName = string.Empty;
|
||||
@@ -29,7 +29,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Protocol1={2}, Protocol2={3}, Protocol3={4}",
|
||||
return string.Format("Name={0}, Protocol1={1}, Protocol2={2}, Protocol3={3}",
|
||||
Name,
|
||||
(string.IsNullOrEmpty(ProtocolTitle1) ? "-" : ProtocolTitle1),
|
||||
(string.IsNullOrEmpty(ProtocolTitle2) ? "-" : ProtocolTitle2),
|
||||
|
||||
@@ -6,10 +6,6 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
public class EntryFormFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "DataEntryForm-3"; } }
|
||||
public bool HasProcedureParams { get { return false; } }
|
||||
public bool HasTestParams { get { return false; } }
|
||||
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
|
||||
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
|
||||
|
||||
/// <summary>Max. number of components of this class in the system</summary>
|
||||
public int MaxCount { get { return 1; } }
|
||||
|
||||
@@ -6,22 +6,12 @@ using TBF.BenchControl.GenericDevices;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.WMStates
|
||||
{
|
||||
public class EntryForm : Generic.IComponent, IOperation, IDataEntry, IHasWMStatesForm
|
||||
public class EntryForm : ComponentBase, IOperation, IDataEntry, IHasWMStatesForm
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(EntryForm));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Name={0}", Name);
|
||||
}
|
||||
|
||||
public override string ToString() { return string.Format("DataEntry.WMStates({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly EntryFormCfg entryFormCfg;
|
||||
public Generic.IComponentCfg Cfg { get { return entryFormCfg; } }
|
||||
|
||||
public static void ResetStaticProperties() { }
|
||||
|
||||
public string Name { get { return entryFormCfg.Name; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Water meter serial numbers set by forms
|
||||
@@ -64,14 +54,14 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
||||
|
||||
CurrentOp currentOp;
|
||||
|
||||
|
||||
public EntryForm(EntryFormCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
if (cfg == null) throw new ArgumentNullException("cfg");
|
||||
this.entryFormCfg = cfg;
|
||||
entryFormCfg = cfg;
|
||||
serialNr = new string[Program.WMsCount];
|
||||
wmState = new float[Program.WMsCount];
|
||||
currentOp = CurrentOp.None;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
||||
{
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
/// Parameterless constructor
|
||||
public EntryFormCfg()
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
EntryFormCfg()
|
||||
{
|
||||
Name = "Generic-WM-States-Form";
|
||||
ParentName = string.Empty;
|
||||
|
||||
@@ -6,10 +6,6 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
||||
public class EntryFormFactory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return "Generic-WM-States-Form"; } }
|
||||
public bool HasProcedureParams { get { return false; } }
|
||||
public bool HasTestParams { get { return false; } }
|
||||
public IParamsProvider GetTestParams(Entities.ComponentTest testParams) { return null; }
|
||||
public IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams) { return null; }
|
||||
|
||||
/// <summary>Max. number of components of this class in the system</summary>
|
||||
public int MaxCount { get { return 1; } }
|
||||
|
||||
Reference in New Issue
Block a user