Dummy.Balance component added
This commit is contained in:
parent
6f599d55c5
commit
6df36659ab
73
TestBenchFramework/BenchControl/Dummy/Balance/Component.cs
Normal file
73
TestBenchFramework/BenchControl/Dummy/Balance/Component.cs
Normal file
@ -0,0 +1,73 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.Balance
|
||||
{
|
||||
public class Component : ComponentBase, GenericDevices.IBalance, IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
|
||||
}
|
||||
|
||||
public Component()
|
||||
{
|
||||
}
|
||||
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public int BalanceNr { get { return 0; } }
|
||||
public double Capacity { get { return 10000.0; } }
|
||||
public bool IsEmpty(double mass) { return true; }
|
||||
public bool IsEmpty() { return true; }
|
||||
public string Format { get { return "F3"; } }
|
||||
public int EmptyTimeSec { get { return 5; } }
|
||||
public float BuoyancyTemp { get { return 20.0f; } }
|
||||
public float BuoyancyPress { get { return 1.013f; } }
|
||||
public float BuoyancyHumi { get { return 50.0f; } }
|
||||
|
||||
public IOperation TaringOp(ref TBF.Boxes.DoubleBox tara)
|
||||
{
|
||||
tara.Val = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IOperation ReadMassOp(ref TBF.Boxes.DoubleBox mass)
|
||||
{
|
||||
mass.Val = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IOperation ReadStableMassOp(ref TBF.Boxes.DoubleBox mass, int readingsCount, double maxSpread, bool method)
|
||||
{
|
||||
mass.Val = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
public Event Run()
|
||||
{
|
||||
return Event.BalanceDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
27
TestBenchFramework/BenchControl/Dummy/Balance/Factory.cs
Normal file
27
TestBenchFramework/BenchControl/Dummy/Balance/Factory.cs
Normal file
@ -0,0 +1,27 @@
|
||||
///
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.Configs.NameOnly;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.Balance
|
||||
{
|
||||
public class Factory : IComponentFactory
|
||||
{
|
||||
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
|
||||
|
||||
public void ResetStaticProperties() { }
|
||||
|
||||
public IComponent DummyComponent() { return new Component(); }
|
||||
|
||||
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Component(cfg); }
|
||||
|
||||
public IComponentCfg DefaultConfig() { return new TestMethodCfg(this.GetType().Namespace.Substring(23), this); }
|
||||
|
||||
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
|
||||
{
|
||||
return ComponentCfgBase.CreateFromDbEntity(typeof(TestMethodCfg), component, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <summary>
|
||||
/// Basic balance functions
|
||||
/// </summary>
|
||||
public interface IBalance : IDevice, IComponent
|
||||
public interface IBalance : IComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Balance number: 0-based index required for communication with the Elde component
|
||||
|
||||
@ -30,7 +30,8 @@ namespace TBF.BenchControl
|
||||
Factories.Add(new DataEntry.Standard12.EntryFormFactory());
|
||||
Factories.Add(new DataEntry.Standard24.EntryFormFactory());
|
||||
Factories.Add(new DataEntry.Standard48.EntryFormFactory());
|
||||
Factories.Add(new Elde.Diverter.DiverterFactory());
|
||||
Factories.Add(new Dummy.Balance.Factory());
|
||||
Factories.Add(new Elde.Diverter.DiverterFactory());
|
||||
Factories.Add(new Elde.FixedStartRegisterReader.RegisterReaderFactory());
|
||||
Factories.Add(new Elde.FlowMeter.FlowMeterFactory());
|
||||
Factories.Add(new Elde.FlowMeterTwins.FlowMeterFactory());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2016 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@ -366,6 +366,8 @@
|
||||
<DependentUpon>DatabaseCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\DB\SensusOracle\DatabaseFactory.cs" />
|
||||
<Compile Include="BenchControl\Dummy\Balance\Component.cs" />
|
||||
<Compile Include="BenchControl\Dummy\Balance\Factory.cs" />
|
||||
<Compile Include="BenchControl\Elde\Diverter\Handlers.cs" />
|
||||
<Compile Include="BenchControl\Elde\PressureMeterInternal\PressureMeter.cs" />
|
||||
<Compile Include="BenchControl\Elde\PressureMeterInternal\PressureMeterCfg.cs" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user