fix 反馈设备状态
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user