From 0e0908cbbc6354b4df435bf0837e540609ec0118 Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期六, 04 七月 2020 17:58:39 +0800
Subject: [PATCH] Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071

---
 src/Bro.Common.Device/DeviceBase/MotionCardBase.cs |   51 +++++++++++++++++++++++++++++++++++----------------
 1 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/src/Bro.Common.Device/DeviceBase/MotionCardBase.cs b/src/Bro.Common.Device/DeviceBase/MotionCardBase.cs
index 1a997ae..1cd328f 100644
--- a/src/Bro.Common.Device/DeviceBase/MotionCardBase.cs
+++ b/src/Bro.Common.Device/DeviceBase/MotionCardBase.cs
@@ -147,7 +147,8 @@
         }
     }
 
-    public class MotionCardOperationSet : IComplexDisplay
+    [Device("MotionOperationSet", "杩愬姩鎿嶄綔閰嶇疆鍩虹被", EnumHelper.DeviceAttributeType.OperationConfig)]
+    public class MotionCardOperationSet :  IComplexDisplay
     {
         [Category("IO鎿嶄綔閰嶇疆")]
         [DisplayName("IO棰勬鏌ュ畾涔夐泦鍚�")]
@@ -177,16 +178,19 @@
         [DisplayName("IO纭瓒呮椂")]
         public int IOConfirmTimeout { get; set; } = 0;
 
+        //[Category("鏉垮崱杩愬姩閰嶇疆")]
+        //[DisplayName("杩愬姩閰嶇疆闆嗗悎")]
+        //[Description("MovingOps锛氳繍鍔ㄩ厤缃泦鍚�")]
+        //[TypeConverter(typeof(CollectionCountConvert))]
+        //[Editor(typeof(ComplexCollectionEditor<MovingOption>), typeof(UITypeEditor))]
+        //public List<MovingOption> MovingOps { get; set; } = new List<MovingOption>();
         [Category("鏉垮崱杩愬姩閰嶇疆")]
         [DisplayName("杩愬姩閰嶇疆闆嗗悎")]
         [Description("MovingOps锛氳繍鍔ㄩ厤缃泦鍚�")]
-        [TypeConverter(typeof(CollectionCountConvert))]
-        [Editor(typeof(ComplexCollectionEditor<MovingOption>), typeof(UITypeEditor))]
-        public List<MovingOption> MovingOps { get; set; } = new List<MovingOption>();
-        [Category("鏉垮崱杩愬姩閰嶇疆")]
-        [Description("瓒呮椂璁剧疆锛屽崟浣嶏細ms")]
-        [DisplayName("杩愬姩瓒呮椂")]
-        public int MovingTimeout { get; set; } = 0;
+        [TypeConverter(typeof(ComplexObjectConvert))]
+        [Editor(typeof(PropertyObjectEditor),typeof(UITypeEditor))]
+        public MotionOperationCollection MotionOperationCollection { get; set; } = new MotionOperationCollection();
+
 
         public string GetDisplayText()
         {
@@ -220,19 +224,34 @@
             }
 
             string moving = "";
-            MovingOps.ForEach(i =>
-            {
-                moving += i.GetDisplayText() + " ";
-            });
-            if (moving != "")
-            {
-                moving = " 杩愬姩锛�" + moving;
-            }
+            //MovingOps.ForEach(i =>
+            //{
+            //    moving += i.GetDisplayText() + " ";
+            //});
+            //if (moving != "")
+            //{
+            //    moving = " 杩愬姩锛�" + moving;
+            //}
 
             return (preCheck + output + confirm + moving).Trim();
         }
     }
 
+    public class MotionOperationCollection : OperationConfigBase, IComplexDisplay
+    {
+        [Category("杩愬姩閰嶇疆")]
+        [DisplayName("杩愬姩閰嶇疆闆嗗悎")]
+        [Description("MovingOps锛氳繍鍔ㄩ厤缃泦鍚�")]
+        [TypeConverter(typeof(CollectionCountConvert))]
+        [Editor(typeof(ComplexCollectionEditor<MovingOption>), typeof(UITypeEditor))]
+        public List<MovingOption> MovingOps { get; set; } = new List<MovingOption>();
+
+        public string GetDisplayText()
+        {
+            return $"{string.Join(" ", MovingOps.Select(u => u.GetDisplayText()))}";
+        }
+    }
+
     //[Device("MotionCardOperationConfigCollection", "鏉垮崱鎿嶄綔閰嶇疆鍩虹被闆嗗悎", EnumHelper.DeviceAttributeType.OperationConfig)]
     //public class MotionCardOperationConfigCollection : OperationConfigBase
     //{

--
Gitblit v1.8.0