Browse Source

update

master
zhaohe 2 months ago
parent
commit
8fd28ba4bf
  1. 100
      src/main/java/a8k/app/service/mainctrl/AppDeviceInitCtrlService.java
  2. 3
      src/main/java/a8k/app/service/statemgr/GStateMgrService.java

100
src/main/java/a8k/app/service/mainctrl/AppDeviceInitCtrlService.java

@ -136,19 +136,6 @@ public class AppDeviceInitCtrlService {
/**
* 设备初始化(同步操作)
* @return 设备自检结果
* @throws AppException e
*/
synchronized public List<CheckResult> initDevice() throws AppException {
try {
return doDeviceMoveToZero();
} catch (AppException e) {
throw e;
}
}
/**
* 设备初始化(异步操作)
* @throws AppException e
*/
@ -186,7 +173,7 @@ public class AppDeviceInitCtrlService {
state.passed = false;
state.deviceInited = false;
if (e.getError().code.equals(A8kEcode.APPE_DEVICE_INIT_CHECK_FAIL)) {
state.promopt = buildAppPromopt(checkResults);
state.promopt = buildAppPrompt(checkResults);
} else {
state.promopt = ZAppPromoptFactory.buildAppPromopt(e);
}
@ -197,6 +184,16 @@ public class AppDeviceInitCtrlService {
workThread.start();
}
/**
* 设备初始化(同步操作)
* @return 设备自检结果
* @throws AppException e
*/
synchronized public List<CheckResult> initDevice() throws AppException {
return doDeviceMoveToZero();
}
//******************************************************************************************
// PRIVATE
//******************************************************************************************
@ -220,6 +217,41 @@ public class AppDeviceInitCtrlService {
}
private List<CheckResult> doDeviceMoveToZero() throws AppException {
List<CheckResult> results = checkBeforeInitDevice();
if (virtualDevice.isEnable()) {
virtualDevice.doVirtualThings("初始化设备");
gstate.setDeviceInited(true);
return results;
}
for (CheckResult result : results) {
if (!result.pass) {
log.info("设备初始化失败: check {} fail", result.info);
// doSomeThingWhenError();
return results;
}
}
moveAllMotorToZero();
//弹出试管架
tubeFeedingCtrlService.ejectTubeHolder();
tubeFeedingCtrlService.moveTubeRackMoveToEnterPos();
//初始化tip
hbotMoveExCtrlService.moveToDropTipXYPos();
pipetteCtrlDriverV2.zMotorMoveToTipDepositBlock();
pipetteCtrlDriverV2.initPumpDeviceBlock();
//hbot快速归零
hbotMoveExCtrlService.moveQuickToZero();
gstate.setDeviceInited(true);
gstate.clearFatalError();
return results;
}
private void moveAllMotorToZero() throws AppException {
moduleEnableCtrlDriver.enableAllMotor();
try {
@ -273,44 +305,7 @@ public class AppDeviceInitCtrlService {
}//HBot初始化
}
private List<CheckResult> doDeviceMoveToZero() throws AppException {
List<CheckResult> results = checkBeforeInitDevice();
if (virtualDevice.isEnable()) {
virtualDevice.doVirtualThings("初始化设备");
gstate.setDeviceInited(true);
return results;
}
for (CheckResult result : results) {
if (!result.pass) {
log.info("设备初始化失败: check {} fail", result.info);
// doSomeThingWhenError();
return results;
}
}
moveAllMotorToZero();
//弹出试管架
tubeFeedingCtrlService.ejectTubeHolder();
tubeFeedingCtrlService.moveTubeRackMoveToEnterPos();
//初始化tip
hbotMoveExCtrlService.moveToDropTipXYPos();
pipetteCtrlDriverV2.zMotorMoveToTipDepositBlock();
pipetteCtrlDriverV2.initPumpDeviceBlock();
//hbot快速归零
hbotMoveExCtrlService.moveQuickToZero();
gstate.setDeviceInited(true);
gstate.clearFatalError();
return results;
}
private static ZAppPromopt buildAppPromopt(List<CheckResult> checkResults) {
private static ZAppPromopt buildAppPrompt(List<CheckResult> checkResults) {
List<ZAppPromoptFormsItem> detailInfos = new ArrayList<>();
for (CheckResult checkResult : checkResults) {
@ -330,7 +325,6 @@ public class AppDeviceInitCtrlService {
result.type = checkPoint.type;
result.info = checkPoint.typechinfo;
//
if (virtualDevice.isEnable()) {
result.pass = true;
} else {

3
src/main/java/a8k/app/service/statemgr/GStateMgrService.java

@ -59,9 +59,6 @@ public class GStateMgrService {
this.gState.deviceRunMode = deviceRunMode;
}
// public String appVersion = AppConstant.APP_VERSION;
// public String mcuVersion = "NOTSET";
// public String sn = "SN25010001";//25年第一个月第一台设备后续改成通过10板的单片机获取
public synchronized String getAppVersion() {
return this.gState.appVersion;

Loading…
Cancel
Save