终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

177 lines
7.7 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace BPASmartClient.MorkTM
  7. {
  8. public enum MaterialPosion
  9. {
  10. Top1 =1, Top2 =2, Top3 =3, Top4 = 4, Top5 = 5, Top6= 6, Top7 = 7, Top8=8, Top9 =9, Top10 =10,
  11. Top11 = 11, Top12 =12, Top13 =13, Top14 =14, Top15= 15, Top16=16, Top17 =17, Top18 =18, Top19 =19, Top20 =20,
  12. Top21 =21, Top22 =22, Top23 =23, Top24 =24, Top25 =25, Top26 =26, Top27 =27, Top28=28
  13. }
  14. public enum OutMaterialPosion
  15. {
  16. 出料位=0, 一号位 = 1, 二号位 = 2, 三号位 = 3, 四号位 = 4, 五号位 = 5, 六号位 = 6
  17. }
  18. public class CommationPosionPLC
  19. {
  20. public CommationPosionPLC( string set,string get, Enum @enum)
  21. {
  22. SetPLCPosion = set;
  23. GetPLCPosion = get;
  24. posion = @enum;
  25. }
  26. public string SetPLCPosion;
  27. public string GetPLCPosion;
  28. public Enum posion;
  29. }
  30. public class PolymerBatching
  31. {
  32. /// <summary>
  33. /// 物料对应的plc点位
  34. /// </summary>
  35. public Dictionary<MaterialPosion, string> MaterialPosionList = new Dictionary<MaterialPosion, string>()
  36. {
  37. {MaterialPosion.Top1 , "VW304"},
  38. {MaterialPosion.Top2 , "VW308"},
  39. {MaterialPosion.Top3 , "VW312"},
  40. {MaterialPosion.Top4 , "VW316"},
  41. {MaterialPosion.Top5 , "VW320"},
  42. {MaterialPosion.Top6 , "VW324"},
  43. {MaterialPosion.Top7 , "VW328"},
  44. {MaterialPosion.Top8 , "VW332"},
  45. {MaterialPosion.Top9 , "VW336"},
  46. {MaterialPosion.Top10, "VW340" },
  47. {MaterialPosion.Top11, "VW344" },
  48. {MaterialPosion.Top12, "VW348" },
  49. {MaterialPosion.Top13, "VW352" },
  50. {MaterialPosion.Top14, "VW356" },
  51. {MaterialPosion.Top15, "VW360" },
  52. {MaterialPosion.Top16, "VW364" },
  53. {MaterialPosion.Top17, "VW368" },
  54. {MaterialPosion.Top18, "VW372" },
  55. {MaterialPosion.Top19, "VW376" },
  56. {MaterialPosion.Top20, "VW380" },
  57. {MaterialPosion.Top21, "VW384" },
  58. {MaterialPosion.Top22, "VW388" },
  59. {MaterialPosion.Top23, "VW392" },
  60. {MaterialPosion.Top24, "VW396" },
  61. {MaterialPosion.Top25, "VW400" },
  62. {MaterialPosion.Top26, "VW404" },
  63. {MaterialPosion.Top27, "VW408" },
  64. {MaterialPosion.Top28, "VW412" },
  65. };
  66. /// <summary>
  67. /// 通道校正PLC点位
  68. /// </summary>
  69. public Dictionary<MaterialPosion, string> PasswayPosionList = new Dictionary<MaterialPosion, string>()
  70. {
  71. {MaterialPosion.Top1 , "VW104"},
  72. {MaterialPosion.Top2 , "VW108"},
  73. {MaterialPosion.Top3 , "VW112"},
  74. {MaterialPosion.Top4 , "VW116"},
  75. {MaterialPosion.Top5 , "VW120"},
  76. {MaterialPosion.Top6 , "VW124"},
  77. {MaterialPosion.Top7 , "VW128"},
  78. {MaterialPosion.Top8 , "VW132"},
  79. {MaterialPosion.Top9 , "VW136"},
  80. {MaterialPosion.Top10, "VW140" },
  81. {MaterialPosion.Top11, "VW144" },
  82. {MaterialPosion.Top12, "VW148" },
  83. {MaterialPosion.Top13, "VW152" },
  84. {MaterialPosion.Top14, "VW156" },
  85. {MaterialPosion.Top15, "VW160" },
  86. {MaterialPosion.Top16, "VW164" },
  87. {MaterialPosion.Top17, "VW168" },
  88. {MaterialPosion.Top18, "VW172" },
  89. {MaterialPosion.Top19, "VW176" },
  90. {MaterialPosion.Top20, "VW180" },
  91. {MaterialPosion.Top21, "VW184" },
  92. {MaterialPosion.Top22, "VW188" },
  93. {MaterialPosion.Top23, "VW192" },
  94. {MaterialPosion.Top24, "VW196" },
  95. {MaterialPosion.Top25, "VW200" },
  96. {MaterialPosion.Top26, "VW204" },
  97. {MaterialPosion.Top27, "VW208" },
  98. {MaterialPosion.Top28, "VW212" },
  99. };
  100. /// <summary>
  101. /// plc转盘点位
  102. /// </summary>
  103. public List<CommationPosionPLC> TurnPosionPLCs = new List<CommationPosionPLC>()
  104. {
  105. new CommationPosionPLC("M4.0","M14.0",OutMaterialPosion.一号位),
  106. new CommationPosionPLC("M4.1","M14.1",OutMaterialPosion.二号位),
  107. new CommationPosionPLC("M4.2","M14.2",OutMaterialPosion.三号位),
  108. new CommationPosionPLC("M4.3","M14.3",OutMaterialPosion.四号位),
  109. new CommationPosionPLC("M4.4","M14.4",OutMaterialPosion.五号位),
  110. new CommationPosionPLC("M4.5","M14.5",OutMaterialPosion.六号位),
  111. };
  112. /// <summary>
  113. /// plc出料点位
  114. /// </summary>
  115. public List<CommationPosionPLC> OutPosionPLCs = new List<CommationPosionPLC>()
  116. {
  117. new CommationPosionPLC("M0.0","M10.0",MaterialPosion.Top1),
  118. new CommationPosionPLC("M0.1","M10.1",MaterialPosion.Top2),
  119. new CommationPosionPLC("M0.2","M10.2",MaterialPosion.Top3),
  120. new CommationPosionPLC("M0.3","M10.3",MaterialPosion.Top4),
  121. new CommationPosionPLC("M0.4","M10.4",MaterialPosion.Top5),
  122. new CommationPosionPLC("M0.5","M10.5",MaterialPosion.Top6),
  123. new CommationPosionPLC("M0.6","M10.6",MaterialPosion.Top7),
  124. new CommationPosionPLC("M0.7","M10.7",MaterialPosion.Top8),
  125. new CommationPosionPLC("M1.0","M11.0",MaterialPosion.Top9),
  126. new CommationPosionPLC("M1.1","M11.1",MaterialPosion.Top10),
  127. new CommationPosionPLC("M1.2","M11.2",MaterialPosion.Top11),
  128. new CommationPosionPLC("M1.3","M11.3",MaterialPosion.Top12),
  129. new CommationPosionPLC("M1.4","M11.4",MaterialPosion.Top13),
  130. new CommationPosionPLC("M1.5","M11.5",MaterialPosion.Top14),
  131. new CommationPosionPLC("M1.6","M11.6",MaterialPosion.Top15),
  132. new CommationPosionPLC("M1.7","M11.7",MaterialPosion.Top16),
  133. new CommationPosionPLC("M2.0","M12.0",MaterialPosion.Top17),
  134. new CommationPosionPLC("M2.1","M12.1",MaterialPosion.Top18),
  135. new CommationPosionPLC("M2.2","M12.2",MaterialPosion.Top19),
  136. new CommationPosionPLC("M2.3","M12.3",MaterialPosion.Top20),
  137. new CommationPosionPLC("M2.4","M12.4",MaterialPosion.Top21),
  138. new CommationPosionPLC("M2.5","M12.5",MaterialPosion.Top22),
  139. new CommationPosionPLC("M2.6","M12.6",MaterialPosion.Top23),
  140. new CommationPosionPLC("M2.7","M12.7",MaterialPosion.Top24),
  141. new CommationPosionPLC("M3.0","M13.0",MaterialPosion.Top25),
  142. new CommationPosionPLC("M3.1","M13.1",MaterialPosion.Top26),
  143. new CommationPosionPLC("M3.2","M13.2",MaterialPosion.Top27),
  144. new CommationPosionPLC("M3.3","M13.3",MaterialPosion.Top28),
  145. };
  146. public void GetMaterialInfo()
  147. {
  148. List<MaterialPosion> materialPosions = Enum.GetValues(typeof(MaterialPosion)).Cast<MaterialPosion>().ToList();
  149. for (int i = 0; i < Enum.GetValues(typeof(OutMaterialPosion)).Length -1; i++)
  150. {
  151. if (i == 2 || i == 3)
  152. {
  153. GoodsMaterialPosion.Add(materialPosions.Take(4).ToList(), TurnPosionPLCs[i]);
  154. materialPosions.RemoveRange(0, 4);
  155. }
  156. else
  157. {
  158. GoodsMaterialPosion.Add(materialPosions.Take(5).ToList(), TurnPosionPLCs[i]);
  159. materialPosions.RemoveRange(0, 5);
  160. }
  161. }
  162. }
  163. public Dictionary<List<MaterialPosion>, CommationPosionPLC> GoodsMaterialPosion = new Dictionary<List<MaterialPosion>, CommationPosionPLC>();
  164. }
  165. }