|
|
@ -244,99 +244,101 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD |
|
|
|
logServer.deviceItemValue(this.device_code,"Wthickness" ,String.valueOf(Wthickness)); |
|
|
|
logServer.deviceExecuteLog(this.device_code,"","","信号Wthickness:" + last_Wthickness + " -> " + Wthickness); |
|
|
|
} |
|
|
|
if(grab_station != last_grab_station){ |
|
|
|
if(grab_station>0) { |
|
|
|
GrabPlaceStationRequest request = new GrabPlaceStationRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName()); |
|
|
|
List<String> getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); |
|
|
|
List<String> putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); |
|
|
|
request.setGet_station(getDeviceCodeList.get((grab_station)-1)); |
|
|
|
request.setPut_station(putDeviceCodeList.get((place_station)-1)); |
|
|
|
Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString()); |
|
|
|
Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString()); |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(getDevice)) { |
|
|
|
throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station)); |
|
|
|
} |
|
|
|
if (ObjectUtil.isEmpty(putDevice)) { |
|
|
|
throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station)); |
|
|
|
} |
|
|
|
|
|
|
|
LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; |
|
|
|
if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver(); |
|
|
|
request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); |
|
|
|
request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); |
|
|
|
} |
|
|
|
if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver(); |
|
|
|
request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); |
|
|
|
request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); |
|
|
|
} |
|
|
|
|
|
|
|
GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage(); |
|
|
|
; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage(); |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(place_station != last_place_station){ |
|
|
|
if(place_station>0) { |
|
|
|
GrabPlaceStationRequest request = new GrabPlaceStationRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName()); |
|
|
|
List<String> getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); |
|
|
|
List<String> putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); |
|
|
|
request.setGet_station(getDeviceCodeList.get((grab_station)-1)); |
|
|
|
request.setPut_station(putDeviceCodeList.get((place_station)-1)); |
|
|
|
Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString()); |
|
|
|
Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString()); |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(getDevice)) { |
|
|
|
throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station)); |
|
|
|
} |
|
|
|
if (ObjectUtil.isEmpty(putDevice)) { |
|
|
|
throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station)); |
|
|
|
} |
|
|
|
|
|
|
|
LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; |
|
|
|
if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver(); |
|
|
|
request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); |
|
|
|
request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); |
|
|
|
} |
|
|
|
if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { |
|
|
|
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver(); |
|
|
|
request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); |
|
|
|
request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); |
|
|
|
} |
|
|
|
|
|
|
|
GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage(); |
|
|
|
; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage(); |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// if(grab_station != last_grab_station){
|
|
|
|
// if(grab_station>0) {
|
|
|
|
// GrabPlaceStationRequest request = new GrabPlaceStationRequest();
|
|
|
|
// request.setDevice_code(this.getDevice_code());
|
|
|
|
// request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode());
|
|
|
|
// request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName());
|
|
|
|
// List<String> getDeviceCodeList = this.getExtraDeviceCodes("link_get_station");
|
|
|
|
// List<String> putDeviceCodeList = this.getExtraDeviceCodes("link_put_station");
|
|
|
|
// request.setGet_station(getDeviceCodeList.get((grab_station)-1));
|
|
|
|
// request.setPut_station(putDeviceCodeList.get((place_station)-1));
|
|
|
|
// Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString());
|
|
|
|
// Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString());
|
|
|
|
//
|
|
|
|
// if (ObjectUtil.isEmpty(getDevice)) {
|
|
|
|
// throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station));
|
|
|
|
// }
|
|
|
|
// if (ObjectUtil.isEmpty(putDevice)) {
|
|
|
|
// throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station));
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver;
|
|
|
|
// if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
|
|
|
// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver();
|
|
|
|
// request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode()));
|
|
|
|
// request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty()));
|
|
|
|
// }
|
|
|
|
// if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
|
|
|
// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver();
|
|
|
|
// request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode()));
|
|
|
|
// request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty()));
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class);
|
|
|
|
// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS...";
|
|
|
|
// lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
|
|
|
//
|
|
|
|
// if (resp.getCode() == 200) {
|
|
|
|
// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage();
|
|
|
|
// ;
|
|
|
|
// } else {
|
|
|
|
// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage();
|
|
|
|
// ;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// if(place_station != last_place_station){
|
|
|
|
// if(place_station>0) {
|
|
|
|
// GrabPlaceStationRequest request = new GrabPlaceStationRequest();
|
|
|
|
// request.setDevice_code(this.getDevice_code());
|
|
|
|
// request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode());
|
|
|
|
// request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName());
|
|
|
|
// List<String> getDeviceCodeList = this.getExtraDeviceCodes("link_get_station");
|
|
|
|
// List<String> putDeviceCodeList = this.getExtraDeviceCodes("link_put_station");
|
|
|
|
// request.setGet_station(getDeviceCodeList.get((grab_station)-1));
|
|
|
|
// request.setPut_station(putDeviceCodeList.get((place_station)-1));
|
|
|
|
// Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString());
|
|
|
|
// Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString());
|
|
|
|
//
|
|
|
|
// if (ObjectUtil.isEmpty(getDevice)) {
|
|
|
|
// throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station));
|
|
|
|
// }
|
|
|
|
// if (ObjectUtil.isEmpty(putDevice)) {
|
|
|
|
// throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station));
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver;
|
|
|
|
// if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
|
|
|
// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver();
|
|
|
|
// request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode()));
|
|
|
|
// request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty()));
|
|
|
|
// }
|
|
|
|
// if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
|
|
|
// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver();
|
|
|
|
// request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode()));
|
|
|
|
// request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty()));
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class);
|
|
|
|
// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS...";
|
|
|
|
// lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
|
|
|
//
|
|
|
|
// if (resp.getCode() == 200) {
|
|
|
|
// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage();
|
|
|
|
// ;
|
|
|
|
// } else {
|
|
|
|
// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage();
|
|
|
|
// ;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
} catch (Exception var17) { |
|
|
|
log.info("分拣机械手驱动错误",var17.getMessage()); |
|
|
|
message = "错误:" + var17.getMessage(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -357,8 +359,6 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD |
|
|
|
Instruction instruction = null; |
|
|
|
List toInstructions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mode > 2 && !requireSucess) { |
|
|
|
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { |
|
|
|
String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); |
|
|
|