46 lines
1.2 KiB
C#
46 lines
1.2 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.CometAmbient
|
|
{
|
|
public class AmbientCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
|
|
protected override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public byte ModbusAddress; /// 1..255
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
AmbientCfg()
|
|
{
|
|
Name = "Ambient";
|
|
ParentName = "Modbus";
|
|
ModbusAddress = 1;
|
|
}
|
|
|
|
public AmbientCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, ModbusAddr={1}, Parent={2}",
|
|
Name,
|
|
ModbusAddress,
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName));
|
|
}
|
|
}
|
|
}
|