using Admin.Core.Common; using Admin.Core.Common.Config; using Aucma.Core.Palletiz.Models; using NPOI.SS.Util; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Documents; namespace Aucma.Core.Palletiz.config { internal class AppConfig { private static IniHelper iniHelper = new IniHelper(System.Environment.CurrentDirectory + "/config/App.InI"); public AppConfig() { } public List GetJumpRanges() { List jumpRanges = new List(); int id = 1; string configStr = RangeConfig; string[] configs = configStr.Split(new[] { "][" }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < configs.Length; i++) { configs[i] = configs[i].Trim('[', ']'); // Console.WriteLine(configs[i]); } foreach (string config in configs) { string[] parts = config.Split('-'); List ints = new List(); foreach (string part in parts) { ints.Add(int.Parse(part)); } JumpRange temp = new JumpRange() { ObjId = id++, MinModel = ints[0], MaxModel = ints[1], OddSpaceRange = ints[2], EvenSpaceRange = ints[3] }; jumpRanges.Add(temp); } return jumpRanges; } /// /// 仓库编号 /// public string storeCode = Appsettings.app("StoreInfo", "StoreCode"); public List plcAddr = new List() { new PlcConfig(){spaceCode = 1,spaceArea = "A",address = "X10D3"}, new PlcConfig(){spaceCode = 2,spaceArea = "A",address = "X10D9"}, new PlcConfig(){spaceCode = 3,spaceArea = "A",address = "X10E3"}, new PlcConfig(){spaceCode = 4,spaceArea = "A",address = "X10E9"}, new PlcConfig(){spaceCode = 5,spaceArea = "A",address = "X10F3"}, new PlcConfig(){spaceCode = 6,spaceArea = "A",address = "X10F9"}, new PlcConfig(){spaceCode = 7,spaceArea = "A",address = "X1103"}, new PlcConfig(){spaceCode = 8,spaceArea = "A",address = "X1109"}, new PlcConfig(){spaceCode = 9,spaceArea = "A",address = "X1113"}, new PlcConfig(){spaceCode = 10,spaceArea = "A",address = "X1119"}, new PlcConfig(){spaceCode = 11,spaceArea = "A",address = "X1123"}, new PlcConfig(){spaceCode = 12,spaceArea = "A",address = "X1129"}, new PlcConfig(){spaceCode = 13,spaceArea = "A",address = "X1133"}, new PlcConfig(){spaceCode = 14,spaceArea = "A",address = "X1139"} }; public string RangeConfig { get { return iniHelper.IniReadValue("RangeConfig", "rangeString"); } set { iniHelper.IniWriteValue("RangeConfig", "rangeString", value); } } } }