61 lines
2.4 KiB
C#
61 lines
2.4 KiB
C#
///
|
|
/// Copyright (c) 2018-2023 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using log4net;
|
|
using Common;
|
|
|
|
namespace TBF.Rig.DataContainer.BenchInfo
|
|
{
|
|
/// <summary>
|
|
/// Holds information identifying the test bench.
|
|
/// </summary>
|
|
public class Component : ComponentBase, GenericDevices.IBenchInfo
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
|
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
|
|
|
readonly ComponentCfg myCfg;
|
|
|
|
public string TestBenchName { get { return myCfg.TestBenchName; } }
|
|
public int TestBenchId { get { return myCfg.TestBenchId; } }
|
|
public string Address1 { get { return myCfg.Address1; } }
|
|
public string Address2 { get { return myCfg.Address2; } }
|
|
public string Address3 { get { return myCfg.Address3; } }
|
|
public string Address4 { get { return myCfg.Address4; } }
|
|
public string Address5 { get { return myCfg.Address5; } }
|
|
public int WaterMetersCount { get { return myCfg.WaterMetersCount; } }
|
|
public int LinesCount { get { return myCfg.LinesCount; } }
|
|
public int CompoundMetersCount { get { return myCfg.CompoundMetersCount; } }
|
|
public Unit VolumeUnit { get { return myCfg.VolumeUnit; } }
|
|
public Unit FlowUnit { get { return myCfg.FlowUnit; } }
|
|
public bool IsFromToInPct { get { return myCfg.IsFromToInPct; } }
|
|
public Unit MassUnit { get { return myCfg.MassUnit; } }
|
|
public Unit TempUnit { get { return myCfg.TempUnit; } }
|
|
public Unit PressUnit { get { return myCfg.PressUnit; } }
|
|
public Unit LengthUnit { get { return myCfg.LenghtUnit; } }
|
|
public Unit ElectricUnit { get { return myCfg.ElectricUnit; } }
|
|
|
|
public ICollection<ProcedureSelection> Sources
|
|
{
|
|
get { return new ProcedureSelection[] { myCfg.Source1, myCfg.Source2, myCfg.Source3, myCfg.Source4 }; }
|
|
}
|
|
|
|
|
|
public Component() { }
|
|
|
|
public Component(Generic.IComponentCfg cfg)
|
|
: base(cfg)
|
|
{
|
|
myCfg = cfg as ComponentCfg;
|
|
}
|
|
|
|
public override void Initialize()
|
|
{
|
|
SharedDatabase.EventsDB.SetBenchName(myCfg.TestBenchName);
|
|
log.FatalFormat("{0} initialized: {1}", Name, this);
|
|
}
|
|
}
|
|
}
|