From 1c4426810c71eead57084be8a18ade8d314dd8c4 Mon Sep 17 00:00:00 2001
From: patrick <patrick.xu@broconcentric.com>
Date: 星期二, 10 十二月 2019 14:24:31 +0800
Subject: [PATCH] 1. 重构项目

---
 src/Bro.Device.SeerAGV/SeerAGVConfig.cs |   57 ++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/src/Bro.Device.SeerAGV/SeerAGVConfig.cs b/src/Bro.Device.SeerAGV/SeerAGVConfig.cs
index 3866776..933114b 100644
--- a/src/Bro.Device.SeerAGV/SeerAGVConfig.cs
+++ b/src/Bro.Device.SeerAGV/SeerAGVConfig.cs
@@ -1,21 +1,17 @@
 锘縰sing Bro.Common.Base;
 using Bro.Common.Helper;
-using Bro.Common.Model.Helper;
+using Bro.Common.Model;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
-using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Drawing.Design;
 using System.Linq;
-using System.Net;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace Bro.Device.SeerAGV
 {
     [Device("SeerAGV", "SeerAGV", EnumHelper.DeviceAttributeType.InitialConfig)]
-    public class SeerAGVInitialConfig : InitialConfigBase
+    public class SeerAGVInitialConfig : InitialMonitorConfigBase
     {
         [Category("閫氫俊閰嶇疆")]
         [Description("AGVIP鍦板潃")]
@@ -29,9 +25,21 @@
         [Description("瀵艰埅绔彛")]
         public int GuidePort { get; set; } = 19206;
 
-        [Category("鐩戝惉閰嶇疆")]
-        [Description("鐩戝惉闂撮殧锛屽崟浣峬s")]
-        public int ScanInterval { get; set; } = 200;
+        //[Category("鐩戝惉閰嶇疆")]
+        //[Description("鐩戝惉闂撮殧锛屽崟浣峬s")]
+        //public int ScanInterval { get; set; } = 500;
+
+        ////[Category("鐩戝惉閰嶇疆")]
+        ////[Description("鐩戝惉鐨処O淇℃伅閰嶇疆闆嗗悎")]
+        ////[TypeConverter(typeof(CollectionCountConvert))]
+        ////[Editor(typeof(ComplexCollectionEditor<IODefinition>), typeof(UITypeEditor))]
+        ////public List<IODefinition> IOCollection { get; set; } = new List<IODefinition>();
+
+        //[Category("鐩戝惉璁剧疆")]
+        //[Description("鐩戝惉鎿嶄綔閰嶇疆闆嗗悎")]
+        //[TypeConverter(typeof(CollectionCountConvert))]
+        //[Editor(typeof(ComplexCollectionEditor<MonitorSet>), typeof(UITypeEditor))]
+        //public List<MonitorSet> MonitorSetCollection { get; set; } = new List<MonitorSet>();
 
         [Category("鐩戝惉閰嶇疆")]
         [Description("鏄惁閲囩敤绠�鍗曠洃鍚ā寮忋�倀rue锛氱畝鍗曟ā寮忥紝鍙幏鍙栦换鍔$姸鎬侊紱false锛氬叏閮ㄦā寮忥紝鑾峰彇浠诲姟鎵�鏈変俊鎭�")]
@@ -53,6 +61,22 @@
             }
         }
 
+        private float batteryLvlToCharge_Recommand = 0.3f;
+        [Category("鍏呯數閰嶇疆")]
+        [Description("鍏呯數鐢垫睜瀹归噺锛岀數姹犲閲忎綆浜庤鍊兼椂锛岃澶囩┖闂叉椂寤鸿鍏呯數")]
+        public float BatteryLvlToCharge_Recommand
+        {
+            get => batteryLvlToCharge_Recommand;
+            set
+            {
+                if (value >= 1 || value <= 0)
+                {
+                    value = 0.3f;
+                }
+                batteryLvlToCharge_Recommand = value;
+            }
+        }
+
         private float batteryLvlChargeDone = 0.9f;
         [Category("鍏呯數閰嶇疆")]
         [Description("鍏呯數瀹屾垚鐢垫睜瀹归噺锛岀數姹犲閲忛珮浜庤鍊兼椂纭鍏呯數瀹屾垚")]
@@ -68,12 +92,22 @@
                 batteryLvlChargeDone = value;
             }
         }
+
+        [Category("鍔ㄤ綔璁剧疆")]
+        [Description("鍔ㄤ綔瓒呮椂璁剧疆锛屽崟浣峬in")]
+        public float OperationTimeout { get; set; } = 5;
     }
 
     [Device("SeerAGV", "SeerAGV", EnumHelper.DeviceAttributeType.OperationConfig)]
     public class SeerAGVOperationConfig : OperationConfigBase
     {
+        [Category("瀵艰埅閰嶇疆")]
+        [Description("AGV琛岄┒鐩殑鍦�")]
+        public string Location { get; set; }
 
+        [Category("瀵艰埅閰嶇疆")]
+        [Description("鏄惁绛夊緟瀹屾垚淇″彿")]
+        public bool IsWaitFinished { get; set; } = true;
     }
 
     public class SeerMessage : IComplexDisplay
@@ -143,7 +177,7 @@
 
             if (data.Length < 16 + msg.DataLength)
             {
-                throw new ProcessException("鏁版嵁闀垮害閿欒", null);
+                throw new ProcessException("鏁版嵁闀垮害閿欒");
             }
 
             msg.JsonData = data.Skip(16).Take(msg.DataLength).ToArray();
@@ -171,6 +205,7 @@
     {
         QueryPosition = 0x03EC,
         QueryTaskStatus = 0x03FC,
+        QueryIO = 0x03F5,
 
         CancelTask = 0x0BBB,
         PauseTask = 0x0BB9,

--
Gitblit v1.8.0