Boilerplate code reduced from factories, GetComponent() and GetControl() added to cfg-s

This commit is contained in:
Milan Hanajik
2015-01-02 19:14:19 +01:00
parent 94de991bf6
commit f2005bbf56
70 changed files with 367 additions and 708 deletions
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -9,6 +10,12 @@ namespace TBF.BenchControl.BenchId
/// </summary>
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Component(this); }
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
///
/// Serialized parameters
///
public int TestBenchNr;
/// Private parameterless constructor invoked by all other (public) constructors
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BenchId
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.BenchId
{
public string ClassName { get { return "Bench-ID"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new ComponentCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new ComponentCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Component((ComponentCfg)config);
}
public IComponentCfg DefaultConfig() { return new ComponentCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(ComponentCfg), component, this);
}
public void ResetStaticProperties() { Component.ResetStaticProperties(); }
}
}
@@ -1,4 +1,6 @@
using System.IO;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Ports;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,9 +9,17 @@ namespace TBF.BenchControl.Cameras.CameraRoi
{
public class CameraRoiCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new CameraRoi(this, components); }
public IComponentCfgCtrl GetControl() { return new CameraRoiCfgCtrl(); }
///
/// Serialized parameters
///
public int RoiNr; /// ROI number 1..4
/// <summary> Procedure parameters </summary>
///
/// Procedure parameters
///
[XmlIgnore]
public RoiProcedureParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; }
@@ -23,10 +33,11 @@ namespace TBF.BenchControl.Cameras.CameraRoi
/// Private parameterless constructor invoked by all other (public) constructors
CameraRoiCfg()
{
Name = "ROI";
Name = "ROI";
ParentName = "Idc";
RoiNr = 1;
ProcParams = new RoiProcedureParams();
RoiNr = 1;
}
public CameraRoiCfg(IComponentFactory factory)
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Cameras.CameraRoi
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Cameras.CameraRoi
{
public string ClassName { get { return "CameraROI"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 20; } }
public void ResetStaticProperties() { CameraRoi.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new CameraRoiCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new CameraRoiCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new CameraRoi((CameraRoiCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new CameraRoiCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(CameraRoiCfg), component, this);
}
public void ResetStaticProperties() { CameraRoi.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.Cameras.IdcCamera
{
public class IdcCameraCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new IdcCamera(this, components); }
public IComponentCfgCtrl GetControl() { return new IdcCameraCfgCtrl(); }
///
/// Serialized parameters
///
public int ComPortNr; /// Com port number 1..999
public int BaudRate; /// Baud rate 57600 or 115200
public float BrightnessCam; /// Relative brightness 0 .. 1.0f
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Cameras.IdcCamera
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Cameras.IdcCamera
{
public string ClassName { get { return "IdcCamera"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 20; } }
public void ResetStaticProperties() { IdcCamera.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new IdcCameraCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new IdcCameraCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new IdcCamera((IdcCameraCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new IdcCameraCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(IdcCameraCfg), component, this);
}
public void ResetStaticProperties() { IdcCamera.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.DataEntry.Munich
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
/// Serialized parameters
///
public string ProtocolTitle1;
public string ProtocolTitle2;
public string ProtocolTitle3;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.Munich
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.DataEntry.Munich
{
public string ClassName { get { return "DataEntryForm-Munich"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new EntryFormCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new EntryFormCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new EntryForm((EntryFormCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
}
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.DataEntry.Munich3
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
///
/// Serialized parameters
///
public string ProtocolTitle1;
public string ProtocolTitle2;
public string ProtocolTitle3;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.Munich3
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.DataEntry.Munich3
{
public string ClassName { get { return "DataEntryForm-3"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new EntryFormCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new EntryFormCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new EntryForm((EntryFormCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
}
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.DataEntry.WMStates
{
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new EntryForm(this); }
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
EntryFormCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataEntry.WMStates
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.DataEntry.WMStates
{
public string ClassName { get { return "Generic-WM-States-Form"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new EntryFormCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new EntryFormCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new EntryForm((EntryFormCfg)config);
}
public IComponentCfg DefaultConfig() { return new EntryFormCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(EntryFormCfg), component, this);
}
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -6,6 +7,12 @@ namespace TBF.BenchControl.Elde
{
public class ControlBoardCfg : ComponentCfgBase, IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new ControlBoardDev(this); }
public IComponentCfgCtrl GetControl() { return new ControlBoardCfgCtrl(); }
///
/// Serialized parameters
///
public int ComPortNr;
/// Private parameterless constructor invoked by all other (public) constructors
@@ -144,7 +144,7 @@ namespace TBF.BenchControl.Elde
/// <summary>
/// Constructor
/// </summary>
public ControlBoardDev(ControlBoardCfg cfg, IList<Generic.IComponent> components)
public ControlBoardDev(ControlBoardCfg cfg)
: base(cfg)
{
controlBoardCfg = cfg;
@@ -11,7 +11,7 @@ namespace TBF.BenchControl.Elde
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
public IComponentCfg DefaultConfig()
{
return new ControlBoardCfg(this);
}
@@ -23,7 +23,7 @@ namespace TBF.BenchControl.Elde
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new ControlBoardDev((ControlBoardCfg)config, components);
return new ControlBoardDev((ControlBoardCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -6,6 +7,12 @@ namespace TBF.BenchControl.Elde.Diverter
{
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Diverter(this, components); }
public IComponentCfgCtrl GetControl() { return new DiverterCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition;
/// Private parameterless constructor invoked by all other (public) constructors
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.Diverter
{
@@ -10,29 +6,13 @@ namespace TBF.BenchControl.Elde.Diverter
{
public string ClassName { get { return "Diverter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 5; } }
public void ResetStaticProperties() { Diverter.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new DiverterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new DiverterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Diverter((DiverterCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new DiverterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(DiverterCfg), component, this);
}
public void ResetStaticProperties() { Diverter.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
{
public class RegisterReaderCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new RegisterReader(this, components); }
public IComponentCfgCtrl GetControl() { return new RegisterReaderCfgCtrl(); }
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public RRProcedureParams ProcParams;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.FixedStartRegisterReader
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
{
public string ClassName { get { return "Fixed-Start-Register-Reader"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return Program.WMsCount; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new RegisterReaderCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new RegisterReaderCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new RegisterReader((RegisterReaderCfg)config, components);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(RegisterReaderCfg), component, this);
}
public void ResetStaticProperties() { RegisterReader.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new RegisterReaderCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(RegisterReaderCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.Elde.FlowMeter
{
public class FlowMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new FlowMeter(this, components); }
public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); }
///
/// Serialized parameters
///
public int Idx1; /// 1..5
public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.FlowMeter
{
@@ -10,30 +6,13 @@ namespace TBF.BenchControl.Elde.FlowMeter
{
public string ClassName { get { return "FlowMeter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 7; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new FlowMeterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new FlowMeterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new FlowMeter((FlowMeterCfg)config, components);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(FlowMeterCfg), component, this);
}
public void ResetStaticProperties() { FlowMeter.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new FlowMeterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(FlowMeterCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,7 +8,13 @@ namespace TBF.BenchControl.Elde.FlowMeterTwins
{
public class FlowMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz
public IComponent GetComponent(IList<IComponent> components) { return new FlowMeter(this, components); }
public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); }
///
/// Serialized parameters
///
public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz
public string FlowMeter1; /// Name of the flow meter 1 component
public string FlowMeter2; /// Name of the flow meter 2 component
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.FlowMeterTwins
{
@@ -10,30 +6,13 @@ namespace TBF.BenchControl.Elde.FlowMeterTwins
{
public string ClassName { get { return "FlowMeterTwins"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { FlowMeter.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new FlowMeterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new FlowMeterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new FlowMeter((FlowMeterCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new FlowMeterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(FlowMeterCfg), component, this);
}
public void ResetStaticProperties() { FlowMeter.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.Elde.PressureMeter
{
public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new PressureMeter(this, components); }
public IComponentCfgCtrl GetControl() { return new PressureMeterCfgCtrl(); }
///
/// Serialized parameters
///
public int Idx0; /// 0..3
public byte RS485Address; /// 0..255
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PressureMeter
{
@@ -10,29 +6,13 @@ namespace TBF.BenchControl.Elde.PressureMeter
{
public string ClassName { get { return "PressureMeter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 5; } }
public void ResetStaticProperties() { PressureMeter.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new PressureMeterCfg(this);
}
public IComponentCfg DefaultConfig() { return new PressureMeterCfg(this); }
public IComponentCfgCtrl CreateCfgCtrl()
{
return new PressureMeterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new PressureMeter((PressureMeterCfg)config, components);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PressureMeterCfg), component, this);
}
public void ResetStaticProperties() { PressureMeter.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -6,6 +7,12 @@ namespace TBF.BenchControl.Elde.Pump
{
public class PumpCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Pump(this, components); }
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition;
public int Delay;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.Pump
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.Pump
{
public string ClassName { get { return "Pump"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new PumpCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new PumpCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Pump((PumpCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new PumpCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PumpCfg), component, this);
}
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -6,6 +7,12 @@ namespace TBF.BenchControl.Elde.PumpWithFM
{
public class PumpCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Pump(this, components); }
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition;
public int FMIndex;
public int Delay;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.PumpWithFM
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.PumpWithFM
{
public string ClassName { get { return "PumpWithFM"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new PumpCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new PumpCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Pump((PumpCfg)config, components);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PumpCfg), component, this);
}
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new PumpCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PumpCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.Elde.RegisterReader
{
public class RegisterReaderCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new RegisterReader(this, components); }
public IComponentCfgCtrl GetControl() { return new RegisterReaderCfgCtrl(); }
///
/// Serialized parameters
///
public int Position; /// 1..nrWaterMeters
/// <summary> Procedure parameters </summary>
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.RegisterReader
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.RegisterReader
{
public string ClassName { get { return "RegisterReader"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return Program.WMsCount; } }
public void ResetStaticProperties() { RegisterReader.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new RegisterReaderCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new RegisterReaderCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new RegisterReader((RegisterReaderCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new RegisterReaderCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(RegisterReaderCfg), component, this);
}
public void ResetStaticProperties() { RegisterReader.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.Elde.RegulValve
{
public class RegulValveCfg : ComponentCfgBase, IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new RegulValve(this, components); }
public IComponentCfgCtrl GetControl() { return new RegulValveCfgCtrl(); }
///
/// Serialized parameters
///
public int Idx1; /// 1..7
public int DacValueClosed; /// 0..1023
public int DacValueOpen; /// 0..1023
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.RegulValve
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.RegulValve
{
public string ClassName { get { return "RegulationValve"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 5; } }
public void ResetStaticProperties() { RegulValve.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new RegulValveCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new RegulValveCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new RegulValve((RegulValveCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new RegulValveCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(RegulValveCfg), component, this);
}
public void ResetStaticProperties() { RegulValve.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,8 +8,13 @@ namespace TBF.BenchControl.Elde.TempMeter
{
public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg
{
public int Idx0; /// 0..7
public IComponent GetComponent(IList<IComponent> components) { return new TempMeter(this, components); }
public IComponentCfgCtrl GetControl() { return new TempMeterCfgCtrl(); }
///
/// Serialized parameters
///
public int Idx0; /// 0..7
public float A1;
public float A2;
public float A3;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.TempMeter
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.TempMeter
{
public string ClassName { get { return "TempMeter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 8; } }
public void ResetStaticProperties() { TempMeter.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TempMeterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TempMeterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TempMeter((TempMeterCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new TempMeterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TempMeterCfg), component, this);
}
public void ResetStaticProperties() { TempMeter.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -6,7 +7,13 @@ namespace TBF.BenchControl.Elde.Valve
{
public class ValveCfg : ComponentCfgBase, IChildComponentCfg
{
public int BitPosition; /// Bit-position
public IComponent GetComponent(IList<IComponent> components) { return new Valve(this, components); }
public IComponentCfgCtrl GetControl() { return new ValveCfgCtrl(); }
///
/// Serialized parameters
///
public int BitPosition; /// Bit-position
public ValveCategory Category; /// None, Feeding, Bench or Output
public int OpenCloseTime; /// Delay for SetValvesOp operations
public bool Inverted; /// The valve is inverted: 0=open, 1=closed
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Elde.Valve
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Elde.Valve
{
public string ClassName { get { return "Valve"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }
public void ResetStaticProperties() { Valve.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new ValveCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new ValveCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Valve((ValveCfg)config, components);
}
public IComponentCfg DefaultConfig() { return new ValveCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(ValveCfg), component, this);
}
public void ResetStaticProperties() { Valve.ResetStaticProperties(); }
}
}
@@ -44,6 +44,12 @@ namespace TBF.BenchControl.Generic
/// </summary>
TBF.Entities.Component CreateDbEntity();
///
/// Object instance factory-like methods
///
IComponent GetComponent(IList<IComponent> components);
IComponentCfgCtrl GetControl();
///
/// Procedure parameters provider support
///
@@ -6,25 +6,10 @@ namespace TBF.BenchControl.Generic
{
string ClassName { get; } /// Name of the class of components (for instance "Valve")
/// <summary>
/// Max. number of components of this class in the system: 1, some integer value or int.MaxValue
/// </summary>
int MaxCount { get; }
/// <summary>
/// Returns the default configuration
/// </summary>
IComponentCfg DefaultConfig(IList<Entities.Component> components);
/// <summary>
/// Returns the UserControl used inside ComponentConfigForm to display and edit the configuration
/// </summary>
IComponentCfgCtrl CreateCfgCtrl();
/// <summary>
/// Returns the component
/// </summary>
IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components);
IComponentCfg DefaultConfig();
/// <summary>
/// Converts an Entities.Component object into an instance of an appropriate class implementing IComponentCfg
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,12 @@ namespace TBF.BenchControl.Greco
{
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Ambient(this, components); }
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
///
/// Serialized parameters
///
public int ComPortNr;
public int BaudRate;
public Parity Parity;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Greco
{
@@ -7,29 +6,13 @@ namespace TBF.BenchControl.Greco
{
public string ClassName { get { return "Greco Ambient"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new AmbientCfg(this);
}
public IComponentCfg DefaultConfig() { return new AmbientCfg(this); }
public IComponentCfgCtrl CreateCfgCtrl()
{
return new AmbientCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Ambient((AmbientCfg)config, components);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(AmbientCfg), component, this);
}
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,16 @@ namespace TBF.BenchControl.MettlerToledo
{
public class BalanceCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components)
{
if (Factory.ClassName.Equals("MettlerToledo Balance")) return new BalanceDev(this);
else return new BalanceNewDev(this);
}
public IComponentCfgCtrl GetControl() { return new BalanceCfgCtrl(); }
///
/// Serialized parameters
///
public int ComPortNr;
public int BaudRate;
public Parity Parity;
@@ -64,7 +64,7 @@ namespace TBF.BenchControl.MettlerToledo
/// </summary>
/// <param name="cfg">Balance properties</param>
/// <param components="cfg">A list of components loaded so far</param>
public BalanceDev(BalanceCfg cfg, IList<Generic.IComponent> components)
public BalanceDev(BalanceCfg cfg)
: base(cfg)
{
balanceCfg = cfg;
@@ -10,7 +10,7 @@ namespace TBF.BenchControl.MettlerToledo
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 5; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
public IComponentCfg DefaultConfig()
{
return new BalanceCfg(this);
}
@@ -22,7 +22,7 @@ namespace TBF.BenchControl.MettlerToledo
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new BalanceDev((BalanceCfg)config, components);
return new BalanceDev((BalanceCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
@@ -27,8 +27,8 @@ namespace TBF.BenchControl.MettlerToledo
public string SerialNumber { get { return serialNumber; } }
string serialNumber;
public BalanceNewDev(BalanceCfg cfg, IList<Generic.IComponent> components)
: base(cfg, components)
public BalanceNewDev(BalanceCfg cfg)
: base(cfg)
{
log.Debug(this.ToString());
}
@@ -10,7 +10,7 @@ namespace TBF.BenchControl.MettlerToledo
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 5; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
public IComponentCfg DefaultConfig()
{
return new BalanceCfg(this);
}
@@ -22,7 +22,7 @@ namespace TBF.BenchControl.MettlerToledo
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new BalanceNewDev((BalanceCfg)config, components);
return new BalanceNewDev((BalanceCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
{
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Printer(this); }
public IComponentCfgCtrl GetControl() { return new PrinterCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
PrinterCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsPrinters.Basic
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.ResultsPrinters.Basic
{
public string ClassName { get { return "BasicResultsPrinter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new PrinterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new PrinterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Printer((PrinterCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PrinterCfg), component, this);
}
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new PrinterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PrinterCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
{
public class PrinterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Printer(this); }
public IComponentCfgCtrl GetControl() { return new PrinterCfgCtrl(); }
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcParams ProcParams;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsPrinters.Munich
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.ResultsPrinters.Munich
{
public string ClassName { get { return "ResultsPrinter4Munich"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new PrinterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new PrinterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Printer((PrinterCfg)config);
}
public IComponentCfg DefaultConfig() { return new PrinterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(PrinterCfg), component, this);
}
public void ResetStaticProperties() { Printer.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.ResultsWriters.Basic
{
public class WriterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Writer(this); }
public IComponentCfgCtrl GetControl() { return new WriterCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
WriterCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.ResultsWriters.Basic
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.ResultsWriters.Basic
{
public string ClassName { get { return "BasicResultsWriter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { Writer.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new WriterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new WriterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new Writer((WriterCfg)config);
}
public IComponentCfg DefaultConfig() { return new WriterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(WriterCfg), component, this);
}
public void ResetStaticProperties() { Writer.ResetStaticProperties(); }
}
}
@@ -92,8 +92,7 @@ namespace TBF.BenchControl
IComponentFactory cmpntFactory = BenchControl.TbfComponents.CmpntFactoryFromClassName(entity.ClassName);
if (cmpntFactory == null) continue;
IComponent cmpnt = cmpntFactory
.ComponentFromCmpntCfg(cmpntFactory.CmpntCfgFromCmpntEntity(entity), components);
IComponent cmpnt = cmpntFactory.CmpntCfgFromCmpntEntity(entity).GetComponent(components);
///
/// Inherit DebugMode from the parent (if any)
@@ -134,10 +133,14 @@ namespace TBF.BenchControl
/// <returns>Matching component or null</returns>
public static IComponent FindComponent(string name, IList<IComponent> components)
{
if (name == null) return null;
foreach (var cmpnt in components) if (cmpnt.Cfg.Name.Equals(name)) return cmpnt;
if (string.IsNullOrEmpty(name)) return null;
foreach (var cmpnt in components)
{
if (cmpnt.Cfg.Name.Equals(name)) return cmpnt;
}
return null;
}
public static IComponent FindComponent(string name)
{
return FindComponent(name, StateMachine.Components);
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
{
public class RoiDetectionCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new RoiDetection(this); }
public IComponentCfgCtrl GetControl() { return new RoiDetectionCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
RoiDetectionCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.CameraRoiDetection
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
{
public string ClassName { get { return "ROI Detection"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { RoiDetection.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new RoiDetectionCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new RoiDetectionCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new RoiDetection((RoiDetectionCfg)config);
}
public IComponentCfg DefaultConfig() { return new RoiDetectionCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(RoiDetectionCfg), component, this);
}
public void ResetStaticProperties() { RoiDetection.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.CombinedMeters
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
{
public string ClassName { get { return "CombinedMeters"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TestMethodCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TestMethodCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TestMethod((TestMethodCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary>
[XmlIgnore]
public CombinedWithDetTestParams TestParams;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.CombinedWithDetection
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
{
public string ClassName { get { return "CombinedWithDetection"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TestMethodCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TestMethodCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TestMethod((TestMethodCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
{
public string ClassName { get { return "FixedStartMassCollection"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TestMethodCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TestMethodCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TestMethod((TestMethodCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.FlyingStart
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
{
public string ClassName { get { return "FlyingStart"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TestMethodCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TestMethodCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TestMethod((TestMethodCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
public string ClassName { get { return "Flying-Start-Collection"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TestMethodCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TestMethodCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TestMethod((TestMethodCfg)config);
}
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -7,6 +8,9 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
{
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new TestMethod(this); }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg()
{
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
{
public string ClassName { get { return "ReferenceFlowmeterCalibration"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new TestMethodCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new TestMethodCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new TestMethod((TestMethodCfg)config);
}
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
}
public void ResetStaticProperties() { TestMethod.ResetStaticProperties(); }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
@@ -8,6 +9,9 @@ namespace TBF.BenchControl.WaterMeter
{
public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new WaterMeter(this); }
public IComponentCfgCtrl GetControl() { return new WaterMeterCfgCtrl(); }
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcParams ProcParams;
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.WaterMeter
{
@@ -7,30 +6,13 @@ namespace TBF.BenchControl.WaterMeter
{
public string ClassName { get { return "WaterMeter"; } }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return int.MaxValue; } }
public void ResetStaticProperties() { WaterMeter.ResetStaticProperties(); }
public IComponentCfg DefaultConfig(IList<Entities.Component> components)
{
return new WaterMeterCfg(this);
}
public IComponentCfgCtrl CreateCfgCtrl()
{
return new WaterMeterCfgCtrl();
}
public IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components)
{
return new WaterMeter((WaterMeterCfg)config);
}
public IComponentCfg DefaultConfig() { return new WaterMeterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(typeof(WaterMeterCfg), component, this);
}
public void ResetStaticProperties() { WaterMeter.ResetStaticProperties(); }
}
}