|
@ -4,6 +4,7 @@ import a8k.OS; |
|
|
import a8k.service.app.appctrl.mainflowctrl.CondtionMgrService; |
|
|
import a8k.service.app.appctrl.mainflowctrl.CondtionMgrService; |
|
|
import a8k.service.app.appctrl.mainflowctrl.ResourceMgrService; |
|
|
import a8k.service.app.appctrl.mainflowctrl.ResourceMgrService; |
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kActionStepType; |
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kActionStepType; |
|
|
|
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kPublicAreaResource; |
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kStepAction; |
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kStepAction; |
|
|
import a8k.service.app.appctrl.mainflowctrl.base.MainFlowProcesser; |
|
|
import a8k.service.app.appctrl.mainflowctrl.base.MainFlowProcesser; |
|
|
import a8k.service.app.appstate.GStateService; |
|
|
import a8k.service.app.appstate.GStateService; |
|
@ -127,6 +128,8 @@ public class SEQ5_PROCESS extends A8kStepAction { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void samplePrepare() throws AppException, ZAppInterruptException { |
|
|
void samplePrepare() throws AppException, ZAppInterruptException { |
|
|
|
|
|
String subResOwner = "samplePrepare"; |
|
|
|
|
|
|
|
|
if (virtualDevice.isEnable()) { |
|
|
if (virtualDevice.isEnable()) { |
|
|
virtualDevice.doVirtualThings("摇匀并取盖", 2); |
|
|
virtualDevice.doVirtualThings("摇匀并取盖", 2); |
|
|
sampleIsReady = true; |
|
|
sampleIsReady = true; |
|
@ -147,9 +150,11 @@ public class SEQ5_PROCESS extends A8kStepAction { |
|
|
logger.info("摇匀次数 :{}", shakeTimes); |
|
|
logger.info("摇匀次数 :{}", shakeTimes); |
|
|
logger.info("试管架类型 :{}", tubeHolder.tubeHolderType); |
|
|
logger.info("试管架类型 :{}", tubeHolder.tubeHolderType); |
|
|
logger.info("是否高位试管:{}", isHighTube); |
|
|
logger.info("是否高位试管:{}", isHighTube); |
|
|
|
|
|
resourceMgrService.applyForResources(this, subResOwner, A8kPublicAreaResource.TubeSampleProcessAndTubeChannelArea); |
|
|
tubePreProcesCtrlService.takeTubeFromTubeholderToShakePos(isHighTube); |
|
|
tubePreProcesCtrlService.takeTubeFromTubeholderToShakePos(isHighTube); |
|
|
tubePreProcesCtrlService.shakeTube(45, shakeTimes); |
|
|
tubePreProcesCtrlService.shakeTube(45, shakeTimes); |
|
|
tubePreProcesCtrlService.takeTubeCap(); |
|
|
tubePreProcesCtrlService.takeTubeCap(); |
|
|
|
|
|
resourceMgrService.releaseAllResource(this, subResOwner); |
|
|
} else { |
|
|
} else { |
|
|
logger.info("不是全血试管,不需要摇匀"); |
|
|
logger.info("不是全血试管,不需要摇匀"); |
|
|
} |
|
|
} |
|
@ -158,11 +163,14 @@ public class SEQ5_PROCESS extends A8kStepAction { |
|
|
waittingForSampleProcessFinished(); |
|
|
waittingForSampleProcessFinished(); |
|
|
|
|
|
|
|
|
//样本后处理 |
|
|
//样本后处理 |
|
|
|
|
|
resourceMgrService.applyForResources(this, subResOwner, A8kPublicAreaResource.TubeSampleProcessAndTubeChannelArea); |
|
|
tubePreProcesCtrlService.resteModule(); |
|
|
tubePreProcesCtrlService.resteModule(); |
|
|
|
|
|
resourceMgrService.releaseAllResource(this, subResOwner); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void paltePrepare() throws AppException, ZAppInterruptException { |
|
|
void paltePrepare() throws AppException, ZAppInterruptException { |
|
|
|
|
|
String subResOwner = "paltePrepare"; |
|
|
// |
|
|
// |
|
|
// VIRTUAL |
|
|
// VIRTUAL |
|
|
// |
|
|
// |
|
@ -181,13 +189,17 @@ public class SEQ5_PROCESS extends A8kStepAction { |
|
|
|
|
|
|
|
|
for (ProjProcessContext cxt : cxts) { |
|
|
for (ProjProcessContext cxt : cxts) { |
|
|
IncubatorPos incubatorPos = cxt.incubatorPos; |
|
|
IncubatorPos incubatorPos = cxt.incubatorPos; |
|
|
|
|
|
resourceMgrService.applyForResources(this, subResOwner, A8kPublicAreaResource.PlateBoxArea, A8kPublicAreaResource.IncubationPlateArea); |
|
|
plateBoxCtrlService.pushPlateQuick(cxt.consumable.getGroup(), incubatorPos); |
|
|
plateBoxCtrlService.pushPlateQuick(cxt.consumable.getGroup(), incubatorPos); |
|
|
|
|
|
resourceMgrService.releaseAllResource(this, subResOwner); |
|
|
} |
|
|
} |
|
|
reactionPlateReady = true; |
|
|
reactionPlateReady = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void sampleProcess() throws AppException, ZAppInterruptException { |
|
|
void sampleProcess() throws AppException, ZAppInterruptException { |
|
|
|
|
|
String subResOwner = "sampleProcess"; |
|
|
|
|
|
|
|
|
if (virtualDevice.isEnable()) { |
|
|
if (virtualDevice.isEnable()) { |
|
|
virtualDevice.doVirtualThings("准备Hbot Tip", 2); |
|
|
virtualDevice.doVirtualThings("准备Hbot Tip", 2); |
|
|
waittingForSampleIsReady(); |
|
|
waittingForSampleIsReady(); |
|
@ -199,22 +211,26 @@ public class SEQ5_PROCESS extends A8kStepAction { |
|
|
List<ProjProcessContext> cxts = projectProcessContextMgrService.getTubeAssociatedProjContext(gstate.getCurProcessingTube().getSampleId()); |
|
|
List<ProjProcessContext> cxts = projectProcessContextMgrService.getTubeAssociatedProjContext(gstate.getCurProcessingTube().getSampleId()); |
|
|
Assert.isTrue(!cxts.isEmpty(), "项目上下文不能为空"); |
|
|
Assert.isTrue(!cxts.isEmpty(), "项目上下文不能为空"); |
|
|
|
|
|
|
|
|
|
|
|
resourceMgrService.applyForResources(this, subResOwner, A8kPublicAreaResource.HbotArea); |
|
|
|
|
|
|
|
|
for (ProjProcessContext cxt : cxts) { |
|
|
for (ProjProcessContext cxt : cxts) { |
|
|
deviceCtrlScripter.doSampleProcessPrepare(cxt); |
|
|
deviceCtrlScripter.doSampleProcessPrepare(cxt); |
|
|
waittingForSampleIsReady(); |
|
|
waittingForSampleIsReady(); |
|
|
deviceCtrlScripter.doSampleProcess(cxt); |
|
|
deviceCtrlScripter.doSampleProcess(cxt); |
|
|
|
|
|
waittingForReactionPlateReady(); |
|
|
|
|
|
resourceMgrService.applyForResources(this, subResOwner, A8kPublicAreaResource.IncubationPlateArea); |
|
|
deviceCtrlScripter.doSampleProcessPostProcess(cxt); |
|
|
deviceCtrlScripter.doSampleProcessPostProcess(cxt); |
|
|
|
|
|
resourceMgrService.releaseResource(A8kPublicAreaResource.IncubationPlateArea); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
sampleProcessFinished = true; |
|
|
sampleProcessFinished = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public Boolean isReady() { |
|
|
public Boolean isReady() { |
|
|
return true; |
|
|
|
|
|
|
|
|
return cms.isTimeToProcessTube(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void beforeDoAction() { |
|
|
public void beforeDoAction() { |
|
|
reactionPlateReady = false; |
|
|
reactionPlateReady = false; |
|
|
sampleIsReady = false; |
|
|
sampleIsReady = false; |
|
@ -243,37 +259,46 @@ public class SEQ5_PROCESS extends A8kStepAction { |
|
|
|
|
|
|
|
|
@Override public List<AppError> doAction() { |
|
|
@Override public List<AppError> doAction() { |
|
|
var future1 = executor.submit(() -> { |
|
|
var future1 = executor.submit(() -> { |
|
|
|
|
|
AppError error = null; |
|
|
try { |
|
|
try { |
|
|
sampleProcess(); |
|
|
sampleProcess(); |
|
|
} catch (AppException e) { |
|
|
} catch (AppException e) { |
|
|
logger.error("error", e); |
|
|
logger.error("error", e); |
|
|
errorFlag = true; |
|
|
errorFlag = true; |
|
|
return e.error; |
|
|
|
|
|
|
|
|
error = e.error; |
|
|
} catch (ZAppInterruptException ignored) { |
|
|
} catch (ZAppInterruptException ignored) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return null; |
|
|
|
|
|
|
|
|
resourceMgrService.releaseAllResource(this, "sampleProcess"); |
|
|
|
|
|
return error; |
|
|
}); |
|
|
}); |
|
|
var future2 = executor.submit(() -> { |
|
|
var future2 = executor.submit(() -> { |
|
|
|
|
|
AppError error = null; |
|
|
try { |
|
|
try { |
|
|
paltePrepare(); |
|
|
paltePrepare(); |
|
|
} catch (AppException e) { |
|
|
} catch (AppException e) { |
|
|
logger.error("error", e); |
|
|
logger.error("error", e); |
|
|
errorFlag = true; |
|
|
errorFlag = true; |
|
|
return e.error; |
|
|
|
|
|
|
|
|
error = e.error; |
|
|
|
|
|
|
|
|
} catch (ZAppInterruptException ignored) { |
|
|
} catch (ZAppInterruptException ignored) { |
|
|
} |
|
|
} |
|
|
return null; |
|
|
|
|
|
|
|
|
resourceMgrService.releaseAllResource(this, "paltePrepare"); |
|
|
|
|
|
return error; |
|
|
}); |
|
|
}); |
|
|
var future3 = executor.submit(() -> { |
|
|
var future3 = executor.submit(() -> { |
|
|
|
|
|
AppError error = null; |
|
|
try { |
|
|
try { |
|
|
samplePrepare(); |
|
|
samplePrepare(); |
|
|
} catch (AppException e) { |
|
|
} catch (AppException e) { |
|
|
logger.error("error", e); |
|
|
logger.error("error", e); |
|
|
errorFlag = true; |
|
|
errorFlag = true; |
|
|
return e.error; |
|
|
|
|
|
|
|
|
error = e.error; |
|
|
|
|
|
|
|
|
} catch (ZAppInterruptException ignored) { |
|
|
} catch (ZAppInterruptException ignored) { |
|
|
} |
|
|
} |
|
|
return null; |
|
|
|
|
|
|
|
|
resourceMgrService.releaseAllResource(this, "samplePrepare"); |
|
|
|
|
|
return error; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
futures.add(future1); |
|
|
futures.add(future1); |
|
|