63 lines
1.8 KiB
C#
63 lines
1.8 KiB
C#
///
|
|
/// Copyright (c) 2017 Sensus Metering Systems
|
|
///
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Network.Camera.Roi
|
|
{
|
|
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 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" : "")));
|
|
}
|
|
}
|
|
}
|