PLCAxis.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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 PLCAxis
  11. {
  12. public static Ini newIni;
  13. //M01M02
  14. public static List<string> listM01M02_轴 = new List<string>();
  15. public static Dictionary<string, ClsAxis> dictM01M02_轴 = new Dictionary<string, ClsAxis>();
  16. //M03
  17. public static List<string> listM03_轴 = new List<string>();
  18. public static Dictionary<string, ClsAxis> dictM03_轴 = new Dictionary<string, ClsAxis>();
  19. //M04M05
  20. public static List<string> listM04M05_轴 = new List<string>();
  21. public static Dictionary<string, ClsAxis> dictM04M05_轴 = new Dictionary<string, ClsAxis>();
  22. public static void GetM01M02AxisAdd()
  23. {
  24. newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM01M02.ini");
  25. string str = newIni.ReadIni("取料X轴", "1", "20");
  26. listM01M02_轴.Add(str);
  27. ClsAxis clsAxisX = new ClsAxis("M01M02", "取料X轴", str);
  28. dictM01M02_轴.Add("取料X轴", clsAxisX);
  29. str = newIni.ReadIni("取料Y轴", "1", "20");
  30. listM01M02_轴.Add(str);
  31. ClsAxis clsAxisY = new ClsAxis("M01M02", "取料Y轴", str);
  32. dictM01M02_轴.Add("取料Y轴", clsAxisY);
  33. str = newIni.ReadIni("取料Z轴", "1", "20");
  34. listM01M02_轴.Add(str);
  35. ClsAxis clsAxisZ = new ClsAxis("M01M02", "取料Z轴", str);
  36. dictM01M02_轴.Add("取料Z轴", clsAxisZ);
  37. str = newIni.ReadIni("取料R轴", "1", "20");
  38. listM01M02_轴.Add(str);
  39. ClsAxis clsAxisR = new ClsAxis("M01M02", "取料R轴", str);
  40. dictM01M02_轴.Add("取料R轴", clsAxisR);
  41. str = newIni.ReadIni("上料站X轴", "1", "20");
  42. listM01M02_轴.Add(str);
  43. ClsAxis clsAxis1 = new ClsAxis("M01M02", "上料站X轴", str);
  44. dictM01M02_轴.Add("上料站X轴", clsAxis1);
  45. str = newIni.ReadIni("上料站Y轴", "1", "20");
  46. listM01M02_轴.Add(str);
  47. ClsAxis clsAxis2 = new ClsAxis("M01M02", "上料站Y轴", str);
  48. dictM01M02_轴.Add("上料站Y轴", clsAxis2);
  49. str = newIni.ReadIni("上料站Z轴", "1", "20");
  50. listM01M02_轴.Add(str);
  51. ClsAxis clsAxis3 = new ClsAxis("M01M02", "上料站Z轴", str);
  52. dictM01M02_轴.Add("上料站Z轴", clsAxis3);
  53. }
  54. public static void GetM03AxisAdd()
  55. {
  56. newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM03.ini");
  57. string str = newIni.ReadIni("压机流线伺服", "1", "20");
  58. listM03_轴.Add(str);
  59. ClsAxis clsAxis压机流线伺服 = new ClsAxis("M03", "压机流线伺服", str);
  60. dictM03_轴.Add("压机流线伺服", clsAxis压机流线伺服);
  61. str = newIni.ReadIni("压机前流线伺服", "1", "20");
  62. listM03_轴.Add(str);
  63. ClsAxis clsAxis压机前流线伺服 = new ClsAxis("M03", "压机前流线伺服", str);
  64. dictM03_轴.Add("压机前流线伺服", clsAxis压机前流线伺服);
  65. //str = newIni.ReadIni("取料X轴", "1", "20");
  66. //listM03_轴.Add(str);
  67. //ClsAxis clsAxisX = new ClsAxis("M03", "取料X轴", str);
  68. //dictM03_轴.Add("取料X轴", clsAxisX);
  69. //str = newIni.ReadIni("取料Y轴", "1", "20");
  70. //listM03_轴.Add(str);
  71. //ClsAxis clsAxisY = new ClsAxis("M03", "取料Y轴", str);
  72. //dictM03_轴.Add("取料Y轴", clsAxisY);
  73. //str = newIni.ReadIni("取料Z轴", "1", "20");
  74. //listM03_轴.Add(str);
  75. //ClsAxis clsAxisZ = new ClsAxis("M03", "取料Z轴", str);
  76. //dictM03_轴.Add("取料Z轴", clsAxisZ);
  77. //str = newIni.ReadIni("取料R轴", "1", "20");
  78. //listM03_轴.Add(str);
  79. //ClsAxis clsAxisR = new ClsAxis("M03", "取料R轴", str);
  80. //dictM03_轴.Add("取料R轴", clsAxisR);
  81. }
  82. public static void GetM04M05AxisAdd()
  83. {
  84. newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM04M05.ini");
  85. string str = newIni.ReadIni("取料X轴", "1", "20");
  86. listM04M05_轴.Add(str);
  87. ClsAxis clsAxisX = new ClsAxis("M04M05", "取料X轴", str);
  88. dictM04M05_轴.Add("取料X轴", clsAxisX);
  89. str = newIni.ReadIni("取料Y轴", "1", "20");
  90. listM04M05_轴.Add(str);
  91. ClsAxis clsAxisY = new ClsAxis("M04M05", "取料Y轴", str);
  92. dictM04M05_轴.Add("取料Y轴", clsAxisY);
  93. str = newIni.ReadIni("装盘X轴", "1", "20");
  94. listM04M05_轴.Add(str);
  95. ClsAxis clsAxis1 = new ClsAxis("M04M05", "装盘X轴", str);
  96. dictM04M05_轴.Add("装盘X轴", clsAxis1);
  97. str = newIni.ReadIni("装盘Y轴", "1", "20");
  98. listM04M05_轴.Add(str);
  99. ClsAxis clsAxis2 = new ClsAxis("M04M05", "装盘Y轴", str);
  100. dictM04M05_轴.Add("装盘Y轴", clsAxis2);
  101. str = newIni.ReadIni("装盘Z轴", "1", "20");
  102. listM04M05_轴.Add(str);
  103. ClsAxis clsAxis3 = new ClsAxis("M04M05", "装盘Z轴", str);
  104. dictM04M05_轴.Add("装盘Z轴", clsAxis3);
  105. str = newIni.ReadIni("下料站X轴", "1", "20");
  106. listM04M05_轴.Add(str);
  107. ClsAxis clsAxis4 = new ClsAxis("M04M05", "下料站X轴", str);
  108. dictM04M05_轴.Add("下料站X轴", clsAxis4);
  109. str = newIni.ReadIni("下料站Y轴", "1", "20");
  110. listM04M05_轴.Add(str);
  111. ClsAxis clsAxis5 = new ClsAxis("M04M05", "下料站Y轴", str);
  112. dictM04M05_轴.Add("下料站Y轴", clsAxis5);
  113. str = newIni.ReadIni("下料站Z轴", "1", "20");
  114. listM04M05_轴.Add(str);
  115. ClsAxis clsAxis6 = new ClsAxis("M04M05", "下料站Z轴", str);
  116. dictM04M05_轴.Add("下料站Z轴", clsAxis6);
  117. }
  118. }
  119. }