CLP1611, TestMethods.Counter : ResetStaticProperties( ) eliminated, code from constructor moved to Initialize( ).
This commit is contained in:
@@ -73,7 +73,6 @@ namespace TBF.Rig.Network.Camera.CLP1611
|
||||
///
|
||||
static int nextCameraIdx = 0;
|
||||
static int GetCameraIdx() { return nextCameraIdx++; } /// Used in Initialize()
|
||||
public static new void ResetStaticProperties() { nextCameraIdx = 0; }
|
||||
|
||||
///
|
||||
/// Telnet support
|
||||
@@ -137,32 +136,32 @@ namespace TBF.Rig.Network.Camera.CLP1611
|
||||
public int GetResult(int roiHandle, out long timeMs) { return roisAndResults.GetResult(roiHandle, out timeMs); }
|
||||
|
||||
|
||||
public Camera() {}
|
||||
|
||||
public Camera() { }
|
||||
|
||||
public Camera(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
CameraCfg = cfg as CameraCfg;
|
||||
NetAdapter = TbfComponents.FindComponent(cfg.ParentName, components) as GenericDevices.INetworkAdapter;
|
||||
|
||||
NetAdapter = TbfComponents.FindComponent(cfg.ParentName, components) as GenericDevices.INetworkAdapter;
|
||||
if (NetAdapter == null) throw new ArgumentNullException("no network adapter");
|
||||
|
||||
Telnet = null;
|
||||
terminalDlg = null;
|
||||
|
||||
roisAndResults = new RoisAndResults(); /// object for measurement results, writes/reads to/from this object are locked
|
||||
|
||||
running = false;
|
||||
}
|
||||
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
cameraIdx = GetCameraIdx();
|
||||
cameraIdx = GetCameraIdx();
|
||||
|
||||
running = false;
|
||||
Telnet = null;
|
||||
terminalDlg = null;
|
||||
roisAndResults = new RoisAndResults(); /// object for measurement results, writes/reads to/from this object are locked
|
||||
|
||||
if (CameraCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} s/n {1} si simulated", Name, CameraCfg.HardwareAddress));
|
||||
UiBridge.Bridge.OnCameraInfo(cameraIdx, string.Format("{0} s/n {1} si simulated", Name, CameraCfg.HardwareAddress));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,7 +180,7 @@ namespace TBF.Rig.Network.Camera.CLP1611
|
||||
|
||||
if (cameraDetected)
|
||||
{
|
||||
UiBridge.Bridge.OnCameraInfo(this.cameraIdx, string.Format("{0} ver.{1} {2} s/n {3}", Name, sdCardVer, ipAddress, CameraCfg.HardwareAddress));
|
||||
UiBridge.Bridge.OnCameraInfo(cameraIdx, string.Format("{0} ver.{1} {2} s/n {3}", Name, sdCardVer, ipAddress, CameraCfg.HardwareAddress));
|
||||
|
||||
ClpUserName = (sdCardVer.Length > 0 && sdCardVer[0] == '1') ? "tbf" : "pi";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user