|
|
@ -266,7 +266,6 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
{
|
|
|
|
{
|
|
|
|
VisionResult singleResult = null;
|
|
|
|
VisionResult singleResult = null;
|
|
|
|
if (exit == false) return null;
|
|
|
|
if (exit == false) return null;
|
|
|
|
//grabFinishedEvent.Reset();
|
|
|
|
|
|
|
|
HObject imageSingle = new HObject();
|
|
|
|
HObject imageSingle = new HObject();
|
|
|
|
exit = false;
|
|
|
|
exit = false;
|
|
|
|
if(!needGo)
|
|
|
|
if(!needGo)
|
|
|
@ -282,7 +281,6 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.到扫码位上方;
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.到扫码位上方;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//Task.Run(() => {
|
|
|
|
|
|
|
|
while (!exit)
|
|
|
|
while (!exit)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop)
|
|
|
|
if (MachineManage.Instance.MachineStatus == EMachineStatus.Stop)
|
|
|
@ -300,7 +298,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
errCode = AxisControl.LoadY.MovePos(targetPoint.Y, GlobalVar.FlyCameraSpeed);
|
|
|
|
errCode = AxisControl.LoadY.MovePos(targetPoint.Y, GlobalVar.FlyCameraSpeed);
|
|
|
|
if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis)
|
|
|
|
if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
logInfo = GetClassName() + $"到扫码起始位";
|
|
|
|
logInfo = GetClassName() + $"到{SlotIndex}号穴位拍照位上方";
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.等待运动到扫码位上方;
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.等待运动到扫码位上方;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -318,13 +316,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
if (Ops.IsStop(AxisAlias.LoadX, AxisAlias.LoadY) || GlobalVar.VirtualAxis)
|
|
|
|
if (Ops.IsStop(AxisAlias.LoadX, AxisAlias.LoadY) || GlobalVar.VirtualAxis)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Thread.Sleep(200);
|
|
|
|
Thread.Sleep(200);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logInfo = GetClassName() + $"已运动到{SlotIndex}号穴位拍照位上方";
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
ImageProcess.ClearManualTrigger();
|
|
|
|
ImageProcess.ClearManualTrigger();
|
|
|
|
HikCamera.Instance.SetTrigger("upCamera", ETriggerMode.Manual);
|
|
|
|
HikCamera.Instance.SetTrigger("upCamera", ETriggerMode.Manual);
|
|
|
|
HikCamera.Instance.SetExposure("upCamera", GlobalVar.UpCameraExposureTime);
|
|
|
|
HikCamera.Instance.SetExposure("upCamera", GlobalVar.UpCameraExposureTime);
|
|
|
|
HikCamera.Instance.SetGain("upCamera", GlobalVar.UpCameraGain);
|
|
|
|
HikCamera.Instance.SetGain("upCamera", GlobalVar.UpCameraGain);
|
|
|
|
AxisControl.LoadX.ComparePulse(2, false);
|
|
|
|
AxisControl.LoadX.ComparePulse(2, false);
|
|
|
|
logInfo = GetClassName() + $"已运动到扫码起始位";
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
|
|
|
scanBarCodeWait.Restart();
|
|
|
|
scanBarCodeWait.Restart();
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.等待扫码结束;
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.等待扫码结束;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -335,26 +334,28 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
HObject image = ImageProcess.GetManualImage();
|
|
|
|
HObject image = ImageProcess.GetManualImage();
|
|
|
|
if (image != null)
|
|
|
|
if (image != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
logInfo = GetClassName() + "拍照完成";
|
|
|
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
imageSingle = ImageRotate.Rotate(image, "upCamera");
|
|
|
|
imageSingle = ImageRotate.Rotate(image, "upCamera");
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.拍照结果处理;
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.拍照结果处理;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
logInfo = GetClassName() + "拍照超时,重新拍照";
|
|
|
|
|
|
|
|
MessageQueue.Instance.Warn(logInfo);
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.到扫码位上方;
|
|
|
|
fixedStep = EUpCameraFixedScanBarCodeFlowStep.到扫码位上方;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case EUpCameraFixedScanBarCodeFlowStep.拍照结果处理:
|
|
|
|
case EUpCameraFixedScanBarCodeFlowStep.拍照结果处理:
|
|
|
|
singleResult = VisionManager.TurnoverTrayDumpProductOK(imageSingle, bNeedLocate, bNeedScanBarcode, SlotIndex);
|
|
|
|
singleResult = VisionManager.TurnoverTrayDumpProductOK(imageSingle, bNeedLocate, bNeedScanBarcode, SlotIndex);
|
|
|
|
singleResult.SlotIndex = SlotIndex;
|
|
|
|
singleResult.SlotIndex = SlotIndex;
|
|
|
|
exit = true;
|
|
|
|
exit = true;
|
|
|
|
//grabFinishedEvent.Set();
|
|
|
|
logInfo = GetClassName() + "拍照处理完成";
|
|
|
|
|
|
|
|
MessageQueue.Instance.Warn(logInfo);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return singleResult;
|
|
|
|
return singleResult;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|