领胜LDS 键盘AOI检测项目
xcd
2020-07-08 452d868c534280ec82aada44d96b47042e694e9e
src/Bro.M071.Process/UI/M071_MainForm.cs
@@ -1,4 +1,5 @@
using Bro.Common.Helper;
using Bro.Common.Base;
using Bro.Common.Helper;
using Bro.UI.Model.Winform;
using System;
using System.Collections.Generic;
@@ -31,6 +32,11 @@
            plImage.Controls.Add(cvImage);
            tscEditLocation.Visible = tsmiShowEditor.Checked = false;
            this.Load += (s, e) =>
              {
                  cvImage.SetScreenSize();
              };
        }
        public override void OnProcessUpdated()
@@ -46,7 +52,8 @@
            try
            {
                Bitmap image = (Bitmap)Image.FromFile(Config.BackgroundImagePath);
                cvImage.LoadImage(image);
                cvImage.LoadImage(image);
                cvImage.SetScreenSize();
            }
            catch (Exception ex)
            {
@@ -69,7 +76,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 +157,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 +188,11 @@
            {
                txtBarcode.Text = _barcode;
                _barcode = "";
            }
            if (e.KeyValue == 27)
            {
                cvImage.Elements.ToList().ForEach(ele => ele.State = ElementState.Normal);
            }
        }
@@ -307,12 +333,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 = "继续测量";
            }