Browse Source

重构系统错误上报相关类

tags/v0
zhaohe 10 months ago
parent
commit
25ba7616cc
  1. 2
      src/main/java/a8k/OS.java
  2. 4
      src/main/java/a8k/baseservice/ActionReactorService.java
  3. 1
      src/main/java/a8k/baseservice/appeventbus/appevent/A8kEcodeContextListPromptEvent.java
  4. 17
      src/main/java/a8k/baseservice/appeventbus/appevent/A8kErrorPromptEvent.java
  5. 4
      src/main/java/a8k/dbservice/HardwareServiceSetting.java
  6. 37
      src/main/java/a8k/hardware/A8kCanBusService.java
  7. 4
      src/main/java/a8k/hardware/type/a8kcanprotocol/A8kEcode.java
  8. 5
      src/main/java/a8k/service/appdata/AppProjInfoMgrService.java
  9. 3
      src/main/java/a8k/service/appdata/AppSettingsMgr.java
  10. 13
      src/main/java/a8k/service/appdata/AppUserMgrService.java
  11. 4
      src/main/java/a8k/service/appdevicectrl/AppConsumablesMgrService.java
  12. 2
      src/main/java/a8k/service/appdevicectrl/AppEmergencySamplePosStateMgrService.java
  13. 4
      src/main/java/a8k/service/appdevicectrl/AppTubeSettingMgrService.java
  14. 2
      src/main/java/a8k/service/appdevicectrl/DeviceInitCtrlService.java
  15. 2
      src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ1_ENTER_TUBEHOLDER_AND_SCAN.java
  16. 3
      src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ2_SWITCH_TO_THE_NEXT_TUBE.java
  17. 3
      src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ3_CHECK_THE_QUANTITY_OF_CONSUMABLES.java
  18. 9
      src/main/java/a8k/service/appdevicectrl/scheduler/MainFlowCtrlScheduler.java
  19. 7
      src/main/java/a8k/service/appdevicectrl/type/A8kEcodeContext.java
  20. 14
      src/main/java/a8k/service/devicedriver/commonctrl/HardwareCommonCtrl.java
  21. 2
      src/main/java/a8k/service/devicedriver/ctrl/ConsumablesScanCtrl.java
  22. 20
      src/main/java/a8k/service/devicedriver/ctrl/HbotControlService.java
  23. 11
      src/main/java/a8k/service/devicedriver/ctrl/ReactionPlatesTransmitCtrl.java
  24. 6
      src/main/java/a8k/service/devicedriver/ctrl/SampleScanTransportCtrl.java
  25. 9
      src/main/java/a8k/service/devicedriver/ctrl/SamplesPreProcesCtrl.java
  26. 6
      src/main/java/a8k/service/devicedriver/param/Hbot2DCodeScanPos.java
  27. 7
      src/main/java/a8k/service/devicedriver/testscript/TestScript.java
  28. 18
      src/main/java/a8k/type/appret/AppRet.java
  29. 31
      src/main/java/a8k/type/ecode/AppEcode.java
  30. 15
      src/main/java/a8k/type/ecode/AppError.java
  31. 18
      src/main/java/a8k/type/ecode/HardwareError.java
  32. 49
      src/main/java/a8k/type/exception/AppException.java
  33. 5
      src/main/java/a8k/utils/ReactionPlate2DCodeParser.java
  34. 4
      src/main/java/a8k/utils/state_machine/AppStateMachine.java

2
src/main/java/a8k/OS.java

@ -8,7 +8,7 @@ public class OS {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
throw new AppException(A8kEcode.OS_threadInterrupt.index);
throw new AppException(A8kEcode.OS_threadInterrupt);
}
}

4
src/main/java/a8k/baseservice/ActionReactorService.java

@ -50,7 +50,7 @@ public class ActionReactorService {
if (breakAction) {
breakAction = false;
throw new AppException(A8kEcode.ActionReactorService_breakByUsr.index);
throw new AppException(A8kEcode.ActionReactorService_breakByUsr);
}
if (fullSpeedRun) {
@ -60,7 +60,7 @@ public class ActionReactorService {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new AppException(A8kEcode.ActionReactorService_breakByUsr.index);
throw new AppException(A8kEcode.ActionReactorService_breakByUsr);
}
}
}

1
src/main/java/a8k/baseservice/appeventbus/appevent/A8kEcodeContextListPromptEvent.java

@ -1,6 +1,5 @@
package a8k.baseservice.appeventbus.appevent;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.service.appdevicectrl.type.A8kEcodeContext;
import java.util.List;

17
src/main/java/a8k/baseservice/appeventbus/appevent/A8kErrorPromptEvent.java

@ -1,23 +1,22 @@
package a8k.baseservice.appeventbus.appevent;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.type.ecode.AppError;
public class A8kErrorPromptEvent extends AppEvent {
public Integer errorCode;
public String errorCodeStr;
public AppError error;
public A8kErrorPromptEvent(Integer errorCode) {
public A8kErrorPromptEvent(A8kEcode errorCode) {
super(A8kErrorPromptEvent.class.getSimpleName());
this.errorCode = errorCode;
this.errorCodeStr = A8kEcode.toDisPlayString(errorCode);
this.error = new AppError(errorCode);
}
public A8kErrorPromptEvent(A8kEcode ecode) {
this(ecode.index);
public A8kErrorPromptEvent(AppError erro) {
super(A8kErrorPromptEvent.class.getSimpleName());
this.error = erro;
}
public String toString() {
return String.format("%s(%s)", errorCodeStr, errorCode);
return String.format("%s", error);
}
}

4
src/main/java/a8k/dbservice/HardwareServiceSetting.java

@ -64,13 +64,13 @@ public class HardwareServiceSetting extends UfActiveRecord {
public static <T> T getObject(String service, String key, Class<T> clazs) throws AppException {
var option = UfActiveRecord.findOne(HardwareServiceSetting.class, Map.of("serviceName", service, "key", key));
if (option == null) {
throw new AppException(A8kEcode.CodeError_GetParamFail.index);
throw new AppException(A8kEcode.CodeError_GetParamFail);
}
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.readValue(option.val, clazs);
} catch (JsonProcessingException e) {
throw new AppException(A8kEcode.CodeError_ParseParamFail.index);
throw new AppException(A8kEcode.CodeError_ParseParamFail);
}
}

37
src/main/java/a8k/hardware/A8kCanBusService.java

@ -7,6 +7,7 @@ import a8k.type.PlateInfo;
import a8k.hardware.custom_param_mgr.A8kModCustomParamMgr;
import a8k.hardware.type.a8kcanprotocol.*;
import a8k.hardware.type.a8kcanprotocol.MId;
import a8k.type.ecode.HardwareError;
import a8k.type.exception.AppException;
import a8k.type.cfg.Pos2d;
import a8k.baseservice.appeventbus.appevent.A8kHardwareReport;
@ -331,9 +332,9 @@ public class A8kCanBusService {
return packet.getContentI32(0);
}
public Integer moduleGetError(MId id) throws AppException {
public A8kEcode moduleGetError(MId id) throws AppException {
var packet = callcmd(id.toInt(), CmdId.module_get_error.toInt());
return packet.getContentI32(0);
return A8kEcode.fromInt(packet.getContentI32(0));
}
public void moduleClearError(MId id) throws AppException {
@ -577,7 +578,7 @@ public class A8kCanBusService {
}
long now = System.currentTimeMillis();
if (now - startedAt > acitionOvertime) {
throw new AppException(id, A8kEcode.Overtime.index);
throw AppException.of(new HardwareError(A8kEcode.Overtime, id, null));
}
} while (true);
@ -591,7 +592,7 @@ public class A8kCanBusService {
} else if (ioid.mtype == ModuleType.kmini_servo_motor_module) {
return callcmd(ioid.mid.toInt(), CmdId.mini_servo_read_io_state.toInt(), ioid.ioIndex).getContentI32(0) != 0;
} else {
throw new AppException(ioid.mid, A8kEcode.IllegalOperation.index);
throw AppException.of(new HardwareError(A8kEcode.IllegalOperation, ioid.mid, null));
}
}
@ -612,7 +613,8 @@ public class A8kCanBusService {
if (ioid.mtype == ModuleType.kboard) {
callcmd(ioid.mid.toInt(), CmdId.extboard_write_outio.toInt(), ioid.ioIndex, val ? 1 : 0);
} else {
throw new AppException(ioid.mid, A8kEcode.IllegalOperation.index);
// throw new AppException(ioid.mid, A8kEcode.IllegalOperation.index);
throw AppException.of(new HardwareError(A8kEcode.IllegalOperation, ioid.mid, null));
}
}
@ -638,7 +640,8 @@ public class A8kCanBusService {
break;
} else if (statu == ModuleStatus.ERROR) {
logger.error("{} waitting for action {} , catch error {}", mid, action, moduleGetError(mid));
throw new AppException(mid, moduleGetError(mid));
// throw new AppException(mid, moduleGetError(mid));
throw AppException.of(new HardwareError(moduleGetError(mid), mid, null));
}
long now = System.currentTimeMillis();
@ -648,7 +651,8 @@ public class A8kCanBusService {
moduleStop(mid);
} catch (AppException ignored) {
}
throw new AppException(mid, A8kEcode.ActionOvertime.index);
// throw new AppException(mid, A8kEcode.ActionOvertime.index);
throw AppException.of(new HardwareError(A8kEcode.ActionOvertime, mid, null));
}
OS.hsleep(100);
} while (true);
@ -691,14 +695,15 @@ public class A8kCanBusService {
try {
return this.sendCmd(pack, A8kPacket.CMD_OVERTIME);
} catch (AppException e) {
if (e.getErrorCode() != A8kEcode.Overtime.index) {
if (!e.error.code.equals(A8kEcode.Overtime)) {
throw e;
}
}
OS.hsleep(100);
logger.error("send cmd {} fail, retry {}", pack, i);
}
throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
// throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId())));
}
@ -715,7 +720,8 @@ public class A8kCanBusService {
CmdId cmdid = CmdId.valueOf(pack.getCmdId());
if (cmdid == null) {
throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.CmdNotSupport.index);
// throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.CmdNotSupport.index);
throw AppException.of(new HardwareError(A8kEcode.CmdNotSupport, MId.valueOf(pack.getModuleId()), null));
}
if (debugFlag && pack.isTrace()) {
String packstr = pack.toString();
@ -733,15 +739,20 @@ public class A8kCanBusService {
receipt = receiptQueue.poll(overtime, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
isWaitingReceipt = false;
throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
// throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId())));
}
isWaitingReceipt = false;
if (receipt == null) {
throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
// throw new AppException(MId.valueOf(pack.getModuleId()), A8kEcode.Overtime.index);
throw AppException.of(new HardwareError(A8kEcode.Overtime, MId.valueOf(pack.getModuleId()), CmdId.valueOf(pack.getCmdId())));
}
if (receipt.getPacketType() == A8kPacket.PACKET_TYPE_ERROR_ACK) {
throw new AppException(MId.valueOf(pack.getModuleId()), (receipt.getContentI32(0)));
// throw new AppException(MId.valueOf(pack.getModuleId()), (receipt.getContentI32(0)));
throw AppException.of(new HardwareError(A8kEcode.fromInt(receipt.getContentI32(0)),
MId.valueOf(pack.getModuleId()),
CmdId.valueOf(pack.getCmdId())));
}
OS.forceSleep(10);
return receipt;

4
src/main/java/a8k/hardware/type/a8kcanprotocol/A8kEcode.java

@ -152,7 +152,7 @@ public enum A8kEcode {
;
public final int index;
public int unknownIndex = 0;
public int rawindex = 0;
A8kEcode(int index) {
this.index = index;
@ -168,7 +168,7 @@ public enum A8kEcode {
return e;
}
}
A8kEcode.CodeError_UnkownError.unknownIndex = index;
A8kEcode.CodeError_UnkownError.rawindex = index;
return A8kEcode.CodeError_UnkownError;
}

5
src/main/java/a8k/service/appdata/AppProjInfoMgrService.java

@ -10,7 +10,6 @@ import a8k.dbservice.A8kProjIdCardDBService;
import a8k.dbservice.type.A8kPresetProjInfo;
import a8k.hardware.type.regindex.RegIndex;
import a8k.type.exception.AppException;
import a8k.type.appret.AppRet;
import a8k.baseservice.appeventbus.AppEventBusService;
import a8k.hardware.A8kCanBusService;
import a8k.hardware.type.a8kcanprotocol.*;
@ -98,7 +97,7 @@ public class AppProjInfoMgrService implements AppEventListener {
//TODO:
//检查解析结果如果解析结果存在异常则抛出错误事件给前端
if (mountedIdCardInfo.lotId.isEmpty()) {
eventBus.pushEvent(new A8kErrorPromptEvent(A8kEcode.A8kIdCardLotIdIsEmpty.index));
eventBus.pushEvent(new A8kErrorPromptEvent(A8kEcode.A8kIdCardLotIdIsEmpty));
return;
}
@ -115,7 +114,7 @@ public class AppProjInfoMgrService implements AppEventListener {
@ExtApiFn(name = "读取当前挂载的ID卡信息", order = ORDER.readIDCardInfo)
public A8kIdCardInfo readMountedIDCardInfo() throws AppException {
if (mountedIdCardInfo == null) {
throw new AppException(A8kEcode.A8kIdCardNotMounted.index);
throw new AppException(A8kEcode.A8kIdCardNotMounted);
}
return mountedIdCardInfo;
}

3
src/main/java/a8k/service/appdata/AppSettingsMgr.java

@ -4,7 +4,6 @@ import a8k.dbservice.AppSettingDBService;
import a8k.dbservice.type.AppSetting;
import a8k.dbservice.type.appsetting.AppSettingType;
import a8k.dbservice.type.appsetting.settingenum.*;
import a8k.type.appret.AppRet;
import a8k.controler.extapi.utils.ExtApiTab;
import a8k.controler.extapi.utils.ExtApiFn;
import a8k.controler.extapi.pagecontrol.ExtApiTabConfig;
@ -110,7 +109,7 @@ public class AppSettingsMgr {
public AppSetting setOptionVal(AppSettingName optionName, String val) throws AppException {
logger.info("setOptionVal {}={}", optionName, val);
if (!isOptionLegal(optionName, val)) {
throw new AppException(A8kEcode.FrontendParamTypeError.index);
throw new AppException(A8kEcode.FrontendParamTypeError);
}
appSettingDBService.updateSetting(optionName, val);
return getAppSettingByName(optionName);

13
src/main/java/a8k/service/appdata/AppUserMgrService.java

@ -5,7 +5,6 @@ import a8k.controler.extapi.utils.ExtApiTab;
import a8k.dbservice.AppUsrDBService;
import a8k.dbservice.type.AppUser;
import a8k.dbservice.type.UsrRole;
import a8k.type.appret.AppRet;
import a8k.controler.extapi.utils.ExtApiFn;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.type.exception.AppException;
@ -48,10 +47,10 @@ public class AppUserMgrService {
public AppUser login(String account, String password) throws AppException {
var usr = appUsrDBService.getUsrByAccount(account);
if (usr == null)
throw new AppException(A8kEcode.UsrNotExitError.index);
throw new AppException(A8kEcode.UsrNotExitError);
if (!usr.password.equals(password)) {
throw new AppException(A8kEcode.UsrPasswdError.index);
throw new AppException(A8kEcode.UsrPasswdError);
}
loginUsr = usr;
return (usr);
@ -77,7 +76,7 @@ public class AppUserMgrService {
public List<AppUser> addUser(String account, String password, UsrRole type) throws AppException {
var user = appUsrDBService.getUsrByAccount(account);
if (user != null) {
throw new AppException(A8kEcode.UsrAlreadyExistError.index);
throw new AppException(A8kEcode.UsrAlreadyExistError);
}
user = new AppUser(account, password, type);
appUsrDBService.addUser(user);
@ -94,7 +93,7 @@ public class AppUserMgrService {
public List<AppUser> modifyUsrPwd(String account, String password) throws AppException {
var user = appUsrDBService.getUsrByAccount(account);
if (user == null) {
throw new AppException(A8kEcode.UsrNotExitError.index);
throw new AppException(A8kEcode.UsrNotExitError);
}
user.password = password;
appUsrDBService.updateUser(user);
@ -105,7 +104,7 @@ public class AppUserMgrService {
public List<AppUser> modifyUsrRole(String account, UsrRole usrRole) throws AppException {
var user = appUsrDBService.getUsrByAccount(account);
if (user == null) {
throw new AppException(A8kEcode.UsrNotExitError.index);
throw new AppException(A8kEcode.UsrNotExitError);
}
user.usrRole = usrRole;
appUsrDBService.updateUser(user);
@ -116,7 +115,7 @@ public class AppUserMgrService {
public List<AppUser> modifyUsrAccount(String account, String newaccount) throws AppException {
var user = appUsrDBService.getUsrByAccount(account);
if (user == null) {
throw new AppException(A8kEcode.UsrNotExitError.index);
throw new AppException(A8kEcode.UsrNotExitError);
}
user.account = newaccount;
appUsrDBService.updateUser(user);

4
src/main/java/a8k/service/appdevicectrl/AppConsumablesMgrService.java

@ -164,7 +164,7 @@ public class AppConsumablesMgrService {
@ExtApiFn(name = "扫描耗材(阻塞接口)", order = 1)
public Map<String, Object> scanConsumables() throws AppException {
if (!gstate.isDeviceInited()) {
throw new AppException(A8kEcode.DeviceNotInited.index);
throw new AppException(A8kEcode.DeviceNotInited);
}
List<ConsumablesScanResult> scanResult = new java.util.ArrayList<>();
//执行扫描耗材动作
@ -193,7 +193,7 @@ public class AppConsumablesMgrService {
@ExtApiFn(name = "扫描某一个通道耗材(阻塞接口)", order = 1)
public Map<String, Object> scanOneChConsumables(Integer chNum) throws AppException {
if (!gstate.isDeviceInited()) {
throw new AppException(A8kEcode.DeviceNotInited.index);
throw new AppException(A8kEcode.DeviceNotInited);
}
List<ConsumablesScanResult> scanResult = new java.util.ArrayList<>();
// var scanRawResult = doScanOneCh(Integer ch);

2
src/main/java/a8k/service/appdevicectrl/AppEmergencySamplePosStateMgrService.java

@ -56,7 +56,7 @@ public class AppEmergencySamplePosStateMgrService {
sampleRecordMgrService.addEmergencySampleRecord(tube);
appSampleProcessContextMgrService.createNewTubeContext(tube);
} else {
throw new AppException(A8kEcode.EmergencySampleIsProcessing.index);
throw new AppException(A8kEcode.EmergencySampleIsProcessing);
}
}

4
src/main/java/a8k/service/appdevicectrl/AppTubeSettingMgrService.java

@ -55,10 +55,10 @@ public class AppTubeSettingMgrService {
TubeHolderSetting getTubeHolderSettingAndCheckIsEditable(String uuid) throws AppException {
TubeHolderSetting setting = getTubeHolderSetting(uuid);
if (setting == null) {
throw new AppException(A8kEcode.TubeHolderSettingNotFound.index);
throw new AppException(A8kEcode.TubeHolderSettingNotFound);
}
if (setting.lock) {
throw new AppException(A8kEcode.TubeHolderSettingIsLocked.index);
throw new AppException(A8kEcode.TubeHolderSettingIsLocked);
}
return setting;
}

2
src/main/java/a8k/service/appdevicectrl/DeviceInitCtrlService.java

@ -86,7 +86,7 @@ public class DeviceInitCtrlService {
public void deviceMoveToZero() throws AppException {
Boolean suc = checkBeforeInitDevicePass();
if (!suc) {
throw new AppException(A8kEcode.CheckPoint_checkFail.index);
throw new AppException(A8kEcode.CheckPoint_checkFail);
}
//进出料初始化

2
src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ1_ENTER_TUBEHOLDER_AND_SCAN.java

@ -98,7 +98,7 @@ public class SEQ1_ENTER_TUBEHOLDER_AND_SCAN extends A8kStepAction {
if (!enterSuc) {
logger.warn("进料超时,从入料口,弹出试管架");
stc.ejectTubeHolderInEnterPos();
throw new AppException(A8kEcode.InfeedOvertimeFail.index);
throw new AppException(A8kEcode.InfeedOvertimeFail);
}
//扫描试管架类型
String tubeType = stc.moveTubeRackToScanPosAndScan();

3
src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ2_SWITCH_TO_THE_NEXT_TUBE.java

@ -9,7 +9,6 @@ import a8k.service.appstate.AppA8kGStateService;
import a8k.service.appstate.resource.A8kPublicResourceType;
import a8k.service.appstate.type.TubeHolder;
import a8k.service.appstate.type.Tube;
import a8k.service.appstate.type.state.TubeHolderState;
import a8k.service.appstate.type.state.TubeState;
import a8k.service.devicedriver.ctrl.SampleScanTransportCtrl;
import a8k.type.exception.AppException;
@ -112,7 +111,7 @@ public class SEQ2_SWITCH_TO_THE_NEXT_TUBE extends A8kStepAction {
}
if (!isHasEnoughConsumables(nextProcessTube)) {
throw new AppException(A8kEcode.ConsumeNotEnough.index);
throw new AppException(A8kEcode.ConsumeNotEnough);
}
}

3
src/main/java/a8k/service/appdevicectrl/action/mainflow/SEQ3_CHECK_THE_QUANTITY_OF_CONSUMABLES.java

@ -1,13 +1,10 @@
package a8k.service.appdevicectrl.action.mainflow;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.service.appdata.AppProjInfoMgrService;
import a8k.service.appdevicectrl.action.base.A8kActionStepType;
import a8k.service.appdevicectrl.action.base.A8kStepAction;
import a8k.service.appstate.AppA8kGStateService;
import a8k.service.appstate.resource.A8kPublicResourceType;
import a8k.service.appstate.type.state.TubeHolderState;
import a8k.service.appstate.type.state.TubeState;
import a8k.service.devicedriver.ctrl.SampleScanTransportCtrl;
import a8k.type.exception.AppException;
import jakarta.annotation.Resource;

9
src/main/java/a8k/service/appdevicectrl/scheduler/MainFlowCtrlScheduler.java

@ -139,9 +139,9 @@ public class MainFlowCtrlScheduler {
try {
logger.info("doaction:{}", key.step);
key.doaction();
return new A8kEcodeContext(key.step, A8kEcode.NoError);
return new A8kEcodeContext(key.step, null);
} catch (AppException appe) {
return new A8kEcodeContext(key.step, A8kEcode.fromInt(appe.getErrorCode()));
return new A8kEcodeContext(key.step, appe.error);
}
}
@ -158,7 +158,7 @@ public class MainFlowCtrlScheduler {
state.errorFlag = false;
}
} catch (AppException appe) {
A8kEcodeContext context = new A8kEcodeContext(A8kActionStepType.DO_CLEAR_ERROR, A8kEcode.fromInt(appe.getErrorCode()));
A8kEcodeContext context = new A8kEcodeContext(A8kActionStepType.DO_CLEAR_ERROR, appe.error);
a8kEcodePostProcesser(List.of(context));
}
}
@ -189,7 +189,7 @@ public class MainFlowCtrlScheduler {
}
//清空NoError
ecodeList.removeIf(ecode -> ecode.ecode == A8kEcode.NoError);
ecodeList.removeIf(ecode -> ecode.ecode == null);
return ecodeList;
}
@ -253,7 +253,6 @@ public class MainFlowCtrlScheduler {
ecodePostProcesser.process(ecodeList);
}
ebus.pushEvent(new A8kEcodeContextListPromptEvent(ecodeList));
state.errorFlag = true;
this.state.ecodeList = ecodeList;

7
src/main/java/a8k/service/appdevicectrl/type/A8kEcodeContext.java

@ -2,18 +2,19 @@ package a8k.service.appdevicectrl.type;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.service.appdevicectrl.action.base.A8kActionStepType;
import a8k.type.ecode.AppError;
public class A8kEcodeContext {
public A8kActionStepType dowhat;
public A8kEcode ecode;
public AppError ecode;
public A8kEcodeContext(A8kActionStepType dowhat, A8kEcode ecode) {
public A8kEcodeContext(A8kActionStepType dowhat, AppError ecode) {
this.dowhat = dowhat;
this.ecode = ecode;
}
public Boolean equals(A8kEcodeContext other) {
return this.dowhat.equals(other.dowhat) && this.ecode.equals(other.ecode);
return this.dowhat.equals(other.dowhat) && this.ecode.code.equals(other.ecode.code);
}
public String toString() {

14
src/main/java/a8k/service/devicedriver/commonctrl/HardwareCommonCtrl.java

@ -49,31 +49,31 @@ public class HardwareCommonCtrl {
//试管平移通道是否有障碍
if (canBus.getIOState(IOId.THChInterPPS) || canBus.getIOState(IOId.THChOuterPPS)) {
logger.warn("THChInterPPS or THChOuterPPS is trigger");
throw new AppException(A8kEcode.TubeXChannelIsNotEmpty.index);
throw new AppException(A8kEcode.TubeXChannelIsNotEmpty);
}
//板夹仓盖子是否盖上
if (!canBus.getIOState(IOId.PlateBoxCoverClosurePPS)) {
throw new AppException(A8kEcode.PlateBoxNotCover.index);
throw new AppException(A8kEcode.PlateBoxNotCover);
}
//板夹仓卡板检测
if (canBus.getIOState(IOId.PlateBoxPlateStuckPPS)) {
throw new AppException(A8kEcode.PlateStuckDetectorSensorTrigger.index);
throw new AppException(A8kEcode.PlateStuckDetectorSensorTrigger);
}
//检查钩板电机是否处于终点位置
if (!canBus.getIOState(IOId.PullerMZeroPPS)) {
throw new AppException(A8kEcode.PullerMInitPosError.index);
throw new AppException(A8kEcode.PullerMInitPosError);
}
//检查板夹仓光电是否处于起点位置
if (!canBus.getIOState(IOId.PusherMZeroPPS)) {
throw new AppException(A8kEcode.PusherMInitPosError.index);
throw new AppException(A8kEcode.PusherMInitPosError);
}
//板夹仓光电
if (canBus.getIOState(IOId.RecycleBinOverflowPPS)) {
throw new AppException(A8kEcode.RecycleBinOverflow.index);
throw new AppException(A8kEcode.RecycleBinOverflow);
}
}
@ -353,7 +353,7 @@ public class HardwareCommonCtrl {
public void checkBeforeMove(MId mId) throws AppException {
//板夹仓盖子是否盖上
if (!canBus.getIOState(IOId.PlateBoxCoverClosurePPS)) {
throw new AppException(A8kEcode.PlateBoxNotCover.index);
throw new AppException(A8kEcode.PlateBoxNotCover);
}
}

2
src/main/java/a8k/service/devicedriver/ctrl/ConsumablesScanCtrl.java

@ -84,7 +84,7 @@ public class ConsumablesScanCtrl {
@ExtApiFn(name = "扫描耗材")
public ScanRawResult doScanConsumablesAction() throws AppException {
if (!stateMgrService.isDeviceInited()) {
throw new AppException(A8kEcode.DeviceNotInited.index);
throw new AppException(A8kEcode.DeviceNotInited);
}
ScanRawResult result = new ScanRawResult();
for (int i = 0; i < 6; i++) {

20
src/main/java/a8k/service/devicedriver/ctrl/HbotControlService.java

@ -38,7 +38,7 @@ public class HbotControlService {
// 检查盖板是否关闭
if (!canBus.getIOState(IOId.PlateBoxCoverClosurePPS)) {
throw new AppException(A8kEcode.PlateBoxNotCover.index);
throw new AppException(A8kEcode.PlateBoxNotCover);
}
boolean zEnable = true;
@ -56,7 +56,7 @@ public class HbotControlService {
pipetteCtrlModule.zMotorMoveToZeroPointQuickBlock();
}
if (!pipetteCtrlModule.zAixsZeroPointIsTrigger()) {
throw new AppException(A8kEcode.ZMNotAtZPosWhenHbotTryMove.index);
throw new AppException(A8kEcode.ZMNotAtZPosWhenHbotTryMove);
}
// HBot移动
@ -108,7 +108,7 @@ public class HbotControlService {
// if (canBus.miniServoReadPos(MId.ShakeModGripperYSV) > getGripperZeroYPos() + 20) {
// logger.error("ShakeModGripperYSV Pos:{} > {}", canBus.miniServoReadPos(MId.ShakeModGripperYSV),
// getGripperZeroYPos() + 20);
// throw new AppException(A8kEcode.ShakeModGripperYSVInXYPublicArea.index);
// throw new AppException(A8kEcode.ShakeModGripperYSVInXYPublicArea);
// }
// }
@ -122,7 +122,7 @@ public class HbotControlService {
// public void hbotCheckAndMoveTo(Pos3d targetPos) throws AppException {
// logger.info("hbotCheckAndMoveTo:{}", targetPos);
// if (!canBus.getIOState(IOId.PlateBoxCoverClosurePPS)) {
// throw new AppException(A8kEcode.PlateBoxNotCover.index);
// throw new AppException(A8kEcode.PlateBoxNotCover);
// }
//
//
@ -140,7 +140,7 @@ public class HbotControlService {
// }
//
// if (!pipetteCtrlModule.zAixsZeroPointIsTrigger()) {
// throw new AppException(A8kEcode.ZMNotAtZPosWhenHbotTryMove.index);
// throw new AppException(A8kEcode.ZMNotAtZPosWhenHbotTryMove);
// }
// Pos2d nowHbotPos = canBus.hbotReadPos(MId.HbotM);
// HbotLimitArea sampleArea = pp.getSampleCollectionArea();
@ -180,7 +180,7 @@ public class HbotControlService {
//
// private void modGroupMoveToZero() throws AppException {
// if (!canBus.getIOState(IOId.PlateBoxCoverClosurePPS)) {
// throw new AppException(A8kEcode.PlateBoxNotCover.index);
// throw new AppException(A8kEcode.PlateBoxNotCover);
// }
//
// pipetteCtrlModule.zMotorEnable(1);
@ -219,11 +219,11 @@ public class HbotControlService {
// public AppRet<Boolean> takeTip(Integer groupId, Integer index) throws AppException {
// logger.info("takeTip groupId:{} index:{}", groupId, index);
// if (groupId > 2 || groupId < 0) {
// throw new AppException(A8kEcode.ParamOutOfRange.index);
// throw new AppException(A8kEcode.ParamOutOfRange);
// }
//
// if (index > TipPickUpPosInfo.cgetTipNum() || index < 0) {
// throw new AppException(A8kEcode.ParamOutOfRange.index);
// throw new AppException(A8kEcode.ParamOutOfRange);
// }
//
// TipPickUpPosInfo tipPos = pp.getTipPickUpPosInfo();
@ -256,7 +256,7 @@ public class HbotControlService {
// throws AppException {
// BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo();
// if (Xhole < 0 || Xhole > BottlesPosInfo.cgetMAX()) {
// throw new AppException(A8kEcode.ParamOutOfRange.index);
// throw new AppException(A8kEcode.ParamOutOfRange);
// }
// Pos2d pos = posInfo.cgetSmallBottleBufferPos(group.off, Xhole);
// hbotCheckAndMoveTo(pos);
@ -267,7 +267,7 @@ public class HbotControlService {
// throws AppException {
// BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo();
// if (Xhole < 0 || Xhole > BottlesPosInfo.cgetMAX()) {
// throw new AppException(A8kEcode.ParamOutOfRange.index);
// throw new AppException(A8kEcode.ParamOutOfRange);
// }
// Pos2d pos = posInfo.cgetDetectMaterialPos(group.off, Xhole);
// hbotCheckAndMoveTo(pos);

11
src/main/java/a8k/service/devicedriver/ctrl/ReactionPlatesTransmitCtrl.java

@ -4,7 +4,6 @@ import a8k.controler.extapi.pagecontrol.ExtApiTabConfig;
import a8k.type.exception.AppException;
import a8k.utils.opt_algo.A8kOptAlgo;
import a8k.type.*;
import a8k.type.appret.AppRet;
import a8k.controler.extapi.utils.*;
import a8k.hardware.A8kCanBusService;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
@ -43,26 +42,26 @@ public class ReactionPlatesTransmitCtrl {
//板夹仓卡板检测
if (canBus.getIOState(IOId.PlateBoxPlateStuckPPS)) {
logger.error("PlateBoxPlateStuckPPS is trigger");
throw new AppException(A8kEcode.PlateStuckDetectorSensorTrigger.index);
throw new AppException(A8kEcode.PlateStuckDetectorSensorTrigger);
}
//检查钩板电机是否处于终点位置
if (!canBus.getIOState(IOId.PullerMZeroPPS)) {
logger.error("PullerM is not in zero pos");
throw new AppException(A8kEcode.PullerMInitPosError.index);
throw new AppException(A8kEcode.PullerMInitPosError);
}
//检查板夹仓光电是否处于起点位置
if (!canBus.getIOState(IOId.PusherMZeroPPS)) {
logger.error("PusherM is not in zero pos");
throw new AppException(A8kEcode.PusherMInitPosError.index);
throw new AppException(A8kEcode.PusherMInitPosError);
}
}
public void checkBeforeMovePlateBox() throws AppException {
if (!canBus.getIOState(IOId.PusherMZeroPPS)) {
logger.error("PusherM is not in zero pos ");
throw new AppException(A8kEcode.PusherMInitPosError.index);
throw new AppException(A8kEcode.PusherMInitPosError);
}
}
@ -153,7 +152,7 @@ public class ReactionPlatesTransmitCtrl {
canBus.stepMotorEasyMoveToBlock(MId.OptModPullM, pp.getPullerTargetPos(), timep.getActionOvertime());
if (!canBus.getIOState(IOId.PullerMEndPPS)) {
logger.error("pull plate fail");
throw new AppException(A8kEcode.PullPlateFail.index);
throw new AppException(A8kEcode.PullPlateFail);
}
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.OptModPullM, timep.getActionOvertime());
}

6
src/main/java/a8k/service/devicedriver/ctrl/SampleScanTransportCtrl.java

@ -90,7 +90,7 @@ public class SampleScanTransportCtrl {
@ExtApiFn(name = "移动到坐标", group = "基础方法", order = ORDER.moveTubeRackTo)
public void moveTubeRackTo(Integer pos, TargetPosMeasureDirection moveDiretion, Boolean moveToZero) throws AppException {
if (!canBus.stepMotorReadIoState(MId.ShakeModGripperZM, 0)) {
throw new AppException(A8kEcode.ShakeModGripperZMNotInZeroPos.index);
throw new AppException(A8kEcode.ShakeModGripperZMNotInZeroPos);
}
//打开扫码夹具
scanClampModRelease();
@ -171,7 +171,7 @@ public class SampleScanTransportCtrl {
@ExtApiFn(name = "入料", group = "单步", order = ORDER.moveTubeRackToExitPos)
public Boolean enterTubeHolder() throws AppException {
if (getTHchInterPPS() || getTHchOuterPPS()) {
throw new AppException(A8kEcode.TubeXChannelIsNotEmpty.index);
throw new AppException(A8kEcode.TubeXChannelIsNotEmpty);
}
moveTubeRackMoveToEnterPos();
try {
@ -216,7 +216,7 @@ public class SampleScanTransportCtrl {
OS.hsleep(1000);
canBus.stepMotorStop(MId.FeedingModOutfeedM);
if (getTHchInterPPS() || getTHchOuterPPS()) {
throw new AppException(A8kEcode.EjectTubeholderTimeout.index);
throw new AppException(A8kEcode.EjectTubeholderTimeout);
}
} finally {
canBus.moduleStop(MId.FeedingModOutfeedM);

9
src/main/java/a8k/service/devicedriver/ctrl/SamplesPreProcesCtrl.java

@ -2,7 +2,6 @@ package a8k.service.devicedriver.ctrl;
import a8k.controler.extapi.pagecontrol.ExtApiTabConfig;
import a8k.type.exception.AppException;
import a8k.type.appret.AppRet;
import a8k.controler.extapi.utils.*;
import a8k.hardware.A8kCanBusService;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
@ -120,22 +119,22 @@ public class SamplesPreProcesCtrl {
//Z轴在原点
if (!canBus.stepMotorReadIoState(MId.ShakeModGripperZM, 0)) {
throw new AppException(MId.ShakeModGripperZM, A8kEcode.MNotInZeroPos.index);
throw new AppException(A8kEcode.MNotInZeroPos,MId.ShakeModGripperZM);
}
//Y轴在零点附近
if (!ZEQ.IntEq(canBus.miniServoReadPos(MId.ShakeModGripperYSV), pp.getGripperZeroYPos(), 30)) {
throw new AppException(MId.ShakeModGripperYSV, A8kEcode.MNotInZeroPos.index);
throw new AppException(A8kEcode.MNotInZeroPos,MId.ShakeModGripperYSV);
}
//夹爪没有零位置
if (!ZEQ.IntEq(canBus.miniServoReadPos(MId.ShakeModGripperSV), pp.getGripperClosePos(), 30)) {
throw new AppException(MId.ShakeModGripperSV, A8kEcode.MNotInZeroPos.index);
throw new AppException(A8kEcode.MNotInZeroPos,MId.ShakeModGripperSV);
}
//检查摇匀夹紧是否在零位
if (!canBus.stepMotorReadIoState(MId.ShakeModClampingM, 0)) {
throw new AppException(MId.ShakeModClampingM, A8kEcode.MNotInZeroPos.index);
throw new AppException(A8kEcode.MNotInZeroPos,MId.ShakeModClampingM);
}
boolean isHighBlood = highTube;

6
src/main/java/a8k/service/devicedriver/param/Hbot2DCodeScanPos.java

@ -116,7 +116,7 @@ public class Hbot2DCodeScanPos {
case 3 -> getPBScanPos3();
case 4 -> getPBScanPos4();
case 5 -> getPBScanPos5();
default -> throw new AppException(A8kEcode.CodeError.index);
default -> throw new AppException(A8kEcode.CodeError);
};
}
@ -146,7 +146,7 @@ public class Hbot2DCodeScanPos {
case 3 -> getLittBS3();
case 4 -> getLittBS4();
case 5 -> getLittBS5();
default -> throw new AppException(A8kEcode.CodeError.index);
default -> throw new AppException(A8kEcode.CodeError);
};
}
@ -176,7 +176,7 @@ public class Hbot2DCodeScanPos {
case 3 -> getLarBS3();
case 4 -> getLarBS4();
case 5 -> getLarBS5();
default -> throw new AppException(A8kEcode.CodeError.index);
default -> throw new AppException(A8kEcode.CodeError);
};
}

7
src/main/java/a8k/service/devicedriver/testscript/TestScript.java

@ -4,7 +4,6 @@ import a8k.controler.extapi.pagecontrol.ExtApiTabConfig;
import a8k.type.ConsumableGroup;
import a8k.type.exception.AppException;
import a8k.type.IncubatorPos;
import a8k.type.appret.AppRet;
import a8k.controler.extapi.utils.*;
import a8k.service.devicedriver.ctrl.SamplesPreProcesCtrl;
import a8k.service.devicedriver.ctrl.SampleScanTransportCtrl;
@ -72,7 +71,7 @@ public class TestScript {
void checkTestScriptWorkFlag() throws AppException {
if (testScriptWorkFlag) {
testScriptWorkFlag = false;
throw new AppException(A8kEcode.TestScrip_deviceIsBusy.index);
throw new AppException(A8kEcode.TestScrip_deviceIsBusy);
}
}
@ -92,7 +91,7 @@ public class TestScript {
// // TODO canBus.pipetteCtrlPutTipBlock(MId.PipetteMod);
//
// if (canBus.moduleGetReg(MId.PipetteMod, RegIndex.kreg_pipette_tip_state) == 1) {
// throw new AppException(A8kEcode.PutTipFail.index);
// throw new AppException(A8kEcode.PutTipFail);
// }
//
// // TODO canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime());
@ -109,7 +108,7 @@ public class TestScript {
// for (int i = startFrom; i < TipPickUpPosInfo.cgetTipNum(); i++) {
// var ret = takeTipTestStep(groupId, i);
// if (!ret.getData()) {
// throw new AppException(A8kEcode.TakeTipFail.index);
// throw new AppException(A8kEcode.TakeTipFail);
// }
//
// result.put("Tip" + i, ret.getData() ? "suc" : "fail");

18
src/main/java/a8k/type/appret/AppRet.java

@ -1,8 +1,6 @@
package a8k.type.appret;
import a8k.type.ecode.AppEcode;
import a8k.hardware.type.a8kcanprotocol.CmdId;
import a8k.hardware.type.a8kcanprotocol.MId;
import a8k.type.ecode.AppError;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.type.exception.AppException;
import lombok.Getter;
@ -10,7 +8,7 @@ import lombok.Getter;
public class AppRet<T> {
public AppRetType appRetType = AppRetType.SUCCESS;
// 错误信息
public AppEcode ecode = null;
public AppError ecode = null;
// 显示给用户的内容
public String message = null;
//异常触发上下文
@ -54,18 +52,12 @@ public class AppRet<T> {
r.appRetType = AppRetType.FAILURE;
if (e instanceof AppException hexcep) {
r.ecode = new AppEcode(hexcep.getErrorCode(), hexcep.getModuleId(), hexcep.getCmdId());
r.traceInfo = trace;
r.message = r.ecode.toDisPlayString();
if (hexcep.getExtmessage() != null) {
r.message = r.message + "\n 额外信息:" + hexcep.getExtmessage();
}
r.ecode = hexcep.error;
} else {
r.ecode = new AppEcode(A8kEcode.CodeError.index, null, null);
r.ecode = new AppError(A8kEcode.CodeError);
}
r.traceInfo = trace;
r.message = e.getMessage();
}
return r;
}

31
src/main/java/a8k/type/ecode/AppEcode.java

@ -1,31 +0,0 @@
package a8k.type.ecode;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.hardware.type.a8kcanprotocol.CmdId;
import a8k.hardware.type.a8kcanprotocol.MId;
public class AppEcode {
public Integer code;
public String codeName;
public MId relateMid;
public CmdId relateCmd;
public AppEcode(Integer errorCode, MId mid, CmdId cmd) {
this.code = errorCode;
this.codeName = A8kEcode.toDisPlayString(errorCode);
this.relateMid = mid;
this.relateCmd = cmd;
}
public String toDisPlayString() {
String info;
info = String.format("错误: (%s)%d", A8kEcode.toDisPlayString(code), code);
if (relateMid != null) {
info += String.format("\n 相关模块: %s", relateMid.chname);
}
if (relateCmd != null) {
info += String.format("\n 相关指令: %s", relateCmd.chName);
}
return info;
}
}

15
src/main/java/a8k/type/ecode/AppError.java

@ -0,0 +1,15 @@
package a8k.type.ecode;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
public class AppError {
public A8kEcode code;
public AppError(A8kEcode errorCode) {
this.code = errorCode;
}
public String toString() {
return String.format("%s", code);
}
}

18
src/main/java/a8k/type/ecode/HardwareError.java

@ -0,0 +1,18 @@
package a8k.type.ecode;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.hardware.type.a8kcanprotocol.CmdId;
import a8k.hardware.type.a8kcanprotocol.MId;
public class HardwareError extends AppError {
public MId mid;
public CmdId cmdId;
public HardwareError(A8kEcode errorCode, MId mid, CmdId cmdId) {
super(errorCode);
}
}

49
src/main/java/a8k/type/exception/AppException.java

@ -3,52 +3,43 @@ package a8k.type.exception;
import a8k.hardware.type.a8kcanprotocol.A8kEcode;
import a8k.hardware.type.a8kcanprotocol.CmdId;
import a8k.hardware.type.a8kcanprotocol.MId;
import a8k.type.ecode.AppError;
import a8k.type.ecode.HardwareError;
import lombok.Getter;
@Getter
public class AppException extends Exception {
// 构造函数
Integer errorCode;
MId moduleId;
CmdId cmdId;
String extmessage;
public AppError error;
public AppException() {
super();
}
public AppException(MId mid, Integer ecode) {
super(String.format("Module ID %s has error code %s", mid, ecode));
this.errorCode = ecode;
this.moduleId = mid;
this.cmdId = null;
public AppException(A8kEcode ecodeType) {
super(String.format("Error code %s", ecodeType));
this.error = new AppError(ecodeType);
}
public AppException(MId mid, Integer ecode, CmdId cmd) {
super(String.format("Module ID %s has error code %s", mid, ecode));
this.errorCode = ecode;
this.moduleId = mid;
this.cmdId = cmd;
public AppException(AppError error) {
super(String.format("Error code %s", error.code));
this.error = error;
}
public AppException(Integer ecode, String extmessage) {
super(String.format("Error code %s", ecode));
this.errorCode = ecode;
this.moduleId = null;
this.cmdId = null;
this.extmessage = extmessage;
public AppException(A8kEcode errorCode, MId mid, CmdId cmdId) {
super(String.format("Error code %s", errorCode));
this.error = new HardwareError(errorCode, mid, cmdId);
}
public AppException(Integer ecode) {
super(String.format("Error code %s", ecode));
this.errorCode = ecode;
this.moduleId = null;
this.cmdId = null;
public AppException(A8kEcode errorCode, MId mid) {
super(String.format("Error code %s", errorCode));
this.error = new HardwareError(errorCode, mid, null);
}
public Boolean ecodeEq(A8kEcode ecode) {
return this.errorCode.equals(ecode.index);
public static AppException of(HardwareError hardwareError) {
return new AppException(hardwareError);
}
}

5
src/main/java/a8k/utils/ReactionPlate2DCodeParser.java

@ -5,7 +5,6 @@ import a8k.type.exception.AppException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ReactionPlate2DCodeParser {
// 1||CAGGB66U||2024.03.26||1083||06
@ -13,7 +12,7 @@ public class ReactionPlate2DCodeParser {
String[] parts = code.split("\\|\\|");
ReactionPlate2DCode ret = new ReactionPlate2DCode();
if (parts.length != 5) {
throw new AppException(A8kEcode.A8kPlate2DCodeFormatError.index);
throw new AppException(A8kEcode.A8kPlate2DCodeFormatError);
}
ret.projIndex = Integer.parseInt(parts[0]);
ret.lotId = parts[1];
@ -22,7 +21,7 @@ public class ReactionPlate2DCodeParser {
try {
ret.expDate = sdf.parse(parts[2]);
} catch (ParseException e) {
throw new AppException(A8kEcode.A8kPlate2DCodeFormatError.index);
throw new AppException(A8kEcode.A8kPlate2DCodeFormatError);
}
ret.ID0 = Integer.parseInt(parts[3]);
ret.ID1 = Integer.parseInt(parts[4]);

4
src/main/java/a8k/utils/state_machine/AppStateMachine.java

@ -117,8 +117,8 @@ public class AppStateMachine<T> {
try {
currentState.onStateProcess.processer(event);
} catch (AppException e) {
logger.error("Catch Exception: {},stop device", e.getErrorCode());
ebus.pushEvent(new A8kErrorPromptEvent(e.getErrorCode()));
logger.error("Catch Exception: {},stop device", e.error);
ebus.pushEvent(new A8kErrorPromptEvent(e.error));
selfStop();
}

Loading…
Cancel
Save