Camera.CLP1611.GrabImagesOp does not delete and overwrite images in simulation mode.

This commit is contained in:
Milan Hanajik
2022-08-30 14:58:27 +02:00
parent 207d4be3d6
commit 4781acf3e2
+4 -12
View File
@@ -71,20 +71,12 @@ namespace TBF.Rig.Network.Camera.CLP1611
grabImageCommandSent = false;
transferringGrabbedImage = false;
if ((imgFileNames != null) && (imgFileNames.Length > 0) && File.Exists(imgFileNames[0]))
if (camera.CameraCfg.DebugLevel != DebugMode.Simulate &&
camera.CameraCfg.DebugLevel != DebugMode.DetectedOff &&
imgFileNames != null && imgFileNames.Length > 0 && File.Exists(imgFileNames[0]))
{
///
/// An image specified, (1) delete previous image, (2) check if this is a simulation
///
/// This is not a simulation => delete previous image
File.Delete(imgFileNames[0]);
if (camera.CameraCfg.DebugLevel == DebugMode.Simulate || camera.CameraCfg.DebugLevel == DebugMode.DetectedOff)
{
///
/// Camera is in simulation mode => create a simulated image
///
File.Copy(string.Format("{0}\\Pictures\\sample.jpg", Program.ExecutableDir), imgFileNames[0]);
}
}
}