(1) UI.Procedures.ProcedureParamsMixedCtrl, (2) Modbus.Novus added, (3) cleanup
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
///
|
||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Modbus.Novus
|
||||
{
|
||||
public class NovusCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(NovusCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new NovusCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public byte ModbusAddress; /// 1..254
|
||||
public int ReservoirNr;
|
||||
|
||||
|
||||
/// <summary> Procedure parameters </summary>
|
||||
[XmlIgnore]
|
||||
public ProcParams ProcParams;
|
||||
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
|
||||
public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
NovusCfg()
|
||||
{
|
||||
Name = "Novus";
|
||||
ParentName = "Modbus";
|
||||
ModbusAddress = 1;
|
||||
ProcParams = CreateProcParamsProvider() as ProcParams;
|
||||
}
|
||||
|
||||
public NovusCfg(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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user