Store_Config.cs
7.6 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class Store_Config : BaseConfig
{
public Store_Config()
: base()
{
}
public Store_Config(int id, string cid, string type, string filepath)
: base(id, cid, type, filepath)
{
}
/// <summary>
/// AXIS,,T1_提升机构升降轴,T1_Batch_Axis,1,COM3,,250,500,500,100,200,1000,10,1000,0,0
/// </summary>
[ConfigProAttribute("T1_Batch_Axis")]
public ConfigMoveAxis T1_Batch_Axis { get; set; }
/// <summary>
/// AXIS,,T2_取料机构旋转轴,T2_Middle_Axis,2,COM3,,1000,1000,1000,200,500,500,10,1000,0,0
/// </summary>
[ConfigProAttribute("T2_Middle_Axis")]
public ConfigMoveAxis T2_Middle_Axis { get; set; }
/// <summary>
/// AXIS,,T3_取料机构上下轴,T3_Updown_Axis,3,COM3,,800,1000,1000,200,500,500,10,1000,0,0
/// </summary>
[ConfigProAttribute("T3_Updown_Axis")]
public ConfigMoveAxis T3_Updown_Axis { get; set; }
/// <summary>
/// PRO,,IO模块对应的DI数量,IO_DILength,192.168.200.21#16;192.168.200.22#16;192.168.200.23#8
/// </summary>
[ConfigProAttribute("IO_DILength")]
public string IO_DILength { get; set; }
/// <summary>
/// PRO,,IO模块对应的DO数量,IO_DOLength,192.168.200.21#16;192.168.200.22#16;192.168.200.23#8
/// </summary>
[ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; }
///// <summary>
///// PRO,,第一块IO模块IP,PRO_AOI_IP_1,192.168.200.21
///// </summary>
//[ConfigProAttribute("PRO_AOI_IP_1")]
//public int PRO_AOI_IP_1 { get; set; }
///// <summary>
///// PRO,,第二块IO模块IP,PRO_AOI_IP_2,192.168.200.22
///// </summary>
//[ConfigProAttribute("PRO_AOI_IP_2")]
//public int PRO_AOI_IP_2 { get; set; }
///// <summary>
///// PRO,,第三块IO模块IP,PRO_AOI_IP_3,192.168.200.23
///// </summary>
//[ConfigProAttribute("PRO_AOI_IP_3")]
//public int PRO_AOI_IP_3 { get; set; }
/// <summary>
/// PRO,,预警温度,WarnTemperate,80
/// </summary>
[ConfigProAttribute("WarnTemperate")]
public int WarnTemperate { get; set; }
/// <summary>
/// PRO,,预警湿度,WarnHumidity,80
/// </summary>
[ConfigProAttribute("WarnHumidity")]
public int WarnHumidity { get; set; }
/// <summary>
/// PRO,,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000
/// </summary>
[ConfigProAttribute("Box_ResetMCount")]
public int Box_ResetMCount { get; set; }
/// <summary>
/// PRO,,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100
/// </summary>
[ConfigProAttribute("Box_ResetACount")]
public int Box_ResetACount { get; set; }
/// <summary>
/// PRO,,IO信号超时时间(毫秒),IOSingle_TimerOut,10000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut")]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO,,需要吹气的温度(温度标准),Max_Temperature,0
/// </summary>
[ConfigProAttribute("Max_Temperature")]
public int Max_Temperature { get; set; }
/// <summary>
/// PRO,,需要吹气的湿度(湿度标准),Max_Humidity,10
/// </summary>
[ConfigProAttribute("Max_Humidity")]
public int Max_Humidity { get; set; }
/// <summary>
/// PRO,,每次吹气的时间(分钟),BlowAir_Time,10
/// </summary>
[ConfigProAttribute("BlowAir_Time")]
public int BlowAir_Time { get; set; }
/// <summary>
/// PRO,,两次吹气间隔(分钟),BlowAir_Interval,10
/// </summary>
[ConfigProAttribute("BlowAir_Interval")]
public int BlowAir_Interval { get; set; }
/// <summary>
/// PRO,0,是否调试状态(1=调试,0=正常),IsDebug,1
/// </summary>
[ConfigProAttribute("IsDebug")]
public int IsDebug { get; set; }
/// <summary>
/// PRO,,气压检测IO关闭需要持续的时间,AirCheckSeconds,3
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
/// <summary>
/// PRO,,所有料仓的CID(用#号分隔),All_CIDs,packing-1#packing-2
/// </summary>
[ConfigProAttribute("All_CIDs")]
public string All_CIDs { get; set; }
/// <summary>
/// PRO,,扫码的相机名称(多个用#分隔),CameraNameList,GigE:MV-CE200-10GC (00D76546875)
/// </summary>
[ConfigProAttribute("CameraNameList")]
public string CameraNameList { get; set; }
private List<string> CameraList = new List<string>();
public List<string> GetCameraList()
{
if (CameraList == null)
{
CameraList = new List<string>();
string[] arrayList = CameraNameList.Split('#');
foreach (string str in arrayList)
{
string camera = str.Trim();
if (string.IsNullOrEmpty(camera).Equals(false))
{
CameraList.Add(camera);
}
}
}
return CameraList;
}
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;
}
}
}