opt: 输送机称重驱动优化

This commit is contained in:
yanps
2024-06-19 17:10:20 +08:00
parent 8037d14a47
commit 9a6afe1c2f

View File

@@ -194,7 +194,7 @@ public class SiemensWeightConveyorDeviceDriver extends AbstractOpcDeviceDriver i
if (to_strap_times != last_to_strap_times) { if (to_strap_times != last_to_strap_times) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times" + last_to_strap_times + "->" + to_strap_times); logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times" + last_to_strap_times + "->" + to_strap_times);
} }
if (weight == last_weight) { if (weight != last_weight) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight" + last_weight + "->" + weight); logServer.deviceExecuteLog(this.device_code, "", "", "信号weight" + last_weight + "->" + weight);
} }
if (to_length != last_to_length) { if (to_length != last_to_length) {
@@ -215,7 +215,7 @@ public class SiemensWeightConveyorDeviceDriver extends AbstractOpcDeviceDriver i
if (to_task != last_to_task) { if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task); logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
} }
/*if (mode != last_mode) { if (mode != last_mode) {
//Boolean flag = ObjectUtil.isEmpty(this.device.getExtraValue().get("special_flag")) ? false : Boolean.valueOf(this.device.getExtraValue().get("special_flag").toString()); //Boolean flag = ObjectUtil.isEmpty(this.device.getExtraValue().get("special_flag")) ? false : Boolean.valueOf(this.device.getExtraValue().get("special_flag").toString());
//暂时这样写 后续通过配置判断 //暂时这样写 后续通过配置判断
@@ -411,10 +411,7 @@ public class SiemensWeightConveyorDeviceDriver extends AbstractOpcDeviceDriver i
} }
break; break;
} }
}*/ }
} catch (Exception e) {
e.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
} }
last_mode = mode; last_mode = mode;
last_move = move; last_move = move;
@@ -429,6 +426,7 @@ public class SiemensWeightConveyorDeviceDriver extends AbstractOpcDeviceDriver i
last_to_length = to_length; last_to_length = to_length;
last_to_weight = to_weight; last_to_weight = to_weight;
last_to_height = to_height; last_to_height = to_height;
last_weight = weight;
} }
public void shipDeviceUpdate() { public void shipDeviceUpdate() {