From b5e7fa2db4ac36fdb7bf9fd330d12a72ade9d483 Mon Sep 17 00:00:00 2001
From: patrick.xu <patrick.xu@broconcentric.com>
Date: 星期日, 24 一月 2021 15:07:26 +0800
Subject: [PATCH] 0124

---
 src/Bro.M071.Process/M071Models.cs |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/src/Bro.M071.Process/M071Models.cs b/src/Bro.M071.Process/M071Models.cs
index 2e9b2db..790745a 100644
--- a/src/Bro.M071.Process/M071Models.cs
+++ b/src/Bro.M071.Process/M071Models.cs
@@ -24,20 +24,33 @@
         [TypeConverter(typeof(KeyNameDictConverter))]
         public string Key { get; set; }
 
+        [Category("榛樿閰嶇疆")]
+        [Description("鏄惁榛樿灏哄閰嶇疆")]
+        public bool IsDefault { get; set; } = false;
+
+        //[Category("浣嶇疆閰嶇疆")]
+        //[Description("鍗曢敭鍦ㄩ敭鐩樺钩闈㈠浘涓婄殑浣嶇疆鏄剧ず")]
+        //public RectangleF KeyRect { get; set; } = new RectangleF(0, 0, 0, 0);
+
         [Category("浣嶇疆閰嶇疆")]
-        [Description("鍗曢敭鍦ㄩ敭鐩樺钩闈㈠浘涓婄殑浣嶇疆鏄剧ず")]
-        public Rectangle KeyRect { get; set; } = new Rectangle();
+        [Description("鍗曢敭宸︿笂瑙掑潗鏍�")]
+        [TypeConverter(typeof(ComplexObjectConvert))]
+        [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
+        public CustomizedPoint KeyPosition { get; set; } = new CustomizedPoint();
+
+        [Category("浣嶇疆閰嶇疆")]
+        [Description("鍗曢敭灏哄")]
+        public SizeF KeySize { get; set; } = new SizeF();
 
         [Category("浣嶇疆閰嶇疆")]
         [Description("鍗曢敭涔嬪悗闂撮殭浣嶇疆")]
-        public Rectangle IntervalRect { get; set; } = new Rectangle();
+        public SizeF IntervalSize { get; set; } = new SizeF();
 
         public string GetDisplayText()
         {
-            return $"{Key}:{KeyRect.X},{KeyRect.Y},{KeyRect.Width},{KeyRect.Height}";
+            return $"{(IsDefault ? "Default" : Key)}:{KeyPosition.X},{KeyPosition.Y},{KeySize.Width},{KeySize.Height}";
         }
     }
-
 
     public class KeyAlgorithem : IComplexDisplay
     {
@@ -70,6 +83,15 @@
         [Description("妫�娴嬬畻娉曡矾寰�")]
         [Editor(typeof(FileDialogEditor), typeof(UITypeEditor))]
         public string AlgorithemPath { get; set; }
+
+        [Category("涓婁紶NG浠g爜")]
+        [Description("涓婁紶NG浠g爜")]
+        public string NGCode { get; set; }
+
+        [Category("鏄剧ず閰嶇疆")]
+        [Description("鏄剧ず鍖哄煙澶у皬")]
+        [DisplayName("鏍囩澶у皬")]
+        public Size DisplayRect { get; set; }
     }
 
     public class KeyResult : IComplexDisplay
@@ -258,7 +280,7 @@
             Measurements?.ForEach(m => m?.Dispose());
             Measurements = null;
             ElementList = null;
-            Barcode = null;
+            //Barcode = null;
             GC.Collect();
         }
 
@@ -349,6 +371,11 @@
 
             mUnit.Id = this.Id;
             mUnit.Name = this.Name;
+            if (string.IsNullOrWhiteSpace(mUnit.Name))
+            {
+                mUnit.Name = string.Join("-", KeyUnitCollection.Select(u => u.GetDisplayText()));
+            }
+
             mUnit.IsEnabled = this.IsEnabled;
             mUnit.MeasureType = this.MeasureType;
 
@@ -485,6 +512,23 @@
         }
     }
 
+    public class KeyCodeMap : IComplexDisplay
+    {
+        [Category("閿悕鏄犲皠閰嶇疆")]
+        [Description("閿悕")]
+        [TypeConverter(typeof(KeyNameDictConverter))]
+        public string Key { get; set; }
+
+        [Category("閿悕鏄犲皠閰嶇疆")]
+        [Description("涓婁紶瀵瑰簲閿唬鐮丆ode")]
+        public string KeyCode { get; set; }
+
+        public string GetDisplayText()
+        {
+            return $"{Key}--{KeyCode}";
+        }
+    }
+
     //public class NoticedDictionary<T1, T2> : Dictionary<T1, T2>, INotifyPropertyChanged
     //{
     //    public event PropertyChangedEventHandler PropertyChanged;

--
Gitblit v1.8.0