Store_Config.cs
9.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
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
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>
///// 预警温度
///// </summary>
//[ConfigProAttribute("WarnTemperate")]
//public int WarnTemperate { get; set; }
///// <summary>
///// 预警湿度
///// </summary>
//[ConfigProAttribute("WarnHumidity")]
//public int WarnHumidity { get; set; }
/// <summary>
/// 气压检测IO关闭需要持续的时间(=3表示需要关闭三秒以上才算关闭)
/// </summary>
[ConfigProAttribute("AirCheckSeconds")]
public int AirCheckSeconds { get; set; }
///// <summary>
///// PRO,BOX出入库次数多少次时,会自动重置旋转轴,Box_ResetMCount,10,,,,,
///// </summary>
//[ConfigProAttribute("Box_ResetMCount")]
//public int Box_ResetMCount { get; set; }
///// <summary>
///// PRO,BOX出入库次数多少次时,会自动重置操作(会重置所有轴),Box_ResetACount,100,,,,,
///// </summary>
//[ConfigProAttribute("Box_ResetACount")]
//public int Box_ResetACount { get; set; }
/// <summary>
/// PRO IO信号超时时间(毫秒) IOSingle_TimerOut 5000
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
///// <summary>
///// PRO 需要吹气的温度(温度标准) Max_Temperature 10
///// </summary>
//[ConfigProAttribute("Max_Temperature", false)]
//public int Max_Temperature { get; set; }
///// <summary>
///// PRO 需要吹气的湿度(湿度标准) Max_Humidity 10
///// </summary>
//[ConfigProAttribute("Max_Humidity", false)]
//public int Max_Humidity { get; set; }
///// <summary>
///// PRO 每次吹气的时间(分钟) BlowAir_Time 10
///// </summary>
//[ConfigProAttribute("BlowAir_Time", false)]
//public int BlowAir_Time { get; set; }
///// <summary>
///// PRO 两次吹气间隔(分钟) BlowAir_Interval 10
///// </summary>
//[ConfigProAttribute("BlowAir_Interval", false)]
//public int BlowAir_Interval { get; set; }
//public int InoutAxis_PositionMax { get; set; }
///// <summary>
///// PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
///// </summary>
//[ConfigProAttribute("Humiture_Port", true )]
//public string Humiture_Port { get; set; }
/// <summary>
/// PRO IO模块对应的DI数量 IO_DILength 192.168.200.10#16;192.168.200.11#4
/// </summary>
[ConfigProAttribute("IO_DILength")]
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")]
public string IO_DOLength { get; set; }
///// <summary>
///// PRO 是否有仓门 HasDoor 1
///// </summary>
//[ConfigProAttribute("HasDoor")]
//public int HasDoor { get; set; }
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);
MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_HddLed);
MustHaveDOList.Add(IO_Type.RunSign_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_Buzzer);
MustHaveDOList.Add(IO_Type.NGLine_Run);
}
public static void ConfigAxis(AC_BOX_Config Config)
{
Config.Middle_Axis.TargetSpeed = Config.MiddleAxis_TargetSpeed;
Config.Middle_Axis.AddSpeed = Config.MiddleAxis_AddSpeed;
Config.Middle_Axis.DelSpeed = Config.MiddleAxis_DelSpeed;
Config.Middle_Axis.HomeAddSpeed = Config.MiddleAxis_HomeAddSpeed;
Config.Middle_Axis.HomeHighSpeed = Config.MiddleAxis_HomeHighSpeed;
Config.Middle_Axis.HomeLowSpeed = Config.MiddleAxis_HomeLowSpeed;
Config.InOut_Axis.TargetSpeed = Config.InoutAxis_TargetSpeed;
Config.InOut_Axis.DelSpeed = Config.InoutAxis_AddSpeed;
Config.InOut_Axis.AddSpeed = Config.InoutAxis_DelSpeed;
Config.InOut_Axis.HomeAddSpeed = Config.InoutAxis_HomeAddSpeed;
Config.InOut_Axis.HomeHighSpeed = Config.InoutAxis_HomeHighSpeed;
Config.InOut_Axis.HomeLowSpeed = Config.InoutAxis_HomeLowSpeed;
Config.UpDown_Axis.TargetSpeed = Config.UpdownAxis_TargetSpeed;
Config.UpDown_Axis.AddSpeed = Config.UpdownAxis_AddSpeed;
Config.UpDown_Axis.DelSpeed = Config.UpdownAxis_DelSpeed;
Config.UpDown_Axis.HomeAddSpeed = Config.UpdownAxis_HomeAddSpeed;
Config.UpDown_Axis.HomeHighSpeed = Config.UpdownAxis_HomeHighSpeed;
Config.UpDown_Axis.HomeLowSpeed = Config.UpdownAxis_HomeLowSpeed;
Config.Comp_Axis.TargetSpeed = Config.CompAxis_TargetSpeed;
Config.Comp_Axis.AddSpeed = Config.CompAxis_AddSpeed;
Config.Comp_Axis.DelSpeed = Config.CompAxis_DelSpeed;
Config.Comp_Axis.HomeAddSpeed = Config.CompAxis_HomeAddSpeed;
Config.Comp_Axis.HomeHighSpeed = Config.CompAxis_HomeHighSpeed;
Config.Comp_Axis.HomeLowSpeed = Config.CompAxis_HomeLowSpeed;
Config.Middle_Axis.CanErrorCountMin = Config.MiddleAxis_ErrorCountMin;
Config.InOut_Axis.CanErrorCountMin = Config.InoutAxis_ErrorCountMin;
Config.UpDown_Axis.CanErrorCountMin = Config.UpdownAxis_ErrorCountMin;
Config.Middle_Axis.CanErrorCountMax = Config.MiddleAxis_ErrorCountMax;
Config.InOut_Axis.CanErrorCountMax = Config.InoutAxis_ErrorCountMax;
Config.UpDown_Axis.CanErrorCountMax = Config.UpdownAxis_ErrorCountMax;
Config.Middle_Axis.PositionMin = Config.MiddleAxis_PositionMin;
Config.Middle_Axis.PositionMax = Config.MiddleAxis_PositionMax;
Config.InOut_Axis.PositionMin = Config.InoutAxis_PositionMin;
Config.InOut_Axis.PositionMax = Config.InoutAxis_PositionMax;
Config.UpDown_Axis.PositionMin = Config.UpdownAxis_PositionMin;
Config.UpDown_Axis.PositionMax = Config.UpdownAxis_PositionMax;
//Config.InOut_Axis.ResolveSpeed = Config.InoutAxis_ResolveSpeed;
//Config.UpDown_Axis.ResolveSpeed = Config.UpdownAxis_ResolveSpeed;
//Config.Middle_Axis.ResolveSpeed = Config.MiddleAxis_ResolveSpeed;
Config.Middle_Axis.DefaultPosition = Config.MiddleAxis_P1_Position;
Config.InOut_Axis.DefaultPosition = Config.InOutAxis_P1_Position;
Config.UpDown_Axis.DefaultPosition = Config.UpDownAxis_DoorOPosition_P1;
Config.Comp_Axis.DefaultPosition = Config.CompressAxis_P1_Position;
Config.Comp_Axis.CanErrorCountMax = 1000;
Config.Comp_Axis.CanErrorCountMin = 10;
Config.Comp_Axis.PositionMin = 0;
Config.Comp_Axis.PositionMax = 0;
}
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;
}
}
}