fix 反馈设备状态

This commit is contained in:
张江玮
2023-08-18 16:11:46 +08:00
parent 36907a602a
commit 4772072564
8 changed files with 49 additions and 26 deletions

View File

@@ -471,14 +471,26 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
//三色灯状态
status = ikey;
if (status != last_status) {
if (status != last_status && status != 6 && status != 7) {
boolean flag = true;
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", status);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
if (status == 1) {
param.put("mode", 0);
} else if (status == 2) {
param.put("mode", 3);
} else if ("345".contains(String.valueOf(status))) {
param.put("mode", 2);
} else {
flag = false;
}
if (flag) {
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", paramService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
}
last_status = status;

View File

@@ -714,14 +714,26 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
//三色灯状态
status = ikey;
if (status != last_status) {
if (status != last_status && status != 6 && status != 7) {
boolean flag = true;
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", status);
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", ParamService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
if (status == 1) {
param.put("mode", 0);
} else if (status == 2) {
param.put("mode", 3);
} else if ("345".contains(String.valueOf(status))) {
param.put("mode", 2);
} else {
flag = false;
}
if (flag) {
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "4");
param.put("product_area", ParamService.findByCode("productArea").getValue());
acsToWmsService.sendDeviceStatus(param);
}
}
last_status = status;

View File

@@ -182,7 +182,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (mode != last_mode) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
param.put("mode", Math.min(mode, 3));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());
@@ -247,7 +247,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
update_instruction_status();
} catch (Exception var17) {
var17.printStackTrace();
feedMessage = var17.getMessage();
@@ -296,7 +295,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
if (task != 0) {
remark = remark + "当前上报任务号(task)应该为0,";
if(ObjectUtil.isNotEmpty(this.inst)){
if (ObjectUtil.isNotEmpty(this.inst)) {
this.inst = null;
}
}
@@ -346,11 +345,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else {
this.instruction_require_time = date;
//抓取工位
if(ObjectUtil.isEmpty(getDeviceCodeList)){
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
}
//放货工位
if(ObjectUtil.isEmpty(putDeviceCodeList)){
if (ObjectUtil.isEmpty(putDeviceCodeList)) {
putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
}
@@ -1094,10 +1093,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
public Instruction checkInst(){
if(ObjectUtil.isNotEmpty(this.inst)){
if(this.task>0){
if(this.inst.getInstruction_code().equals(String.valueOf(this.task))){
public Instruction checkInst() {
if (ObjectUtil.isNotEmpty(this.inst)) {
if (this.task > 0) {
if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) {
return this.inst;
} else {
inst = instructionService.findByCodeFromCache(String.valueOf(task));

View File

@@ -232,7 +232,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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());

View File

@@ -190,7 +190,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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());

View File

@@ -173,7 +173,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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());

View File

@@ -164,7 +164,7 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
if (last_mode != mode) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
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());

View File

@@ -235,7 +235,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (mode != last_mode) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
param.put("mode", mode);
param.put("mode", Math.min(mode, 3));
param.put("device_name", this.getDevice().getDevice_name());
param.put("device_type", "2");
param.put("product_area", paramService.findByCode("productArea").getValue());