/// /// Copyright (c) 2017 Sensus Metering Systems /// using System.Xml.Serialization; using Config.Entities; using TBF.BenchControl.Generic; namespace TBF.BenchControl.Network.Camera.RoiForFixedStart { public class RoiCfg : ComponentCfgBase, IChildComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RoiCfg) })[0]; protected override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl() { return new RoiCfgCtrl(); } /// /// Serialized parameters /// public bool BlackAndWhite; public bool LowResolution; public ImageRotation ImageRotation; /// Procedure parameters [XmlIgnore] public ProcedureParams ProcParams; public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider CreateProcedureParams(Procedure procedure) { ProcedureParams procParams = new ProcedureParams(true); procParams.UpdateProcedureParams(Name, procedure); return procParams; } /// Private parameterless constructor invoked by all other (public) constructors RoiCfg() { ProcParams = new ProcedureParams(true); } public RoiCfg(string name, IComponentFactory factory) : this() { Name = name; Factory = factory; ParentName = "Camera"; BlackAndWhite = false; LowResolution = true; ImageRotation = ImageRotation.None; } public string ToString(int i) { return string.Format("{0} Camera={1} B&W={2}, LowRes={3}, Rotation={4}", Name, ParentName, BlackAndWhite, LowResolution, ImageRotation); } } }