| | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | |
| | | using HH.WCS.Mobox3.DSZSH.util; |
| | | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | |
| | |
| | | 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> |
| | |
| | | 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 文件未找到"); |
| | |
| | | } |
| | | |
| | | 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 { |
| | | |
| | |
| | | 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 { |
| | |
| | | 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 { |
| | |
| | | public List<string> StartAreas { get; set; } |
| | | public List<string> EndAreas { get; set; } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public class AreaName { |