rev
This commit is contained in:
@@ -236,6 +236,13 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
this.setApplySucess(false);
|
||||
message = null;
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", this.device_code);
|
||||
param.put("mode", Math.min(mode, 3));
|
||||
param.put("device_name", this.getDevice().getDevice_name());
|
||||
param.put("device_type", "1");
|
||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||
acsToWmsService.sendDeviceStatus(param);
|
||||
}
|
||||
if (move != last_move) {
|
||||
if (move == 0) {
|
||||
@@ -254,6 +261,15 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", this.device_code);
|
||||
param.put("error", error);
|
||||
param.put("error_msg", error == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
|
||||
param.put("device_name", this.getDevice().getDevice_name());
|
||||
param.put("device_type", "1");
|
||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||
acsToWmsService.sendDeviceStatus(param);
|
||||
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (plcbarcode_length != last_plcbarcode_length) {
|
||||
|
||||
@@ -549,12 +549,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
AddressDto addressDto = addressService.findByCode("sendDeviceStatus");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
// log.info("sendDeviceStatus - 请求参数 {}", param);
|
||||
HttpRequest
|
||||
log.info("sendDeviceStatus - 请求参数 {}", param);
|
||||
HttpResponse response = HttpRequest
|
||||
.post(url)
|
||||
.body(param.toString())
|
||||
.execute();
|
||||
// log.info("sendDeviceStatus - 返回参数 {}", response.body());
|
||||
log.info("sendDeviceStatus - 返回参数 {}", response.body());
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.udw.UnifiedDataAccessor;
|
||||
import org.nl.acs.udw.UnifiedDataAccessorFactory;
|
||||
import org.nl.acs.udw.UnifiedDataAppService;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -25,6 +27,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
private int all_null;
|
||||
private Map<String, OpcItemDto> itemSearchCache;
|
||||
|
||||
|
||||
public DeviceOpcProtocolRunable() {
|
||||
this.error_num = 0;
|
||||
this.all_null = 0;
|
||||
@@ -80,6 +83,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
|
||||
|
||||
private void runOld() {
|
||||
OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerService .class);
|
||||
while (true) {
|
||||
start:
|
||||
try {
|
||||
@@ -93,9 +97,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
log.trace("清理server...");
|
||||
}
|
||||
|
||||
this.server = OpcServerUtl.getServerWithOutException(this.OpcServer.getOpc_host(), this.OpcServer.getCls_id(), this.OpcServer.getUser(), this.OpcServer.getPassword(), this.OpcServer.getDomain());
|
||||
this.server.addStateListener(this);
|
||||
group = this.server.addGroup();
|
||||
group =opcServerService.getServer(this.getOpcServer().getOpc_code());
|
||||
// this.server = OpcServerUtl.getServerWithOutException(this.OpcServer.getOpc_host(), this.OpcServer.getCls_id(), this.OpcServer.getUser(), this.OpcServer.getPassword(), this.OpcServer.getDomain());
|
||||
// this.server.addStateListener(this);
|
||||
// group = this.server.addGroup();
|
||||
List<String> itemsString = new ArrayList();
|
||||
Iterator var3 = this.protocols.iterator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user