|
@ -35,7 +35,7 @@ public class DeviceInitializationCtrlService { |
|
|
|
|
|
|
|
|
@PostMapping("/api/DeviceInitializationCtrlService/initializeDevice") |
|
|
@PostMapping("/api/DeviceInitializationCtrlService/initializeDevice") |
|
|
@ResponseBody |
|
|
@ResponseBody |
|
|
public AppRet initializeDevice() { |
|
|
|
|
|
|
|
|
public AppRet initializeDevice() throws HardwareException, InterruptedException { |
|
|
logger.info("Initializing device ..."); |
|
|
logger.info("Initializing device ..."); |
|
|
boolean initSuc = false; |
|
|
boolean initSuc = false; |
|
|
try { |
|
|
try { |
|
@ -71,15 +71,9 @@ public class DeviceInitializationCtrlService { |
|
|
// 清空耗材 |
|
|
// 清空耗材 |
|
|
|
|
|
|
|
|
initSuc = true; |
|
|
initSuc = true; |
|
|
// throw new RuntimeException("test"); |
|
|
|
|
|
|
|
|
// throw new RuntimeException("test"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (HardwareException e) { |
|
|
|
|
|
logger.error("HardwareException ", e); |
|
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
|
logger.error("InterruptedException", e); |
|
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
if (!initSuc) { |
|
|
if (!initSuc) { |
|
|
try { |
|
|
try { |
|
@ -121,6 +115,7 @@ public class DeviceInitializationCtrlService { |
|
|
//试管平移通道是否有障碍 |
|
|
//试管平移通道是否有障碍 |
|
|
if (canBus.getIOState(IOId.THChInterPPS) || canBus.getIOState(IOId.THChOuterPPS)) { |
|
|
if (canBus.getIOState(IOId.THChInterPPS) || canBus.getIOState(IOId.THChOuterPPS)) { |
|
|
logger.warn("THChInterPPS or THChOuterPPS is trigger"); |
|
|
logger.warn("THChInterPPS or THChOuterPPS is trigger"); |
|
|
|
|
|
// throw new HardwareException(MId.A8kIdCardReaderBoard, A8kEcode.PlateStuckDetectorSensorTrigger); |
|
|
return AppRet.fail(A8kEcode.PlateStuckDetectorSensorTrigger); |
|
|
return AppRet.fail(A8kEcode.PlateStuckDetectorSensorTrigger); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|