tbf/TestBenchFramework/BenchControl/Modbus/TankSelector/TankSelectorCfg.cs

64 lines
2.4 KiB
C#

///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.TankSelector
{
public class TankSelectorCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponentCfgCtrl GetControl() { return new TankSelectorCfgCtrl(); }
///
/// Serialized parameters
///
public string HotWaterHeating; /// Name of the component communicating with the temperature controller
public string HotWaterCooling; /// Name of the component communicating with the temperature controller
public string WarmWaterHeating; /// Name of the component communicating with the temperature controller
public string WarmWaterCooling; /// Name of the component communicating with the temperature controller
public string ColdWaterCooling; /// Name of the component communicating with the temperature controller
/// <summary> Procedure parameters </summary>
[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
TankSelectorCfg()
{
Name = "TankSelector";
ParentName = "QuidoRS";
ProcParams = new ProcParams();
}
public TankSelectorCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, DigOut={1}, Hot heating={2}, Hot cooling={3}, Warm heating={4}, Warm cooling={5}, Cold cooling={6}",
Name,
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
(string.IsNullOrEmpty(HotWaterHeating) ? "-" : HotWaterHeating),
(string.IsNullOrEmpty(HotWaterCooling) ? "-" : HotWaterCooling),
(string.IsNullOrEmpty(WarmWaterHeating) ? "-" : WarmWaterHeating),
(string.IsNullOrEmpty(WarmWaterCooling) ? "-" : WarmWaterCooling),
(string.IsNullOrEmpty(ColdWaterCooling) ? "-" : ColdWaterCooling));
}
}
}