TBF.Rig.Dummy.TempControl added.

This commit is contained in:
Milan Hanajik 2022-05-23 10:05:04 +02:00
parent 7f3cc27138
commit 4197328be9
4 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,37 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.Rig.GenericDevices;
using TBF.Boxes;
namespace TBF.Rig.Dummy.TempControl
{
public class Component : ComponentBase, ITempControl
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
public bool MsrmntAvailable { get { return true; } }
public double MeasuredVal { get { return ReadTemperature(); } }
public double MsrdValLimLo { get { return 5.0; } }
public double MsrdValLimHi { get { return 95.0; } }
public string MsrdFormat { get { return "{0:F1} C"; } }
public Common.Unit MsrdUnit { get { return Common.Unit.C; } }
public string AltString { get { return string.Empty; } }
public Component() { }
public Component(Generic.IComponentCfg cfg) : base(cfg) { log.FatalFormat("{0} initialized: {1}", Name, this); }
public override void Initialize() { }
public double ReadTemperature() { return 25.0; }
public bool SetTemperatureSetpoint(double reqTempC) { return true; }
public IOperation ReadTempOp(ref DoubleBox temp) { return null; }
public IOperation ReadTempOp(ref DoubleBox temp, Event tempDone) { return null; }
public IOperation SetTemperatureSetpointOp(double temperature) { return null; }
}
}

View File

@ -0,0 +1,26 @@
///
/// Copyright (c) 2022 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.Rig.Generic;
using TBF.Rig.Configs.NameOnly;
namespace TBF.Rig.Dummy.TempControl
{
public class Factory : IComponentFactory
{
public string ClassName { get { return GetType().Namespace.Substring(8); } }
public override string ToString() { return ClassName; }
public IComponent DummyComponent() { return new Component(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
public IComponentCfg DefaultConfig() { return new TestMethodCfg(GetType().Namespace.Substring(14), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(TestMethodCfg.Serializer, component, this);
}
}
}

View File

@ -50,6 +50,7 @@ namespace TBF.Rig
Factories.Add(new Dummy.Diverter.Factory());
Factories.Add(new Dummy.FlowMeter.Factory());
Factories.Add(new Dummy.RegulValve.Factory());
Factories.Add(new Dummy.TempControl.Factory());
Factories.Add(new Dummy.Valve.Factory());
Factories.Add(new Elde.Diverter.DiverterFactory());
Factories.Add(new Elde.FlowMeter.FlowMeterFactory());

View File

@ -601,6 +601,8 @@
<Compile Include="Rig\Dummy\RegulValve\Factory.cs" />
<Compile Include="Rig\Dummy\RegulValve\SetFlowOp.cs" />
<Compile Include="Rig\Dummy\RegulValve\SetRegulValvePositionOp.cs" />
<Compile Include="Rig\Dummy\TempControl\Component.cs" />
<Compile Include="Rig\Dummy\TempControl\Factory.cs" />
<Compile Include="Rig\Dummy\Valve\Component.cs" />
<Compile Include="Rig\Dummy\Valve\Factory.cs" />
<Compile Include="Rig\Elde\CoverTest\CoverTestForm.cs">