47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
///
|
|
/// Copyright (c) 2016-2023 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.Modbus.PressureMeter.Meret
|
|
{
|
|
public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new PressureMeterCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public byte ModbusAddress; /// 1..255
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
PressureMeterCfg()
|
|
{
|
|
Name = "Pr";
|
|
ParentName = "Modbus";
|
|
ModbusAddress = 49;
|
|
}
|
|
|
|
public PressureMeterCfg(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));
|
|
}
|
|
}
|
|
}
|