上相机扫码流程增加虚拟轴运动

master
lhiven 2 years ago
parent f17c1bade5
commit 7be5f1319f

@ -86,12 +86,12 @@ namespace Rs.MotionPlat.Flow.SubFlow
{
errCode = AxisControl.LoadX.MovePos(startPoint.X - 50, GlobalVar.FlyCameraSpeed);
if (errCode == ErrorCode.Ok)
if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis)
{
errCode = AxisControl.LoadY.MovePos(startPoint.Y, GlobalVar.FlyCameraSpeed);
if (errCode == ErrorCode.Ok)
if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis)
{
logInfo = $"正向扫码,到扫码起始位";
logInfo = GetClassName()+$"正向扫码,到扫码起始位";
MessageQueue.Instance.Insert(logInfo);
step = EUpCameraScanBarCodeFlowStep.;
}
@ -105,7 +105,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
errCode = AxisControl.LoadY.MovePos(startPoint.Y, GlobalVar.FlyCameraSpeed);
if (errCode == ErrorCode.Ok)
{
logInfo = $"反向扫码,到扫码起始位";
logInfo = GetClassName() + $"反向扫码,到扫码起始位";
MessageQueue.Instance.Insert(logInfo);
step = EUpCameraScanBarCodeFlowStep.;
}
@ -139,7 +139,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
HikCamera.Instance.SetTrigger("upCamera", ETriggerMode.Auto);
AxisControl.LoadX.SetPosCompare(2, grabPoints.ToArray());
AxisControl.LoadX.CompareStatus(out short pstatu, out int pcount);
logInfo = $"已运动到扫码起始位";
logInfo = GetClassName() + $"已运动到扫码起始位";
MessageQueue.Instance.Insert(logInfo);
step = EUpCameraScanBarCodeFlowStep.;
}
@ -148,11 +148,9 @@ namespace Rs.MotionPlat.Flow.SubFlow
if (!isReverse)
{
errCode = AxisControl.LoadX.MovePos(endPoint.X + 50, GlobalVar.FlyCameraSpeed);
if (errCode == ErrorCode.Ok)
if (errCode == ErrorCode.Ok || GlobalVar.VirtualAxis)
{
Thread.Sleep(1000);
logInfo = $"正向扫码,到扫码结束位";
logInfo = GetClassName() + $"正向扫码,到扫码结束位";
MessageQueue.Instance.Insert(logInfo);
step = EUpCameraScanBarCodeFlowStep.;
}
@ -162,7 +160,8 @@ namespace Rs.MotionPlat.Flow.SubFlow
errCode = AxisControl.LoadX.MovePos(endPoint.X - 50, GlobalVar.FlyCameraSpeed);
if (errCode == ErrorCode.Ok)
{
logInfo = $"反向扫码,到扫码结束位";
logInfo = GetClassName()+ $"反向扫码,到扫码结束位";
MessageQueue.Instance.Insert(logInfo);
step = EUpCameraScanBarCodeFlowStep.;
}
@ -171,7 +170,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
case EUpCameraScanBarCodeFlowStep.:
if (Ops.IsStop(AxisAlias.LoadX, AxisAlias.LoadY) || GlobalVar.VirtualAxis)
{
logInfo = $"已运动到扫码结束位";
logInfo = GetClassName() + $"已运动到扫码结束位";
MessageQueue.Instance.Insert(logInfo);
timeout.Restart();
@ -230,6 +229,10 @@ namespace Rs.MotionPlat.Flow.SubFlow
}
public string GetClassName()
{
return "UpCameraScanBarCodeFlow-";
}
public List<VisionResult> Wait()
{
grabFinishedEvent.WaitOne();

Loading…
Cancel
Save