领胜LDS 键盘AOI检测项目
wells.liu
2020-07-04 4cb676856f0c791ffcbef569c0ca8195bf8b0938
src/Bro.M071.Process/M071Process.cs
@@ -2,6 +2,7 @@
using Bro.Common.Helper;
using Bro.Common.Interface;
using Bro.Common.Model;
using Bro.M071.Model;
using Bro.Process;
using HalconDotNet;
using System;
@@ -33,7 +34,7 @@
        #region 事件
        public event Action OnMeasureStart;
        public event Action<string> OnBarcodeChanged;
        public event Action OnClearBarcode;
        public event Action<IShapeElement> OnElementUpdated;
        #endregion
@@ -51,11 +52,14 @@
        /// </summary>
        private void CheckMachineState()
        {
            throw new NotImplementedException();
            //throw new NotImplementedException();
        }
        private void InitialSetting()
        {
            //数据库迁移检查
            DatabaseInitialize.Initialize();
            Config.SnapshotPointCollection.ForEach(u =>
            {
                u.GetHalconToolPathList().ForEach(path =>
@@ -150,19 +154,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>();
@@ -171,6 +163,7 @@
        {
            if (string.IsNullOrWhiteSpace(BarCode))
            {
                OnClearBarcode?.Invoke();
                throw new ProcessException("未输入产品条码,请勿开始测量");
            }
@@ -346,7 +339,7 @@
            }
        }
        private void SaveKeyImages(string barCode, MeasurementUint measureUnit)
        private void SaveKeyImages(string barCode, MeasurementUnit measureUnit)
        {
            string measureName = measureUnit.GetDisplayText();
            if (Config.ImageSaveOption.IsSaveOriginImage)
@@ -377,7 +370,7 @@
            }
        }
        private async void SaveKeyImages(MeasurementUint measureUnit, string measureName, string dir)
        private async void SaveKeyImages(MeasurementUnit measureUnit, string measureName, string dir)
        {
            await Task.Run(() =>
            {
@@ -397,7 +390,7 @@
        }
        #endregion
        private async void RunImageHandle(CameraBase camera, IOperationConfig opConfig, HImage hImage, string snapshotId, string snapshotName, List<MeasurementUint> measureList)
        private async void RunImageHandle(CameraBase camera, IOperationConfig opConfig, HImage hImage, string snapshotId, string snapshotName, List<MeasurementUnit> measureList)
        {
            await Task.Run(() =>
             {