|
@ -59,8 +59,9 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
@Override |
|
|
@Override |
|
|
public void run() { |
|
|
public void run() { |
|
|
while (true) { |
|
|
while (true) { |
|
|
|
|
|
Server server = null; |
|
|
try { |
|
|
try { |
|
|
Server server = OpcServerUtl.getServerWithOutException(this.OpcServer.getOpc_host(), this.OpcServer.getCls_id(), this.OpcServer.getUser(), this.OpcServer.getPassword(), this.OpcServer.getDomain()); |
|
|
server = OpcServerUtl.getServerWithOutException(this.OpcServer.getOpc_host(), this.OpcServer.getCls_id(), this.OpcServer.getUser(), this.OpcServer.getPassword(), this.OpcServer.getDomain()); |
|
|
Group group = server.addGroup(); |
|
|
Group group = server.addGroup(); |
|
|
List<String> itemsString = new ArrayList(); |
|
|
List<String> itemsString = new ArrayList(); |
|
|
Iterator it = this.protocols.iterator(); |
|
|
Iterator it = this.protocols.iterator(); |
|
@ -178,11 +179,29 @@ public class DeviceOpcProtocolRunable implements Runnable { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (Exception var30) { |
|
|
} catch (Exception var30) { |
|
|
|
|
|
if (!DeviceOpcSynchronizeAutoRun.isRun) { |
|
|
|
|
|
System.out.println("opc线程停止2。。。"); |
|
|
|
|
|
if (server != null) { |
|
|
|
|
|
try { |
|
|
|
|
|
server.disconnect(); |
|
|
|
|
|
} catch (Exception var31) { |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
String error_message = "设备信息同步异常"; |
|
|
String error_message = "设备信息同步异常"; |
|
|
if (!StrUtil.equals(this.message, error_message)) { |
|
|
if (!StrUtil.equals(this.message, error_message)) { |
|
|
log.warn("", var30); |
|
|
log.warn("", var30); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (server != null) { |
|
|
|
|
|
try { |
|
|
|
|
|
server.disconnect(); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000)); |
|
|
Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000)); |
|
|
} catch (InterruptedException e) { |
|
|
} catch (InterruptedException e) { |
|
|