DISTLineConfig.cs
4.3 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.LoadCSVLibrary
{
public class DISTLineConfig : RobotConfig
{
public DISTLineConfig()
: base()
{
}
public DISTLineConfig( string filepath)
: base(1, "", "", filepath)
{
}
/// <summary>
/// PRO,休眠秒数(秒),SleepSeconds,60,,,,,,,
/// </summary>
[ConfigProAttribute("SleepSeconds", false)]
public int SleepSeconds { get; set; }
/// <summary>
/// PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
/// </summary>
[ConfigProAttribute("IOSingle_TimerOut", false)]
public int IOSingle_TimerOut { get; set; }
/// <summary>
/// PRO,IO模块对应的DI数量,IO_DILength,10.85.199.21#16,,,,,,,
/// </summary>
[ConfigProAttribute("IO_DILength")]
public string IO_DILength { get; set; }
/// <summary>
/// PRO,模块对应的DO数量,IO_DOLength,10.85.199.21#16,,,,,,,
/// </summary>
[ConfigProAttribute("IO_DOLength")]
public string IO_DOLength { get; set; }
/// <summary>
/// PRO,分盘1线AGV节点名称,L1_AgvName,A8,,,,,,,
/// </summary>
[ConfigProAttribute("L1_AgvName")]
public string L1_AgvName { get; set; }
/// <summary>
/// PRO,分盘2线AGV节点名称,L2_AgvName,A7,,,,,,,
/// </summary>
[ConfigProAttribute("L2_AgvName")]
public string L2_AgvName { get; set; }
public double AirCheckSeconds = 60;
/// <summary>
/// PRO,分盘线出口RFIDIP,L2Out_RFIDIP,192.168.103.108,,,,,, ,
/// </summary>
[ConfigProAttribute("L2Out_RFIDIP", false)]
public string L2Out_RFIDIP { get; set; }
/// <summary>
/// PRO,分盘线入口RFIDIP,L1In_RFIDIP,192.168.103.109,,,,,, ,
/// </summary>
[ConfigProAttribute("L1In_RFIDIP", false)]
public string L1In_RFIDIP { get; set; }
protected override void initMustHavePro()
{
MustHaveDIList = new List<string>();
MustHaveDOList = new List<string>();
MustHaveDIList.Add(IO_Type.SuddenStop_BTN);
}
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;
}
}
}