add: 信号未连接,在监控显示感叹号

This commit is contained in:
yanps
2024-02-19 17:00:57 +08:00
parent 1b215a0b93
commit fd08038078
47 changed files with 215 additions and 12 deletions

View File

@@ -111,6 +111,7 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
walk_y = this.itemProtocol.getWalk_y();
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
iserror = this.itemProtocol.deviceStatus;
if (mode != last_mode) {
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
@@ -265,7 +266,6 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
} else if (this.getAction() == 4) {
action = "放货完成";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.box_palletizing_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -64,9 +65,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean deviceStatus = false;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
deviceStatus = true;
}else if (item_heartbeat.equals(protocol)){
deviceStatus = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -107,7 +107,7 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
error = this.itemProtocol.getItem_error();
task = this.itemProtocol.getItem_task();
action = this.itemProtocol.getItem_action();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.cargo_lift_conveyor;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -57,9 +58,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -150,7 +150,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
material2 = this.itemProtocol.getMaterial2();
qty = this.itemProtocol.getQty();
to_command = this.itemProtocol.getTo_command();
iserror = this.itemProtocol.isError;
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
@@ -485,6 +485,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("move", move);
jo.put("inventory_qty", qty);
jo.put("isError", iserror);
jo.put("out_finish", out_finish);
jo.put("material1", material1);
jo.put("material2", material2);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.casing_station;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -85,11 +86,17 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
private CasingStationConveyorDeviceDriver driver;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -104,7 +104,7 @@ public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceD
number = this.itemProtocol.getItem_number();
container_type = this.itemProtocol.getItem_container_type();
task = this.itemProtocol.getItem_task();
iserror = this.itemProtocol.getIsError();
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -61,9 +62,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -104,7 +104,7 @@ public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver im
number = this.itemProtocol.getItem_number();
container_type = this.itemProtocol.getItem_container_type();
task = this.itemProtocol.getItem_task();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -65,9 +66,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -167,6 +167,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
currentB = this.itemProtocol.getItem_currentB();
currentC = this.itemProtocol.getItem_currentC();
to_temperature = this.itemProtocol.getItem_to_temperature();
iserror = this.itemProtocol.isError;
if (door != last_door) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号door" + last_door + "->" + door);
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.hongxiang_device;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -123,9 +124,15 @@ public class ItemProtocol {
} ;
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -138,6 +138,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
int last_is_wrapped = 0;
Boolean isonline = true;
Boolean deviceStatus = false;
int hasGoods = 0;
String message = null;
Boolean iserror = false;
@@ -212,6 +213,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
tube_num = this.itemProtocol.getTube_num();
inflatableShaftVersion = this.itemProtocol.getInflatableShaftVersion();
is_wrapped = this.itemProtocol.getIs_wrapped();
deviceStatus = this.itemProtocol.deviceStatus;
if (to_onset != last_to_onset) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset" + last_to_onset + "->" + to_onset);
@@ -753,6 +755,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (this.requireSucess) {
requireSucess = "1";
}
if(deviceStatus){
iserror = true;
}
if(error == 0 && !deviceStatus){
iserror = false;
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 2) {
action = "反馈气胀轴尺寸";

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.indoor_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -152,8 +153,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean deviceStatus = false;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
deviceStatus = true;
}else if(item_heartbeat.equals(protocol)){
deviceStatus = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.oven_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -40,6 +41,7 @@ public class ItemProtocol {
//下发任务号
public static String item_to_task = "to_task";
public Boolean device_status = false;
private OvenGantryManipulatorDeviceDriver driver;
@@ -104,6 +106,11 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
device_status = true;
}else if(item_heartbeat.equals(protocol)){
device_status = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.paint_conveyor;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -60,9 +61,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -102,7 +102,7 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
error = this.itemProtocol.getItem_error();
number = this.itemProtocol.getItem_number();
task = this.itemProtocol.getItem_task();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.paper_tube_device;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -75,9 +76,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -107,7 +107,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
error = this.itemProtocol.getError();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTotarget();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);
if (mode == 0) {

View File

@@ -294,9 +294,14 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -284,7 +284,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
item_to_position1 = this.itemProtocol.getTo_position1();
item_to_position2 = this.itemProtocol.getTo_position2();
item_to_position3 = this.itemProtocol.getTo_position3();
iserror = this.itemProtocol.isError;
//信号位置校验,记录日志
signal_verification();
@@ -754,6 +754,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("z_qty11", this.getItem_qty11());
map.put("material12", this.getItem_material12());
map.put("z_qty12", this.getItem_qty12());
map.put("isError", iserror);
String requireSucess = "0";
if (this.requireSucess) {
requireSucess = "1";

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.plugging_unplugging_machine;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -59,9 +60,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -104,6 +104,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
move = this.itemProtocol.getMove();
task1 = this.itemProtocol.getTask1();
to_command = this.itemProtocol.getToCommand();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.requireSucess = false;

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device_driver.basedriver.rgv;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -65,11 +66,11 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public float getOpcFloatValue(String protocol) {
Float value = this.driver.getDoubleValue(protocol);
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);
@@ -80,6 +81,11 @@ public class ItemProtocol {
}
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -57,6 +57,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
@Autowired
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
int heartbeat = 0;
int mode = 0;
int last_mode = 0;
int error = 0;
@@ -108,6 +109,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
qty2 = this.itemProtocol.getQty2();
task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getToCommand();
heartbeat = this.itemProtocol.getHeartbeat();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.requireSucess = false;
@@ -320,6 +323,16 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
move2 = "无货";
jo.put("hasGoods", false);
} else if (this.getMove1() == 1 || this.getMove2() == 1) {
if(this.getMove1() == 1){
move1 = "有货";
}else if(this.getMove1() == 0){
move1 = "无货";
}
if(this.getMove2() == 1){
move2 = "有货";
}else if(this.getMove2() == 0){
move2 = "无货";
}
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -103,9 +104,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean deviceStatus = false;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
deviceStatus = true;
}else if (item_heartbeat.equals(protocol)){
deviceStatus = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -128,6 +128,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
int hasGoods = 0;
String message = null;
Boolean iserror = false;
Boolean deviceStatus = false;
String hand_barcode = null;
@@ -186,6 +187,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
to_length = this.itemProtocol.getTo_length();
to_weight = this.itemProtocol.getTo_weight();
to_height = this.itemProtocol.getTo_height();
deviceStatus = this.itemProtocol.deviceStatus;
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
@@ -611,7 +613,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
move = "有托盘有货";
jo.put("hasGoods", true);
}
if(deviceStatus){
iserror = true;
}
if(error == 0 && !deviceStatus){
iserror = false;
}
if (this.carrier_direction == 1) {
carrier_direction = "正转";
} else if (this.carrier_direction == 2) {

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -86,9 +87,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -166,6 +166,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
iserror = this.itemProtocol.isError;
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -81,9 +82,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -158,6 +158,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
task = this.itemProtocol.getTask();
weight = this.itemProtocol.getWeight();
heartbeat = this.itemProtocol.getHeartbeat();
iserror = this.itemProtocol.isError;
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_onefloor_agv_conveyor;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -87,9 +88,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -161,6 +161,7 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
iserror = this.itemProtocol.isError;
if (last_mode != mode) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.slit_two_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -163,9 +164,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -213,6 +213,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
to_target2 = this.itemProtocol.getTo_target2();
to_onset1 = this.itemProtocol.getTo_onset1();
to_onset2 = this.itemProtocol.getTo_onset2();
iserror = this.itemProtocol.isError;
if (to_command1 != last_to_command1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command1" + last_to_command1 + "->" + to_command1);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -80,9 +81,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -151,6 +151,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();
operation_type = this.itemProtocol.getOperation_type();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
}
if (move != last_move) {

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -97,9 +98,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -162,6 +162,7 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
direction = this.itemProtocol.getDirection();
hasGoods = this.itemProtocol.getMove();
barcode = this.itemProtocol.getBarcode();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -112,9 +113,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -225,6 +225,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
weight = this.itemProtocol.getWeight();
iserror = this.itemProtocol.isError;
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_inspect_site;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -69,9 +70,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -138,6 +138,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
action = this.itemProtocol.getAction();
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode + "复位请求标记");

View File

@@ -54,12 +54,14 @@ public interface OpcDeviceDriver extends DeviceDriver {
@Override
Device getDevice();
default String getOpcPlc() {
return this.getDevice().getOpc_plc_code();
}
default Integer getIntegeregerValue(String protocol) {
if("heartbeat".equals(protocol) && this.getValue(protocol)==null){
return null;
}
Object value = this.getValue(protocol)==null?"0":this.getValue(protocol);
return Integer.parseInt(value.toString());
}

View File

@@ -198,6 +198,9 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
if (true) {
this.logItemChanged(itemId, accessor_value, value, itemDto);
}
if(ObjectUtil.isEmpty(value)){
accessor_value.removeValue(itemId);
}
if(!ObjectUtil.isEmpty(value)){
accessor_value.setValue(itemId, value);
}

View File

@@ -9,6 +9,8 @@ public interface UnifiedDataAccessor {
void setValue(String key, Object value);
void removeValue(String key);
UnifiedData getUnifiedData(String key);
List<UnifiedData> getHistoryUnifiedData(String key);

View File

@@ -33,6 +33,10 @@ public class UnifiedDataAccessorImpl implements UnifiedDataAccessor {
this.unifiedDataAppService.setValue(this.unified_key, key, value);
}
public void removeValue(String key) {
this.unifiedDataAppService.removeValue(this.unified_key, key);
}
public void setValueWithPersistence(String key, Object value) {
this.unifiedDataAppService.setValueWithPersistence(this.unified_key, key, value);
}