Boilerplate code reduced from factories, GetComponent() and GetControl() added to cfg-s
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user