Browse Source

rev:优化日志和堆垛机异常任务

master
gengby 5 months ago
parent
commit
d428fefcd9
  1. 6
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java
  2. 19
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/enums/ErrorEnum.java
  3. 13
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java
  4. 10
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java
  5. 1
      nladmin-system/nlsso-server/src/main/java/org/nl/config/mqtt2/MqttService.java
  6. 2
      nladmin-system/nlsso-server/src/main/resources/config/application-dev2.yml

6
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java

@ -343,6 +343,12 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut);
} else {
this.requireTime = currentTimeMillis;
TaskDto taskDto = taskService.findReadyByVehicleCode(this.barcode);
if (ObjectUtil.isNotEmpty(taskDto)) {
this.writing(ItemProtocol.TO_COMMAND.getKey(), CommandEnum.COMMAND_6.getValue());
this.requireSuccess = true;
return;
}
JSONObject param = new JSONObject();
param.put(this.barcode, this.currentDeviceCode);
CommonRequest<JSONObject> request =

19
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/enums/ErrorEnum.java

@ -11,7 +11,24 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ErrorEnum {
NO(0, "无报警");
NO(0, "无报警"),
ERROR1(1, "输送驱动故障"),
ERROR2(2, "顶升驱动故障"),
ERROR3(3, "移栽驱动故障"),
ERROR4(4, "称重故障"),
ERROR5(5, "外形检测故障"),
ERROR6(6, "扫码失败"),
ERROR7(7, "前超差"),
ERROR8(8, "后超差"),
ERROR9(9, "高超差"),
ERROR10(10, "左超差"),
ERROR11(11, "右超差"),
ERROR12(12, "输送超时"),
ERROR13(13, "电动阻挡上升故障"),
ERROR14(14, "电动阻挡下降故障"),
ERROR15(15, "急停被触发"),
ERROR16(16, "提升机上限位被触发"),
ERROR17(17, "提升机下限位被触发");
private int value;
private String label;

13
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java

@ -12,6 +12,9 @@ import org.nl.config.SpringContextHolder;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import java.util.Arrays;
import java.util.List;
@Slf4j
@Getter
@Setter
@ -71,6 +74,12 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
*/
private long requireTimeOut = 3000L;
/**
* 不需要记录日志的点位
*/
private static final List<String> No_SET_LOG_KEYS = Arrays.asList(org.nl.acs.device.driver.conveyor.appearance_inspection_scannner_conveyor.ItemProtocol.HEARTBEAT.getKey());
@Override
public Device getDevice() {
return this.device;
@ -83,7 +92,9 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
@Override
public void setLog(String key, Object newValue, Object oldValue) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "自动线程读取信号:" + key + ",由" + oldValue + "->" + newValue));
if (!No_SET_LOG_KEYS.contains(key)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "自动线程读取信号:" + key + ",由" + oldValue + "->" + newValue));
}
}
@Override

10
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java

@ -481,7 +481,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
if (this.front_Zerror == ErrorEnum.ZD.getCode() && this.back_Zerror == ErrorEnum.ZD.getCode()
&& this.front_command == CommandEnum.PICKUP.getStatus() && this.back_command == CommandEnum.PICKUP.getStatus()
&& this.front_forkCargo == 0 && this.back_forkCargo == 0
) {
if (!this.againRequireSuccess) {
this.getzD(this.front_task);
@ -489,26 +489,26 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
} else if (this.front_Zerror == ErrorEnum.ZD.getCode()) {
if (!this.againRequireSuccess) {
if (this.front_command == CommandEnum.PICKUP.getStatus()) {
if (this.front_forkCargo == 0) {
this.getzD(this.front_task);
Instruction back_inst = instructionService.findByCodeFromCache(String.valueOf(this.back_task));
if (ObjectUtil.isNotEmpty(back_inst)) {
this.backWrite(back_inst);
}
} else if (this.front_command == CommandEnum.RELEASE.getStatus()) {
} else if (this.front_forkCargo == 2) {
this.putzD(this.front_task, ForkTypeEnum.FRONT.getCode());
}
}
return;
} else if (this.back_Zerror == ErrorEnum.ZD.getCode()) {
if (!this.againRequireSuccess) {
if (this.back_command == CommandEnum.PICKUP.getStatus()) {
if (this.back_forkCargo == 0) {
this.getzD(this.back_task);
Instruction front_inst = instructionService.findByCodeFromCache(String.valueOf(this.front_task));
if (ObjectUtil.isNotEmpty(front_inst)) {
this.frontWrite(front_inst);
}
} else if (this.back_command == CommandEnum.RELEASE.getStatus()) {
} else if (this.back_forkCargo == 2) {
this.putzD(this.back_task, ForkTypeEnum.BACK.getCode());
}
}

1
nladmin-system/nlsso-server/src/main/java/org/nl/config/mqtt2/MqttService.java

@ -146,6 +146,7 @@ public class MqttService {
@PostConstruct
public void init() {
log.info("执行MQTT初始化");
initTopicMap();
loadTags();
initMqttClient();

2
nladmin-system/nlsso-server/src/main/resources/config/application-dev2.yml

@ -80,7 +80,7 @@ spring:
username: root
password: 123456
cleanSession: true
url: 192.168.1.218
url: 10.211.55.3
clientId: hs_mqtt21
topics:
- HS/#

Loading…
Cancel
Save