Refactorization : BenchControl -> Rig
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.Rig.Generic;
|
||||
|
||||
namespace TBF.Rig.Network.Camera.Roi
|
||||
{
|
||||
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<Config.Entities.Component> cmpntEntities) { return new RoiCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string PreviousRoi;
|
||||
|
||||
[XmlIgnore]
|
||||
public bool LoadImages;
|
||||
|
||||
[XmlIgnore]
|
||||
public bool SaveImages;
|
||||
|
||||
/// <summary> Procedure parameters </summary>
|
||||
[XmlIgnore]
|
||||
public ProcedureParams ProcParams;
|
||||
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
|
||||
public override IParamsProvider CreateProcParamsProvider() { return new ProcedureParams(true); }
|
||||
|
||||
public int DetectionImagesCount { get { return ProcParams.DetectionImagesCount; } }
|
||||
public int DetectionPeriod1 { get { return ProcParams.DetectionPeriod1; } }
|
||||
public int DetectionPeriod2 { get { return ProcParams.DetectionPeriod2; } }
|
||||
public string RoiParams { get { return ProcParams.RoiParams; } }
|
||||
|
||||
|
||||
/// 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";
|
||||
DebugLevel = DebugMode.Inherit;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("{0} ({1}) PreviousRoi={2} {3}", Name, ParentName,
|
||||
string.IsNullOrEmpty(PreviousRoi) ? "---" : PreviousRoi,
|
||||
(LoadImages ? " load images" : (SaveImages ? " save images" : "")));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user