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/A032.Process/AGVPath.cs |   43 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/src/A032.Process/AGVPath.cs b/src/A032.Process/AGVPath.cs
index 1bfb3e0..f908ae3 100644
--- a/src/A032.Process/AGVPath.cs
+++ b/src/A032.Process/AGVPath.cs
@@ -3,13 +3,10 @@
 using Bro.Common.Model;
 using Bro.Common.Model.Interface;
 using Bro.Device.HikCamera;
-using System;
+using Newtonsoft.Json;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing.Design;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace A032.Process
 {
@@ -25,6 +22,8 @@
         LoadFullTray = 3,
         [Description("鍗歌浇婊ray鍦扮偣")]
         UnloadFullTray = 4,
+        [Description("鍏呯數鍦扮偣")]
+        Charge = 5,
     }
 
     public class PathPosition : IComplexDisplay
@@ -45,6 +44,10 @@
         [Description("褰掑睘璁惧缂栧彿")]
         [TypeConverter(typeof(PLCDeviceConverter))]
         public string DeviceOwner { get; set; }
+
+        [Browsable(false)]
+        [JsonIgnore]
+        public bool IsOccupied { get; set; } = false;
 
         public string GetDisplayText()
         {
@@ -73,13 +76,25 @@
         [Description("璇ヤ綅缃爣鍑嗙偣浣嶄俊鎭�")]
         [TypeConverter(typeof(ComplexObjectConvert))]
         [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
-        public CustomizedPoint StandardPoint { get; set; } = new CustomizedPoint();
+        public CustomizedPointWithAngle StandardPoint { get; set; } = new CustomizedPointWithAngle();
 
         [Category("瑙嗚閰嶇疆")]
         [Description("璇ヤ綅缃媿鎽勯厤缃�")]
         [TypeConverter(typeof(ComplexObjectConvert))]
         [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
         public HikCameraOperationConfig CameraOpConfig { get; set; } = new HikCameraOperationConfig();
+
+        [Category("绀烘暀閰嶇疆")]
+        [Description("鏈哄櫒浜烘媿鐓т綅缃�")]
+        [TypeConverter(typeof(ComplexObjectConvert))]
+        [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
+        public RobotPoint RobotSnapshotPoint { get; set; } = new RobotPoint();
+
+        [Category("绀烘暀閰嶇疆")]
+        [Description("鏈哄櫒浜虹ず鏁欎綅缃埌瀹為檯鎶撳彇浣嶇疆鐨勫亸绉�")]
+        [TypeConverter(typeof(ComplexObjectConvert))]
+        [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
+        public RobotPoint RobotShift { get; set; } = new RobotPoint();
 
         public string GetDisplayText()
         {
@@ -102,7 +117,23 @@
 
                 config.PositionCollection.ForEach(p =>
                 {
-                    _hash[p.PositionCode] = $"{p.PositionCode}-{p.Description.GetEnumDescription()}";
+                    _hash[p.PositionCode] = $"{p.PositionCode}-{p.PositionNo}-{p.Description.GetEnumDescription()}";
+                });
+            }
+        }
+    }
+
+    public class PositionNoConverter : ComboBoxItemTypeConvert
+    {
+        public override void GetConvertHash()
+        {
+            using (var scope = GlobalVar.Container.BeginLifetimeScope())
+            {
+                var config = scope.Resolve<ProcessConfig>();
+
+                config.PositionCollection.ForEach(p =>
+                {
+                    _hash[p.PositionNo] = $"{p.PositionNo}-{p.PositionCode}-{p.Description.GetEnumDescription()}";
                 });
             }
         }

--
Gitblit v1.8.0