/// /// Copyright (c) 2017 Sensus Metering Systems /// using System; using System.Collections.Generic; using log4net; using Config.Entities; using TBF.BenchControl; namespace TBF.BenchControl.TestMethods.RoiDetection { public class RoiDetection : ComponentBase, GenericDevices.ITestMethod { private static readonly ILog log = LogManager.GetLogger(typeof(RoiDetection)); public override string ToString() { return string.Format("TestMethods.RoiDetection({0})", Cfg.ToString(1)); } public bool CanTest(MetersKind meters) { return true; } public RoiDetection() { } public RoiDetection(Generic.IComponentCfg cfg) : base(cfg) { log.Debug(this.ToString()); } public IList Execute(Test test, bool outerLoopMode, int outerLoopCounter) { GenericDevices.ICameraDisplay display = null; foreach (var cmpnt in StateMachine.Components) { if (cmpnt is GenericDevices.ICameraDisplay) { display = (cmpnt as GenericDevices.ICameraDisplay); break; } } return (new RoiDetectionSeq()).Execute(test, display, outerLoopMode, outerLoopCounter); } } }