/// /// Copyright (c) 2015 Sensus Metering Systems /// Author: Milan Hanajík /// using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; using Config.Entities; using TBF.BenchControl.Generic; using TBF.Resources; namespace TBF.BenchControl.WaterMeters.iPerl { public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg { public IComponent GetComponent(IList components) { return new WaterMeter(this); } public IComponentCfgCtrl GetControl() { return new WaterMeterCfgCtrl(); } /// /// Serialized parameters /// public MeterType MeterType; public int OptoComPortNr; public int MuxBoardNr; /// Multiplexer board number 1 .. 4 public int Group; /// Number written to QuidoRS to connct the watermeter to RfidComPort /// Procedure parameters [XmlIgnore] public ProcParams ProcParams; public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider CreateProcedureParams(Procedure procedure) { ProcParams procParams = new ProcParams(); procParams.UpdateProcedureParams(Name, procedure); return procParams; } /// Private parameterless constructor invoked by all other (public) constructors WaterMeterCfg() { Name = "iPerl"; ParentName = string.Empty; OptoComPortNr = 10; ProcParams = new ProcParams(); } public WaterMeterCfg(IComponentFactory factory) : this() { this.Factory = factory; } public string ToString(int i) { return string.Format("Name={0}, Type={1}, Opto=COM{2}, MuxBoard#={3}, Group={4}", Name, MeterType, OptoComPortNr, MuxBoardNr, Group); } } }