tbf/TestBenchFramework/BenchControl/Modbus/Easytherm/EasythermCfg.cs

44 lines
1.0 KiB
C#

///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.Easytherm
{
public class EasythermCfg : ComponentCfgBase, Generic.IChildComponentCfg
{
public IComponentCfgCtrl GetControl() { return new EasythermCfgCtrl(); }
///
/// Serialized parameters
///
public byte ModbusAddress; /// 1..255
/// Private parameterless constructor invoked by all other (public) constructors
EasythermCfg()
{
Name = "Easytherm";
ParentName = "Modbus";
ModbusAddress = 49;
}
public EasythermCfg(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));
}
}
}