/// /// Copyright (c) 2017 Sensus Metering Systems /// using System.Collections.Generic; using System.Xml.Serialization; using Common; using Config.Entities; using TBF.Rig.Generic; namespace TBF.Rig.Network.Camera.RoiForFixedStart { public class RoiCfg : ComponentCfgBase, IChildComponentCfg { public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RoiCfg) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } public IComponentCfgCtrl GetControl(IList cmpntEntities) { return new RoiCfgCtrl(); } /// /// Serialized parameters /// public bool BlackAndWhite; public bool LowResolution; public ImageRotation ImageRotation; /// Procedure parameters [XmlIgnore] public ProcedureParams ProcParams; public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; } public override IParamsProvider CreateProcParamsProvider() { return new ProcedureParams(true); } /// 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; DebugLevel = DebugMode.Inherit; } public string ToString(int i) { return string.Format("{0} Camera={1} B&W={2}, LowRes={3}, Rotation={4}", Name, ParentName, BlackAndWhite, LowResolution, ImageRotation); } } }