47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System.IO;
|
|
using System.Collections.Generic;
|
|
using System.IO.Ports;
|
|
using System.Xml.Serialization;
|
|
using TBF.BenchControl.Generic;
|
|
|
|
namespace TBF.BenchControl.Cameras.IdcCamera
|
|
{
|
|
public class IdcCameraCfg : ComponentCfgBase, Generic.IComponentCfg
|
|
{
|
|
public IComponent GetComponent(IList<IComponent> components) { return new IdcCamera(this, components); }
|
|
public IComponentCfgCtrl GetControl() { return new IdcCameraCfgCtrl(); }
|
|
|
|
///
|
|
/// Serialized parameters
|
|
///
|
|
public int ComPortNr; /// Com port number 1..999
|
|
public int BaudRate; /// Baud rate 57600 or 115200
|
|
public float BrightnessCam; /// Relative brightness 0 .. 1.0f
|
|
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|
IdcCameraCfg()
|
|
{
|
|
Name = "Idc";
|
|
ParentName = string.Empty;
|
|
ComPortNr = 20;
|
|
BaudRate = 57600;
|
|
BrightnessCam = 0.5f;
|
|
}
|
|
|
|
public IdcCameraCfg(IComponentFactory factory)
|
|
: this()
|
|
{
|
|
this.Factory = factory;
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format("Name={0}, Com{1}, {2}Bd, brght={3}%",
|
|
Name,
|
|
ComPortNr,
|
|
BaudRate,
|
|
(int)(100.0f * BrightnessCam));
|
|
}
|
|
}
|
|
}
|