From 753b5add58defa5c09015308efb81bcaea0ebe91 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期六, 04 七月 2020 12:36:55 +0800 Subject: [PATCH] 修改板卡操作配置基类复数化 --- src/Bro.M071.Process/M071Process.cs | 72 +++++++---------------------------- 1 files changed, 15 insertions(+), 57 deletions(-) diff --git a/src/Bro.M071.Process/M071Process.cs b/src/Bro.M071.Process/M071Process.cs index dfab5fa..65f74a9 100644 --- a/src/Bro.M071.Process/M071Process.cs +++ b/src/Bro.M071.Process/M071Process.cs @@ -33,7 +33,7 @@ #region 浜嬩欢 public event Action OnMeasureStart; - public event Action<string> OnBarcodeChanged; + public event Action OnClearBarcode; public event Action<IShapeElement> OnElementUpdated; #endregion @@ -42,6 +42,16 @@ InitialSetting(); base.Open(); + + CheckMachineState(); + } + + /// <summary> + /// 妫�鏌ヨ澶囩姸鎬� + /// </summary> + private void CheckMachineState() + { + //throw new NotImplementedException(); } private void InitialSetting() @@ -100,7 +110,7 @@ if (keyRespone.Count == 0) throw new ProcessException($"{u.GetDisplayText()}瀵瑰簲鐨勫崟閿笉瀛樺湪鎴栦笉鍙敤"); - if (b.KeyResult == "All") + if (b.KeyResultId == "All") { keyRespone.SelectMany(kr => kr.KeyResultList).ToList().ForEach(r => { @@ -109,7 +119,7 @@ } else { - b.MeasureValueDict[b.KeyResult] = null; + b.MeasureValueDict[b.KeyResultId] = null; } }); }); @@ -140,19 +150,7 @@ //} #endregion - private string barCode = ""; - public string BarCode - { - get => barCode; - set - { - if (barCode != value) - { - barCode = value; - OnBarcodeChanged?.Invoke(value); - } - } - } + public string BarCode { get; set; } List<ProductionMeasurement> productionList = new List<ProductionMeasurement>(); @@ -161,14 +159,9 @@ { if (string.IsNullOrWhiteSpace(BarCode)) { + OnClearBarcode?.Invoke(); throw new ProcessException("鏈緭鍏ヤ骇鍝佹潯鐮侊紝璇峰嬁寮�濮嬫祴閲�"); } - - //妫�鏌ヤ骇鍝佹斁缃甇K - - //姘旂几鎺ㄥ姩鍘嬫澘绉诲姩鍒颁骇鍝佷笂鏂� - - //鍘嬫澘鍘嬬揣浜у搧 OnMeasureStart?.BeginInvoke(null, null); @@ -231,42 +224,7 @@ BarCode = ""; - - return new ProcessResponse(true); - } - - /// <summary> - /// 鏆傚仠鏍囧織 - /// WaitHandle 鏆傚仠鍙ユ焺 榛樿涓洪潪闃诲 鍙墽琛� - /// WaitResult 鏆傚仠鏍囧織 true 姝e父鎵ц false 鏆傚仠涓� - /// </summary> - ManualWaitConfirm _pauseHandle = new ManualWaitConfirm() - { - WaitHandle = new ManualResetEvent(true), - WaitResult = true, - }; - - [ProcessMethod("", "PauseJob", "鏆傚仠娴佺▼", InvokeType.TestInvoke)] - public ProcessResponse PauseJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) - { - if (_pauseHandle.WaitResult) - { - #region 鏉垮崱鏆傚仠鍔ㄤ綔 - #endregion - - _pauseHandle.WaitHandle.Reset(); - } - else - { - #region 鏉垮崱鎭㈠鍔ㄤ綔 - #endregion - - _pauseHandle.WaitHandle.Set(); - } - - _pauseHandle.WaitResult = !_pauseHandle.WaitResult; - return new ProcessResponse(_pauseHandle.WaitResult); } #region 绉佹湁鏂规硶 -- Gitblit v1.8.0