PLCAxisPos.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. using BaseLibRWFile;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. namespace HRT_Measure
  9. {
  10. public class PLCAxisPos
  11. {
  12. public static Ini newIni;
  13. //M01M02
  14. public static List<string> listM01M02_取料X轴 = new List<string>();
  15. public static List<string> listM01M02_取料Y轴 = new List<string>();
  16. public static List<string> listM01M02_取料Z轴 = new List<string>();
  17. public static List<string> listM01M02_取料R轴 = new List<string>();
  18. public static List<string> listM01M02_上料站X轴 = new List<string>();
  19. public static List<string> listM01M02_上料站Y轴 = new List<string>();
  20. public static List<string> listM01M02_上料站Z轴 = new List<string>();
  21. public static Dictionary<string, ClsAxisPos> dictM01M02_取料X轴 = new Dictionary<string, ClsAxisPos>();
  22. public static Dictionary<string, ClsAxisPos> dictM01M02_取料Y轴 = new Dictionary<string, ClsAxisPos>();
  23. public static Dictionary<string, ClsAxisPos> dictM01M02_取料Z轴 = new Dictionary<string, ClsAxisPos>();
  24. public static Dictionary<string, ClsAxisPos> dictM01M02_取料R轴 = new Dictionary<string, ClsAxisPos>();
  25. public static Dictionary<string, ClsAxisPos> dictM01M02_上料站X轴 = new Dictionary<string, ClsAxisPos>();
  26. public static Dictionary<string, ClsAxisPos> dictM01M02_上料站Y轴 = new Dictionary<string, ClsAxisPos>();
  27. public static Dictionary<string, ClsAxisPos> dictM01M02_上料站Z轴 = new Dictionary<string, ClsAxisPos>();
  28. //M03
  29. public static List<string> listM03_取料X轴 = new List<string>();
  30. public static List<string> listM03_取料Y轴 = new List<string>();
  31. public static List<string> listM03_取料Z轴 = new List<string>();
  32. public static List<string> listM03_取料R轴 = new List<string>();
  33. public static Dictionary<string, ClsAxisPos> dictM03_取料X轴 = new Dictionary<string, ClsAxisPos>();
  34. public static Dictionary<string, ClsAxisPos> dictM03_取料Y轴 = new Dictionary<string, ClsAxisPos>();
  35. public static Dictionary<string, ClsAxisPos> dictM03_取料Z轴 = new Dictionary<string, ClsAxisPos>();
  36. public static Dictionary<string, ClsAxisPos> dictM03_取料R轴 = new Dictionary<string, ClsAxisPos>();
  37. //M04M05
  38. public static List<string> listM04M05_取料X轴 = new List<string>();
  39. public static List<string> listM04M05_取料Y轴 = new List<string>();
  40. public static List<string> listM04M05_装盘X轴 = new List<string>();
  41. public static List<string> listM04M05_装盘Y轴 = new List<string>();
  42. public static List<string> listM04M05_装盘Z轴 = new List<string>();
  43. public static List<string> listM04M05_下料站X轴 = new List<string>();
  44. public static List<string> listM04M05_下料站Y轴 = new List<string>();
  45. public static List<string> listM04M05_下料站Z轴 = new List<string>();
  46. public static Dictionary<string, ClsAxisPos> dictM04M05_取料X轴 = new Dictionary<string, ClsAxisPos>();
  47. public static Dictionary<string, ClsAxisPos> dictM04M05_取料Y轴 = new Dictionary<string, ClsAxisPos>();
  48. public static Dictionary<string, ClsAxisPos> dictM04M05_装盘X轴 = new Dictionary<string, ClsAxisPos>();
  49. public static Dictionary<string, ClsAxisPos> dictM04M05_装盘Y轴 = new Dictionary<string, ClsAxisPos>();
  50. public static Dictionary<string, ClsAxisPos> dictM04M05_装盘Z轴 = new Dictionary<string, ClsAxisPos>();
  51. public static Dictionary<string, ClsAxisPos> dictM04M05_下料站X轴 = new Dictionary<string, ClsAxisPos>();
  52. public static Dictionary<string, ClsAxisPos> dictM04M05_下料站Y轴 = new Dictionary<string, ClsAxisPos>();
  53. public static Dictionary<string, ClsAxisPos> dictM04M05_下料站Z轴 = new Dictionary<string, ClsAxisPos>();
  54. public static void GetM01M02PosAdd()
  55. {
  56. newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM01M02.ini");
  57. int count取料X轴 = Convert.ToInt32(newIni.ReadIni("System", "取料X轴Count", "20"));
  58. int count取料Y轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Y轴Count", "20"));
  59. int count取料Z轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Z轴Count", "20"));
  60. int count取料R轴 = Convert.ToInt32(newIni.ReadIni("System", "取料R轴Count", "20"));
  61. int count上料站X轴 = Convert.ToInt32(newIni.ReadIni("System", "上料站X轴Count", "20"));
  62. int count上料站Y轴 = Convert.ToInt32(newIni.ReadIni("System", "上料站Y轴Count", "20"));
  63. int count上料站Z轴 = Convert.ToInt32(newIni.ReadIni("System", "上料站Z轴Count", "20"));
  64. for (int i = 13; i < count取料X轴; i++)
  65. {
  66. string str = newIni.ReadIni("取料X轴", (i + 1).ToString(), "20");
  67. listM01M02_取料X轴.Add(str);
  68. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料X轴", str);
  69. dictM01M02_取料X轴.Add(str.Split(',')[0], clsAxisPos);
  70. }
  71. for (int i = 13; i < count取料Y轴; i++)
  72. {
  73. string str = newIni.ReadIni("取料Y轴", (i + 1).ToString(), "20");
  74. listM01M02_取料Y轴.Add(str);
  75. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料Y轴", str);
  76. dictM01M02_取料Y轴.Add(str.Split(',')[0], clsAxisPos);
  77. }
  78. for (int i = 13; i < count取料Z轴; i++)
  79. {
  80. string str = newIni.ReadIni("取料Z轴", (i + 1).ToString(), "20");
  81. listM01M02_取料Z轴.Add(str);
  82. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料Z轴", str);
  83. dictM01M02_取料Z轴.Add(str.Split(',')[0], clsAxisPos);
  84. }
  85. for (int i = 13; i < count取料R轴; i++)
  86. {
  87. string str = newIni.ReadIni("取料R轴", (i + 1).ToString(), "20");
  88. listM01M02_取料R轴.Add(str);
  89. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料R轴", str);
  90. dictM01M02_取料R轴.Add(str.Split(',')[0], clsAxisPos);
  91. }
  92. for (int i = 13; i < count上料站X轴; i++)
  93. {
  94. string str = newIni.ReadIni("上料站X轴", (i + 1).ToString(), "20");
  95. listM01M02_上料站X轴.Add(str);
  96. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "上料站X轴", str);
  97. dictM01M02_上料站X轴.Add(str.Split(',')[0], clsAxisPos);
  98. }
  99. for (int i = 13; i < count上料站Y轴; i++)
  100. {
  101. string str = newIni.ReadIni("上料站Y轴", (i + 1).ToString(), "20");
  102. listM01M02_上料站Y轴.Add(str);
  103. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "上料站Y轴", str);
  104. dictM01M02_上料站Y轴.Add(str.Split(',')[0], clsAxisPos);
  105. }
  106. for (int i = 13; i < count上料站Z轴; i++)
  107. {
  108. string str = newIni.ReadIni("上料站Z轴", (i + 1).ToString(), "20");
  109. listM01M02_上料站Z轴.Add(str);
  110. ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "上料站Z轴", str);
  111. dictM01M02_上料站Z轴.Add(str.Split(',')[0], clsAxisPos);
  112. }
  113. }
  114. public static void GetM03PosAdd()
  115. {
  116. newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM03.ini");
  117. int count取料X轴 = Convert.ToInt32(newIni.ReadIni("System", "取料X轴Count", "20"));
  118. int count取料Y轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Y轴Count", "20"));
  119. int count取料Z轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Z轴Count", "20"));
  120. int count取料R轴 = Convert.ToInt32(newIni.ReadIni("System", "取料R轴Count", "20"));
  121. for (int i = 13; i < count取料X轴; i++)
  122. {
  123. string str = newIni.ReadIni("取料X轴", (i + 1).ToString(), "20");
  124. listM03_取料X轴.Add(str);
  125. ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料X轴", str);
  126. dictM03_取料X轴.Add(str.Split(',')[0], clsAxisPos);
  127. }
  128. for (int i = 13; i < count取料Y轴; i++)
  129. {
  130. string str = newIni.ReadIni("取料Y轴", (i + 1).ToString(), "20");
  131. listM03_取料Y轴.Add(str);
  132. ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料Y轴", str);
  133. dictM03_取料Y轴.Add(str.Split(',')[0], clsAxisPos);
  134. }
  135. for (int i = 13; i < count取料Z轴; i++)
  136. {
  137. string str = newIni.ReadIni("取料Z轴", (i + 1).ToString(), "20");
  138. listM03_取料Z轴.Add(str);
  139. ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料Z轴", str);
  140. dictM03_取料Z轴.Add(str.Split(',')[0], clsAxisPos);
  141. }
  142. for (int i = 13; i < count取料R轴; i++)
  143. {
  144. string str = newIni.ReadIni("取料R轴", (i + 1).ToString(), "20");
  145. listM03_取料R轴.Add(str);
  146. ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料R轴", str);
  147. dictM03_取料R轴.Add(str.Split(',')[0], clsAxisPos);
  148. }
  149. }
  150. public static void GetM04M05PosAdd()
  151. {
  152. newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM04M05.ini");
  153. int count取料X轴 = Convert.ToInt32(newIni.ReadIni("System", "取料X轴Count", "20"));
  154. int count取料Y轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Y轴Count", "20"));
  155. int count装盘X轴 = Convert.ToInt32(newIni.ReadIni("System", "装盘X轴Count", "20"));
  156. int count装盘Y轴 = Convert.ToInt32(newIni.ReadIni("System", "装盘Y轴Count", "20"));
  157. int count装盘Z轴 = Convert.ToInt32(newIni.ReadIni("System", "装盘Z轴Count", "20"));
  158. int count下料站X轴 = Convert.ToInt32(newIni.ReadIni("System", "下料站X轴Count", "20"));
  159. int count下料站Y轴 = Convert.ToInt32(newIni.ReadIni("System", "下料站Y轴Count", "20"));
  160. int count下料站Z轴 = Convert.ToInt32(newIni.ReadIni("System", "下料站Z轴Count", "20"));
  161. for (int i = 13; i < count取料X轴; i++)
  162. {
  163. string str = newIni.ReadIni("取料X轴", (i + 1).ToString(), "20");
  164. listM04M05_取料X轴.Add(str);
  165. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "取料X轴", str);
  166. dictM04M05_取料X轴.Add(str.Split(',')[0], clsAxisPos);
  167. }
  168. for (int i = 13; i < count取料Y轴; i++)
  169. {
  170. string str = newIni.ReadIni("取料Y轴", (i + 1).ToString(), "20");
  171. listM04M05_取料Y轴.Add(str);
  172. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "取料Y轴", str);
  173. dictM04M05_取料Y轴.Add(str.Split(',')[0], clsAxisPos);
  174. }
  175. for (int i = 13; i < count装盘X轴; i++)
  176. {
  177. string str = newIni.ReadIni("装盘X轴", (i + 1).ToString(), "20");
  178. listM04M05_装盘X轴.Add(str);
  179. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "装盘X轴", str);
  180. dictM04M05_装盘X轴.Add(str.Split(',')[0], clsAxisPos);
  181. }
  182. for (int i = 13; i < count装盘Y轴; i++)
  183. {
  184. string str = newIni.ReadIni("装盘Y轴", (i + 1).ToString(), "20");
  185. listM04M05_装盘Y轴.Add(str);
  186. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "装盘Y轴", str);
  187. dictM04M05_装盘Y轴.Add(str.Split(',')[0], clsAxisPos);
  188. }
  189. for (int i = 13; i < count装盘Z轴; i++)
  190. {
  191. string str = newIni.ReadIni("装盘Z轴", (i + 1).ToString(), "20");
  192. listM04M05_装盘Z轴.Add(str);
  193. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "装盘Z轴", str);
  194. dictM04M05_装盘Z轴.Add(str.Split(',')[0], clsAxisPos);
  195. }
  196. for (int i = 13; i < count下料站X轴; i++)
  197. {
  198. string str = newIni.ReadIni("下料站X轴", (i + 1).ToString(), "20");
  199. listM04M05_下料站X轴.Add(str);
  200. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "下料站X轴", str);
  201. dictM04M05_下料站X轴.Add(str.Split(',')[0], clsAxisPos);
  202. }
  203. for (int i = 13; i < count下料站Y轴; i++)
  204. {
  205. string str = newIni.ReadIni("下料站Y轴", (i + 1).ToString(), "20");
  206. listM04M05_下料站Y轴.Add(str);
  207. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "下料站Y轴", str);
  208. dictM04M05_下料站Y轴.Add(str.Split(',')[0], clsAxisPos);
  209. }
  210. for (int i = 13; i < count下料站Z轴; i++)
  211. {
  212. string str = newIni.ReadIni("下料站Z轴", (i + 1).ToString(), "20");
  213. listM04M05_下料站Z轴.Add(str);
  214. ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "下料站Z轴", str);
  215. dictM04M05_下料站Z轴.Add(str.Split(',')[0], clsAxisPos);
  216. }
  217. }
  218. }
  219. }