自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-08-04 6abc20e29568c129f4ca71eccec9310534a8c779
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
package com.zy.common.HslCommunication.Core.Net;
 
import com.zy.common.HslCommunication.Core.Types.IDataTransfer;
import com.zy.common.HslCommunication.Core.Types.OperateResult;
import com.zy.common.HslCommunication.Core.Types.OperateResultExOne;
 
/**
 * 所有设备交互类的统一的读写接口
 */
public interface IReadWriteNet {
 
    /**
     * 批量读取底层的数据信息,需要指定地址和长度,具体的结果取决于实现
     * @param address 地址信息
     * @param length 数据长度
     * @return 带有成功标识的byte[]数组
     */
    OperateResultExOne<byte[]> Read(String address, short length );
 
    /**
     * 读取16位的有符号整型
     * @param address 起始地址
     * @return 带有成功标识的short数据
     */
    OperateResultExOne<Short> ReadInt16(String address);
 
    /**
     * 读取16位的有符号整型数组
     * @param address 起始地址
     * @param length 读取的数组长度
     * @return 带有成功标识的short数组
     */
    OperateResultExOne<short []> ReadInt16( String address, short length );
 
    /**
     * 读取32位的有符号整型
     * @param address 起始地址
     * @return 带有成功标识的int数据
     */
    OperateResultExOne<Integer> ReadInt32(String address);
 
    /**
     * 读取32位有符号整型的数组
     * @param address 起始地址
     * @param length 数组长度
     * @return 带成功标志的结果数据对象
     */
    OperateResultExOne<int[]> ReadInt32( String address, short length );
 
    /**
     * 读取64位的有符号整型
     * @param address 起始地址
     * @return 带有成功标识的long数据
     */
    OperateResultExOne<Long> ReadInt64(String address);
 
    /**
     * 读取64位的有符号整型数组
     * @param address 起始地址
     * @param length 数组长度
     * @return 带成功标志的结果数据对象
     */
    OperateResultExOne<long[]> ReadInt64( String address, short length );
 
    /**
     * 读取单浮点精度的数据
     * @param address 起始地址
     * @return 带有成功标识的float数据
     */
    OperateResultExOne<Float> ReadFloat(String address);
 
    /**
     * 读取单浮点精度的数组
     * @param address 起始地址
     * @param length 数组长度
     * @return 带成功标志的结果数据对象
     */
    OperateResultExOne<float[]> ReadFloat( String address, short length );
 
    /**
     * 读取双浮点精度的数据
     * @param address 起始地址
     * @return 带有成功标识的double数据
     */
    OperateResultExOne<Double> ReadDouble(String address);
 
 
    /**
     * 读取双浮点精度的数据的数组
     * @param address 起始地址
     * @param length 数组长度
     * @return 带成功标志的结果数据对象
     */
    OperateResultExOne<double[]> ReadDouble( String address, short length );
 
    /**
     * 读取字符串数据
     * @param address 起始地址
     * @param length 数据长度
     * @return 带有成功标识的string数据
     */
    OperateResultExOne<String> ReadString(String address, short length);
 
 
    /**
     * 读取自定义的数据类型,需要继承自IDataTransfer接口
     * @param address 起始地址
     * @param <T> 自定义的类型
     * @return 带有成功标识的自定义类型数据
     */
    <T extends IDataTransfer> OperateResultExOne<T> ReadCustomer(String address,Class<T> tClass);
 
 
 
 
 
 
 
 
    /**
     * 写入short数据
     * @param address 起始地址
     * @param value 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, short value);
 
    /**
     * 写入short数组
     * @param address 起始地址
     * @param values 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, short[] values);
 
    /**
     * 写入int数据
     * @param address 起始地址
     * @param value 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, int value);
 
    /**
     * 写入int[]数组
     * @param address 起始地址
     * @param values 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, int[] values);
 
    /**
     * 写入long数据
     * @param address 起始地址
     * @param value 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, long value);
 
    /**
     * 写入long数组
     * @param address 起始地址
     * @param values 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, long[] values);
 
    /**
     * 写入float数据
     * @param address 起始地址
     * @param value 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, float value);
 
    /**
     * 写入float数组
     * @param address 起始地址
     * @param values 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, float[] values);
 
    /**
     * 写入double数据
     * @param address 起始地址
     * @param value 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, double value);
 
    /**
     * 写入double数组
     * @param address 起始地址
     * @param values 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, double[] values);
 
    /**
     * 写入字符串信息,编码为ASCII
     * @param address 起始地址
     * @param value 写入值
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, String value);
 
 
    /**
     * 写入字符串信息,编码为ASCII
     * @param address 起始地址
     * @param value 写入值
     * @param length 写入的字符串的长度
     * @return 带有成功标识的结果类对象
     */
    OperateResult Write(String address, String value, int length);
 
    /**
     * 写入自定义类型的数据,该类型必须继承自IDataTransfer接口
     * @param address 起始地址
     * @param value 写入值
     * @param <T> 类型对象
     * @return 带有成功标识的结果类对象
     */
    <T extends IDataTransfer> OperateResult WriteCustomer(String address, T value);
 
}