From 53d582ad41d8450b21045b2d862a532ecc57a9ba Mon Sep 17 00:00:00 2001
From: kazelee <1847801760@qq.com>
Date: 星期一, 26 五月 2025 17:29:57 +0800
Subject: [PATCH] 抽检移库基本测完,添加TCP模拟测试输送线产品下线的逻辑

---
 util/Settings.cs |   36 ++++++++++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/util/Settings.cs b/util/Settings.cs
index aee5018..f5b2934 100644
--- a/util/Settings.cs
+++ b/util/Settings.cs
@@ -2,6 +2,8 @@
 using System.Collections.Generic;
 using System.IO;
 
+using HH.WCS.Mobox3.DSZSH.util;
+
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 
@@ -13,10 +15,10 @@
         public static string SqlServer { get; set; }
         public static string TcpServerIp { get; set; }
         public static int TcpServerPort { get; set; }
-        public static List<Config.Area> Areas { get; set; }
-        public static List<Config.Task> Tasks { get; set; }
-        public static List<Config.ProductionLine> ProductionLines { get; set; }
-
+        public static List<Config.Area> Areas { get; set; } = new List<Config.Area>();
+        public static List<Config.Task> Tasks { get; set; } = new List<Config.Task>();
+        public static List<Config.ProductionLine> ProductionLines { get; set; } = new List<Config.ProductionLine>();
+        public static List<Config.ProdAgvSite> ProdAgvSites { get; set; } = new List<Config.ProdAgvSite>();
         /// <summary>
         /// 搴撳尯瀛楀吀锛堝姞杞藉悗灏变笉鍙橈級
         /// </summary>
@@ -26,6 +28,8 @@
         /// 浠诲姟瀛楀吀锛堝姞杞藉悗灏变笉鍙橈級
         /// </summary>
         public static Dictionary<string, Config.Task> TaskMap { get; set; } = new Dictionary<string, Config.Task>();
+
+        public static Dictionary<string, int> AgvSite_ProdLineCodeMap { get; set; } = new Dictionary<string, int>();
 
         public static void Init() {
             // 鍔犺浇閰嶇疆鏂囦欢
@@ -59,6 +63,11 @@
                 Tasks = root.Tasks;
                 ProductionLines = root.ProductionLines;
 
+                ProdAgvSites = root.ProdAgvSite;
+                foreach (var item in ProdAgvSites) {
+                    AgvSite_ProdLineCodeMap.Add(item.Code, item.ProdId);
+                }
+
             }   
             catch (FileNotFoundException) {
                 LogHelper.Info("JSON 鏂囦欢鏈壘鍒�);
@@ -83,7 +92,18 @@
                 TaskMap.Add(task.Name, task);
             }
         }
+
+        private static void LoadProdLines() {
+            //var db = new SqlHelper<object>().GetInstance();
+            //for (int  i = 0;  i < ProductionLines.Count;  i++) {
+            //    var line = ProductionLines[i];
+            //    // 閫氳繃OnLoc OffLoc鎵惧埌AGVsite鐒跺悗鍐欏叆瀛楀吀
+            //}
+        }
+
     }
+
+    // [Convert JSON to C# Classes Online - Json2CSharp Toolkit](https://json2csharp.com/)
 
     public class Config {
 
@@ -91,6 +111,11 @@
         public class Area {
             public string Name { get; set; }
             public List<string> Codes { get; set; }
+        }
+
+        public class ProdAgvSite {
+            public string Code { get; set; }
+            public int ProdId { get; set; }
         }
 
         public class ProductionLine {
@@ -112,6 +137,7 @@
             public List<Area> Areas { get; set; }
             public List<Task> Tasks { get; set; }
             public List<ProductionLine> ProductionLines { get; set; }
+            public List<ProdAgvSite> ProdAgvSite { get; set; }
         }
 
         public class Task {
@@ -119,6 +145,8 @@
             public List<string> StartAreas { get; set; }
             public List<string> EndAreas { get; set; }
         }
+
+
     }
 
     public class AreaName {

--
Gitblit v1.9.1