(1) Tank & ManualLevelMsrmnt components added, (2) Sequences cope with IScaleOrTank, (3) FixedStartTankCollection & FlyingStartTankCollection added, etc., ver. 2.18.1040
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Various.TankWithLevelMsrmnt
|
||||
{
|
||||
public class TankCfg : ComponentCfgBase, Generic.IComponentCfg, GenericDevices.ITankDrainingCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TankCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new TankCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
|
||||
/// Max. water mass in 'kg' or volume in 'l'
|
||||
private float capacity;
|
||||
public float Capacity { get { return capacity; } set { capacity = value; } }
|
||||
|
||||
/// Mass threshold for 'Tank is empty' in 'kg' (or volume in 'l')
|
||||
private float empty;
|
||||
public float Empty { get { return empty; } set { empty = value; } }
|
||||
|
||||
private string drainValve;
|
||||
public string DrainValve { get { return drainValve; } set { drainValve = value; } }
|
||||
|
||||
private int drainTimeSec;
|
||||
public int DrainTimeSec { get { return drainTimeSec; } set { drainTimeSec = value; } }
|
||||
|
||||
public string LevelMeasurement;
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
TankCfg()
|
||||
{
|
||||
}
|
||||
|
||||
public TankCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
ParentName = string.Empty;
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
Capacity = 2000.0f;
|
||||
Empty = 20.0f;
|
||||
DrainValve = "VB1";
|
||||
DrainTimeSec = 180;
|
||||
LevelMeasurement = string.Empty;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, {1}l, empty={2}l, drainVlv={3}, drainTm={4}s",
|
||||
Name, Capacity, Empty, DrainValve, DrainTimeSec);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user