From 4cb676856f0c791ffcbef569c0ca8195bf8b0938 Mon Sep 17 00:00:00 2001 From: wells.liu <wells.liu@broconcentric.com> Date: 星期六, 04 七月 2020 18:05:47 +0800 Subject: [PATCH] 数据库操作 --- src/Bro.M071.Process/M071Process.cs | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/Bro.M071.Process/M071Process.cs b/src/Bro.M071.Process/M071Process.cs index b5235b2..f76d19a 100644 --- a/src/Bro.M071.Process/M071Process.cs +++ b/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(() => { -- Gitblit v1.8.0