From d06507ffdbad5db95156e114d5e8a0f89672529a Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期二, 02 二月 2021 08:43:07 +0800 Subject: [PATCH] MES上传数据checkTime参数更改为DateTime类型 --- src/Bro.M071.Process/M071Process.cs | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Bro.M071.Process/M071Process.cs b/src/Bro.M071.Process/M071Process.cs index f4108cd..7666577 100644 --- a/src/Bro.M071.Process/M071Process.cs +++ b/src/Bro.M071.Process/M071Process.cs @@ -19,6 +19,7 @@ using System.Drawing.Imaging; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -47,6 +48,7 @@ public event Action<IShapeElement> OnElementUpdated; public event Action<MachineState> OnMachineStateChanged; public event Action OnFullResetDone; + public event Action OnResetDone; #endregion string _precision = "f3"; @@ -196,7 +198,10 @@ object productionLock = new object(); List<ProductionMeasurement> productionList = new List<ProductionMeasurement>(); + bool _isdoing = false; + [ProcessMethod("", "StartJob", "寮�濮嬫壂鎻�", InvokeType.TestInvoke)] + [MethodImpl(MethodImplOptions.Synchronized)] public ProcessResponse StartJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) { if (!IsAllowedWork) @@ -205,6 +210,7 @@ } string hint = ""; + //if (MachineState != MachineState.Ready) //{ // hint = "鏈哄彴鏈氨缁紝璇峰嬁寮�濮嬫祴閲�"; @@ -219,6 +225,8 @@ OnCheckHintUpload?.Invoke(hint, true); throw new ProcessException(hint); } + + _isdoing = true; MachineState = MachineState.Running; @@ -315,6 +323,7 @@ }); LogAsync(DateTime.Now, $"{pMeasure.Barcode}娴嬮噺鍔ㄤ綔瀹屾垚", ""); + _isdoing = false; GC.Collect(0, GCCollectionMode.Optimized); @@ -328,8 +337,11 @@ get => isLeftStart; set { - isLeftStart = value; - StartCheck(); + if (IsLeftStart != value) + { + isLeftStart = value; + StartCheck(); + } } } @@ -339,8 +351,11 @@ get => isRightStart; set { - isRightStart = value; - StartCheck(); + if (isRightStart != value) + { + isRightStart = value; + StartCheck(); + } } } @@ -348,6 +363,11 @@ { if (isRightStart && isLeftStart) { + if (_isdoing) + { + OnCheckHintUpload?.Invoke("璁惧杩愯涓�", false); + return; + } StartJob(null, null, null); } } -- Gitblit v1.8.0