|
@ -18,6 +18,8 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; |
|
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; |
|
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; |
|
|
|
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applySignalStaus.ApplySignalStatusRequest; |
|
|
|
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applySignalStaus.ApplySignalStatusResponse; |
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; |
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; |
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; |
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; |
|
|
import org.nl.acs.ext.wms.data.Resp; |
|
|
import org.nl.acs.ext.wms.data.Resp; |
|
@ -152,6 +154,22 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme |
|
|
if (move != last_move) { |
|
|
if (move != last_move) { |
|
|
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); |
|
|
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + " -> " + move); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + " -> " + move); |
|
|
|
|
|
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) { |
|
|
|
|
|
ApplySignalStatusRequest request = new ApplySignalStatusRequest(); |
|
|
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
|
|
request.setRequest_medthod_code(RequestMethodEnum.real_time_set_point.getCode()); |
|
|
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.real_time_set_point.getName()); |
|
|
|
|
|
request.setMove(String.valueOf(move)); |
|
|
|
|
|
ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class); |
|
|
|
|
|
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS..."; |
|
|
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
|
|
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();; |
|
|
|
|
|
} else { |
|
|
|
|
|
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if (error != last_error) { |
|
|
if (error != last_error) { |
|
|
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); |
|
|
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); |
|
@ -162,6 +180,22 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + " -> " + task); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + " -> " + task); |
|
|
} |
|
|
} |
|
|
if (action != last_action) { |
|
|
if (action != last_action) { |
|
|
|
|
|
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) { |
|
|
|
|
|
ApplySignalStatusRequest request = new ApplySignalStatusRequest(); |
|
|
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
|
|
request.setRequest_medthod_code(RequestMethodEnum.real_time_set_point.getCode()); |
|
|
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.real_time_set_point.getName()); |
|
|
|
|
|
request.setAction(String.valueOf(action)); |
|
|
|
|
|
ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class); |
|
|
|
|
|
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS..."; |
|
|
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
|
|
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();; |
|
|
|
|
|
} else { |
|
|
|
|
|
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); |
|
|
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action); |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action); |
|
|
} |
|
|
} |
|
|