|
|
@ -154,17 +154,23 @@ public class SamplePreProcessModule { |
|
|
|
// 预定孵育盘位置 |
|
|
|
for (var cxt : tube.getPreProcessContexts()) { |
|
|
|
//预定孵育盘位置 |
|
|
|
cxt.incubatorPos = incubationPlateStateMgr.takeOneIncubationIDLEPos((IncubatorPos pos) -> |
|
|
|
incubationPlateStateMgr.syncCxtInfo(pos, cxt.sampleInfo, cxt.projBuildinInfo, cxt.projExtInfoCard, cxt.consumableInfo) |
|
|
|
var incubatorPos = incubationPlateStateMgr.takeOneIncubationIDLEPos((IncubatorPos pos) -> |
|
|
|
incubationPlateStateMgr.syncCxtInfo(pos, cxt.getSampleInfo(), cxt.getProjBuildinInfo(), cxt.getProjExtInfoCard(), cxt.getConsumableInfo()) |
|
|
|
); |
|
|
|
//使用耗材 |
|
|
|
consumablesMgrService.useReserveConsumable(cxt.consumableInfo); |
|
|
|
tubeStateMgrService.setTubeCxtIncubationPos(cxt,incubatorPos); |
|
|
|
consumablesMgrService.useReserveConsumable(cxt.getConsumableInfo()); |
|
|
|
} |
|
|
|
tubeStateMgrService.changeTubeStateToResourceIsReady(); |
|
|
|
|
|
|
|
|
|
|
|
startTask(); |
|
|
|
actionTaskPool.waitAllDone(); |
|
|
|
if (actionTaskPool.isHasError()) { |
|
|
|
sampleProcessRollback(); |
|
|
|
samplePrepareRollback(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AppError samplePrepareAppError = actionTaskPool.getError(TaskLine.SamplePrepare); |
|
|
|
if (samplePrepareAppError != null && A8kEcodeAnalyzer.isFatalError(samplePrepareAppError)) { |
|
|
|
throw AppException.of(samplePrepareAppError); |
|
|
@ -177,8 +183,6 @@ public class SamplePreProcessModule { |
|
|
|
|
|
|
|
if (samplePrepareAppError != null || sampleProcessAppError != null) { |
|
|
|
//发生错误,进行回滚 |
|
|
|
sampleProcessRollback(); |
|
|
|
samplePrepareRollback(); |
|
|
|
tubeStateMgrService.changeTubeStateToError(samplePrepareAppError, sampleProcessAppError); |
|
|
|
} else { |
|
|
|
// 样本处理完成 |
|
|
@ -190,6 +194,7 @@ public class SamplePreProcessModule { |
|
|
|
|
|
|
|
void startTask() { |
|
|
|
actionTaskPool.resetState(); |
|
|
|
|
|
|
|
actionTaskPool.pushTask(TaskLine.SamplePrepare, () -> { |
|
|
|
Tube tube = tubeStateMgrService.getCurProcessingTube(); |
|
|
|
TubeHolder tubeHolder = tubeStateMgrService.getTubeHolder(); |
|
|
@ -233,34 +238,38 @@ public class SamplePreProcessModule { |
|
|
|
List<ProjectPreProcessContext> cxts = tube.getPreProcessContexts(); |
|
|
|
|
|
|
|
//! 等待样本准备完成 |
|
|
|
sampleIsReadyCondition.waitTrue(); |
|
|
|
|
|
|
|
for (ProjectPreProcessContext cxt : cxts) { |
|
|
|
|
|
|
|
Assert.isTrue(cxt.getIncubatorPos() != null, "cxt.incubatorPos != null"); |
|
|
|
|
|
|
|
boolean finalCxt = cxt.equals(cxts.getLast()); |
|
|
|
PreReactionPos preReactionPos = ProjectParamUtils.getPreReactionPos(tubeHolder, tube, cxt); |
|
|
|
A8kReactionFlowType reactionFlowType = cxt.projBuildinInfo.reactionFlowType; |
|
|
|
A8kReactionFlowType reactionFlowType = cxt.getProjBuildinInfo().reactionFlowType; |
|
|
|
A8kSamplePos samplePos = ProjectParamUtils.getSamplePos(tubeHolder, tube); |
|
|
|
Integer sampleVol = ProjectParamUtils.getSampleUl(cxt); |
|
|
|
|
|
|
|
liquidOperationCtrService.setProjContext(cxt.projBuildinInfo, cxt.projExtInfoCard); |
|
|
|
liquidOperationCtrService.setProjContext(cxt.getProjBuildinInfo(), cxt.getProjExtInfoCard()); |
|
|
|
|
|
|
|
|
|
|
|
//预处理 |
|
|
|
if (reactionFlowType.equals(A8kReactionFlowType.SampleAndBSAndProbeSubstance)) { |
|
|
|
UISender.txInfoMsg(log, "取大瓶缓冲液到探测物质中"); |
|
|
|
LargeBufferPos largeBufferPos = LargeBufferPos.of(cxt.consumableInfo.group); |
|
|
|
Integer largeBSVolume = cxt.projBuildinInfo.bigBufferSampleUl; |
|
|
|
LargeBufferPos largeBufferPos = LargeBufferPos.of(cxt.getConsumableInfo().group); |
|
|
|
Integer largeBSVolume = cxt.getProjBuildinInfo().bigBufferSampleUl; |
|
|
|
Assert.notNull(largeBufferPos, "largeBufferPos != null"); |
|
|
|
docmd("取大瓶缓冲液", () -> { |
|
|
|
liquidOperationCtrService.takeLargeBottleBufferLiquidToProbeSubstance(largeBufferPos, preReactionPos, largeBSVolume); |
|
|
|
}); |
|
|
|
|
|
|
|
} else if (reactionFlowType.equals(A8kReactionFlowType.SampleAndBS)) { |
|
|
|
docmd("刺破小瓶缓冲液", () -> liquidOperationCtrService.pirceLittleBuffer(preReactionPos)); |
|
|
|
} |
|
|
|
|
|
|
|
sampleIsReadyCondition.waitTrue(); |
|
|
|
|
|
|
|
//取样本到小缓冲瓶或者探测物质 |
|
|
|
if (reactionFlowType.equals(A8kReactionFlowType.SampleAndBS)) { |
|
|
|
docmd("刺破小瓶缓冲液", () -> liquidOperationCtrService.pirceLittleBuffer(preReactionPos)); |
|
|
|
UISender.txInfoMsg(log, "取样"); |
|
|
|
docmd("取样", () -> liquidOperationCtrService.takeSampleToPreReactionPos(samplePos, preReactionPos, sampleVol)); |
|
|
|
} else if (reactionFlowType.equals(A8kReactionFlowType.SampleAndBSAndProbeSubstance)) { |
|
|
@ -274,9 +283,9 @@ public class SamplePreProcessModule { |
|
|
|
liquidOperationCtrService.takePreReactionLiquid(preReactionPos); |
|
|
|
//开始孵育 |
|
|
|
UISender.txInfoMsg(log, "开始孵育"); |
|
|
|
Integer incubatedTimeSec = cxt.projBuildinInfo.reactionPlateIncubationTimeMin * 60; |
|
|
|
Integer incubatedTimeSec = cxt.getProjBuildinInfo().reactionPlateIncubationTimeMin * 60; |
|
|
|
incubationPlateCtrlModule.dropLiquidAndStartIncubating( |
|
|
|
cxt.incubatorPos, |
|
|
|
cxt.getIncubatorPos(), |
|
|
|
() -> docmd("取反应液到孵育盘", liquidOperationCtrService::dropLiquidToReactionPlate), |
|
|
|
incubatedTimeSec |
|
|
|
); |
|
|
|