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 | 27 +++++++++++++++++++++++---- 1 files changed, 23 insertions(+), 4 deletions(-) diff --git a/util/Settings.cs b/util/Settings.cs index 70de35d..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; @@ -16,7 +18,7 @@ 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> @@ -61,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 鏂囦欢鏈壘鍒�); @@ -87,12 +94,16 @@ } private static void LoadProdLines() { - foreach (var prod in ProductionLines) { - - } + //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 { @@ -100,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 { @@ -121,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 { @@ -128,6 +145,8 @@ public List<string> StartAreas { get; set; } public List<string> EndAreas { get; set; } } + + } public class AreaName { -- Gitblit v1.9.1