fix 反馈设备状态
This commit is contained in:
@@ -471,15 +471,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
//三色灯状态
|
//三色灯状态
|
||||||
status = ikey;
|
status = ikey;
|
||||||
|
|
||||||
if (status != last_status) {
|
if (status != last_status && status != 6 && status != 7) {
|
||||||
|
boolean flag = true;
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
param.put("device_code", this.device_code);
|
||||||
param.put("mode", status);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "4");
|
param.put("device_type", "4");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
acsToWmsService.sendDeviceStatus(param);
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
last_status = status;
|
last_status = status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -714,15 +714,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
//三色灯状态
|
//三色灯状态
|
||||||
status = ikey;
|
status = ikey;
|
||||||
|
|
||||||
if (status != last_status) {
|
if (status != last_status && status != 6 && status != 7) {
|
||||||
|
boolean flag = true;
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
param.put("device_code", this.device_code);
|
||||||
param.put("mode", status);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "4");
|
param.put("device_type", "4");
|
||||||
param.put("product_area", ParamService.findByCode("productArea").getValue());
|
param.put("product_area", ParamService.findByCode("productArea").getValue());
|
||||||
acsToWmsService.sendDeviceStatus(param);
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
last_status = status;
|
last_status = status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "2");
|
param.put("device_type", "2");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
@@ -247,7 +247,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
update_instruction_status();
|
update_instruction_status();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
var17.printStackTrace();
|
var17.printStackTrace();
|
||||||
feedMessage = var17.getMessage();
|
feedMessage = var17.getMessage();
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
|
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "1");
|
param.put("device_type", "1");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "1");
|
param.put("device_type", "1");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
|
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "1");
|
param.put("device_type", "1");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
|
|||||||
if (last_mode != mode) {
|
if (last_mode != mode) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "1");
|
param.put("device_type", "1");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_code);
|
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_name", this.getDevice().getDevice_name());
|
||||||
param.put("device_type", "2");
|
param.put("device_type", "2");
|
||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
|
|||||||
Reference in New Issue
Block a user