67 lines
2.3 KiB
C#
67 lines
2.3 KiB
C#
///
|
|
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
|
///
|
|
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
using Common;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.TestMethods.iPerlCommunication.iPerlHead
|
|
{
|
|
public class IperlHeadCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(IperlHeadCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new IperlHeadCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public bool UseTcpIP;
|
|
public string OptoIPAddress;
|
|
public ushort OptoTcpipPortNr;
|
|
public int OptoComPortNr;
|
|
public int RfidComPortNr; /// 0 = use MuxBoardNr
|
|
public int MuxBoardNr; /// 0 = use RfidComPort(Nr), otherwise mux. board nr. 1 .. 4
|
|
public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort, 1 .. 10
|
|
|
|
/// <summary> Procedure parameters </summary>
|
|
[XmlIgnore]
|
|
public ProcParams ProcParams;
|
|
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
|
|
public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
|
|
|
|
[XmlIgnore]
|
|
public MeterType MeterType { get { return (ProcParams != null) ? ProcParams.MeterType : MeterType.AutoDetect; } }
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
IperlHeadCfg()
|
|
{
|
|
Name = "iPerl";
|
|
ParentName = string.Empty;
|
|
OptoComPortNr = 10;
|
|
RfidComPortNr = 0; /// = use mux. board
|
|
MuxBoardNr = 1;
|
|
ProcParams = CreateProcParamsProvider() as ProcParams;
|
|
}
|
|
|
|
public IperlHeadCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("{0} Group1 (mux#)={1}, Group2={2}, Opto=Com{3}, RFID=Com{4}",
|
|
Name,
|
|
MuxBoardNr,
|
|
Group,
|
|
OptoComPortNr,
|
|
RfidComPortNr);
|
|
}
|
|
}
|
|
}
|