diff --git a/src/main/java/a8k/app/dao/DeviceActionParameterDao.java b/src/main/java/a8k/app/dao/DeviceActionParameterDao.java index 44721a1..5eccf18 100644 --- a/src/main/java/a8k/app/dao/DeviceActionParameterDao.java +++ b/src/main/java/a8k/app/dao/DeviceActionParameterDao.java @@ -83,7 +83,7 @@ public class DeviceActionParameterDao extends ZSqlite { ObjectMapper objectMapper = new ObjectMapper(); List list = queryList("select * from " + tableName + " where service = ? and key = ?;", service, key); Assert.isTrue(list.size() == 1, "参数不存在,或者存在多个参数"); - Assert.isTrue(list.get(0).valType.equals(param.getClass().getSimpleName()), "参数类型不匹配"); + Assert.isTrue(list.get(0).valType.equals(param.getClass().getSimpleName()), String.format("参数类型不匹配, %s, %s", list.get(0).valType, param.getClass().getSimpleName())); Parameter parameter = list.get(0); parameter.val = Objects.requireNonNull(ZJsonHelper.createObjectNode(param)).toString(); parameter.service = service; diff --git a/src/main/java/a8k/app/engineer/service/qatest/LiquidAbsorptionAndDistributionTestService.java b/src/main/java/a8k/app/engineer/service/qatest/LiquidAbsorptionAndDistributionTestService.java index b2da28f..0bb4951 100644 --- a/src/main/java/a8k/app/engineer/service/qatest/LiquidAbsorptionAndDistributionTestService.java +++ b/src/main/java/a8k/app/engineer/service/qatest/LiquidAbsorptionAndDistributionTestService.java @@ -186,17 +186,17 @@ public class LiquidAbsorptionAndDistributionTestService { //NEW CODE pumpMoveTo(8000, 0.0); - pumpMoveTo(LiquidOperationCtrlService.ASPIRATE_PUMP_VMAX, LiquidOperationCtrlService.ASPIRATE_PRE_TAKE); + pumpMoveTo(LiquidOperationCtrlService.PRE_ASPIRATE_PUMP_VMAX, LiquidOperationCtrlService.ASPIRATE_PRE_TAKE); pipetteCtrlDriver.zMotorMoveToBlock(liquidPos); pipetteCtrlDriver.liquidOperationClearParams(); pipetteCtrlDriver.liquidOperationSetGunRunParams(LiquidOperationCtrlService.PUMP_ACC, LiquidOperationCtrlService.PUMP_DEC, LiquidOperationCtrlService.PUMP_VSTART, - LiquidOperationCtrlService.PUMP_VSTOP, LiquidOperationCtrlService.ASPIRATE_PUMP_VMAX); + LiquidOperationCtrlService.PUMP_VSTOP, (int) pipetteGunExParamMgr.geVolumeAbsorbVelocity(ul)); Pos3d sampleEndPos = hbotConsumableExParamMgr.getLargeBufferSamplePosEnd(ConsumableGroup.CG1); - pipetteCtrlDriver.liquidOperationSetZMotorRunParams(0, sampleEndPos.z, LiquidOperationCtrlService.LARGE_BS_BOTTLE_LLF_VEL); + pipetteCtrlDriver.liquidOperationSetZMotorRunParams(0, sampleEndPos.z, pipetteGunExParamMgr.getLargeBSBottleLlfVel()); pipetteCtrlDriver.liquidOperationFreshParams(); ul = pipetteGunExParamMgr.calibrateVolume(ul); log.info("取液体 {}", ul); diff --git a/src/main/java/a8k/app/hardware/channel/A8kCanBusConnection.java b/src/main/java/a8k/app/hardware/channel/A8kCanBusConnection.java index a5c7f28..0c557d8 100644 --- a/src/main/java/a8k/app/hardware/channel/A8kCanBusConnection.java +++ b/src/main/java/a8k/app/hardware/channel/A8kCanBusConnection.java @@ -50,9 +50,9 @@ public class A8kCanBusConnection extends WebSocketClient { public A8kPacket getReceipt(int overtime) { - long end = System.currentTimeMillis() + overtime; + long end = System.currentTimeMillis() + overtime; + A8kPacket packet = null; while (System.currentTimeMillis() < end) { - A8kPacket packet = null; try { packet = receiptQueue.poll(10, TimeUnit.MILLISECONDS); } catch (InterruptedException ignored) { @@ -61,7 +61,15 @@ public class A8kCanBusConnection extends WebSocketClient { return packet; } } - return null; + + synchronized (this) { + try { + packet = receiptQueue.poll(1, TimeUnit.MILLISECONDS); + } catch (InterruptedException ignored) { + } + receiptQueue.clear(); + return packet; + } } synchronized void pushReceipt(A8kPacket receipt) { @@ -248,7 +256,6 @@ public class A8kCanBusConnection extends WebSocketClient { A8kPacket receipt; receipt = context.getReceipt(overtime); if (receipt == null) { - log.debug("RX-NULL: |RAW:{}| {}", txpacket, pack); throw buildOvertimeError(pack); } diff --git a/src/main/java/a8k/app/service/lowerctrl/LiquidOperationCtrlService.java b/src/main/java/a8k/app/service/lowerctrl/LiquidOperationCtrlService.java index ea553a8..0cca8ab 100644 --- a/src/main/java/a8k/app/service/lowerctrl/LiquidOperationCtrlService.java +++ b/src/main/java/a8k/app/service/lowerctrl/LiquidOperationCtrlService.java @@ -32,30 +32,27 @@ import org.springframework.stereotype.Component; public class LiquidOperationCtrlService { static public final Integer helicalPitch = 80; - static public final Integer LLD_ZMOTOR_VMAX = 60 * 80 / helicalPitch; + static public final Integer LLD_ZMOTOR_VMAX = 60; static public final Integer LLD_GUN_PUMP_VMAX = 40; static public final Integer LLD_P_THRESHOLD = 60;//30时候可行,将其调整到50,增加容错性 - static public final Integer ASPIRATE_PUMP_VMAX = 100; - static public final Double ASPIRATE_PRE_TAKE = 20.0;// 吸取前预吸量 + static public final Double ASPIRATE_PRE_TAKE = 40.0;// 吸取前预吸量 + static public final Integer PRE_ASPIRATE_PUMP_VMAX = 100; + static public final Integer REACTION_VOLUME_UL = 75; static public final Integer MIX_VOLUME_UL = 200; - static public final Integer EMERGENCY_TUBE_LLF_VEL = 25 * 80 / helicalPitch;// <急诊试管>液面跟随速度 - static public final Integer BLOOD_TUBE_LLF_VEL = 25 * 80 / helicalPitch;// <全血试管>液面跟随速度 - static public final Integer MINI_TUBE_LLF_VEL = 25 * 80 / helicalPitch;// <迷你试管>液面跟随速度 - static public final Integer MINI_BLOOD_LLF_VEL = 25 * 80 / helicalPitch;// <阳普管>液面跟随速度 - static public final Integer BULLET_TUBE_1P5_LLF_VEL = 30 * 80 / helicalPitch;// <子弹头试管1.5ML>液面跟随速度 - static public final Integer BULLET_TUBE_0P5_LLF_VEL = 25 * 80 / helicalPitch;// <子弹头试管0.5ML>液面跟随速度 - static public final Integer STOOL_TEST_TUBE_LLF_VEL = 25 * 80 / helicalPitch;// <粪便试管>液面跟随速度 - static public final Integer LARGE_BS_BOTTLE_LLF_VEL = 10 * 80 / helicalPitch; - ;// <大瓶缓冲液>液面跟随速度 + + ;// <大瓶缓冲液>液面跟随速度s static public final Integer PUMP_VSTART = 0; static public final Integer PUMP_VSTOP = 900; static public final Integer PUMP_ACC = 14; static public final Integer PUMP_DEC = 14; + static public final Integer ASPIRATE_PUMP_ACC = 14; + static public final Integer ASPIRATE_PUMP_DEC = 14; + @Resource GStateMgrService gstate; @@ -188,7 +185,7 @@ public class LiquidOperationCtrlService { pumpMoveTo(8000, 25.0);//预先吸入部分空气 } - aspirate(largeBottleEndPos.z, ASPIRATE_PUMP_VMAX, getLargeBSBottleLlfVel(), ul * 1.0); + aspirate(largeBottleEndPos.z, pipetteGunExParamMgr.getLargeBSBottleLlfVel(), ul * 1.0); pipetteCtrlDriver.zMotorMoveToBlock(0); // @@ -216,16 +213,15 @@ public class LiquidOperationCtrlService { return toCPos; } - /** * 取样本到探测物质 * @param from 样本位置 - * @param pos 预先反应位置P * @param ul 吸取量 * @throws AppException 异常 */ - public void takeSample(A8kSamplePos from, PreReactionPos pos, Integer ul) throws AppException { - log.info("takeSampleToPreReactionPos: from={}, pos={}, ul={}ul", from, pos, ul); + public void takeSampleOnly(A8kSamplePos from, Integer ul) throws AppException { + log.info("takeSampleOnly: from={},ul={}ul", from, ul); + // 取TIP forceTakeTip(); ZAppChecker.check(pipetteCtrlDriver.isHasTip(), A8kEcode.CODEERROR, "未检测到TIP"); @@ -256,14 +252,30 @@ public class LiquidOperationCtrlService { //取样准备 pipetteCtrlDriver.zMotorMoveToBlock(sampleStartPos.z); //回到0 pumpMoveTo(8000, 0.0); //排空 - pumpMoveTo(ASPIRATE_PUMP_VMAX, ASPIRATE_PRE_TAKE); //预先吸入部分空气 + pumpMoveTo(PRE_ASPIRATE_PUMP_VMAX, ASPIRATE_PRE_TAKE); //预先吸入部分空气 //取样 pipetteCtrlDriver.zMotorMoveToBlock(liquidLevel); - aspirate(sampleEndZPos, ASPIRATE_PUMP_VMAX, getSampleLLFVel(from), ul * 1.0); + aspirate(sampleEndZPos, pipetteGunExParamMgr.getSampleLLFVel(ul * 1.0, from), ul * 1.0); pipetteCtrlDriver.zMotorMoveToBlock(0); + } + + + /** + * 取样本到探测物质 + * @param from 样本位置 + * @param pos 预先反应位置P + * @param ul 吸取量 + * @throws AppException 异常 + */ + public void takeSample(A8kSamplePos from, PreReactionPos pos, Integer ul) throws AppException { + log.info("takeSampleToPreReactionPos: from={}, pos={}, ul={}ul", from, pos, ul); + + takeSampleOnly(from, ul); + + // // 移动到反应位 // @@ -311,7 +323,7 @@ public class LiquidOperationCtrlService { makeReserveAir(100); hbotMoveExCtrlService.moveToZ(reactionPos); - aspirate(reactionPos.z, ASPIRATE_PUMP_VMAX, 0, (double) REACTION_VOLUME_UL); + aspirate(reactionPos.z, 0, (double) REACTION_VOLUME_UL); hbotMoveExCtrlService.moveToDropLiquidPos(); pumpMoveTo(8000, 0.0); @@ -379,20 +391,18 @@ public class LiquidOperationCtrlService { /** * 在当前位置吸取液体 * @param maxpos 最大位置 - * @param gunv 枪速 * @param zv z轴速度 * @param ul 吸取量 * @throws AppException 异常 */ - private void aspirate(Integer maxpos, int gunv, int zv, Double ul) throws AppException { - log.info("aspirate: maxpos={}, gunv={}, zv={}, ul={}", maxpos, gunv, zv, ul); + private void aspirate(Integer maxpos, int zv, Double ul) throws AppException { + log.info("aspirate: maxpos={}, zv={}, ul={}", maxpos, zv, ul); pipetteCtrlDriver.liquidOperationClearParams(); - pipetteCtrlDriver.liquidOperationSetGunRunParams(PUMP_ACC, PUMP_DEC, PUMP_VSTART, PUMP_VSTOP, gunv); + pipetteCtrlDriver.liquidOperationSetGunRunParams(ASPIRATE_PUMP_ACC, ASPIRATE_PUMP_DEC, PUMP_VSTART, PUMP_VSTOP, pipetteGunExParamMgr.geVolumeAbsorbVelocity(ul)); pipetteCtrlDriver.liquidOperationSetZMotorRunParams(0, maxpos, zv); pipetteCtrlDriver.liquidOperationFreshParams(); Double realul = pipetteGunExParamMgr.calibrateVolume(ul); - // Double realul = ul; pipetteCtrlDriver.pipetteAspirate(realul); } @@ -405,20 +415,4 @@ public class LiquidOperationCtrlService { } - public Integer getSampleLLFVel(A8kSamplePos pos) { - return switch (pos) { - case EmergencyTubePos -> EMERGENCY_TUBE_LLF_VEL; - case BloodHTubePos, BloodSTubePos -> BLOOD_TUBE_LLF_VEL; - case MiniBloodPos -> MINI_BLOOD_LLF_VEL; - case Bulltube1P5Pos -> BULLET_TUBE_1P5_LLF_VEL; - case Bulltube0P5Pos -> BULLET_TUBE_0P5_LLF_VEL; - case StoolTestTubePos -> STOOL_TEST_TUBE_LLF_VEL; - }; - } - - public Integer getLargeBSBottleLlfVel() { - return LARGE_BS_BOTTLE_LLF_VEL; - } - - } diff --git a/src/main/java/a8k/app/service/param/pipetteparam/PipetteGunExParamMgr.java b/src/main/java/a8k/app/service/param/pipetteparam/PipetteGunExParamMgr.java index 37f3d45..2132505 100644 --- a/src/main/java/a8k/app/service/param/pipetteparam/PipetteGunExParamMgr.java +++ b/src/main/java/a8k/app/service/param/pipetteparam/PipetteGunExParamMgr.java @@ -1,6 +1,7 @@ package a8k.app.service.param.pipetteparam; import a8k.app.service.param.base.ParamMgr; +import a8k.app.type.param.type.A8kSamplePos; import jakarta.annotation.PostConstruct; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -9,16 +10,37 @@ import org.springframework.stereotype.Component; @Slf4j public class PipetteGunExParamMgr extends ParamMgr { enum PipetteGunParam { - VOLUME_CALIBRATION_COEFFICIENT_A("体积校准系数-A", Double.class), - VOLUME_CALIBRATION_COEFFICIENT_B("体积校准系数-B", Double.class), + VOLUME_CALIBRATION_COEFFICIENT_A("体积校准系数-A", Double.class, 1.0), + VOLUME_CALIBRATION_COEFFICIENT_B("体积校准系数-B", Double.class, 0.0), + + SMALL_VOLUME_CALIBRATION_COEFFICIENT_A("小体积-校准系数-A", Double.class, 1.0), + SMALL_VOLUME_CALIBRATION_COEFFICIENT_B("小体积-校准系数-B", Double.class, 0.0), + + THRESHOLD("阈值", Double.class, 35.0), + + + SMALL_VOLUME_ABSORB_VELOCITY("小体积吸液速度", Double.class, 10.0), + LARGE_VOLUME_ABSORB_VELOCITY("大体积排液速度", Double.class, 40.0), + + EMERGENCY_TUBE_LLF_VEL("<急诊试管>液面跟随速度", Integer.class, 20), + BLOOD_TUBE_LLF_VEL("<全血试管>液面跟随速度", Integer.class, 15), + MINI_TUBE_LLF_VEL("<迷你试管>液面跟随速度", Integer.class, 15), + MINI_BLOOD_LLF_VEL("<阳普管>液面跟随速度", Integer.class, 15), + BULLET_TUBE_1P5_LLF_VEL("<子弹头试管1.5ML>液面跟随速度", Integer.class, 20), + BULLET_TUBE_0P5_LLF_VEL("<子弹头试管0.5ML>液面跟随速度", Integer.class, 20), + STOOL_TEST_TUBE_LLF_VEL("<粪便试管>液面跟随速度", Integer.class, 15), + LARGE_BS_BOTTLE_LLF_VEL("<大BS瓶>液面跟随速度", Integer.class, 20), + ; public final String chName; public final Class type; + public final Object defaultVal; - PipetteGunParam(String chName, Class type) { - this.chName = chName; - this.type = type; + PipetteGunParam(String chName, Class type, Object defaultVal) { + this.chName = chName; + this.type = type; + this.defaultVal = defaultVal; } } @@ -26,19 +48,39 @@ public class PipetteGunExParamMgr extends ParamMgr { @PostConstruct void initialize() { for (PipetteGunParam param : PipetteGunParam.values()) { - initParam(param, param.chName, param.type); + initParam(param, param.chName, param.type, param.defaultVal); } } - public void setVolumeCalibrationCoefficient(Double A, Double B) { + public void setLargeVolumeCalibrationCoefficient(Double A, Double B) { setParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_A, A); setParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_B, B); } + public void setSmallVolumeCalibrationCoefficient(Double A, Double B) { + setParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_A, A); + setParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_B, B); + } + + public void setThreshold(Double threshold) { + setParam(PipetteGunParam.THRESHOLD, threshold); + } + public double calibrateVolume(double rawVolume) { Double A = getParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_A, Double.class); Double B = getParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); - return A * rawVolume + B; + + + Double sA = getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_A, Double.class); + Double sB = getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); + + Double threshold = getParam(PipetteGunParam.THRESHOLD, Double.class); + + if (rawVolume < threshold) { + return sA * rawVolume + sB; + } else { + return A * rawVolume + B; + } } public double getCoefficientA() { @@ -48,4 +90,73 @@ public class PipetteGunExParamMgr extends ParamMgr { public double getCoefficientB() { return getParam(PipetteGunParam.VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); } + + public double getSmallCoefficientA() { + return getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_A, Double.class); + } + + public double getSmallCoefficientB() { + return getParam(PipetteGunParam.SMALL_VOLUME_CALIBRATION_COEFFICIENT_B, Double.class); + } + + public double getThreshold() { + return getParam(PipetteGunParam.THRESHOLD, Double.class); + } + + public int geVolumeAbsorbVelocity(Double ul) { + Double threshold = getParam(PipetteGunParam.THRESHOLD, Double.class); + if (ul < threshold) { + return (int) getSmallVolumeAbsorbVelocity(); + } else { + return (int) getLargeVolumeAbsorbVelocity(); + } + } + + public double getSmallVolumeAbsorbVelocity() { + return getParam(PipetteGunParam.SMALL_VOLUME_ABSORB_VELOCITY, Double.class); + } + + public double getLargeVolumeAbsorbVelocity() { + return getParam(PipetteGunParam.LARGE_VOLUME_ABSORB_VELOCITY, Double.class); + } + + + public Integer getSampleLLFVel(Double ul, A8kSamplePos pos) { + Double threshold = getParam(PipetteGunParam.THRESHOLD, Double.class); + if (ul < threshold) { + return 0; + } + return getLargeAbsorbSampleLLFVel(pos); + } + + public Integer getLargeAbsorbSampleLLFVel(A8kSamplePos pos) { + return switch (pos) { + case EmergencyTubePos -> getParam(PipetteGunParam.EMERGENCY_TUBE_LLF_VEL, Integer.class); + case BloodHTubePos, BloodSTubePos -> getParam(PipetteGunParam.BLOOD_TUBE_LLF_VEL, Integer.class); + case MiniBloodPos -> getParam(PipetteGunParam.MINI_BLOOD_LLF_VEL, Integer.class); + case Bulltube1P5Pos -> getParam(PipetteGunParam.BULLET_TUBE_1P5_LLF_VEL, Integer.class); + case Bulltube0P5Pos -> getParam(PipetteGunParam.BULLET_TUBE_0P5_LLF_VEL, Integer.class); + case StoolTestTubePos -> getParam(PipetteGunParam.STOOL_TEST_TUBE_LLF_VEL, Integer.class); + }; + } + + public void setLargeAbsorbSampleLLFVel(A8kSamplePos pos, Integer val) { + switch (pos) { + case EmergencyTubePos -> setParam(PipetteGunParam.EMERGENCY_TUBE_LLF_VEL, val); + case BloodHTubePos, BloodSTubePos -> setParam(PipetteGunParam.BLOOD_TUBE_LLF_VEL, val); + case MiniBloodPos -> setParam(PipetteGunParam.MINI_BLOOD_LLF_VEL, val); + case Bulltube1P5Pos -> setParam(PipetteGunParam.BULLET_TUBE_1P5_LLF_VEL, val); + case Bulltube0P5Pos -> setParam(PipetteGunParam.BULLET_TUBE_0P5_LLF_VEL, val); + case StoolTestTubePos -> setParam(PipetteGunParam.STOOL_TEST_TUBE_LLF_VEL, val); + } + } + + public Integer getLargeBSBottleLlfVel() { + return getParam(PipetteGunParam.LARGE_BS_BOTTLE_LLF_VEL, Integer.class); + } + + public void setLargeBSBottleLlfVel(Integer val) { + setParam(PipetteGunParam.LARGE_BS_BOTTLE_LLF_VEL, val); + } + } diff --git a/src/main/java/a8k/extui/page/extapp/profession_test/P01PipetteGunVerification.java b/src/main/java/a8k/extui/page/extapp/profession_test/P01PipetteGunVerification.java index 7d1a67a..4a9ccf1 100644 --- a/src/main/java/a8k/extui/page/extapp/profession_test/P01PipetteGunVerification.java +++ b/src/main/java/a8k/extui/page/extapp/profession_test/P01PipetteGunVerification.java @@ -1,25 +1,12 @@ package a8k.extui.page.extapp.profession_test; -import a8k.app.constant.AppConstant; import a8k.app.engineer.service.qatest.LiquidAbsorptionAndDistributionTestService; -import a8k.app.service.lowerctrl.LiquidOperationCtrlService; -import a8k.app.service.param.exparam.HbotConsumableExParamMgr; -import a8k.app.service.param.hbotpos.HbotTipPosMgr; import a8k.app.service.param.pipetteparam.PipetteGunExParamMgr; +import a8k.app.type.param.type.A8kSamplePos; import a8k.extui.mgr.ExtApiPageMgr; import a8k.extui.type.ExtUIPageCfg; -import a8k.app.hardware.type.LldType; -import a8k.app.service.lowerctrl.HbotMoveExCtrlService; -import a8k.app.hardware.driver.PipetteCtrlDriver; -import a8k.app.hardware.type.PipetteRegIndex; -import a8k.app.service.lowerctrl.HbotMoveCtrlService; -import a8k.app.type.a8k.ConsumableGroup; -import a8k.app.type.a8k.Pos3d; import a8k.app.type.exception.AppException; -import a8k.app.type.a8k.pos.TipPos; -import a8k.app.type.a8k.pos.TipGroupPos; import jakarta.annotation.PostConstruct; -import jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -37,9 +24,23 @@ public class P01PipetteGunVerification { void init() { ExtUIPageCfg page = new ExtUIPageCfg(this); page.newGroup("基础"); - page.addFunction("设置校准系数", this::setCalibrationParam) + page.addFunction("设置校准系数", this::setLargeVolumeCalibrationCoefficient) .setParamVal("coefficientA", pipetteGunExParamMgr::getCoefficientA) .setParamVal("coefficientB", pipetteGunExParamMgr::getCoefficientB); + page.addFunction("设置小体积校准系数", this::setSmallVolumeCalibrationCoefficient) + .setParamVal("coefficientA", pipetteGunExParamMgr::getSmallCoefficientA) + .setParamVal("coefficientB", pipetteGunExParamMgr::getSmallCoefficientB); + page.addFunction("设置阈值", this::setThreshold) + .setParamVal("threshold", pipetteGunExParamMgr::getThreshold); + page.newGroup("大取样时LLF-VEL"); + page.addFunction("设置大瓶缓冲液LLF-VEL", this::setLargeBSBottleLlfVel).setParamVal("val", pipetteGunExParamMgr::getLargeBSBottleLlfVel); + page.addFunction("设置急诊室位LLF-VEL", this::setEmergencyTubePosSampleLLF).setParamVal("val", () -> pipetteGunExParamMgr.getLargeAbsorbSampleLLFVel(A8kSamplePos.EmergencyTubePos)); + page.addFunction("设置全血试管LLF-VEL", this::setBloodHTubePosSampleLLF).setParamVal("val", () -> pipetteGunExParamMgr.getLargeAbsorbSampleLLFVel(A8kSamplePos.BloodHTubePos)); + page.addFunction("设置阳普管LLF-VEL", this::setMiniBloodPosSampleLLF).setParamVal("val", () -> pipetteGunExParamMgr.getLargeAbsorbSampleLLFVel(A8kSamplePos.MiniBloodPos)); + page.addFunction("设置1.5ml子弹头LLF-VEL", this::setBulltube1P5PosSampleLLF).setParamVal("val", () -> pipetteGunExParamMgr.getLargeAbsorbSampleLLFVel(A8kSamplePos.Bulltube1P5Pos)); + page.addFunction("设置0.5ml子弹头LLF-VEL", this::setBulltube0P5PosSampleLLF).setParamVal("val", () -> pipetteGunExParamMgr.getLargeAbsorbSampleLLFVel(A8kSamplePos.Bulltube0P5Pos)); + page.addFunction("设置粪便试管LLF-VEL", this::setStoolTestTubePosSampleLLF).setParamVal("val", () -> pipetteGunExParamMgr.getLargeAbsorbSampleLLFVel(A8kSamplePos.StoolTestTubePos)); + page.newGroup("测试0"); page.addFunction("取一次10ul", this::aspirate10ul); page.addFunction("取一次75ul", this::aspirate75ul); @@ -53,11 +54,55 @@ public class P01PipetteGunVerification { } - public void setCalibrationParam(Double coefficientA, Double coefficientB) { - pipetteGunExParamMgr.setVolumeCalibrationCoefficient(coefficientA, coefficientB); + public void setLargeVolumeCalibrationCoefficient(Double coefficientA, Double coefficientB) { + pipetteGunExParamMgr.setLargeVolumeCalibrationCoefficient(coefficientA, coefficientB); + } + + public void setSmallVolumeCalibrationCoefficient(Double coefficientA, Double coefficientB) { + pipetteGunExParamMgr.setSmallVolumeCalibrationCoefficient(coefficientA, coefficientB); + } + + + public void setThreshold(Double threshold) { + pipetteGunExParamMgr.setThreshold(threshold); + } + + // EmergencyTubePos + //BloodHTubePos + //MiniBloodPos + //Bulltube1P5Pos + //Bulltube0P5Pos + //StoolTestTubePos + public void setEmergencyTubePosSampleLLF(Integer val) { + pipetteGunExParamMgr.setLargeAbsorbSampleLLFVel(A8kSamplePos.EmergencyTubePos, val); + } + + public void setBloodHTubePosSampleLLF(Integer val) { + pipetteGunExParamMgr.setLargeAbsorbSampleLLFVel(A8kSamplePos.BloodHTubePos, val); + } + + public void setMiniBloodPosSampleLLF(Integer val) { + pipetteGunExParamMgr.setLargeAbsorbSampleLLFVel(A8kSamplePos.MiniBloodPos, val); + } + + public void setBulltube1P5PosSampleLLF(Integer val) { + pipetteGunExParamMgr.setLargeAbsorbSampleLLFVel(A8kSamplePos.Bulltube1P5Pos, val); } - public void aspirate(Integer ul,Boolean takeTipEachTime) throws AppException { + public void setBulltube0P5PosSampleLLF(Integer val) { + pipetteGunExParamMgr.setLargeAbsorbSampleLLFVel(A8kSamplePos.Bulltube0P5Pos, val); + } + + public void setStoolTestTubePosSampleLLF(Integer val) { + pipetteGunExParamMgr.setLargeAbsorbSampleLLFVel(A8kSamplePos.StoolTestTubePos, val); + } + + public void setLargeBSBottleLlfVel(Integer val) { + pipetteGunExParamMgr.setLargeBSBottleLlfVel(val); + } + + + public void aspirate(Integer ul, Boolean takeTipEachTime) throws AppException { liquidAbsorptionAndDistributionTestService.setTakeTipEachTime(takeTipEachTime); liquidAbsorptionAndDistributionTestService.absorbAndDistribute(ul); } @@ -81,6 +126,5 @@ public class P01PipetteGunVerification { public void aspirate50ul() throws AppException { liquidAbsorptionAndDistributionTestService.absorbAndDistribute(50); - } } diff --git a/src/main/java/a8k/extui/page/test/verification/P34LiquidOperationTestPage.java b/src/main/java/a8k/extui/page/test/verification/P34LiquidOperationTestPage.java index 9f3fb0b..0ad2581 100644 --- a/src/main/java/a8k/extui/page/test/verification/P34LiquidOperationTestPage.java +++ b/src/main/java/a8k/extui/page/test/verification/P34LiquidOperationTestPage.java @@ -21,7 +21,7 @@ public class P34LiquidOperationTestPage { @Resource LiquidOperationCtrlService liquidOperationCtrlService; @Resource - ExtApiPageMgr extApiPageMgr; + ExtApiPageMgr extApiPageMgr; // @@ -45,6 +45,10 @@ public class P34LiquidOperationTestPage { liquidOperationCtrlService.takeSample(from, topos, ul); } + public void takeSampleOnly(A8kSamplePos from, Integer ul) throws AppException { + liquidOperationCtrlService.takeSampleOnly(from, ul); + } + public void takeSampleToLittleBuffer(A8kSamplePos from, ConsumableGroup toGroup, Integer toIndex, Integer ul) throws AppException { PreReactionPos topos = new PreReactionPos(ConsumableType.SmallBottleBuffer, toGroup, toIndex); liquidOperationCtrlService.takeSample(from, topos, ul); @@ -79,6 +83,7 @@ public class P34LiquidOperationTestPage { cfg.addFunction("刺小瓶缓冲液", this::pirceLittleBuffer); cfg.addFunction("取样品到小瓶缓冲液", this::takeSampleToLittleBuffer); cfg.addFunction("取反应液到反应位", this::takePreReactionLiquidFromLittleBufferToLiquid); + cfg.addFunction("取样本", this::takeSampleOnly); extApiPageMgr.addPage(cfg); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index a24f8d4..57f4a44 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,13 +2,13 @@ server: port: 80 #device.runmode: "RealMode" -a8k.enableTemperatureCtrl: true +a8k.enableTemperatureCtrl: false device.runmode: "RealMode" device.enableCanBus: true iflytophald: # ip: 192.168.8.10 -# ip: 192.168.8.10 + # ip: 192.168.8.10 ip: 127.0.0.1 cmdch.port: 19004 datach.port: 19005 @@ -19,7 +19,7 @@ logging: file: name: ./runenv/app.log level: - a8k.app.hardware.basedriver: info + a8k.app.hardware: info spring: web: