手动拍照增加拍照超时机制,防止死循环

master
lhiven 2 years ago
parent 964a38ebb6
commit d4078b106a

@ -319,7 +319,7 @@ namespace Rs.MotionPlat
private void LoadImage() private void LoadImage()
{ {
Stopwatch time = new Stopwatch(); Stopwatch time = new Stopwatch();
time.Start();
while (true && time.ElapsedMilliseconds < 3000) while (true && time.ElapsedMilliseconds < 3000)
{ {
if (ImageProcess.manualTriggerEvent.WaitOne(100)) if (ImageProcess.manualTriggerEvent.WaitOne(100))
@ -339,10 +339,10 @@ namespace Rs.MotionPlat
} }
} }
} }
Task.Run(() => if(time.ElapsedMilliseconds>3000)
{ {
Msg.ShowError("grab fail");
}); }
} }
HObject imageReduced, partImage; HObject imageReduced, partImage;

Loading…
Cancel
Save