From eff39fab10e5285f0d1196037f3a237a676346d2 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期四, 09 七月 2020 10:17:26 +0800
Subject: [PATCH] IImageSet添加图片信息序列化输出 操作配置添加输出信息序列化输出 添加激光扫描参数模型 修改CollectionHImage方法,输出IImageSet

---
 src/Bro.M071.Process/UI/M071_MainForm.cs |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/src/Bro.M071.Process/UI/M071_MainForm.cs b/src/Bro.M071.Process/UI/M071_MainForm.cs
index 63f429e..df918c4 100644
--- a/src/Bro.M071.Process/UI/M071_MainForm.cs
+++ b/src/Bro.M071.Process/UI/M071_MainForm.cs
@@ -1,4 +1,5 @@
-锘縰sing Bro.Common.Helper;
+锘縰sing Bro.Common.Base;
+using Bro.Common.Helper;
 using Bro.UI.Model.Winform;
 using System;
 using System.Collections.Generic;
@@ -31,6 +32,13 @@
             plImage.Controls.Add(cvImage);
 
             tscEditLocation.Visible = tsmiShowEditor.Checked = false;
+
+            this.Load += async (s, e) =>
+               {
+                   await Task.Delay(300);
+
+                   cvImage.SetScreenSize();
+               };
         }
 
         public override void OnProcessUpdated()
@@ -47,6 +55,7 @@
             {
                 Bitmap image = (Bitmap)Image.FromFile(Config.BackgroundImagePath);
                 cvImage.LoadImage(image);
+                cvImage.SetScreenSize();
             }
             catch (Exception ex)
             {
@@ -69,7 +78,8 @@
                 lvMeasures.Items.Add(item);
             });
 
-            txtBarcode.ReadOnly = Config.IsBarcodeManulInputBlocked;
+            if (txtBarcode.IsHandleCreated)
+                txtBarcode.BeginInvoke(new Action(() => txtBarcode.ReadOnly = Config.IsBarcodeManulInputBlocked));
 
             Process_M071.OnClearBarcode -= M071_MainForm_OnClearBarcode;
             Process_M071.OnClearBarcode += M071_MainForm_OnClearBarcode;
@@ -149,6 +159,19 @@
 
             MessageBox.Show("鏍囩淇敼瀹屾垚");
         }
+
+        private void lvMeasures_DoubleClick(object sender, EventArgs e)
+        {
+            if (lvMeasures.SelectedItems.Count <= 0)
+                return;
+
+            var ele = cvImage.Elements.FirstOrDefault(u => u.ID == lvMeasures.SelectedItems[0].Tag.ToString());
+            if (ele != null)
+            {
+                ele.State = ElementState.Selected;
+                cvImage.Invalidate();
+            }
+        }
         #endregion
 
         #region 涓婃柟鐘舵�佸尯
@@ -167,6 +190,11 @@
             {
                 txtBarcode.Text = _barcode;
                 _barcode = "";
+            }
+
+            if (e.KeyValue == 27)
+            {
+                cvImage.Elements.ToList().ForEach(ele => ele.State = ElementState.Normal);
             }
         }
 
@@ -307,12 +335,12 @@
             }
             else if (btnStartMeasure.Text == "缁х画娴嬮噺")
             {
-                Process_M071.ResumeJob(null, null, null);
+                Process_M071.SwitchJobStatus(new OperationConfigBase() { InputPara = new List<int>() { 0 } }, null, null);
                 btnStartMeasure.Text = "鏆傚仠娴嬮噺";
             }
             else
             {
-                Process_M071.PauseJob(null, null, null);
+                Process_M071.SwitchJobStatus(new OperationConfigBase() { InputPara = new List<int>() { 1 } }, null, null);
                 btnStartMeasure.Text = "缁х画娴嬮噺";
             }
 

--
Gitblit v1.8.0