Dummy.Valve component added

This commit is contained in:
Milan Hanajik 2016-12-09 11:45:49 +01:00 committed by Milan Hanajik
parent 6df36659ab
commit 56217a68ce
4 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,40 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Dummy.Valve
{
public class Component : ComponentBase, IValve
{
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());
}
bool state;
public bool State { get { return state; } }
public ValveCategory Category { get { return ValveCategory.None; } }
public int Delay { get { return 1; } }
public IValve CoupledTo { get { return null; } }
public bool InvertCouple { get { return false; } }
public int LagOpening { get { return 0; } }
public int LagClosing { get { return 0; } }
}
}

View 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.Valve
{
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);
}
}
}

View File

@ -31,6 +31,7 @@ namespace TBF.BenchControl
Factories.Add(new DataEntry.Standard24.EntryFormFactory());
Factories.Add(new DataEntry.Standard48.EntryFormFactory());
Factories.Add(new Dummy.Balance.Factory());
Factories.Add(new Dummy.Valve.Factory());
Factories.Add(new Elde.Diverter.DiverterFactory());
Factories.Add(new Elde.FixedStartRegisterReader.RegisterReaderFactory());
Factories.Add(new Elde.FlowMeter.FlowMeterFactory());

View File

@ -368,6 +368,8 @@
<Compile Include="BenchControl\DB\SensusOracle\DatabaseFactory.cs" />
<Compile Include="BenchControl\Dummy\Balance\Component.cs" />
<Compile Include="BenchControl\Dummy\Balance\Factory.cs" />
<Compile Include="BenchControl\Dummy\Valve\Component.cs" />
<Compile Include="BenchControl\Dummy\Valve\Factory.cs" />
<Compile Include="BenchControl\Elde\Diverter\Handlers.cs" />
<Compile Include="BenchControl\Elde\PressureMeterInternal\PressureMeter.cs" />
<Compile Include="BenchControl\Elde\PressureMeterInternal\PressureMeterCfg.cs" />