diff --git a/TestBenchFramework/BenchControl/Dummy/Diverter/Component.cs b/TestBenchFramework/BenchControl/Dummy/Diverter/Component.cs new file mode 100644 index 000000000..4622a4ae4 --- /dev/null +++ b/TestBenchFramework/BenchControl/Dummy/Diverter/Component.cs @@ -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; } } + } +} diff --git a/TestBenchFramework/BenchControl/Dummy/Diverter/Factory.cs b/TestBenchFramework/BenchControl/Dummy/Diverter/Factory.cs new file mode 100644 index 000000000..9afd2c8d5 --- /dev/null +++ b/TestBenchFramework/BenchControl/Dummy/Diverter/Factory.cs @@ -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 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); + } + } +} diff --git a/TestBenchFramework/BenchControl/TbfComponents.cs b/TestBenchFramework/BenchControl/TbfComponents.cs index 5f8bd5f60..c64ffc181 100644 --- a/TestBenchFramework/BenchControl/TbfComponents.cs +++ b/TestBenchFramework/BenchControl/TbfComponents.cs @@ -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()); diff --git a/TestBenchFramework/TBF.csproj b/TestBenchFramework/TBF.csproj index 644243dc3..6ae1b8da5 100644 --- a/TestBenchFramework/TBF.csproj +++ b/TestBenchFramework/TBF.csproj @@ -368,6 +368,8 @@ + +