From 22658ee90bd0f8b7b89a6030c2edc7fbf6719c3a Mon Sep 17 00:00:00 2001 From: wells.liu <wells.liu@broconcentric.com> Date: 星期四, 02 七月 2020 11:16:25 +0800 Subject: [PATCH] Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071 --- src/Bro.M071.Process/M071Process.cs | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Bro.M071.Process/M071Process.cs b/src/Bro.M071.Process/M071Process.cs index 2667c4f..0c615a6 100644 --- a/src/Bro.M071.Process/M071Process.cs +++ b/src/Bro.M071.Process/M071Process.cs @@ -154,6 +154,8 @@ } } + List<ProductionMeasurement> productionList = new List<ProductionMeasurement>(); + [ProcessMethod("", "StartJob", "寮�濮嬫壂鎻�", InvokeType.TestInvoke)] public ProcessResponse StartJob(IOperationConfig opConfig, IDevice invokeDevice, IDevice sourceDevice) { @@ -175,6 +177,16 @@ Barcode = BarCode, Measurements = measurements, }; + + var existedProduction = productionList.FirstOrDefault(u => u.Barcode == pMeasure.Barcode); + if (existedProduction != null) + { + productionList.Remove(existedProduction); + existedProduction.Dispose(); + existedProduction = null; + } + + productionList.Add(pMeasure); pMeasure.InitialMeasurementsPropertyChanged(); pMeasure.PropertyChanged += MeasureProduction_PropertyChanged; @@ -200,10 +212,6 @@ CameraBase camera = DeviceCollection.FirstOrDefault(u => u.Id == s.CameraOp.Device) as CameraBase; if (camera == null) return; - - //IImageSet imgSet = camera.Snapshot(s.CameraOp.OpConfig); - //if (imgSet == null) - // return; HImage hImage = CollectHImage(camera, s.CameraOp.OpConfig, out string imgSetId); if (string.IsNullOrWhiteSpace(imgSetId)) @@ -294,8 +302,12 @@ } } + LogAsync(DateTime.Now, $"{m.GetDisplayText()}妫�娴嬬粨鏋�", $"{((m.Spec.MeasureResult ?? false) ? "OK" : "NG")}"); + + IShapeElement indicator = null; + pMeasure.ElementList.Add(indicator); //杈撳嚭鍥惧舰鍩哄厓鍒扮晫闈� todo - OnElementUpdated?.BeginInvoke(null, null, null); + OnElementUpdated?.BeginInvoke(indicator, null, null); SaveKeyImages(pMeasure.Barcode, m); @@ -309,8 +321,6 @@ return; } - - //MES杈撳嚭 todo //Excel鎶ヨ〃杈撳嚭 todo @@ -318,6 +328,8 @@ //鏁版嵁搴撲繚瀛� todo SaveWholeImage(pMeasure); + + productionList.RemoveAll(p => p.Barcode == pMeasure.Barcode); pMeasure.Dispose(); } } -- Gitblit v1.8.0