From 27ec4a74d3ed9aa8ce1ee8e5d0955596c67cb996 Mon Sep 17 00:00:00 2001
From: wells.liu <wells.liu@broconcentric.com>
Date: 星期一, 13 七月 2020 18:36:39 +0800
Subject: [PATCH] Excel追加 +设置样式做好了

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

diff --git a/src/Bro.M071.Process/M071Models.cs b/src/Bro.M071.Process/M071Models.cs
index a5c4137..beb5008 100644
--- a/src/Bro.M071.Process/M071Models.cs
+++ b/src/Bro.M071.Process/M071Models.cs
@@ -137,13 +137,13 @@
             get => key;
             set
             {
-                AlignName = key = value;
+                AliasName = key = value;
             }
         }
 
         [Category("閿悕閰嶇疆")]
         [Description("鍒悕")]
-        public string AlignName { get; set; }
+        public string AliasName { get; set; }
 
         [Category("鍚敤璁剧疆")]
         [Description("true锛氬惎鐢� false锛氱鐢�")]
@@ -178,7 +178,22 @@
 
         public string GetDisplayText()
         {
-            return $"{AlignName}";
+            string snapShot = "鏈寚瀹�";
+
+            using (var scope = GlobalVar.Container.BeginLifetimeScope())
+            {
+                var config = scope.Resolve<IProcessConfig>();
+                if (config != null)
+                {
+                    var snapshotPoint = (config as M071Config).SnapshotPointCollection.FirstOrDefault(u => u.Id == SnapshotPointId);
+                    if (snapshotPoint != null)
+                    {
+                        snapShot = snapshotPoint.Name;
+                    }
+                }
+            }
+
+            return $"{AliasName}-{snapShot}-{ImageSeq}";
         }
 
         public List<string> GetHalconToolPathList()
@@ -204,10 +219,15 @@
     public class ProductionMeasurement : INotifyPropertyChanged, IDisposable
     {
         public string Barcode;
+        public string PResult;
 
-        public List<MeasurementUint> Measurements = new List<MeasurementUint>();
+        public List<MeasurementUnit> Measurements = new List<MeasurementUnit>();
 
         public List<IShapeElement> ElementList = new List<IShapeElement>();
+
+        public DateTime? StartTime = null;
+
+        public DateTime? EndTime = null;
 
         public event PropertyChangedEventHandler PropertyChanged;
 
@@ -235,7 +255,7 @@
         }
     }
 
-    public class MeasurementUint : IComplexDisplay, INotifyPropertyChanged, IDisposable
+    public class MeasurementUnit : IComplexDisplay, INotifyPropertyChanged, IDisposable
     {
         public string Id = Guid.NewGuid().ToString();
 
@@ -371,7 +391,9 @@
             {
                 if (valuePairs == null || valuePairs.Count == 0)
                 {
-                    IsDone = false;
+                    IsDone = false; 
+                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsDone"));
+                    return;
                 }
 
                 foreach (KeyValuePair<string, double> pair in valuePairs)

--
Gitblit v1.8.0