add 缺口体积
This commit is contained in:
@@ -315,9 +315,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
&& conveyorPressStationDeviceDriver.getMove() != 0
|
||||
&& (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 1)
|
||||
&& (conveyorPressStationDeviceDriver.getAction() == 3 || conveyorPressStationDeviceDriver.getAction() == 1)) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",2);
|
||||
conveyorPressStationDeviceDriver.writing(map);
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("to_command",2);
|
||||
// conveyorPressStationDeviceDriver.writing(map);
|
||||
conveyorPressStationDeviceDriver.writing(2);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
conveyorPressStationDeviceDriver.setMessage("");
|
||||
flag = true;
|
||||
@@ -368,8 +369,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
//标准版-下发条码输送线
|
||||
if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){
|
||||
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver();
|
||||
if (conveyorBarcodeDeviceDriver.getMode() == 2
|
||||
&& conveyorBarcodeDeviceDriver.getMove() == 1
|
||||
if ( conveyorBarcodeDeviceDriver.getMove() == 1
|
||||
) {
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
@@ -585,9 +585,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
) {
|
||||
inst.setExecute_status("5");
|
||||
instructionService.update(inst);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",3);
|
||||
conveyorPressStationDeviceDriver.writing(map);
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("to_command",3);
|
||||
// conveyorPressStationDeviceDriver.writing(map);
|
||||
conveyorPressStationDeviceDriver.writing(3);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
conveyorPressStationDeviceDriver.setMessage("");
|
||||
flag = true;
|
||||
@@ -633,9 +634,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver();
|
||||
if (conveyorBarcodeDeviceDriver.getMode() != 0) {
|
||||
inst.setExecute_status("5");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",3);
|
||||
conveyorBarcodeDeviceDriver.writing(map);
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("to_command",3);
|
||||
// conveyorBarcodeDeviceDriver.writing(map);
|
||||
conveyorBarcodeDeviceDriver.writing(3);
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
conveyorBarcodeDeviceDriver.setMessage("");
|
||||
@@ -865,10 +867,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
&& (conveyorPressStationDeviceDriver.getIo_action() == 1 || conveyorPressStationDeviceDriver.getIo_action() == 3)
|
||||
&& (conveyorPressStationDeviceDriver.getAction() == 2 || conveyorPressStationDeviceDriver.getAction() == 3)) {
|
||||
inst.setExecute_status("3");
|
||||
instructionService.update(inst);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",4);
|
||||
conveyorPressStationDeviceDriver.writing(map);
|
||||
instructionService.update(inst) ;
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("to_command",4);
|
||||
// conveyorPressStationDeviceDr/iver.writing(map);
|
||||
conveyorPressStationDeviceDriver.writing(4);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
conveyorPressStationDeviceDriver.setMessage("");
|
||||
flag = true;
|
||||
@@ -1130,11 +1133,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
String direction=task.getDirection();
|
||||
if(ObjectUtil.isNotEmpty(direction)){
|
||||
Integer direction1=Integer.parseInt(direction);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",5);
|
||||
//困料位写入方向
|
||||
map.put("to_target",direction1);
|
||||
conveyorPressStationDeviceDriver.writing(map);
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("to_command",5);
|
||||
// //困料位写入方向
|
||||
// map.put("to_target",direction1);
|
||||
// conveyorPressStationDeviceDriver.writing(map);
|
||||
conveyorPressStationDeviceDriver.writing(5);
|
||||
conveyorPressStationDeviceDriver.writing(2,direction1);
|
||||
}else{
|
||||
log.info("未输入方向");
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -24,6 +24,9 @@ public class ItemProtocol {
|
||||
public static String item_weight = "weight";
|
||||
public static String item_material = "material";
|
||||
public static String item_barcode = "barcode";
|
||||
public static String item_barcode1 = "barcode1";
|
||||
public static String item_barcode2 = "barcode2";
|
||||
public static String item_barcode3 = "barcode3";
|
||||
public static String item_unqualified_qty = "unqualified_qty";
|
||||
public static String item_encoder_qty = "encoder_qty";
|
||||
public static String item_product_code = "product_code";
|
||||
@@ -32,6 +35,9 @@ public class ItemProtocol {
|
||||
public static String item_Htrapezoidal = "Htrapezoidal";
|
||||
public static String item_Wthickness = "Wthickness";
|
||||
public static String item_tray_qty = "tray_qty";
|
||||
public static String item_encoder_qty1 = "encoder_qty1";
|
||||
public static String item_encoder_qty2 = "encoder_qty2";
|
||||
public static String item_encoder_qty3 = "encoder_qty3";
|
||||
public static String item_tray_high = "tray_high";
|
||||
public static String item_crib_category = "crib_category";
|
||||
public static String item_palletX1_line = "palletX1_line";
|
||||
@@ -189,6 +195,18 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_barcode);
|
||||
}
|
||||
|
||||
public int getBarcode1() {
|
||||
return this.getOpcIntegerValue(item_barcode1);
|
||||
}
|
||||
|
||||
public int getBarcode2() {
|
||||
return this.getOpcIntegerValue(item_barcode2);
|
||||
}
|
||||
|
||||
public int getBarcode3() {
|
||||
return this.getOpcIntegerValue(item_barcode3);
|
||||
}
|
||||
|
||||
public int getProduct_code() {
|
||||
return this.getOpcIntegerValue(item_product_code);
|
||||
}
|
||||
@@ -405,9 +423,13 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_tool_coordinate);
|
||||
}
|
||||
|
||||
public int getEncoder_qty() {
|
||||
return this.getOpcIntegerValue(item_encoder_qty);
|
||||
}
|
||||
public int getEncoder_qty() { return this.getOpcIntegerValue(item_encoder_qty); }
|
||||
|
||||
public int getEncoder_qty1() { return this.getOpcIntegerValue(item_encoder_qty1); }
|
||||
|
||||
public int getEncoder_qty2() { return this.getOpcIntegerValue(item_encoder_qty2); }
|
||||
|
||||
public int getEncoder_qty3() { return this.getOpcIntegerValue(item_encoder_qty3); }
|
||||
|
||||
public int getUnqualified_qty() {
|
||||
return this.getOpcIntegerValue(item_unqualified_qty);
|
||||
@@ -734,7 +756,12 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_pressLayerY2_offset, "压层Y2偏移", "DB112.W172"));
|
||||
list.add(new ItemDto(item_pressLayerX3_offset, "压层X3偏移", "DB112.W174"));
|
||||
list.add(new ItemDto(item_pressLayerY3_offset, "压层Y3偏移", "DB112.W176"));
|
||||
list.add(new ItemDto(item_tool_coordinate, "工具坐标", "DB112.W178"));
|
||||
list.add(new ItemDto(item_barcode1, "条码1", "DB112.W180"));
|
||||
list.add(new ItemDto(item_barcode2, "条码2", "DB112.W184"));
|
||||
list.add(new ItemDto(item_barcode3, "条码3", "DB112.W188"));
|
||||
list.add(new ItemDto(item_encoder_qty1, "当前垛盘数1", "DB112.W192"));
|
||||
list.add(new ItemDto(item_encoder_qty2, "当前垛盘数2", "DB112.W196"));
|
||||
list.add(new ItemDto(item_encoder_qty3, "当前垛盘数3", "DB112.W200"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,11 +131,17 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
String material;
|
||||
String last_material;
|
||||
int barcode;
|
||||
int barcode1;
|
||||
int barcode2;
|
||||
int barcode3;
|
||||
int last_barcode;
|
||||
|
||||
int unqualified_qty = 0;
|
||||
int last_unqualified_qty = 0;
|
||||
int encoder_qty = 0;
|
||||
int encoder_qty1 = 0;
|
||||
int encoder_qty2 = 0;
|
||||
int encoder_qty3 = 0;
|
||||
int last_encoder_qty = 0;
|
||||
|
||||
//垛型参数
|
||||
@@ -270,13 +276,18 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
weight = this.itemProtocol.getWeight();
|
||||
material = this.itemProtocol.getMaterial();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
barcode1 = this.itemProtocol.getBarcode1();
|
||||
barcode2 = this.itemProtocol.getBarcode2();
|
||||
barcode3 = this.itemProtocol.getBarcode3();
|
||||
AlongSide = this.itemProtocol.getAlongSide();
|
||||
BshortSide = this.itemProtocol.getBshortSide();
|
||||
Htrapezoidal = this.itemProtocol.getHtrapezoidal();
|
||||
Wthickness = this.itemProtocol.getWthickness();
|
||||
encoder_qty = this.itemProtocol.getEncoder_qty();
|
||||
encoder_qty1 = this.itemProtocol.getEncoder_qty1();
|
||||
encoder_qty2 = this.itemProtocol.getEncoder_qty2();
|
||||
encoder_qty3 = this.itemProtocol.getEncoder_qty3();
|
||||
unqualified_qty = this.itemProtocol.getUnqualified_qty();
|
||||
|
||||
product_code = this.itemProtocol.getProduct_code();
|
||||
AlongSide = this.itemProtocol.getAlongSide();
|
||||
BshortSide = this.itemProtocol.getBshortSide();
|
||||
@@ -881,8 +892,14 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
|
||||
request.setMaterial_code(material);
|
||||
request.setQty(String.valueOf(encoder_qty));
|
||||
request.setQty1(String.valueOf(encoder_qty1));
|
||||
request.setQty2(String.valueOf(encoder_qty2));
|
||||
request.setQty3(String.valueOf(encoder_qty3));
|
||||
request.setWeight(String.valueOf(weight));
|
||||
request.setVehicle_code(String.valueOf(barcode));
|
||||
request.setVehicle_code1(String.valueOf(barcode1));
|
||||
request.setVehicle_code2(String.valueOf(barcode2));
|
||||
request.setVehicle_code3(String.valueOf(barcode3));
|
||||
List<ApplyDeviceDto> listDto = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.device_driver.lnsh.lnsh_press;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -48,7 +49,7 @@ public class ItemProtocol {
|
||||
public static String item_to_standard_size_height2 = "to_standard_size_height2";
|
||||
public static String item_to_standard_size_height3 = "to_standard_size_height3";
|
||||
public static String item_to_standard_size_height4 = "to_standard_size_height4";
|
||||
|
||||
public static String item_to_reduce_volume = "to_reduce_volume";
|
||||
private LnshPressDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(LnshPressDeviceDriver driver) {
|
||||
@@ -176,6 +177,10 @@ public class ItemProtocol {
|
||||
public int getToStandardSizeHeight3() {return this.getOpcIntegerValue(item_to_standard_size_height3);}
|
||||
|
||||
public int getToStandardSizeHeight4() {return this.getOpcIntegerValue(item_to_standard_size_height4);}
|
||||
|
||||
public float getReduceVolum() {
|
||||
return this.getOpcFloatValue(item_to_reduce_volume);
|
||||
}
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
return move;
|
||||
@@ -205,6 +210,17 @@ public class ItemProtocol {
|
||||
return "";
|
||||
}
|
||||
|
||||
public Float getOpcFloatValue(String protocol) {
|
||||
Float value = this.driver.getFloatValue(protocol);
|
||||
if (ObjectUtil.isEmpty(value)) {
|
||||
// log.error("读取错误!");
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB112.B0"));
|
||||
@@ -247,6 +263,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_standard_size_height2, "标准尺寸高度2", "DB113.REAL252"));
|
||||
list.add(new ItemDto(item_to_standard_size_height3, "标准尺寸高度3", "DB113.REAL256"));
|
||||
list.add(new ItemDto(item_to_standard_size_height4, "标准尺寸高度4", "DB113.REAL260"));
|
||||
list.add(new ItemDto(item_to_reduce_volume, "缺口体积", "DB113.REAL264"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,11 +156,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号mode:" + last_mode + " -> " + mode));
|
||||
}
|
||||
if (move != last_move && mode>0) {
|
||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + " -> " + move);
|
||||
lucene.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号mode:" + last_move + " -> " + move));
|
||||
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
|
||||
logServer.deviceExecuteLog(this.device_code,"","","开始反馈光电信号"+"mode:" + mode + ",move: " + move);
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "开始反馈光电信号:" + "mode:" + mode + ",move: " + move ));
|
||||
ApplySignalStatusRequest request = new ApplySignalStatusRequest();
|
||||
request.setDevice_code(this.getDevice_code());
|
||||
request.setRequest_medthod_code(RequestMethodEnum.real_time_set_point.getCode());
|
||||
@@ -240,7 +238,18 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
log.error("发生异常",var17);
|
||||
return;
|
||||
}finally {
|
||||
last_mode = mode;
|
||||
last_error = error;
|
||||
last_move = move;
|
||||
last_task = task;
|
||||
last_action = action;
|
||||
last_ioaction = io_action;
|
||||
last_weight = weight;
|
||||
last_material = material;
|
||||
last_barcode = barcode;
|
||||
}
|
||||
|
||||
//急停
|
||||
@@ -282,15 +291,6 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
}
|
||||
|
||||
last_mode = mode;
|
||||
last_error = error;
|
||||
last_move = move;
|
||||
last_task = task;
|
||||
last_action = action;
|
||||
last_ioaction = io_action;
|
||||
last_weight = weight;
|
||||
last_material = material;
|
||||
last_barcode = barcode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -152,6 +152,8 @@ public class PackageSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
if (mode != last_mode) {
|
||||
this.setRequireSucess(false);
|
||||
this.writing("to_message","0");
|
||||
this.writing(0);
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode);
|
||||
}
|
||||
@@ -159,10 +161,7 @@ public class PackageSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + " -> " + move);
|
||||
}
|
||||
if (action != last_action) {
|
||||
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action);
|
||||
}
|
||||
if (action != last_action)
|
||||
if (ioaction != last_ioaction) {
|
||||
logServer.deviceItemValue(this.device_code, "ioaction", String.valueOf(ioaction));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号ioaction:" + last_ioaction + " -> " + ioaction);
|
||||
|
||||
@@ -15,6 +15,21 @@ public class ApplyTaskRequest extends BaseRequest {
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicle_code1;
|
||||
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicle_code2;
|
||||
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicle_code3;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
@@ -45,6 +60,21 @@ public class ApplyTaskRequest extends BaseRequest {
|
||||
*/
|
||||
private String qty;
|
||||
|
||||
/**
|
||||
* 数量1
|
||||
*/
|
||||
private String qty1;
|
||||
|
||||
/**
|
||||
* 数量2
|
||||
*/
|
||||
private String qty2;
|
||||
|
||||
/**
|
||||
* 数量3
|
||||
*/
|
||||
private String qty3;
|
||||
|
||||
/**
|
||||
* 砖型
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@ public class OrderDto {
|
||||
private String standard_size_height4; // 标准尺寸4
|
||||
private String standard_weight; // 标准重量
|
||||
private String detection_error; // 检测误差值
|
||||
|
||||
|
||||
private String reduce_volume; // 缺口体积
|
||||
|
||||
}
|
||||
|
||||
@@ -375,6 +375,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
String standard_size_height4 = orderDto.getStandard_size_height4();
|
||||
String standard_weight = orderDto.getStandard_weight();
|
||||
String detection_error = orderDto.getDetection_error();
|
||||
String reduce_volume=orderDto.getReduce_volume();
|
||||
|
||||
if (StrUtil.isEmpty(order_code)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("order_code", order_code);
|
||||
@@ -478,6 +480,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
map.put("to_standard_size_height2", standard_size_height2);
|
||||
map.put("to_standard_size_height3", standard_size_height3);
|
||||
map.put("to_standard_size_height4", standard_size_height4);
|
||||
map.put("to_reduce_volume",reduce_volume);
|
||||
map.put("to_command",100);
|
||||
// delayed(device_code,map);
|
||||
lnshPressDeviceDriver.writing(map);
|
||||
|
||||
@@ -859,7 +859,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_time(now);
|
||||
entity.setUpdate_by(currentUsername);
|
||||
entity.setUpdate_by("NDC");
|
||||
entity.setInstruction_status("3");
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||
|
||||
@@ -38,7 +38,6 @@ public class LogMessageConstant {
|
||||
public final static String COLOR_RESET = "\u001B[0m";
|
||||
/** 背景颜色:黄色 */
|
||||
public final static String BACKGROUND_YELLOW = "\u001B[43m";
|
||||
|
||||
/** 索引路径 */
|
||||
public final static String INDEX_DIR = "D:\\lucene\\index";
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class LuceneAppender extends AppenderBase<ILoggingEvent> {
|
||||
String message = event.getFormattedMessage();
|
||||
try {
|
||||
String[] split = message.split("@");
|
||||
LuceneLogDto luceneLogDto = JSONObject.parseObject(split[1], LuceneLogDto.class);
|
||||
LuceneLogDto luceneLogDto = JSONObject.parseObject(message, LuceneLogDto.class);
|
||||
Document document = new Document();
|
||||
try {
|
||||
//向document对象中添加域。
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
public class AutoCreateInst {
|
||||
/**
|
||||
* 根据任务状态创建指令、生成下一条指令
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.nl.modules.quartz.domain.QuartzLog;
|
||||
import org.nl.modules.quartz.repository.QuartzLogRepository;
|
||||
import org.nl.modules.quartz.service.QuartzJobService;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.quartz.DisallowConcurrentExecution;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
@@ -41,6 +42,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
@Async
|
||||
@SuppressWarnings({"unchecked", "all"})
|
||||
@Slf4j
|
||||
@DisallowConcurrentExecution
|
||||
public class ExecutionJob extends QuartzJobBean {
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,8 @@ import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -218,6 +220,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
if (!ObjectUtil.isEmpty(inst)) {
|
||||
if (!ObjectUtil.isEmpty(inst)) {
|
||||
instructionService.cancelNOSendAgv(inst.getInstruction_id());
|
||||
|
||||
}
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
@@ -256,9 +259,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("OneAgv链接异常");
|
||||
log.info("OneAgv链接异常");
|
||||
log.error("agv连接出现异常:{}", e);
|
||||
((LuceneExecuteLogService)SpringContextHolder.getBean("luceneExecuteLogServiceImpl")).deviceExecuteLog(new LuceneLogDto("sdfdsfsd", "sdfsdfsdfs"));
|
||||
// System.out.println("OneAgv链接异常");
|
||||
// log.info("OneAgv链接异常");
|
||||
// log.error("agv连接出现异常:{}", e);
|
||||
logServer.deviceExecuteLog("1", "", "", "agv异常" + e.getMessage());
|
||||
logServer.deviceExecuteLog("1", "", "", "agv异常" + e);
|
||||
if (ObjectUtil.isNotEmpty(s)) {
|
||||
|
||||
Reference in New Issue
Block a user