Client_Config.cs
10.4 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
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 Client_Config : DeviceConfig
{
public Client_Config()
: base()
{
}
public Client_Config(int id, string cid, string type, string filepath)
: base(id, cid, LoadCSVLibrary.DeviceType.Store, filepath)
{
}
#region 轴
[ConfigProAttribute("MoveAxis")]
public ConfigMoveAxis MoveAxis { get; set; }
[ConfigProAttribute("CompressAxis")]
public ConfigMoveAxis CompressAxis { get; set; }
#endregion
#region 行走机构点位
/// <summary>
///PRO,0,行走机构_待机点,MoveAxis_P1,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P1")]
public int MoveAxis_P1 { get; set; }
/// <summary>
///PRO,0,行走机构_入料口,MoveAxis_P2_Inlet,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P2_Inlet")]
public int MoveAxis_P2_Inlet { get; set; }
/// <summary>
///PRO,0,行走机构_出料口,MoveAxis_P3_Outlet,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P3_Outlet")]
public int MoveAxis_P3_Outlet { get; set; }
/// <summary>
///PRO,0,行走机构_NG口,MoveAxis_P4_NGBox,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P4_NGBox")]
public int MoveAxis_P4_NGBox { get; set; }
/// <summary>
///PRO,0,行走机构_料仓1门口,MoveAxis_P5_Store1,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P5_Store1")]
public int MoveAxis_P5_Store1 { get; set; }
/// <summary>
///PRO,0,行走机构_料仓2门口,MoveAxis_P6_Store2,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P6_Store2")]
public int MoveAxis_P6_Store2 { get; set; }
/// <summary>
///PRO,0,行走机构_料仓3门口,MoveAxis_P7_Store3,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P7_Store3")]
public int MoveAxis_P7_Store3 { get; set; }
/// <summary>
///PRO,0,行走机构_料仓4门口,MoveAxis_P8_Store4,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P8_Store4")]
public int MoveAxis_P8_Store4 { get; set; }
/// <summary>
///PRO,0,行走机构_料仓5门口,MoveAxis_P9_Store5,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P9_Store5")]
public int MoveAxis_P9_Store5 { get; set; }
/// <summary>
///PRO,0,行走机构_料仓6门口,MoveAxis_P10_Store6,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P10_Store6")]
public int MoveAxis_P10_Store6 { get; set; }
#endregion
#region 行走机构速度
/// <summary>
///PRO,0,行走机构_待机点,MoveAxis_P1,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P1_Speed")]
public int MoveAxis_P1_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_入料口,MoveAxis_P2_Inlet,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P2_Inlet_Speed")]
public int MoveAxis_P2_Inlet_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_出料口,MoveAxis_P3_Outlet,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P3_Outlet_Speed")]
public int MoveAxis_P3_Outlet_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_NG口,MoveAxis_P4_NGBox,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P4_NGBox_Speed")]
public int MoveAxis_P4_NGBox_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_料仓1门口,MoveAxis_P5_Store1,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P5_Store1_Speed")]
public int MoveAxis_P5_Store1_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_料仓2门口,MoveAxis_P6_Store2,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P6_Store2_Speed")]
public int MoveAxis_P6_Store2_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_料仓3门口,MoveAxis_P7_Store3,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P7_Store3_Speed")]
public int MoveAxis_P7_Store3_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_料仓4门口,MoveAxis_P8_Store4,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P8_Store4_Speed")]
public int MoveAxis_P8_Store4_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_料仓5门口,MoveAxis_P9_Store5,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P9_Store5_Speed")]
public int MoveAxis_P9_Store5_Speed { get; set; }
/// <summary>
///PRO,0,行走机构_料仓6门口,MoveAxis_P10_Store6,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("MoveAxis_P10_Store6_Speed")]
public int MoveAxis_P10_Store6_Speed { get; set; }
#endregion
#region 压紧轴点位
/// <summary>
///PRO,0,压紧轴_待机点,CompressAxis_P1,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P1")]
public int CompressAxis_P1 { get; set; }
/// <summary>
///PRO,0,压紧轴_张开点,CompressAxis_P2,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P2")]
public int CompressAxis_P2 { get; set; }
/// <summary>
///PRO,0,压紧轴_压紧前点,CompressAxis_P3,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P3")]
public int CompressAxis_P3 { get; set; }
/// <summary>
///PRO,0,压紧轴_压紧点,CompressAxis_P4,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P4")]
public int CompressAxis_P4 { get; set; }
#endregion
#region 压紧轴速度
/// <summary>
///PRO,0,压紧轴_待机点,CompressAxis_P1,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P1_Speed")]
public int CompressAxis_P1_Speed { get; set; }
/// <summary>
///PRO,0,压紧轴_张开点,CompressAxis_P2,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P2_Speed")]
public int CompressAxis_P2_Speed { get; set; }
/// <summary>
///PRO,0,压紧轴_压紧前点,CompressAxis_P3,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P3_Speed")]
public int CompressAxis_P3_Speed { get; set; }
/// <summary>
///PRO,0,压紧轴_压紧点,CompressAxis_P4,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("CompressAxis_P4_Speed")]
public int CompressAxis_P4_Speed { get; set; }
#endregion
#region PRO参数
/// <summary>
///PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,,,,,,,,,
/// </summary>
/// <summary>
[ConfigProAttribute("IsDebug")]
public int IsDebug { get; set; }
/// PRO,0,当多久没操作时流水线休眠(秒),Sleep_MSeconds,600,,,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Sleep_MSeconds")]
public int Sleep_MSeconds { get; set; }
/// <summary>
/// PRO,0,气压检测信号关闭需要持续的时间,Airpressure_CheckSeconds,600,,,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Airpressure_CheckSeconds")]
public int Airpressure_CheckSeconds { get; set; }
/// <summary>
/// PRO,0,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut")]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO,0,扫码的相机名称(多个用#分隔),ScanCodeCamera,GigE:MV-CE200-10GC (00E70964538),,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("ScanCodeCamera")]
public string ScanCodeCamera { get; set; }
[ConfigProAttribute("Robot_IP")]
public string Robot_IP { get; set; }
/// <summary>
/// PRO,0,料盘高度转换系数,Coeff_Height,0.5,,,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Coeff_Height")]
public double Coeff_Height { get; set; }
/// <summary>
/// PRO,0,料盘宽度转换系数,Coeff_Width,0.5,,,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("Coeff_Width")]
public double Coeff_Width { get; set; }
#endregion
protected override void initMustHavePro()
{
MustHaveDIList = new List<string>();
MustHaveDOList = new List<string>();
}
public ushort GetDOLength(string iP)
{
return 16;
}
public ushort GetDILength(string ioIp)
{
return 16;
}
private List<string> CameraList = null;
public List<string> GetCameraList(string list)
{
if (CameraList == null)
{
CameraList = new List<string>();
string[] arrayList = list.Split('#');
foreach (string str in arrayList)
{
string camera = str.Trim();
if (string.IsNullOrEmpty(camera).Equals(false))
{
CameraList.Add(camera);
}
}
}
return CameraList;
}
}
}