123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- using BaseLibRWFile;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace HRT_Measure
- {
- public class PLCAxisPos
- {
- public static Ini newIni;
- //M01M02
- public static List<string> listM01M02_取料X轴 = new List<string>();
- public static List<string> listM01M02_取料Y轴 = new List<string>();
- public static List<string> listM01M02_取料Z轴 = new List<string>();
- public static List<string> listM01M02_取料R轴 = new List<string>();
- public static List<string> listM01M02_上料站X轴 = new List<string>();
- public static List<string> listM01M02_上料站Y轴 = new List<string>();
- public static List<string> listM01M02_上料站Z轴 = new List<string>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_取料X轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_取料Y轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_取料Z轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_取料R轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_上料站X轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_上料站Y轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM01M02_上料站Z轴 = new Dictionary<string, ClsAxisPos>();
- //M03
- public static List<string> listM03_取料X轴 = new List<string>();
- public static List<string> listM03_取料Y轴 = new List<string>();
- public static List<string> listM03_取料Z轴 = new List<string>();
- public static List<string> listM03_取料R轴 = new List<string>();
- public static Dictionary<string, ClsAxisPos> dictM03_取料X轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM03_取料Y轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM03_取料Z轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM03_取料R轴 = new Dictionary<string, ClsAxisPos>();
- //M04M05
- public static List<string> listM04M05_取料X轴 = new List<string>();
- public static List<string> listM04M05_取料Y轴 = new List<string>();
- public static List<string> listM04M05_装盘X轴 = new List<string>();
- public static List<string> listM04M05_装盘Y轴 = new List<string>();
- public static List<string> listM04M05_装盘Z轴 = new List<string>();
- public static List<string> listM04M05_下料站X轴 = new List<string>();
- public static List<string> listM04M05_下料站Y轴 = new List<string>();
- public static List<string> listM04M05_下料站Z轴 = new List<string>();
-
- public static Dictionary<string, ClsAxisPos> dictM04M05_取料X轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_取料Y轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_装盘X轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_装盘Y轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_装盘Z轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_下料站X轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_下料站Y轴 = new Dictionary<string, ClsAxisPos>();
- public static Dictionary<string, ClsAxisPos> dictM04M05_下料站Z轴 = new Dictionary<string, ClsAxisPos>();
- public static void GetM01M02PosAdd()
- {
- newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM01M02.ini");
- int count取料X轴 = Convert.ToInt32(newIni.ReadIni("System", "取料X轴Count", "20"));
- int count取料Y轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Y轴Count", "20"));
- int count取料Z轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Z轴Count", "20"));
- int count取料R轴 = Convert.ToInt32(newIni.ReadIni("System", "取料R轴Count", "20"));
- int count上料站X轴 = Convert.ToInt32(newIni.ReadIni("System", "上料站X轴Count", "20"));
- int count上料站Y轴 = Convert.ToInt32(newIni.ReadIni("System", "上料站Y轴Count", "20"));
- int count上料站Z轴 = Convert.ToInt32(newIni.ReadIni("System", "上料站Z轴Count", "20"));
- for (int i = 13; i < count取料X轴; i++)
- {
- string str = newIni.ReadIni("取料X轴", (i + 1).ToString(), "20");
- listM01M02_取料X轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料X轴", str);
- dictM01M02_取料X轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料Y轴; i++)
- {
- string str = newIni.ReadIni("取料Y轴", (i + 1).ToString(), "20");
- listM01M02_取料Y轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料Y轴", str);
- dictM01M02_取料Y轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料Z轴; i++)
- {
- string str = newIni.ReadIni("取料Z轴", (i + 1).ToString(), "20");
- listM01M02_取料Z轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料Z轴", str);
- dictM01M02_取料Z轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料R轴; i++)
- {
- string str = newIni.ReadIni("取料R轴", (i + 1).ToString(), "20");
- listM01M02_取料R轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "取料R轴", str);
- dictM01M02_取料R轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count上料站X轴; i++)
- {
- string str = newIni.ReadIni("上料站X轴", (i + 1).ToString(), "20");
- listM01M02_上料站X轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "上料站X轴", str);
- dictM01M02_上料站X轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count上料站Y轴; i++)
- {
- string str = newIni.ReadIni("上料站Y轴", (i + 1).ToString(), "20");
- listM01M02_上料站Y轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "上料站Y轴", str);
- dictM01M02_上料站Y轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count上料站Z轴; i++)
- {
- string str = newIni.ReadIni("上料站Z轴", (i + 1).ToString(), "20");
- listM01M02_上料站Z轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M01M02", "上料站Z轴", str);
- dictM01M02_上料站Z轴.Add(str.Split(',')[0], clsAxisPos);
- }
- }
- public static void GetM03PosAdd()
- {
- newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM03.ini");
- int count取料X轴 = Convert.ToInt32(newIni.ReadIni("System", "取料X轴Count", "20"));
- int count取料Y轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Y轴Count", "20"));
- int count取料Z轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Z轴Count", "20"));
- int count取料R轴 = Convert.ToInt32(newIni.ReadIni("System", "取料R轴Count", "20"));
-
- for (int i = 13; i < count取料X轴; i++)
- {
- string str = newIni.ReadIni("取料X轴", (i + 1).ToString(), "20");
- listM03_取料X轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料X轴", str);
- dictM03_取料X轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料Y轴; i++)
- {
- string str = newIni.ReadIni("取料Y轴", (i + 1).ToString(), "20");
- listM03_取料Y轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料Y轴", str);
- dictM03_取料Y轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料Z轴; i++)
- {
- string str = newIni.ReadIni("取料Z轴", (i + 1).ToString(), "20");
- listM03_取料Z轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料Z轴", str);
- dictM03_取料Z轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料R轴; i++)
- {
- string str = newIni.ReadIni("取料R轴", (i + 1).ToString(), "20");
- listM03_取料R轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M03", "取料R轴", str);
- dictM03_取料R轴.Add(str.Split(',')[0], clsAxisPos);
- }
- }
- public static void GetM04M05PosAdd()
- {
- newIni = new Ini(Application.StartupPath + "\\Config\\PLCAxisM04M05.ini");
- int count取料X轴 = Convert.ToInt32(newIni.ReadIni("System", "取料X轴Count", "20"));
- int count取料Y轴 = Convert.ToInt32(newIni.ReadIni("System", "取料Y轴Count", "20"));
- int count装盘X轴 = Convert.ToInt32(newIni.ReadIni("System", "装盘X轴Count", "20"));
- int count装盘Y轴 = Convert.ToInt32(newIni.ReadIni("System", "装盘Y轴Count", "20"));
- int count装盘Z轴 = Convert.ToInt32(newIni.ReadIni("System", "装盘Z轴Count", "20"));
- int count下料站X轴 = Convert.ToInt32(newIni.ReadIni("System", "下料站X轴Count", "20"));
- int count下料站Y轴 = Convert.ToInt32(newIni.ReadIni("System", "下料站Y轴Count", "20"));
- int count下料站Z轴 = Convert.ToInt32(newIni.ReadIni("System", "下料站Z轴Count", "20"));
- for (int i = 13; i < count取料X轴; i++)
- {
- string str = newIni.ReadIni("取料X轴", (i + 1).ToString(), "20");
- listM04M05_取料X轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "取料X轴", str);
- dictM04M05_取料X轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count取料Y轴; i++)
- {
- string str = newIni.ReadIni("取料Y轴", (i + 1).ToString(), "20");
- listM04M05_取料Y轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "取料Y轴", str);
- dictM04M05_取料Y轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count装盘X轴; i++)
- {
- string str = newIni.ReadIni("装盘X轴", (i + 1).ToString(), "20");
- listM04M05_装盘X轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "装盘X轴", str);
- dictM04M05_装盘X轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count装盘Y轴; i++)
- {
- string str = newIni.ReadIni("装盘Y轴", (i + 1).ToString(), "20");
- listM04M05_装盘Y轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "装盘Y轴", str);
- dictM04M05_装盘Y轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count装盘Z轴; i++)
- {
- string str = newIni.ReadIni("装盘Z轴", (i + 1).ToString(), "20");
- listM04M05_装盘Z轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "装盘Z轴", str);
- dictM04M05_装盘Z轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count下料站X轴; i++)
- {
- string str = newIni.ReadIni("下料站X轴", (i + 1).ToString(), "20");
- listM04M05_下料站X轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "下料站X轴", str);
- dictM04M05_下料站X轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count下料站Y轴; i++)
- {
- string str = newIni.ReadIni("下料站Y轴", (i + 1).ToString(), "20");
- listM04M05_下料站Y轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "下料站Y轴", str);
- dictM04M05_下料站Y轴.Add(str.Split(',')[0], clsAxisPos);
- }
- for (int i = 13; i < count下料站Z轴; i++)
- {
- string str = newIni.ReadIni("下料站Z轴", (i + 1).ToString(), "20");
- listM04M05_下料站Z轴.Add(str);
- ClsAxisPos clsAxisPos = new ClsAxisPos("M04M05", "下料站Z轴", str);
- dictM04M05_下料站Z轴.Add(str.Split(',')[0], clsAxisPos);
- }
- }
- }
- }
|