|
|
@ -1,101 +1,101 @@ |
|
|
|
package a8k.app.service.mainctrl.mainflowctrl.action; |
|
|
|
|
|
|
|
import a8k.app.hardware.type.a8kcanprotocol.A8kEcode; |
|
|
|
import a8k.app.service.mainctrl.mainflowctrl.base.A8kActionTask; |
|
|
|
import a8k.app.service.mainctrl.mainflowctrl.base.MainFlowProcesser; |
|
|
|
import a8k.app.service.statemgr.DeviceWorkStateMgrService; |
|
|
|
import a8k.app.service.statemgr.TubeStateMgrService; |
|
|
|
import a8k.app.a8ktype.state.Tube; |
|
|
|
import a8k.app.a8ktype.state.enumtype.TubeState; |
|
|
|
import a8k.app.service.lowerctrl.HbotMoveExCtrlService; |
|
|
|
import a8k.app.service.lowerctrl.TubePreProcesModuleExCtrlService; |
|
|
|
import a8k.app.service.mainctrl.erroranalyzer.ErrorProcessor; |
|
|
|
import a8k.app.utils.ZList; |
|
|
|
import a8k.teststate.VirtualDevice; |
|
|
|
import a8k.app.a8ktype.error.AppError; |
|
|
|
import a8k.app.a8ktype.exception.AppException; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 异常试管处理任务 |
|
|
|
*/ |
|
|
|
|
|
|
|
@Component |
|
|
|
@MainFlowProcesser |
|
|
|
@Slf4j |
|
|
|
public class AC42FinishProcesseTube extends A8kActionTask { |
|
|
|
|
|
|
|
@Resource |
|
|
|
VirtualDevice virtualDevice; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
TubePreProcesModuleExCtrlService tubePreProcesCtrlService; |
|
|
|
@Resource |
|
|
|
HbotMoveExCtrlService hbotMoveExCtrlService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
TubeStateMgrService tubeStateMgrService; |
|
|
|
@Resource |
|
|
|
DeviceWorkStateMgrService deviceWorkStateMgrService; |
|
|
|
|
|
|
|
|
|
|
|
public Boolean isReady() { |
|
|
|
Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
return tube != null |
|
|
|
&& tube.getState().equals(TubeState.PROCESSED) |
|
|
|
; |
|
|
|
} |
|
|
|
|
|
|
|
public String toDisplayString() { |
|
|
|
return "样本后处理"; |
|
|
|
} |
|
|
|
|
|
|
|
void resetHbotAndShakeModule() throws AppException { |
|
|
|
if (virtualDevice.isEnable()) { |
|
|
|
virtualDevice.doVirtualThings("处理错误试管"); |
|
|
|
virtualDevice.doVirtualThings("复位摇匀模组"); |
|
|
|
virtualDevice.doVirtualThings("复位HBOT"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//复位hbot |
|
|
|
if (hbotMoveExCtrlService.isHasTip()) { |
|
|
|
hbotMoveExCtrlService.dropTip(); |
|
|
|
hbotMoveExCtrlService.moveQuickToZero(); |
|
|
|
} |
|
|
|
|
|
|
|
//复位预处理模块 |
|
|
|
tubePreProcesCtrlService.resteModule(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override public List<AppError> doAction() { |
|
|
|
try { |
|
|
|
Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
Assert.isTrue(tube != null, "tube != null"); |
|
|
|
//如果试管状态为ERROR,则复位hbot和预处理模块 |
|
|
|
if (tube.getState().equals(TubeState.ERROR)) { |
|
|
|
resetHbotAndShakeModule(); |
|
|
|
} |
|
|
|
} catch (AppException e) { |
|
|
|
log.error("catch error {}", e.getMessage(), e); |
|
|
|
return ZList.of(e.getError()); |
|
|
|
} |
|
|
|
Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
if (ErrorProcessor.isContainError(tube.getErrors(), A8kEcode.APPE_TAKE_TIP_FAIL)) { |
|
|
|
deviceWorkStateMgrService.setPauseActionPending(true); |
|
|
|
} |
|
|
|
|
|
|
|
tubeStateMgrService.changeTubeStateToProcessComplete(); |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
//package a8k.app.service.mainctrl.mainflowctrl.action; |
|
|
|
// |
|
|
|
//import a8k.app.hardware.type.a8kcanprotocol.A8kEcode; |
|
|
|
//import a8k.app.service.mainctrl.mainflowctrl.base.A8kActionTask; |
|
|
|
//import a8k.app.service.mainctrl.mainflowctrl.base.MainFlowProcesser; |
|
|
|
//import a8k.app.service.statemgr.DeviceWorkStateMgrService; |
|
|
|
//import a8k.app.service.statemgr.TubeStateMgrService; |
|
|
|
//import a8k.app.a8ktype.state.Tube; |
|
|
|
//import a8k.app.a8ktype.state.enumtype.TubeState; |
|
|
|
//import a8k.app.service.lowerctrl.HbotMoveExCtrlService; |
|
|
|
//import a8k.app.service.lowerctrl.TubePreProcesModuleExCtrlService; |
|
|
|
//import a8k.app.service.mainctrl.erroranalyzer.ErrorProcessor; |
|
|
|
//import a8k.app.utils.ZList; |
|
|
|
//import a8k.teststate.VirtualDevice; |
|
|
|
//import a8k.app.a8ktype.error.AppError; |
|
|
|
//import a8k.app.a8ktype.exception.AppException; |
|
|
|
//import jakarta.annotation.Resource; |
|
|
|
//import lombok.extern.slf4j.Slf4j; |
|
|
|
//import org.springframework.stereotype.Component; |
|
|
|
//import org.springframework.util.Assert; |
|
|
|
// |
|
|
|
//import java.util.ArrayList; |
|
|
|
//import java.util.List; |
|
|
|
// |
|
|
|
// |
|
|
|
///** |
|
|
|
// * 异常试管处理任务 |
|
|
|
// */ |
|
|
|
// |
|
|
|
//@Component |
|
|
|
//@MainFlowProcesser |
|
|
|
//@Slf4j |
|
|
|
//public class AC42FinishProcesseTube extends A8kActionTask { |
|
|
|
// |
|
|
|
// @Resource |
|
|
|
// VirtualDevice virtualDevice; |
|
|
|
// |
|
|
|
// |
|
|
|
// @Resource |
|
|
|
// TubePreProcesModuleExCtrlService tubePreProcesCtrlService; |
|
|
|
// @Resource |
|
|
|
// HbotMoveExCtrlService hbotMoveExCtrlService; |
|
|
|
// |
|
|
|
// @Resource |
|
|
|
// TubeStateMgrService tubeStateMgrService; |
|
|
|
// @Resource |
|
|
|
// DeviceWorkStateMgrService deviceWorkStateMgrService; |
|
|
|
// |
|
|
|
// |
|
|
|
// public Boolean isReady() { |
|
|
|
// Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
// return tube != null |
|
|
|
// && tube.getState().equals(TubeState.PROCESSED) |
|
|
|
// ; |
|
|
|
// } |
|
|
|
// |
|
|
|
// public String toDisplayString() { |
|
|
|
// return "样本后处理"; |
|
|
|
// } |
|
|
|
// |
|
|
|
// void resetHbotAndShakeModule() throws AppException { |
|
|
|
// if (virtualDevice.isEnable()) { |
|
|
|
// virtualDevice.doVirtualThings("处理错误试管"); |
|
|
|
// virtualDevice.doVirtualThings("复位摇匀模组"); |
|
|
|
// virtualDevice.doVirtualThings("复位HBOT"); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// |
|
|
|
// //复位hbot |
|
|
|
// if (hbotMoveExCtrlService.isHasTip()) { |
|
|
|
// hbotMoveExCtrlService.dropTip(); |
|
|
|
// hbotMoveExCtrlService.moveQuickToZero(); |
|
|
|
// } |
|
|
|
// |
|
|
|
// //复位预处理模块 |
|
|
|
// tubePreProcesCtrlService.resteModule(); |
|
|
|
// } |
|
|
|
// |
|
|
|
// @Override public List<AppError> doAction() { |
|
|
|
// try { |
|
|
|
// Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
// Assert.isTrue(tube != null, "tube != null"); |
|
|
|
// //如果试管状态为ERROR,则复位hbot和预处理模块 |
|
|
|
// if (tube.getState().equals(TubeState.ERROR)) { |
|
|
|
// resetHbotAndShakeModule(); |
|
|
|
// } |
|
|
|
// } catch (AppException e) { |
|
|
|
// log.error("catch error {}", e.getMessage(), e); |
|
|
|
// return ZList.of(e.getError()); |
|
|
|
// } |
|
|
|
// Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
// if (ErrorProcessor.isContainError(tube.getErrors(), A8kEcode.APPE_TAKE_TIP_FAIL)) { |
|
|
|
// deviceWorkStateMgrService.setPauseActionPending(true); |
|
|
|
// } |
|
|
|
// |
|
|
|
// tubeStateMgrService.changeTubeStateToProcessComplete(); |
|
|
|
// return new ArrayList<>(); |
|
|
|
// } |
|
|
|
// |
|
|
|
// |
|
|
|
//} |