62 lines
1.6 KiB
C#
62 lines
1.6 KiB
C#
///
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.IO.Ports;
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Cameras.CameraRoi
|
|
{
|
|
public class CameraRoiCfg : ComponentCfgBase, IChildComponentCfg
|
|
{
|
|
public IComponent GetComponent(IList<IComponent> components) { return new CameraRoi(this, components); }
|
|
public IComponentCfgCtrl GetControl() { return new CameraRoiCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public int RoiNr; /// ROI number 1..4
|
|
|
|
///
|
|
/// Procedure parameters
|
|
///
|
|
[XmlIgnore]
|
|
public RoiProcedureParams ProcParams;
|
|
public override IParamsProvider GetProcedureParams() { return ProcParams; }
|
|
public override IParamsProvider CreateProcedureParams(Procedure procedure)
|
|
{
|
|
RoiProcedureParams procParams = new RoiProcedureParams();
|
|
procParams.UpdateProcedureParams(Name, procedure);
|
|
return procParams;
|
|
}
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
CameraRoiCfg()
|
|
{
|
|
Name = "ROI";
|
|
ParentName = "Idc";
|
|
ProcParams = new RoiProcedureParams();
|
|
|
|
RoiNr = 1;
|
|
}
|
|
|
|
public CameraRoiCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Parent={1}, Roi={2}",
|
|
Name,
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
|
RoiNr);
|
|
}
|
|
}
|
|
}
|