rev:优化日志和堆垛机异常任务
This commit is contained in:
@@ -343,6 +343,12 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
|
|||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut);
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut);
|
||||||
} else {
|
} else {
|
||||||
this.requireTime = currentTimeMillis;
|
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();
|
JSONObject param = new JSONObject();
|
||||||
param.put(this.barcode, this.currentDeviceCode);
|
param.put(this.barcode, this.currentDeviceCode);
|
||||||
CommonRequest<JSONObject> request =
|
CommonRequest<JSONObject> request =
|
||||||
|
|||||||
@@ -11,7 +11,24 @@ import lombok.Getter;
|
|||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum ErrorEnum {
|
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 int value;
|
||||||
private String label;
|
private String label;
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import org.nl.config.SpringContextHolder;
|
|||||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -71,6 +74,12 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
|
|||||||
*/
|
*/
|
||||||
private long requireTimeOut = 3000L;
|
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
|
@Override
|
||||||
public Device getDevice() {
|
public Device getDevice() {
|
||||||
return this.device;
|
return this.device;
|
||||||
@@ -83,7 +92,9 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLog(String key, Object newValue, Object oldValue) {
|
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
|
@Override
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.front_Zerror == ErrorEnum.ZD.getCode() && this.back_Zerror == ErrorEnum.ZD.getCode()
|
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) {
|
if (!this.againRequireSuccess) {
|
||||||
this.getzD(this.front_task);
|
this.getzD(this.front_task);
|
||||||
@@ -489,26 +489,26 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
} else if (this.front_Zerror == ErrorEnum.ZD.getCode()) {
|
} else if (this.front_Zerror == ErrorEnum.ZD.getCode()) {
|
||||||
if (!this.againRequireSuccess) {
|
if (!this.againRequireSuccess) {
|
||||||
if (this.front_command == CommandEnum.PICKUP.getStatus()) {
|
if (this.front_forkCargo == 0) {
|
||||||
this.getzD(this.front_task);
|
this.getzD(this.front_task);
|
||||||
Instruction back_inst = instructionService.findByCodeFromCache(String.valueOf(this.back_task));
|
Instruction back_inst = instructionService.findByCodeFromCache(String.valueOf(this.back_task));
|
||||||
if (ObjectUtil.isNotEmpty(back_inst)) {
|
if (ObjectUtil.isNotEmpty(back_inst)) {
|
||||||
this.backWrite(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());
|
this.putzD(this.front_task, ForkTypeEnum.FRONT.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (this.back_Zerror == ErrorEnum.ZD.getCode()) {
|
} else if (this.back_Zerror == ErrorEnum.ZD.getCode()) {
|
||||||
if (!this.againRequireSuccess) {
|
if (!this.againRequireSuccess) {
|
||||||
if (this.back_command == CommandEnum.PICKUP.getStatus()) {
|
if (this.back_forkCargo == 0) {
|
||||||
this.getzD(this.back_task);
|
this.getzD(this.back_task);
|
||||||
Instruction front_inst = instructionService.findByCodeFromCache(String.valueOf(this.front_task));
|
Instruction front_inst = instructionService.findByCodeFromCache(String.valueOf(this.front_task));
|
||||||
if (ObjectUtil.isNotEmpty(front_inst)) {
|
if (ObjectUtil.isNotEmpty(front_inst)) {
|
||||||
this.frontWrite(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());
|
this.putzD(this.back_task, ForkTypeEnum.BACK.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public class MqttService {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
|
log.info("执行MQTT初始化");
|
||||||
initTopicMap();
|
initTopicMap();
|
||||||
loadTags();
|
loadTags();
|
||||||
initMqttClient();
|
initMqttClient();
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ spring:
|
|||||||
username: root
|
username: root
|
||||||
password: 123456
|
password: 123456
|
||||||
cleanSession: true
|
cleanSession: true
|
||||||
url: 192.168.1.218
|
url: 10.211.55.3
|
||||||
clientId: hs_mqtt21
|
clientId: hs_mqtt21
|
||||||
topics:
|
topics:
|
||||||
- HS/#
|
- HS/#
|
||||||
|
|||||||
Reference in New Issue
Block a user