From 8feea03e4ff2bd4f6db21928e7989f0b72686867 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期二, 30 六月 2020 18:43:08 +0800 Subject: [PATCH] 修改流程取图方式。添加M071流程OK/NG/原图保存。 --- src/Bro.M071.Process/M071Models.cs | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Bro.M071.Process/M071Models.cs b/src/Bro.M071.Process/M071Models.cs index be596b7..d9a40ac 100644 --- a/src/Bro.M071.Process/M071Models.cs +++ b/src/Bro.M071.Process/M071Models.cs @@ -3,6 +3,7 @@ using Bro.Common.Helper; using Bro.Common.Interface; using Bro.Common.Model; +using HalconDotNet; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -11,6 +12,7 @@ using System.Drawing.Design; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace Bro.M071.Process @@ -195,18 +197,20 @@ public class ProductionMeasurement : INotifyPropertyChanged, IDisposable { - public string Barcode { get; set; } + public string Barcode; - public List<MeasurementUint> Measurements { get; set; } = new List<MeasurementUint>(); + public List<MeasurementUint> Measurements = new List<MeasurementUint>(); + + public List<IShapeElement> ElementList = new List<IShapeElement>(); public event PropertyChangedEventHandler PropertyChanged; public void Dispose() { - Barcode = null; - Measurements?.ForEach(m => m?.Dispose()); Measurements = null; + + Barcode = null; GC.Collect(); } @@ -304,6 +308,10 @@ [TypeConverter(typeof(KeyUnitResultConverter))] public string KeyResult { get; set; } = ""; + + public List<HImage> KeyImages = new List<HImage>(); + + public volatile int ImageSaveStatus = 0; //[Browsable(false)] //public NoticedDictionary<string, double?> MeasureValueDict { get; set; } = new NoticedDictionary<string, double?>(); @@ -335,6 +343,18 @@ public void Dispose() { + SpinWait wait = new SpinWait(); + while (ImageSaveStatus != 0) + { + wait.SpinOnce(); + } + + KeyImages?.ForEach(i => + { + i?.Dispose(); + i = null; + }); + KeyImages = null; MeasureValueDict = null; } -- Gitblit v1.8.0