From 9204fc11cc49dad7d5c96043835f8785b47b0718 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 26 Oct 2024 22:33:54 +0800 Subject: [PATCH] update --- .../a8k/hardware/type/a8kcanprotocol/CmdId.java | 6 +- .../app/devicectrl/driver/PipetteCtrlDriver.java | 101 ++++++++++++--------- .../calibration/PipetteGunLLDParamCalibration.java | 4 +- .../calibration/PipetteGunLLFParamCalibration.java | 90 +++++++++++++++++- .../param/ext_param_mgr/PipetteGunParamExMgr.java | 32 +++++-- .../param/ext_param_mgr/base/LLFParamPack.java | 4 +- .../app/devicectrl/script/DeviceCtrlScripter.java | 6 ++ src/main/resources/app.db | Bin 225280 -> 225280 bytes 8 files changed, 183 insertions(+), 60 deletions(-) diff --git a/src/main/java/a8k/hardware/type/a8kcanprotocol/CmdId.java b/src/main/java/a8k/hardware/type/a8kcanprotocol/CmdId.java index bd7d151..fc95ac9 100644 --- a/src/main/java/a8k/hardware/type/a8kcanprotocol/CmdId.java +++ b/src/main/java/a8k/hardware/type/a8kcanprotocol/CmdId.java @@ -137,11 +137,13 @@ public enum CmdId { pipette_zmotor_read_dev_status_cache(0x741A, "pipette_zmotor_read_dev_status_cache"), pipette_lld_is_detect_liquid(0x741B, "kpipette_lld_is_detect_liquid"), pipette_lld_test(0x741C, "pipette_lld_test"), - pipette_set_startz(0x741D, "移动枪设置移动开始高度"), - pipette_set_endz(0x741E, "移动枪设置移动最大高度"), + pipette_set_lld_startz(0x741D, "移动枪设置移动开始高度"), + pipette_set_lld_endz(0x741E, "移动枪设置移动最大高度"), pipette_set_lld_type(0x741F, "移动枪设置液面探测类型"), pipette_set_lld_c_threshold(0x7420, "移动枪设置液面探测电容阈值"), pipette_set_lld_p_threshold(0x7421, "移动枪设置液面探测压力阈值"), + kpipette_set_llf_startz(0x7422, "移动枪设置液面跟随开始限制高度"), + kpipette_set_llf_endz(0x7423, "移动枪设置液面跟随结束限制高度"), ; diff --git a/src/main/java/a8k/service/app/devicectrl/driver/PipetteCtrlDriver.java b/src/main/java/a8k/service/app/devicectrl/driver/PipetteCtrlDriver.java index 7542dc1..936090a 100644 --- a/src/main/java/a8k/service/app/devicectrl/driver/PipetteCtrlDriver.java +++ b/src/main/java/a8k/service/app/devicectrl/driver/PipetteCtrlDriver.java @@ -43,43 +43,50 @@ public class PipetteCtrlDriver { final Integer overtime = 10000; static class FnOrder { - public static final int zMotorEnable = 1; - public static final int moduleStop = 2; - public static final int zMotorMoveZeroBlock = 3; - public static final int zMotorMoveToZeroPointQuickBlock = 4; - public static final int zMotorMoveByBlock = 5; - public static final int zMotorMoveToBlock = 6; - public static final int zMotorMeasureDistance = 7; - public static final int zMotorReadMeasureDistanceResult = 8; - public static final int initDeviceBlock = 9; - public static final int putTipBlock = 11; - public static final int setStartZ = 12; - public static final int setEndZ = 12; - public static final int setLldType = 13; - public static final int setLldCThreshold = 14; - public static final int setLldPThreshold = 15; - public static final int lldPrepareBlock = 16; - public static final int lldBlock = 17; - public static final int lldCalibrationBlock = 18; - public static final int lldIsDetectLiquid = 19; - public static final int getSensorSampleData = 20; - public static final int readCapacitance = 21; - public static final int aspiratePrepareBlock = 22; - public static final int aspirateSetLlfVelocity = 23; - public static final int aspirateSetOperationVerifPThre = 24; - public static final int aspirateSetOperationVerifEigenTime = 25; - public static final int aspirateSetOperationVerifTolerance = 26; - public static final int aspirateBlock = 27; - public static final int aspirateAndVerifyBlock = 27; - public static final int shakeUpBlock = 28; - public static final int aspirateInferPressureBlock = 29; - public static final int aspirateInferEigenTimeBlock = 30; - public static final int getAspirateInferPressureResult = 31; - public static final int getAspirateInferEigenTimeResultBlock = 32; - public static final int zAixsZeroPointIsTrigger = 33; - public static final int setReg = 34; - public static final int getReg = 35; - public static final int getAllRegs = 36; + public static final int zMotorEnable = 1; + public static final int moduleStop = 2; + public static final int zMotorMoveZeroBlock = 3; + public static final int zMotorMoveToZeroPointQuickBlock = 4; + public static final int zMotorMoveByBlock = 5; + public static final int zMotorMoveToBlock = 6; + public static final int zMotorMeasureDistance = 7; + public static final int zMotorReadMeasureDistanceResult = 8; + public static final int initDeviceBlock = 9; + public static final int putTipBlock = 11; + + public static final int setLLDStartZ = 20; + public static final int setLLDEndZ = 21; + public static final int setLldType = 22; + public static final int setLldCThreshold = 23; + public static final int setLldPThreshold = 24; + public static final int lldPrepareBlock = 25; + public static final int lldBlock = 26; + public static final int lldCalibrationBlock = 27; + public static final int lldIsDetectLiquid = 28; + public static final int getSensorSampleData = 29; + public static final int readCapacitance = 30; + + public static final int aspiratePrepareBlock = 30; + public static final int aspirateSetLlfVelocity = 31; + public static final int setLlfStartZ = 32; + public static final int setLlfEndZ = 33; + public static final int aspirateSetOperationVerifPThre = 34; + public static final int aspirateSetOperationVerifEigenTime = 35; + public static final int aspirateSetOperationVerifTolerance = 36; + public static final int aspirateBlock = 37; + public static final int aspirateAndVerifyBlock = 38; + public static final int shakeUpBlock = 39; + public static final int aspirateInferPressureBlock = 40; + public static final int aspirateInferEigenTimeBlock = 41; + public static final int getAspirateInferPressureResult = 42; + public static final int getAspirateInferEigenTimeResultBlock = 43; + + + public static final int zAixsZeroPointIsTrigger = 50; + + public static final int setReg = 100; + public static final int getReg = 101; + public static final int getAllRegs = 102; } @PostConstruct @@ -148,16 +155,16 @@ public class PipetteCtrlDriver { pipetteInitDeviceBlock(); } - @ExtApiFn(name = "设置LLDAndLLF起始位置", order = FnOrder.setStartZ) + @ExtApiFn(name = "设置LLD起始位置", order = FnOrder.setLLDStartZ) public void setStartZ(Integer startZ) throws AppException { log.info("setStartZ:{}", startZ); - canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.pipette_set_startz.toInt(), startZ); + canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.pipette_set_lld_startz.toInt(), startZ); } - @ExtApiFn(name = "设置LLDAndLLF结束位置", order = FnOrder.setEndZ) + @ExtApiFn(name = "设置LLD结束位置", order = FnOrder.setLLDEndZ) public void setEndZ(Integer endZ) throws AppException { log.info("setEndZ:{}", endZ); - canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.pipette_set_endz.toInt(), endZ); + canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.pipette_set_lld_endz.toInt(), endZ); } @ExtApiFn(name = "设置LLD类型", order = FnOrder.setLldType) @@ -247,6 +254,18 @@ public class PipetteCtrlDriver { public void aspirateSetLlfVelocity(Integer llf_zm_rpm) throws AppException { canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.pipette_aspirate_set_llf_velocity.toInt(), llf_zm_rpm); } + // kpipette_set_llf_startz + //kpipette_set_llf_endz + + @ExtApiFn(name = "设置LLF起始位置", order = FnOrder.setLlfStartZ) + public void setLlfStartZ(Integer startZ) throws AppException { + canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.kpipette_set_llf_startz.toInt(), startZ); + } + + @ExtApiFn(name = "设置LLF结束位置", order = FnOrder.setLlfEndZ) + public void setLlfEndZ(Integer endZ) throws AppException { + canBusService.callcmd(MId.PipetteMod.toInt(), CmdId.kpipette_set_llf_endz.toInt(), endZ); + } @ExtApiFn(name = "设置操作验证压力阈值", order = FnOrder.aspirateSetOperationVerifPThre) public void aspirateSetOperationVerifPThre(Integer p_thre) throws AppException { diff --git a/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLDParamCalibration.java b/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLDParamCalibration.java index a6bca10..1823fb2 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLDParamCalibration.java +++ b/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLDParamCalibration.java @@ -111,8 +111,8 @@ public class PipetteGunLLDParamCalibration { } - @ExtApiFn(name = "设置参数", group = "设置", order = 200) - public void setDefaultCThread(PipetteGunLLDThresholdParam param, Integer val) throws AppException { + @ExtApiFn(name = "设置阈值", group = "设置", order = 200) + public void setThreshold(PipetteGunLLDThresholdParam param, Integer val) throws AppException { pipetteGunLLDParamMgr.setParam(param, val); } diff --git a/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLFParamCalibration.java b/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLFParamCalibration.java index 05cdd4a..07c13eb 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLFParamCalibration.java +++ b/src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLFParamCalibration.java @@ -4,6 +4,8 @@ package a8k.service.app.devicectrl.param.calibration; import a8k.extapi_controler.pagecontrol.ExtApiTabConfig; import a8k.extapi_controler.utils.ExtApiFn; import a8k.extapi_controler.utils.ExtApiTab; +import a8k.service.app.devicectrl.driver.PipetteCtrlDriver; +import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; import a8k.service.app.devicectrl.param.param_mgr.PipetteGunLLFParamMgr; import a8k.service.app.devicectrl.param.type.PipetteGunLLFParam; import a8k.type.exception.AppException; @@ -17,15 +19,95 @@ public class PipetteGunLLFParamCalibration { @Resource PipetteGunLLFParamMgr pipetteGunLLFParamMgr; - @ExtApiFn(name = "获取相关参数", group = "基础", order = 1) + @Resource + PipetteCtrlDriver pipetteCtrlDriver; + + @Resource + MotorEnableExDriver motorEnableExDriver; + + + @ExtApiFn(name = "移液枪初始化(Tip会掉落)", group = "基础", order = 2) + public void pipetteInitDeviceBlock() throws AppException { + pipetteCtrlDriver.pipetteInitDeviceBlock(); + + } + + @ExtApiFn(name = "使能相关模块", group = "基础", order = 3) + public void enableModule() throws AppException { + pipetteCtrlDriver.zMotorEnable(1); + } + + @ExtApiFn(name = "失能相关模块", group = "基础", order = 4) + public void disableModule() throws AppException { + motorEnableExDriver.forceDisableAllMotor(); + } + + @ExtApiFn(name = "获取相关参数", group = "基础", order = 5) public Object getParams() throws AppException { return pipetteGunLLFParamMgr.getParams(); } - @ExtApiFn(name = "设置参数", group = "设置", order = 1) - public void setParam(PipetteGunLLFParam param, Integer val) throws AppException { - pipetteGunLLFParamMgr.setParam(param.chName, val); + Integer llfStartPos; + Integer llfEndPos; + + + Integer hasUl = 0; + Integer llfv = 0; + + + @ExtApiFn(name = "设置llf开始位置", group = "测试", order = 100) + public void setStartTestPos() throws AppException { + pipetteCtrlDriver.zMotorEnable(1); + pipetteCtrlDriver.zMotorMeasureDistance(); + llfStartPos = pipetteCtrlDriver.zMotorReadMeasureDistanceResult(); + pipetteCtrlDriver.zMotorEnable(0); + } + + @ExtApiFn(name = "设置llf结束位置", group = "测试", order = 101) + public void setEndTestPos() throws AppException { + pipetteCtrlDriver.zMotorEnable(1); + pipetteCtrlDriver.zMotorMeasureDistance(); + llfEndPos = pipetteCtrlDriver.zMotorReadMeasureDistanceResult(); + pipetteCtrlDriver.zMotorEnable(0); + } + + + @ExtApiFn(name = "吸液准备", group = "测试", order = 102) + public void aspiratePrepare() throws AppException { + enableModule(); + pipetteCtrlDriver.zMotorMoveZeroBlock(); + pipetteCtrlDriver.aspiratePrepareBlock(); + } + + + @ExtApiFn(name = "移动到吸液起始位", group = "测试", order = 103) + public void moveToAspirateStartPos() throws AppException { + pipetteCtrlDriver.zMotorMoveToBlock(llfStartPos); + } + + @ExtApiFn(name = "吸液", group = "测试", order = 104) + public void aspirate(Integer llfv, Integer ul) throws AppException { + this.llfv = llfv; + pipetteCtrlDriver.setLlfStartZ(llfStartPos); + pipetteCtrlDriver.setLlfEndZ(llfEndPos); + pipetteCtrlDriver.aspirateSetLlfVelocity(llfv); + pipetteCtrlDriver.aspirateBlock(ul); + hasUl += ul; + } + + @ExtApiFn(name = "分液", group = "测试", order = 105) + public void distribute() throws AppException { + pipetteCtrlDriver.setLlfStartZ(llfStartPos); + pipetteCtrlDriver.setLlfEndZ(llfEndPos); + pipetteCtrlDriver.aspirateSetLlfVelocity(llfv); + pipetteCtrlDriver.aspirateBlock(-hasUl); + hasUl = 0; + } + + @ExtApiFn(name = "设置参数", group = "设置", order = 200) + public void setDefaultCThread(PipetteGunLLFParam param, Integer val) throws AppException { + pipetteGunLLFParamMgr.setParam(param, val); } } diff --git a/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/PipetteGunParamExMgr.java b/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/PipetteGunParamExMgr.java index 9e9b663..1394a94 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/PipetteGunParamExMgr.java +++ b/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/PipetteGunParamExMgr.java @@ -35,6 +35,9 @@ public class PipetteGunParamExMgr { @Resource HbotLargeBottleBSPosMgr hbotLargeBottleBSPosMgr; + @Resource + HbotConsumableParamMgr hbotConsumableParamMgr; + /** * 获取液面探测相关参数 * @param type 操作类型 @@ -82,21 +85,30 @@ public class PipetteGunParamExMgr { */ public LLFParamPack getLLFParam(PipetteGunBindActionType type, ProjProcessContext cxt) { LLFParamPack paramPack = null; - A8kTubeHolderType thType = cxt.tubeHolderType; switch (type) { - case MIX_SAMPLE, SAMPLE -> { //取样 + // 取样 + case MIX_SAMPLE, SAMPLE -> { // A8kSamplePos samplePos = ProjProcessContextUtils.getSamplePos(cxt); - paramPack = new LLFParamPack(); - paramPack.llfVel = pipetteGunLLFParamMgr.getSampleLLFVel(samplePos); + paramPack = new LLFParamPack(); + paramPack.llfVel = pipetteGunLLFParamMgr.getSampleLLFVel(samplePos); + paramPack.llfStartPos = hbotSamplePosParamMgr.getSampleStartPos(samplePos).z; + paramPack.llfEndPos = hbotSamplePosParamMgr.getSampleStartPos(samplePos).z; + } - case TAKE_LARGE_BUFFER_SOLUTION -> { //取大瓶缓冲液 - paramPack = new LLFParamPack(); - paramPack.llfVel = pipetteGunLLFParamMgr.getLargeBSBottleLlfVel(); + //取大瓶缓冲液 + case TAKE_LARGE_BUFFER_SOLUTION -> { // + paramPack = new LLFParamPack(); + paramPack.llfVel = pipetteGunLLFParamMgr.getLargeBSBottleLlfVel(); + paramPack.llfStartPos = hbotConsumableParamMgr.getLargeBufferSamplePos(cxt.consumable.getGroup()).z; + paramPack.llfEndPos = hbotConsumableParamMgr.getLargeBufferSamplePosEnd(cxt.consumable.getGroup()).z; } - case MIX_REACTION_LIQUOR,DISTRIBUTION_LARGE_BUFFER_SOLUTION_PROBE_SUBSTANCE -> { - paramPack = new LLFParamPack(); - paramPack.llfVel = 0; + //混合反应液,分配大瓶缓冲液到探测物质中 + case MIX_REACTION_LIQUOR, DISTRIBUTION_LARGE_BUFFER_SOLUTION_PROBE_SUBSTANCE -> { + paramPack = new LLFParamPack(); + paramPack.llfVel = 0; + paramPack.llfStartPos = 0; + paramPack.llfEndPos = 0; } } diff --git a/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/base/LLFParamPack.java b/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/base/LLFParamPack.java index 832571a..ff17bfc 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/base/LLFParamPack.java +++ b/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/base/LLFParamPack.java @@ -1,5 +1,7 @@ package a8k.service.app.devicectrl.param.ext_param_mgr.base; public class LLFParamPack { - public Integer llfVel; + public Integer llfVel = 0; + public Integer llfStartPos = 0; + public Integer llfEndPos = 0; } diff --git a/src/main/java/a8k/service/app/devicectrl/script/DeviceCtrlScripter.java b/src/main/java/a8k/service/app/devicectrl/script/DeviceCtrlScripter.java index 753ec7a..de1f3c4 100644 --- a/src/main/java/a8k/service/app/devicectrl/script/DeviceCtrlScripter.java +++ b/src/main/java/a8k/service/app/devicectrl/script/DeviceCtrlScripter.java @@ -79,12 +79,16 @@ public class DeviceCtrlScripter { void distribute(PipetteGunBindActionType actionType, ProjProcessContext 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, ProjProcessContext 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); } @@ -92,6 +96,8 @@ public class DeviceCtrlScripter { void aspirate(PipetteGunBindActionType actionType, ProjProcessContext 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); } diff --git a/src/main/resources/app.db b/src/main/resources/app.db index f51742e2299f910505cf33bb3a3298f02695783e..dffb0e257916761b08634b283a3e84d8fc63afc3 100644 GIT binary patch delta 1466 zcmZp8z}xVEcY>7Ayy*-K4CX*=2E>XC4E*0G>KL&BMfJ+MHl{3>XVl%yqwtoWQMvh- z{`Oz`j9d@GG#Otp@XzAc=DWgI$EU@6m^XpvAJ04;Y__*`~4?v7Td1XJuts$>PQQnz@%*pXmZqA(I~CtIdK26BxHo zJ;cPw$(b3?&R}jWtr|Q%;Wv}$^b^0B#DzWcN>bBPi>j5%5_3vZm8=X6YNy}-#iY!U z76(y0eW5Os*mQ;8OyW`)YRzhGo^M+9WZ(Yj4Z2K{9C@)&E%CpZbcHZgPfw6%5}7_9 zXg5b*3__{W^n1UVxG`N~Ry+OWZzc`SxM-kSLuplah_m(oFbQE*?D&UCmLnkws90ZG z72<55TGr{gx=cJ+HT3>rQs798gqRM}pn+A{U68WW2%s`cpt&D)nRKu!GyKa`GTmN@ zDQx={JtiH-WdckBOBopj7C8tk6<}1@R=~s>5IP#gsEKVzN3kF7Ata%I!4CX*=2E>XC4E)b0>KL&BMfJ)$Hl{3>XH?$IqwtoWQK|Wt z{`Oz`j9d@4vnVkA;g8~Fn#!QgWY54qi(i}X3X?sbE$>U-nY>;+e|Z-0ICH<_p2qFU z^^6dl1+$p18WG&SC(lk7R6LLXv<*mN0LCc)_rvP=pbevuFjAgjfu*U19a z8~$ZdWRCy}Tf&rceFVyJ$uX610>jqX+?avEaQeExOtRA}KQeJ|KXi`CPH>Tfz)}H5 zg>3~)tO23G5QT&$-$W{f=1p*DS~G2bCCJ3cIdsF%F$@^4nBixys16KS9mZe={!V^f zzKeX>ynlF?G6wSo0#o5yo;V&s?k(Km+)P}nrfYm)3Yn~6a2=ekwy*p+l!IgY(!We; bL5#Z7c>