From 7be5f1319f4ad15be0cbd0ab80b96a7e2dec3207 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Mon, 11 Dec 2023 17:18:30 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=9B=B8=E6=9C=BA=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=A2=9E=E5=8A=A0=E8=99=9A=E6=8B=9F=E8=BD=B4?= =?UTF-8?q?=E8=BF=90=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Flow/SubFlow/UpCameraScanBarCodeFlow.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs b/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs index f8bbd46..7555a05 100644 --- a/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs +++ b/Rs.SkyLine/Flow/SubFlow/UpCameraScanBarCodeFlow.cs @@ -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 Wait() { grabFinishedEvent.WaitOne();