Line_Config.cs
6.9 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.LoadCSVLibrary
{
/// <summary>
/// 流水线配置
/// </summary>
public class Line_Config : DeviceConfig
{
public Line_Config()
: base()
{
}
public Line_Config(int id, string cid, string type, string filepath)
: base(id, cid, LoadCSVLibrary.DeviceType.Line, filepath)
{
}
public static Dictionary<int, ConfigClampJaw> ClampJawMap = new Dictionary<int, ConfigClampJaw>();
/// <summary>
/// CLAW,1,D1移栽夹爪,CLAW_D1,0,COM1,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D1")]
public ConfigClampJaw CLAW_D1 { get; set; }
/// <summary>
/// CLAW,2,D2移栽夹爪,CLAW_D2,1,COM1,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D2")]
public ConfigClampJaw CLAW_D2 { get; set; }
/// <summary>
/// CLAW,3,D3移栽夹爪,CLAW_D3,2,COM1,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D3")]
public ConfigClampJaw CLAW_D3 { get; set; }
/// <summary>
/// CLAW,4,D4移栽夹爪,CLAW_D4,3,COM1,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D4")]
public ConfigClampJaw CLAW_D4 { get; set; }
/// <summary>
/// CLAW,5,D5移栽夹爪,CLAW_D5,0,COM2,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D5")]
public ConfigClampJaw CLAW_D5 { get; set; }
/// <summary>
/// CLAW,6,D6移栽夹爪,CLAW_D6,1,COM2,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D6")]
public ConfigClampJaw CLAW_D6 { get; set; }
/// <summary>
/// CLAW,7,D7移栽夹爪,CLAW_D7,2,COM2,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_D7")]
public ConfigClampJaw CLAW_D7 { get; set; }
/// <summary>
/// CLAW,101,D8移栽夹爪,CLAW_T1,3,COM2,,500,0,0,30,7
/// </summary>
[ConfigProAttribute("CLAW_T1")]
public ConfigClampJaw CLAW_T1 { get; set; }
/// <summary>
/// 气压检测信号关闭需要持续的时间
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// PRO,当多久没有出入库操作时,流水线进行休眠(休眠毫秒数),Sleep_MSeconds,120,,,,,
/// </summary>
[ConfigProAttribute("Sleep_MSeconds")]
public int Sleep_MSeconds { get; set; }
/// <summary>
/// PRO IO信号超时时间(秒) IOSingle_TimerOut 5000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut",false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DILength",false )]
public string IO_DILength { get; set; }
/// <summary>
/// PRO 模块对应的DO数量 IO_DOLength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DOLength",false )]
public string IO_DOLength { get; set; }
/// <summary>
/// PRO,0,移栽上下轴走到待机点速度,UpdownAxis_P1Speed,400,,,,,
/// </summary>
[ConfigProAttribute("UpdownAxis_P1Speed", false)]
public int UpdownAxis_P1Speed { get; set; }
/// <summary>
/// PRO,0,移栽上下轴P2速度,UpdownAxis_P2Speed,500,,,,,
/// </summary>
[ConfigProAttribute("UpdownAxis_P2Speed", false)]
public int UpdownAxis_P2Speed { get; set; }
/// <summary>
/// PRO,0,移栽上下轴P3速度,UpdownAxis_P3Speed,500,,,,,
/// </summary>
[ConfigProAttribute("UpdownAxis_P3Speed", false)]
public int UpdownAxis_P3Speed { get; set; }
private Dictionary<string, ushort> DILengthMap = null;
private Dictionary<string, ushort> DOLengthMap = null;
public ushort GetDILength(string ip)
{
try
{
if (DILengthMap == null)
{
DILengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DILength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DILengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DILengthMap.ContainsKey(ip))
{
return DILengthMap[ip];
}
return 16;
}
public ushort GetDOLength(string ip)
{
try
{
if (DOLengthMap == null)
{
DOLengthMap = new Dictionary<string, ushort>();
string[] arrayList = IO_DOLength.Split(';');
foreach (string str in arrayList)
{
string[] arrStr = str.Split('#');
if (arrStr.Length == 2)
{
string ioip = arrStr[0];
ushort length = Convert.ToUInt16(arrStr[1]);
DOLengthMap.Add(ioip, length);
}
}
}
}
catch (Exception ex)
{
}
if (DOLengthMap.ContainsKey(ip))
{
return DOLengthMap[ip];
}
return 16;
}
protected override void initMustHavePro()
{
MustHaveDIList = new List<string>();
MustHaveDOList = new List<string>();
MustHaveDIList.Add(IO_Type.SuddenStop_BTN);
MustHaveDIList.Add(IO_Type.Reset_BTN);
MustHaveDIList.Add(IO_Type.Airpressure_Check);
MustHaveDIList.Add(IO_Type.TopCylinder_Up);
MustHaveDIList.Add(IO_Type.TopCylinder_Down);
MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
MustHaveDOList.Add(IO_Type.RunSign_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_Buzzer);
MustHaveDOList.Add(IO_Type.TopCylinder_Up);
MustHaveDOList.Add(IO_Type.TopCylinder_Down);
}
}
}