From b0a4c47dd74bc41c5df3bab6ddd8de7bcc6a52b0 Mon Sep 17 00:00:00 2001
From: patrick <patrick.xu@broconcentric.com>
Date: 星期五, 06 十二月 2019 18:35:42 +0800
Subject: [PATCH] 1. 重新整理项目,按照A034模式,将设备异步操作修改为类同步操作。使用任务队列来存储和分配任务。

---
 src/A032.Process/AGVPath.cs |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/A032.Process/AGVPath.cs b/src/A032.Process/AGVPath.cs
index 1bfb3e0..426a620 100644
--- a/src/A032.Process/AGVPath.cs
+++ b/src/A032.Process/AGVPath.cs
@@ -3,6 +3,7 @@
 using Bro.Common.Model;
 using Bro.Common.Model.Interface;
 using Bro.Device.HikCamera;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -25,6 +26,8 @@
         LoadFullTray = 3,
         [Description("鍗歌浇婊ray鍦扮偣")]
         UnloadFullTray = 4,
+        [Description("鍏呯數鍦扮偣")]
+        Charge = 5,
     }
 
     public class PathPosition : IComplexDisplay
@@ -45,6 +48,10 @@
         [Description("褰掑睘璁惧缂栧彿")]
         [TypeConverter(typeof(PLCDeviceConverter))]
         public string DeviceOwner { get; set; }
+
+        [Browsable(false)]
+        [JsonIgnore]
+        public bool IsOccupied { get; set; } = false;
 
         public string GetDisplayText()
         {
@@ -73,13 +80,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 +121,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