|
- using BPA.Helper;
- using Org.BouncyCastle.Asn1.X509;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.MorkF.Model
- {
- internal class MaterialCoordinate : Singleton<MaterialCoordinate>
- {
- public List<string> MLNumberList { get; set; } = new List<string>() { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"
- , "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27" };
-
- public List<Coordinate> MLCoordinateList { get;set;} = new List<Coordinate>()
- { new Coordinate() { X = 34500, Y = 0 }, new Coordinate() { X = 34500, Y = 9000 } , new Coordinate() { X = 34500, Y = 0 } , //第1层
- new Coordinate(){ X = 34500,Y=0} , new Coordinate() { X = 34500, Y = 83000 }, new Coordinate(){ X = 34500,Y=0}, //第1层
- new Coordinate(){ X = 34500,Y=0} , new Coordinate() { X = 34500, Y = 0 }, new Coordinate(){ X = 34500,Y=0}, //第1层
- new Coordinate(){ X = 0,Y=0} , new Coordinate() { X = 0, Y = 0 }, new Coordinate(){ X = 0,Y=0}, //第2层
- new Coordinate(){ X = 0,Y=0} , new Coordinate() { X = 0, Y = 0 }, new Coordinate(){ X = 0,Y=0}, //第2层
- new Coordinate(){ X = 0,Y=0} , new Coordinate() { X = 0, Y = 0 }, new Coordinate(){ X = 0,Y=0}, //第2层
- new Coordinate(){ X = 0,Y=0} , new Coordinate() { X = 0, Y = 0 }, new Coordinate(){ X = 0,Y=0}, //第3层
- new Coordinate(){ X = 0,Y=0} , new Coordinate() { X = 0, Y = 0 }, new Coordinate(){ X = 0,Y=0}, //第3层
- new Coordinate(){ X = 0,Y=0} , new Coordinate() { X = 0, Y = 0 }, new Coordinate(){ X = 0,Y=0} //第3层
- };
-
- public MaterialCoordinate()
- {
- if(MLNumberList.Count == MLCoordinateList.Count && MLNumberList.Count == 27)
- {
- for(int i = 0;i<MLNumberList.Count;i++)
- {
- //判断是否已经有该值了
- if (!dicNoMaterialCoordinate.ContainsKey(MLNumberList[i]))
- {
- dicNoMaterialCoordinate.Add(MLNumberList[i], MLCoordinateList[i]);
- }
- }
- }
- }
-
- /// <summary>
- /// 更新键值对
- /// </summary>
- /// <param name="mlNumber"></param>
- /// <param name="coordinate"></param>
- /// <returns></returns>
- public bool UpdateMLCoordinateList(string mlNumber,Coordinate coordinate)
- {
- if(dicNoMaterialCoordinate.ContainsKey(mlNumber))
- {
- dicNoMaterialCoordinate[mlNumber] = coordinate;
- return true;
- }
- else
- {
- return false;
- }
- }
-
- /// <summary>
- /// 每个取菜点的编号与坐标字典
- /// </summary>
- public Dictionary<string, Coordinate> dicNoMaterialCoordinate { get; set; } = new Dictionary<string, Coordinate>();
- //{
- // {"A1",new Coordinate(){ X = 34500,Y=0} },
- // {"A2",new Coordinate(){ X = 34500,Y=9000} },
- // {"A3",new Coordinate(){ X = 34500,Y=0} },
- // {"B1",new Coordinate(){ X = 34500,Y=0} },
- // {"B2",new Coordinate(){ X = 34500,Y=83000} },
- // {"B3",new Coordinate(){ X = 34500,Y=0} },
- // {"C1",new Coordinate(){ X = 34500,Y=0} },
- // {"C2",new Coordinate(){ X = 34500,Y=0} },
- // {"C3",new Coordinate(){ X = 34500,Y=0} },
- // {"D1",new Coordinate(){ X = 0,Y=0} },
- // {"D2",new Coordinate(){ X = 0,Y=0} },
- // {"D3",new Coordinate(){ X = 0,Y=0} },
- // {"E1",new Coordinate(){ X = 0,Y=0} },
- // {"E2",new Coordinate(){ X = 0,Y=0} },
- // {"E3",new Coordinate(){ X = 0,Y=0} },
- // {"F1",new Coordinate(){ X = 0,Y=0} },
- // {"F2",new Coordinate(){ X = 0,Y=0} },
- // {"F3",new Coordinate(){ X = 0,Y=0} },
- // {"G1",new Coordinate(){ X = 0,Y=0} },
- // {"G2",new Coordinate(){ X = 0,Y=0} },
- // {"G3",new Coordinate(){ X = 0,Y=0} },
- // {"H1",new Coordinate(){ X = 0,Y=0} },
- // {"H2",new Coordinate(){ X = 0,Y=0} },
- // {"H3",new Coordinate(){ X = 0,Y=0} },
- // {"I1",new Coordinate(){ X = 0,Y=0} },
- // {"I2",new Coordinate(){ X = 0,Y=0} },
- // {"I3",new Coordinate(){ X = 0,Y=0} },
- // {"J1",new Coordinate(){ X = 0,Y=0} },
- // {"J2",new Coordinate(){ X = 0,Y=0} },
- // {"J3",new Coordinate(){ X = 0,Y=0} },
- //};
- }
- }
|