Dummy.Diverter component added

This commit is contained in:
Milan Hanajik 2016-12-09 12:18:22 +01:00
parent 56217a68ce
commit 1143fa79ae
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,33 @@
///
/// 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.Diverter
{
public class Component : ComponentBase, IDiverter
{
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; } }
}
}

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.Diverter
{
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.Diverter.Factory());
Factories.Add(new Dummy.Valve.Factory());
Factories.Add(new Elde.Diverter.DiverterFactory());
Factories.Add(new Elde.FixedStartRegisterReader.RegisterReaderFactory());

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\Diverter\Component.cs" />
<Compile Include="BenchControl\Dummy\Diverter\Factory.cs" />
<Compile Include="BenchControl\Dummy\Valve\Component.cs" />
<Compile Include="BenchControl\Dummy\Valve\Factory.cs" />
<Compile Include="BenchControl\Elde\Diverter\Handlers.cs" />