IComponentCfg and IComponentFactory interfaces and all derived classes modified.

This commit is contained in:
Milan Hanajik
2016-08-05 14:32:36 +02:00
parent 4d616939ad
commit 8dae45e10e
201 changed files with 491 additions and 354 deletions
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.Common
@@ -13,6 +14,8 @@ namespace TBF.BenchControl.Modbus.Common
public IComponent DummyComponent() { return new Modbus(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Modbus(cfg); }
public IComponentCfg DefaultConfig() { return new ModbusCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
@@ -37,11 +37,11 @@ namespace TBF.BenchControl.Modbus.Common
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware.
/// </summary>
public Modbus(ModbusCfg cfg, IList<Generic.IComponent> components)
public Modbus(Generic.IComponentCfg cfg)
: base(cfg)
{
serialPort = null;
modbusCommonCfg = cfg;
modbusCommonCfg = cfg as ModbusCfg;
log.Debug(this.ToString());
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System.IO;
using System.Collections.Generic;
@@ -11,7 +11,6 @@ namespace TBF.BenchControl.Modbus.Common
{
public class ModbusCfg : ComponentCfgBase, Generic.IComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new Modbus(this, components); }
public IComponentCfgCtrl GetControl() { return new ModbusCfgCtrl(); }
///
@@ -1,6 +1,7 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.QuidoRS
@@ -13,6 +14,8 @@ namespace TBF.BenchControl.Modbus.QuidoRS
public IComponent DummyComponent() { return new QuidoRS(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new QuidoRS(cfg, components); }
public IComponentCfg DefaultConfig() { return new QuidoRSCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
@@ -25,10 +25,10 @@ namespace TBF.BenchControl.Modbus.QuidoRS
{
}
public QuidoRS(QuidoRSCfg cfg, IList<Generic.IComponent> components)
public QuidoRS(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
quidoRSCfg = cfg;
quidoRSCfg = cfg as QuidoRSCfg;
modbus = (GenericDevices.IModbus)TbfComponents.FindComponent(cfg.ParentName, components);
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
@@ -11,7 +11,6 @@ namespace TBF.BenchControl.Modbus.QuidoRS
{
public class QuidoRSCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponent GetComponent(IList<IComponent> components) { return new QuidoRS(this, components); }
public IComponentCfgCtrl GetControl() { return new QuidoRSCfgCtrl(); }
///