|
|
@ -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 { |
|
|
|