61 lines
2.1 KiB
C#
61 lines
2.1 KiB
C#
///
|
|
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.Uni.RegValveTandem
|
|
{
|
|
public class RegValveTandemCfg : ComponentCfgBase, IChildComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegValveTandemCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities) { return new RegValveTandemCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public ValveCategory Category; /// Feeding, Output or All
|
|
public string RegulValveName; /// Name of the regulation valve used to control the flow
|
|
public string FixedRVName; /// Name of the regulation valve with a fixed position
|
|
public float FixedRVPosition; /// Fixed RV position 0 .. 100 in [%]
|
|
public bool StoredPositionReuse; /// true = store and re-use previous regulation valve positions
|
|
public int FlowStableSec; /// 0..60 sec
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
RegValveTandemCfg()
|
|
{
|
|
}
|
|
|
|
public RegValveTandemCfg(string name, IComponentFactory factory)
|
|
: this()
|
|
{
|
|
Name = name;
|
|
Factory = factory;
|
|
ParentName = string.Empty;
|
|
Category = ValveCategory.Output;
|
|
RegulValveName = "RV1";
|
|
FixedRVName = "RV2";
|
|
FixedRVPosition = 50.0f;
|
|
StoredPositionReuse = false;
|
|
FlowStableSec = 5;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, RegulVName={1}, FixedRVName={2}, FixedRVPos={3}%, PosReuse={4}, FlowStable={5}s",
|
|
Name,
|
|
RegulValveName,
|
|
FixedRVName,
|
|
FixedRVPosition.ToString("F0"),
|
|
StoredPositionReuse,
|
|
FlowStableSec);
|
|
}
|
|
}
|
|
}
|