2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
|
|
|
|
|
///
|
|
|
|
|
|
using System;
|
2015-01-02 18:14:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
using System.IO.Ports;
|
|
|
|
|
|
using System.Xml.Serialization;
|
2015-12-04 16:17:20 +00:00
|
|
|
|
using Config.Entities;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
using TBF.BenchControl.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TBF.BenchControl.Cameras.CameraRoi
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CameraRoiCfg : ComponentCfgBase, IChildComponentCfg
|
|
|
|
|
|
{
|
2015-01-02 18:14:19 +00:00
|
|
|
|
public IComponent GetComponent(IList<IComponent> components) { return new CameraRoi(this, components); }
|
|
|
|
|
|
public IComponentCfgCtrl GetControl() { return new CameraRoiCfgCtrl(); }
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Serialized parameters
|
|
|
|
|
|
///
|
2014-07-28 07:54:35 +00:00
|
|
|
|
public int RoiNr; /// ROI number 1..4
|
|
|
|
|
|
|
2015-01-02 18:14:19 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Procedure parameters
|
|
|
|
|
|
///
|
2014-12-31 12:46:33 +00:00
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
public RoiProcedureParams ProcParams;
|
|
|
|
|
|
public override IParamsProvider GetProcedureParams() { return ProcParams; }
|
2015-12-04 16:17:20 +00:00
|
|
|
|
public override IParamsProvider CreateProcedureParams(Procedure procedure)
|
2014-12-31 12:46:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
RoiProcedureParams procParams = new RoiProcedureParams();
|
|
|
|
|
|
procParams.UpdateProcedureParams(Name, procedure);
|
|
|
|
|
|
return procParams;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
|
|
|
|
CameraRoiCfg()
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
2015-01-02 18:14:19 +00:00
|
|
|
|
Name = "ROI";
|
2014-12-29 15:00:27 +00:00
|
|
|
|
ParentName = "Idc";
|
2014-12-31 12:46:33 +00:00
|
|
|
|
ProcParams = new RoiProcedureParams();
|
2015-01-02 18:14:19 +00:00
|
|
|
|
|
|
|
|
|
|
RoiNr = 1;
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2014-12-29 15:00:27 +00:00
|
|
|
|
public CameraRoiCfg(IComponentFactory factory)
|
|
|
|
|
|
: this()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Factory = factory;
|
|
|
|
|
|
}
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
public string ToString(int i)
|
|
|
|
|
|
{
|
2014-12-29 15:00:27 +00:00
|
|
|
|
return string.Format("Name={0}, Parent={1}, Roi={2}",
|
|
|
|
|
|
Name,
|
|
|
|
|
|
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
|
|
|
|
|
RoiNr);
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|