10 changed files with 337 additions and 317 deletions
-
190src/main/java/a8k/service/app/appctrl/mainflowctrl/action/SEQ5_PROCESS.java
-
6src/main/java/a8k/service/app/appstate/type/ProjectTaskContext.java
-
12src/main/java/a8k/service/app/devicectrl/ctrlservice/DeviceInitCtrlService.java
-
26src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java
-
6src/main/java/a8k/service/app/devicectrl/param/calibration/HbotLargeBottleBSPosCalibration.java
-
4src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/HbotConsumableParamMgr.java
-
4src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotLittleBSPosMgr.java
-
274src/main/java/a8k/service/app/devicectrl/script/DeviceCtrlScripter.java
-
110src/main/java/a8k/service/app/devicectrl/script/PipeGunCtrlScripter.java
-
4src/main/java/a8k/utils/ProjProcessContextUtils.java
@ -1,274 +0,0 @@ |
|||
package a8k.service.app.devicectrl.script; |
|||
|
|||
import a8k.service.app.appstate.type.ProjectTaskContext; |
|||
import a8k.service.app.devicectrl.ctrlservice.HbotCtrlService; |
|||
import a8k.service.app.devicectrl.ctrlservice.OptScanModuleCtrlService; |
|||
import a8k.service.app.devicectrl.ctrlservice.TurnableMoveCtrlService; |
|||
import a8k.service.app.devicectrl.driver.PipetteCtrlDriver; |
|||
import a8k.service.app.devicectrl.exdriver.HbotBaseMoveExDriver; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.HbotConsumableParamMgr; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.base.PipetteGunBindActionType; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.base.LLDParamPack; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.PipetteGunParamExMgr; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.base.LLFParamPack; |
|||
import a8k.service.app.devicectrl.param.param_mgr.HbotFixedPosParamMgr; |
|||
import a8k.service.app.devicectrl.param.param_mgr.HbotSamplePosParamMgr; |
|||
import a8k.service.app.devicectrl.param.type.A8kSamplePos; |
|||
import a8k.service.dao.type.a8kidcard.zenum.A8kReactionFlowType; |
|||
import a8k.type.cfg.Pos3d; |
|||
import a8k.type.exception.AppException; |
|||
import a8k.type.pos.Consumable; |
|||
import a8k.type.pos.TipPos; |
|||
import a8k.utils.ProjProcessContextUtils; |
|||
import a8k.utils.ZAppChecker; |
|||
import jakarta.annotation.Resource; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.util.Assert; |
|||
|
|||
@Component |
|||
@Slf4j |
|||
public class DeviceCtrlScripter { |
|||
|
|||
|
|||
@Resource |
|||
PipetteCtrlDriver pipetteCtrlDriver; |
|||
@Resource |
|||
HbotBaseMoveExDriver hbotBaseMoveExDriver; |
|||
@Resource |
|||
HbotCtrlService hbotCtrlService; |
|||
@Resource |
|||
TurnableMoveCtrlService turnableMoveCtrlService; |
|||
|
|||
@Resource |
|||
HbotSamplePosParamMgr hbotSamplePosParamMgr; |
|||
@Resource |
|||
HbotConsumableParamMgr hbotConsumableParamMgr; |
|||
@Resource |
|||
HbotFixedPosParamMgr hbotFixedPosParamMgr; |
|||
@Resource |
|||
PipetteGunParamExMgr pipetteGunParamExMgr; |
|||
|
|||
@Resource |
|||
ZAppChecker zAppChecker; |
|||
|
|||
|
|||
@Resource |
|||
OptScanModuleCtrlService optScanModuleCtrlService; |
|||
|
|||
|
|||
public void dropAllPlates() throws AppException { |
|||
log.info("清空孵育盘"); |
|||
//TODO:测试模式下不执行 |
|||
// actionReactor.dosome("丢板", () -> optScanModuleCtrlService.dropPlate()); |
|||
// for (var incubatorPos : IncubatorPos.values()) { |
|||
// actionReactor.dosome("拉板" + incubatorPos.name(), () -> optScanModuleCtrlService.pullPlate(incubatorPos)); |
|||
// actionReactor.dosome("丢板", () -> optScanModuleCtrlService.dropPlate()); |
|||
// } |
|||
} |
|||
|
|||
|
|||
void aspirateNoLLF(Integer ul) throws AppException { |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(0); |
|||
pipetteCtrlDriver.aspirateBlock(ul); |
|||
} |
|||
|
|||
void distributeNoLLF(Integer ul) throws AppException { |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(0); |
|||
pipetteCtrlDriver.aspirateBlock(-ul); |
|||
} |
|||
|
|||
|
|||
void distribute(PipetteGunBindActionType actionType, ProjectTaskContext ctx, Integer ul) throws AppException { |
|||
LLFParamPack llfParamPack = pipetteGunParamExMgr.getLLFParam(actionType, ctx); |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(llfParamPack.llfVel); |
|||
pipetteCtrlDriver.setLlfStartZ(llfParamPack.llfStartPos); |
|||
pipetteCtrlDriver.setLlfEndZ(llfParamPack.llfEndPos); |
|||
pipetteCtrlDriver.aspirateBlock(-ul); |
|||
} |
|||
|
|||
void mix(PipetteGunBindActionType actionType, ProjectTaskContext ctx, Integer ul, Integer times) throws AppException { |
|||
LLFParamPack llfParamPack = pipetteGunParamExMgr.getLLFParam(actionType, ctx); |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(llfParamPack.llfVel); |
|||
pipetteCtrlDriver.setLlfStartZ(llfParamPack.llfStartPos); |
|||
pipetteCtrlDriver.setLlfEndZ(llfParamPack.llfEndPos); |
|||
pipetteCtrlDriver.shakeUpBlock(ul, times); |
|||
} |
|||
|
|||
|
|||
void aspirate(PipetteGunBindActionType actionType, ProjectTaskContext ctx, Integer ul) throws AppException { |
|||
LLFParamPack llfParamPack = pipetteGunParamExMgr.getLLFParam(actionType, ctx); |
|||
log.info("吸液 {} , llfvel {} , llfStartPos {} , llfEndPos {}", ul, llfParamPack.llfVel, llfParamPack.llfStartPos, llfParamPack.llfEndPos); |
|||
|
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(llfParamPack.llfVel); |
|||
pipetteCtrlDriver.setLlfStartZ(llfParamPack.llfStartPos); |
|||
pipetteCtrlDriver.setLlfEndZ(llfParamPack.llfEndPos); |
|||
pipetteCtrlDriver.aspirateBlock(ul); |
|||
} |
|||
|
|||
|
|||
void lld(PipetteGunBindActionType actionType, ProjectTaskContext ctx) throws AppException { |
|||
pipetteCtrlDriver.lldPrepareBlock(); |
|||
|
|||
log.info("液面探测 {}", actionType); |
|||
LLDParamPack lldparm = pipetteGunParamExMgr.getLLDParam(actionType, ctx); |
|||
Pos3d sampleStartPos = null; |
|||
Pos3d sampleEndPos = null; |
|||
|
|||
//取tip,移动到样本所在的位置,并液面探测 |
|||
switch (actionType) { |
|||
case SAMPLE -> { |
|||
A8kSamplePos samplePos = ProjProcessContextUtils.getSamplePos(ctx); |
|||
sampleStartPos = hbotSamplePosParamMgr.getSampleStartPos(samplePos); |
|||
sampleEndPos = hbotSamplePosParamMgr.getSampleEndPos(samplePos); |
|||
} |
|||
case TAKE_LARGE_BUFFER_SOLUTION -> { //取大瓶缓冲液 |
|||
var group = ctx.getConsumable().getGroup(); |
|||
sampleStartPos = hbotConsumableParamMgr.getLargeBufferSamplePos(group); |
|||
sampleEndPos = hbotConsumableParamMgr.getLargeBufferSamplePosEnd(group); |
|||
} |
|||
} |
|||
|
|||
Assert.notNull(sampleStartPos, "sampleStartPos is null"); |
|||
Assert.notNull(sampleEndPos, "sampleEndPos is null"); |
|||
|
|||
pipetteCtrlDriver.setStartZ(sampleStartPos.z); |
|||
pipetteCtrlDriver.setEndZ(sampleEndPos.z); |
|||
pipetteCtrlDriver.setLldType(lldparm.type); |
|||
pipetteCtrlDriver.setLldCThreshold(lldparm.cThreshold); |
|||
pipetteCtrlDriver.setLldPThreshold(lldparm.pThreshold); |
|||
pipetteCtrlDriver.lldBlock(); |
|||
} |
|||
|
|||
|
|||
public void doSampleProcessPrepare(ProjectTaskContext ctx) throws AppException { |
|||
A8kReactionFlowType type = ctx.getProjBuildinInfo().projBaseInfo.reactionFlowType; |
|||
if (type.equals(A8kReactionFlowType.FlowType1)) { |
|||
log.info("样本预处理,刺破小瓶缓冲液"); |
|||
/* |
|||
* 刺破小瓶缓冲液 |
|||
*/ |
|||
TipPos tip = ctx.takeTip(); |
|||
Assert.isTrue(tip != null, "tip is null"); |
|||
|
|||
Consumable consumable = ctx.getConsumable(); |
|||
|
|||
//取tip |
|||
hbotCtrlService.takeTip(tip); |
|||
//刺破 |
|||
hbotCtrlService.moveToLittleBufferPiercePos(consumable.getGroup(), consumable.getPos()); |
|||
//丢tip |
|||
hbotCtrlService.dropTip(); |
|||
//待机 |
|||
hbotCtrlService.moveQuickToZero(); |
|||
|
|||
//提前.取tip, |
|||
hbotCtrlService.takeTip(ctx.takeTip()); |
|||
} else if (type.equals(A8kReactionFlowType.FlowType2)) { |
|||
log.info("样本预处理,取大瓶缓冲液液到探测物质中"); |
|||
/* |
|||
* 取大瓶缓冲液液到探测物质中 |
|||
*/ |
|||
//ldd准备 |
|||
|
|||
//取tip, |
|||
hbotCtrlService.takeTip(ctx.takeTip()); |
|||
|
|||
//移动到取样位置 |
|||
Pos3d pos = hbotConsumableParamMgr.getLargeBufferSamplePos(ctx.getConsumable().getGroup()); |
|||
pos.z = 0; |
|||
hbotCtrlService.moveTo(pos); |
|||
|
|||
//移动到目标位置,并液面探测 |
|||
lld(PipetteGunBindActionType.TAKE_LARGE_BUFFER_SOLUTION, ctx); |
|||
|
|||
//取液.准备 |
|||
pipetteCtrlDriver.aspiratePrepareBlock(); |
|||
|
|||
//取液 |
|||
Integer takeul = ProjProcessContextUtils.getTakeLargeBSVolume(ctx); |
|||
aspirate(PipetteGunBindActionType.TAKE_LARGE_BUFFER_SOLUTION, ctx, takeul); |
|||
|
|||
//移动到吐液位 |
|||
hbotCtrlService.moveTo(hbotConsumableParamMgr.getProbeSubstanceSamplePos(ctx.getConsumable().getGroup(), ctx.getConsumable().getPos())); |
|||
|
|||
//吐液 |
|||
distribute(PipetteGunBindActionType.DISTRIBUTION_LARGE_BUFFER_SOLUTION_PROBE_SUBSTANCE, ctx, takeul); |
|||
|
|||
|
|||
//丢tip |
|||
hbotCtrlService.dropTip(); |
|||
|
|||
//归零,待机 |
|||
hbotCtrlService.moveQuickToZero(); |
|||
} else { |
|||
Assert.isTrue(false, "不支持的反应流程类型"); |
|||
} |
|||
} |
|||
|
|||
public void doSampleProcess(ProjectTaskContext ctx) throws AppException { |
|||
Integer sampleul = ProjProcessContextUtils.getSampleVol(ctx); |
|||
Integer reactionul = ProjProcessContextUtils.getReactionPlateDropletVolUl(ctx); |
|||
|
|||
A8kReactionFlowType type = ctx.getProjBuildinInfo().projBaseInfo.reactionFlowType; |
|||
if (type.equals(A8kReactionFlowType.FlowType1)) { |
|||
// hbotCtrlService.takeTip(ctx.takeTip()); |
|||
} else { |
|||
hbotCtrlService.takeTip(ctx.takeTip()); |
|||
} |
|||
|
|||
//移动到取样位置 |
|||
A8kSamplePos samplePos = ProjProcessContextUtils.getSamplePos(ctx); |
|||
log.info("移动到 {}", samplePos); |
|||
Pos3d pos = hbotSamplePosParamMgr.getSampleStartPos(samplePos); |
|||
pos.z = 0; |
|||
hbotCtrlService.moveTo(pos); |
|||
|
|||
//ldd准备 |
|||
lld(PipetteGunBindActionType.SAMPLE, ctx); |
|||
|
|||
//取液准备 |
|||
pipetteCtrlDriver.aspiratePrepareBlock(); |
|||
|
|||
//吸吐混匀 |
|||
if (ProjProcessContextUtils.isDoMixTubeSample(ctx)) |
|||
mix(PipetteGunBindActionType.MIX_SAMPLE, ctx, sampleul, ProjProcessContextUtils.getTubeMixingCount(ctx)); |
|||
|
|||
//取样 |
|||
aspirate(PipetteGunBindActionType.SAMPLE, ctx, sampleul); |
|||
|
|||
//移动到吐液位, |
|||
hbotCtrlService.moveTo(ProjProcessContextUtils.getReactionEndPos(ctx)); |
|||
} |
|||
|
|||
|
|||
public void doSampleProcessPostProcess(ProjectTaskContext ctx) throws AppException { |
|||
Integer sampleul = ProjProcessContextUtils.getSampleVol(ctx); |
|||
Integer reactionul = ProjProcessContextUtils.getReactionPlateDropletVolUl(ctx); |
|||
|
|||
//吐液 |
|||
aspirateNoLLF(-sampleul); |
|||
|
|||
//吸吐混匀 |
|||
mix(PipetteGunBindActionType.MIX_REACTION_LIQUOR, ctx, sampleul, ProjProcessContextUtils.getBSMixingCnt(ctx)); |
|||
|
|||
//吸液 |
|||
aspirateNoLLF(reactionul); |
|||
|
|||
//旋转转盘 |
|||
turnableMoveCtrlService.trunableMoveToDropLiquidPos(ctx.getIncubatorPos()); |
|||
|
|||
//吐液到反应板 |
|||
hbotCtrlService.moveTo(hbotFixedPosParamMgr.getDropLiquidPos()); |
|||
distributeNoLLF(reactionul); |
|||
pipetteCtrlDriver.clearHangingLiquid(2); |
|||
|
|||
|
|||
//丢tip |
|||
hbotCtrlService.dropTip(); |
|||
//归零,待机 |
|||
hbotCtrlService.moveQuickToZero(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,110 @@ |
|||
package a8k.service.app.devicectrl.script; |
|||
|
|||
import a8k.service.app.appstate.type.ProjectTaskContext; |
|||
import a8k.service.app.devicectrl.ctrlservice.HbotCtrlService; |
|||
import a8k.service.app.devicectrl.ctrlservice.OptScanModuleCtrlService; |
|||
import a8k.service.app.devicectrl.ctrlservice.TurnableMoveCtrlService; |
|||
import a8k.service.app.devicectrl.driver.PipetteCtrlDriver; |
|||
import a8k.service.app.devicectrl.exdriver.HbotBaseMoveExDriver; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.HbotConsumableParamMgr; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.base.PipetteGunBindActionType; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.base.LLDParamPack; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.PipetteGunParamExMgr; |
|||
import a8k.service.app.devicectrl.param.ext_param_mgr.base.LLFParamPack; |
|||
import a8k.service.app.devicectrl.param.param_mgr.HbotFixedPosParamMgr; |
|||
import a8k.service.app.devicectrl.param.param_mgr.HbotSamplePosParamMgr; |
|||
import a8k.service.app.devicectrl.param.type.A8kSamplePos; |
|||
import a8k.type.cfg.Pos3d; |
|||
import a8k.type.exception.AppException; |
|||
import a8k.utils.ProjProcessContextUtils; |
|||
import a8k.utils.ZAppChecker; |
|||
import jakarta.annotation.Resource; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.util.Assert; |
|||
|
|||
@Component |
|||
@Slf4j |
|||
public class PipeGunCtrlScripter { |
|||
|
|||
|
|||
@Resource |
|||
PipetteCtrlDriver pipetteCtrlDriver; |
|||
@Resource |
|||
HbotSamplePosParamMgr hbotSamplePosParamMgr; |
|||
@Resource |
|||
HbotConsumableParamMgr hbotConsumableParamMgr; |
|||
@Resource |
|||
PipetteGunParamExMgr pipetteGunParamExMgr; |
|||
|
|||
public void aspirateNoLLF(Integer ul) throws AppException { |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(0); |
|||
pipetteCtrlDriver.aspirateBlock(ul); |
|||
} |
|||
|
|||
public void distributeNoLLF(Integer ul) throws AppException { |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(0); |
|||
pipetteCtrlDriver.aspirateBlock(-ul); |
|||
} |
|||
|
|||
|
|||
public void distribute(PipetteGunBindActionType actionType, ProjectTaskContext ctx, Integer ul) throws AppException { |
|||
LLFParamPack llfParamPack = pipetteGunParamExMgr.getLLFParam(actionType, ctx); |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(llfParamPack.llfVel); |
|||
pipetteCtrlDriver.setLlfStartZ(llfParamPack.llfStartPos); |
|||
pipetteCtrlDriver.setLlfEndZ(llfParamPack.llfEndPos); |
|||
pipetteCtrlDriver.aspirateBlock(-ul); |
|||
} |
|||
|
|||
public void mix(PipetteGunBindActionType actionType, ProjectTaskContext ctx, Integer ul, Integer times) throws AppException { |
|||
LLFParamPack llfParamPack = pipetteGunParamExMgr.getLLFParam(actionType, ctx); |
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(llfParamPack.llfVel); |
|||
pipetteCtrlDriver.setLlfStartZ(llfParamPack.llfStartPos); |
|||
pipetteCtrlDriver.setLlfEndZ(llfParamPack.llfEndPos); |
|||
pipetteCtrlDriver.shakeUpBlock(ul, times); |
|||
} |
|||
|
|||
|
|||
public void aspirate(PipetteGunBindActionType actionType, ProjectTaskContext ctx, Integer ul) throws AppException { |
|||
LLFParamPack llfParamPack = pipetteGunParamExMgr.getLLFParam(actionType, ctx); |
|||
log.info("吸液 {} , llfvel {} , llfStartPos {} , llfEndPos {}", ul, llfParamPack.llfVel, llfParamPack.llfStartPos, llfParamPack.llfEndPos); |
|||
|
|||
pipetteCtrlDriver.aspirateSetLlfVelocity(llfParamPack.llfVel); |
|||
pipetteCtrlDriver.setLlfStartZ(llfParamPack.llfStartPos); |
|||
pipetteCtrlDriver.setLlfEndZ(llfParamPack.llfEndPos); |
|||
pipetteCtrlDriver.aspirateBlock(ul); |
|||
} |
|||
|
|||
|
|||
public void lld(PipetteGunBindActionType actionType, ProjectTaskContext ctx) throws AppException { |
|||
log.info("液面探测 {}", actionType); |
|||
LLDParamPack lldparm = pipetteGunParamExMgr.getLLDParam(actionType, ctx); |
|||
Pos3d sampleStartPos = null; |
|||
Pos3d sampleEndPos = null; |
|||
|
|||
//取tip,移动到样本所在的位置,并液面探测 |
|||
switch (actionType) { |
|||
case SAMPLE -> { |
|||
A8kSamplePos samplePos = ProjProcessContextUtils.getSamplePos(ctx); |
|||
sampleStartPos = hbotSamplePosParamMgr.getSampleStartPos(samplePos); |
|||
sampleEndPos = hbotSamplePosParamMgr.getSampleEndPos(samplePos); |
|||
} |
|||
case TAKE_LARGE_BUFFER_SOLUTION -> { //取大瓶缓冲液 |
|||
var group = ctx.getConsumable().getGroup(); |
|||
sampleStartPos = hbotConsumableParamMgr.getLargeBufferSamplePos(group); |
|||
sampleEndPos = hbotConsumableParamMgr.getLargeBufferSamplePosEnd(group); |
|||
} |
|||
} |
|||
|
|||
Assert.notNull(sampleStartPos, "sampleStartPos is null"); |
|||
Assert.notNull(sampleEndPos, "sampleEndPos is null"); |
|||
|
|||
pipetteCtrlDriver.setStartZ(sampleStartPos.z); |
|||
pipetteCtrlDriver.setEndZ(sampleEndPos.z); |
|||
pipetteCtrlDriver.setLldType(lldparm.type); |
|||
pipetteCtrlDriver.setLldCThreshold(lldparm.cThreshold); |
|||
pipetteCtrlDriver.setLldPThreshold(lldparm.pThreshold); |
|||
pipetteCtrlDriver.lldBlock(); |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue