DoubleLineConfig.cs
5.7 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class DoubleLineConfig : RobotConfig
{
public DoubleLineConfig()
: base()
{
}
public DoubleLineConfig( string filepath)
: base(1, "", "", filepath)
{
}
/// <summary>
/// PRO,休眠秒数(秒),SleepSeconds,180,,,,,,,
/// </summary>
[ConfigProAttribute("SleepSeconds", false)]
public int SleepSeconds { get; set; }
/// <summary>
/// PRO IO信号超时时间(秒) IOSingle_TimerOut 10
/// </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")]
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; }
public double AirCheckSeconds = 60;
/// <summary>
/// PRO ABB机器人1IP ABB1_IP 192.168.103.51
/// </summary>
[ConfigProAttribute("ABB1_IP", false)]
public string ABB1_IP { get; set; }
/// <summary>
/// PRO ABB机器人2IP ABB2_IP 192.168.103.52
/// </summary>
[ConfigProAttribute("ABB2_IP", false)]
public string ABB2_IP { get; set; }
/// <summary>
/// PRO ABB机器人3IP ABB3_IP 192.168.103.53
/// </summary>
//[ConfigProAttribute("ABB3_IP", false)]
//public string ABB3_IP { get; set; }
/// <summary>
/// PRO 双层线左侧提升机 L_Updown_Rfid 192.168.103.51
/// </summary>
[ConfigProAttribute("L_Updown_Rfid", false)]
public string L_Updown_Rfid { get; set; }
/// <summary>
/// PRO 双层线中间提升机 M_Updown_Rfid 192.168.103.52
/// </summary>
[ConfigProAttribute("M_Updown_Rfid", false)]
public string M_Updown_Rfid { get; set; }
/// <summary>
/// PRO 双层线上料工位1 S1_Rfid 192.168.103.53
/// </summary>
[ConfigProAttribute("S1_Rfid", false)]
public string S1_Rfid { get; set; }
/// <summary>
/// PRO 双层线上料工位2 S2_Rfid 192.168.103.104
/// </summary>
//[ConfigProAttribute("S2_Rfid", false)]
//public string S2_Rfid { get; set; }
/// <summary>
/// PRO 双层线右侧提升机 R_Updown_Rfid 192.168.103.54
/// </summary>
[ConfigProAttribute("R_Updown_Rfid", false)]
public string R_Updown_Rfid { get; set; }
/// <summary>
/// PRO,包装线RFID,Pkg_Rfid,192.168.103.106
/// </summary>
//[ConfigProAttribute("Pkg_Rfid", false)]
//public string Pkg_Rfid { get; set; }
/// <summary>
/// PRO,双层线上层右侧RFID,RHigh_Rfid,192.168.103.55
/// </summary>
[ConfigProAttribute("RHigh_Rfid", false)]
public string RHigh_Rfid { 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);
MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
MustHaveDOList.Add(IO_Type.Alarm_HddLed);
}
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;
}
}
}