堆垛机读取修改
This commit is contained in:
@@ -26,9 +26,10 @@ public class PlcDdjRead extends Thread {
|
||||
private final String ip;
|
||||
private final int port;
|
||||
private boolean success = false;
|
||||
private MsgDdj msgDdj;
|
||||
|
||||
public PlcDdjRead(ConcurrentHashMap<String, MsgDdj> deviceDdjMap, PlcConnectInfo plcConnectInfo) {
|
||||
PlcDdjRead.deviceDdjMap = deviceDdjMap;
|
||||
public PlcDdjRead(MsgDdj msgDdj, PlcConnectInfo plcConnectInfo) {
|
||||
this.msgDdj = msgDdj;
|
||||
this.ip = plcConnectInfo.getIp();
|
||||
this.port = plcConnectInfo.getPort();
|
||||
}
|
||||
@@ -46,12 +47,7 @@ public class PlcDdjRead extends Thread {
|
||||
while (isRun) {
|
||||
try {
|
||||
if (IsConnect()) {
|
||||
for (String key : deviceDdjMap.keySet()) {
|
||||
MsgDdj msgDdj = deviceDdjMap.get(key);
|
||||
if (msgDdj != null) {
|
||||
readPlcDdj(msgDdj);
|
||||
}
|
||||
}
|
||||
readPlcDdj(msgDdj);
|
||||
Thread.sleep(1000);
|
||||
} else {
|
||||
reConnect();
|
||||
|
||||
Reference in New Issue
Block a user