45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
///
|
|
/// Copyright (c) 2020 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Modbus.Meret.TempMeter
|
|
{
|
|
public class TempMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TempMeterCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl() { return new TempMeterCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public byte ModbusAddress; /// 1..254
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
TempMeterCfg()
|
|
{
|
|
Name = "T";
|
|
ParentName = "Modbus";
|
|
ModbusAddress = 49;
|
|
}
|
|
|
|
public TempMeterCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("name={0} addr={1} parent={2}",
|
|
Name,
|
|
ModbusAddress,
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName));
|
|
}
|
|
}
|
|
}
|