From a81e9a921795baa00032e2b6c036e5a73c510afc Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sun, 25 May 2025 20:38:40 +0800 Subject: [PATCH] update --- .../a8k/app/constant/ActionOvertimeConstant.java | 6 +- .../app/hardware/driver/PipetteCtrlDriverV2.java | 77 ++++++++++++++++++++-- src/main/java/a8k/app/hardware/type/CmdId.java | 2 + .../type/pipette_module/cpyidx/ZMVCpyIdx.java | 1 + .../java/a8k/extui/mgr/ExtApiPageGroupCfgMgr.java | 3 + .../driver/pipette_module/PipetteGunCfgSync.java | 12 ++-- .../PipetteGunContainerConfigSettingPage.java | 28 ++++---- .../PipetteGunOperationCtrlPage.java | 27 ++++---- .../PipetteGunPMVelConfigSettingPage.java | 69 +++++++++++++++++++ .../pipette_module/PipetteGunTestCtrlPage.java | 42 ++++++++++++ 10 files changed, 229 insertions(+), 38 deletions(-) create mode 100644 src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunPMVelConfigSettingPage.java create mode 100644 src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunTestCtrlPage.java diff --git a/src/main/java/a8k/app/constant/ActionOvertimeConstant.java b/src/main/java/a8k/app/constant/ActionOvertimeConstant.java index 71322c2..b1634d4 100644 --- a/src/main/java/a8k/app/constant/ActionOvertimeConstant.java +++ b/src/main/java/a8k/app/constant/ActionOvertimeConstant.java @@ -10,7 +10,7 @@ import java.util.*; @Component public class ActionOvertimeConstant { - final Integer defaultOvertime = 10 * 1000; + final Integer defaultOvertime = 15 * 1000; static class OvertimeConfigItem { public MId mid; @@ -33,6 +33,10 @@ public class ActionOvertimeConstant { pushNewConfig(StepMotorMId.FeedingModXM, CmdId.step_motor_easy_move_to_zero, 15 * 1000); pushNewConfig(StepMotorMId.FeedingModXM, CmdId.step_motor_easy_move_to_end_point, 15 * 1000); + pushNewConfig(MId.PipetteMod, CmdId.pipette_pump_distribu, 30 * 1000); + pushNewConfig(MId.PipetteMod, CmdId.pipette_pump_aspirate, 30 * 1000); + pushNewConfig(MId.PipetteMod, CmdId.pipette_test_lld, 30 * 1000); + pushNewConfig(MId.PipetteMod, CmdId.pipette_test_pump_move_to_x100nl, 30 * 1000); } diff --git a/src/main/java/a8k/app/hardware/driver/PipetteCtrlDriverV2.java b/src/main/java/a8k/app/hardware/driver/PipetteCtrlDriverV2.java index 382ce73..1442245 100644 --- a/src/main/java/a8k/app/hardware/driver/PipetteCtrlDriverV2.java +++ b/src/main/java/a8k/app/hardware/driver/PipetteCtrlDriverV2.java @@ -40,11 +40,14 @@ public class PipetteCtrlDriverV2 { } public void setZMBCfg(ZMBasicConfigIndex index, Integer val) throws AppException { + log.info("setZMBCfg: index={}, val={}", index, val); callcmd(MId.PipetteMod, CmdId.pipette_set_zmbcfg, index.toInteger(), val); } public Integer getZMBCfg(ZMBasicConfigIndex index) throws AppException { - return callcmd(MId.PipetteMod, CmdId.pipette_get_zmbcfg, index.toInteger()).getContentI32(0); + Integer ret = callcmd(MId.PipetteMod, CmdId.pipette_get_zmbcfg, index.toInteger()).getContentI32(0); + log.info("getZMBCfg: index={} --> {}", index, ret); + return ret; } public void setPMBCfg(PMBasicConfigIndex index, Integer val) throws AppException { @@ -64,6 +67,7 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public void setPlatInfo(Integer cpyid, PlatformInfoIndex index, Integer val) throws AppException { + log.info("setPlatInfo: cpyid={}, index={} , {}", cpyid, index, val); callcmd(MId.PipetteMod, CmdId.pipette_set_platinfo, cpyid, index.toInteger(), val); } @@ -76,7 +80,9 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public Integer getPlatInfo(Integer cpyid, PlatformInfoIndex index) throws AppException { - return callcmd(MId.PipetteMod, CmdId.pipette_get_platinfo, cpyid, index.toInteger()).getContentI32(0); + Integer ret = callcmd(MId.PipetteMod, CmdId.pipette_get_platinfo, cpyid, index.toInteger()).getContentI32(0); + log.info("getPlatInfo: cpyid={}, index={} --> {}", cpyid, index, ret); + return ret; } /** @@ -88,6 +94,7 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public void setZMVCfg(ZMVCpyIdx cpyid, ZMVConfigIndex index, Integer val) throws AppException { + log.info("setZMVCfg: cpyid={}, index={} , {}", cpyid, index, val); callcmd(MId.PipetteMod, CmdId.pipette_set_zmvcfg, cpyid.toInteger(), index.toInteger(), val); } @@ -100,7 +107,9 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public Integer getZMVCfg(ZMVCpyIdx cpyid, ZMVConfigIndex index) throws AppException { - return callcmd(MId.PipetteMod, CmdId.pipette_get_zmvcfg, cpyid.toInteger(), index.toInteger()).getContentI32(0); + Integer ret = callcmd(MId.PipetteMod, CmdId.pipette_get_zmvcfg, cpyid.toInteger(), index.toInteger()).getContentI32(0); + log.info("getZMVCfg: cpyid={}, index={} --> {}", cpyid, index, ret); + return ret; } /** @@ -112,6 +121,7 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public void setPMVCfg(PMVCpyIdx cpyid, PMVConfigIndex index, Integer val) throws AppException { + log.info("setPMVCfg: cpyid={}, index={} , {}", cpyid, index, val); callcmd(MId.PipetteMod, CmdId.pipette_set_pmvcfg, cpyid.toInteger(), index.toInteger(), val); } @@ -124,7 +134,9 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public Integer getPMVCfg(PMVCpyIdx cpyid, PMVConfigIndex index) throws AppException { - return callcmd(MId.PipetteMod, CmdId.pipette_get_pmvcfg, cpyid.toInteger(), index.toInteger()).getContentI32(0); + Integer ret = callcmd(MId.PipetteMod, CmdId.pipette_get_pmvcfg, cpyid.toInteger(), index.toInteger()).getContentI32(0); + log.info("getPMVCfg: cpyid={}, index={} --> {}", cpyid, index, ret); + return ret; } /** @@ -136,6 +148,7 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public void setContainerInfo(Integer cpyid, ContainerInfoIndex index, Integer val) throws AppException { + log.info("setContainerInfo: cpyid={}, index={} , {}", cpyid, index, val); callcmd(MId.PipetteMod, CmdId.pipette_set_container_info, cpyid, index.toInteger(), val); } @@ -152,7 +165,10 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public Integer getContainerInfo(Integer cpyid, ContainerInfoIndex index) throws AppException { - return callcmd(MId.PipetteMod, CmdId.pipette_get_container_info, cpyid, index.toInteger()).getContentI32(0); + Integer val = callcmd(MId.PipetteMod, CmdId.pipette_get_container_info, cpyid, index.toInteger()).getContentI32(0); + log.info("getContainerInfo: cpyid={}, index={} --> {}", cpyid, index, val); + return val; + } public Integer getContainerInfo(ContainerCpyId cpyid, ContainerInfoIndex index) throws AppException { @@ -168,6 +184,7 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public void setLiquidInfo(Integer cpyid, LiquidInfoIndex index, Integer val) throws AppException { + log.info("setLiquidInfo: cpyid={}, index={} , {}", cpyid, index, val); callcmd(MId.PipetteMod, CmdId.pipette_set_liquid_info, cpyid, index.toInteger(), val); } @@ -184,7 +201,9 @@ public class PipetteCtrlDriverV2 { * @throws AppException 异常 */ public Integer getLiquidInfo(Integer cpyid, LiquidInfoIndex index) throws AppException { - return callcmd(MId.PipetteMod, CmdId.pipette_get_liquid_info, cpyid, index.toInteger()).getContentI32(0); + Integer ret = callcmd(MId.PipetteMod, CmdId.pipette_get_liquid_info, cpyid, index.toInteger()).getContentI32(0); + log.info("getLiquidInfo: cpyid={}, index={} --> {}", cpyid, index, ret); + return ret; } public Integer getLiquidInfo(LiquidConfigCpyIdx cpyid, LiquidInfoIndex index) throws AppException { @@ -312,6 +331,16 @@ public class PipetteCtrlDriverV2 { waitForMod(CmdId.pipette_pump_distribu); } + public void pipetteTestPumpMoveToX100nl(Integer x100nl, Integer vcfgIndex) throws AppException { + callcmd(MId.PipetteMod, CmdId.pipette_test_pump_move_to_x100nl, x100nl, vcfgIndex); + waitForMod(CmdId.pipette_test_pump_move_to_x100nl); + } + + public void pipetteTestLld(Integer containerPos, ContainerCpyId containerCpyId, LiquidConfigCpyIdx liquidCpyId) throws AppException { + callcmd(MId.PipetteMod, CmdId.pipette_test_lld, containerPos, containerCpyId.toInteger(), liquidCpyId.toInteger()); + waitForMod(CmdId.pipette_test_lld); + } + public Integer readState(PipetteStateIndex index) throws AppException { return callcmd(MId.PipetteMod, CmdId.pipette_read_state, index.toInteger()).getContentI32(0); } @@ -526,7 +555,7 @@ public class PipetteCtrlDriverV2 { val.d1 = getZMVCfg(idx, ZMVConfigIndex.d1); val.vstop = getZMVCfg(idx, ZMVConfigIndex.vstop); val.vmax = getZMVCfg(idx, ZMVConfigIndex.vmax); - val.mark = getZMVCfg(idx, ZMVConfigIndex.mark); + val.mark = getZMVCfg(idx, ZMVConfigIndex.mark); return val; } @@ -559,4 +588,38 @@ public class PipetteCtrlDriverV2 { return cfg; } + public void updateConfig(PipetteConfig cfg) throws AppException { + if (cfg == null) { + log.error("updateConfig cfg is null"); + return; + } + Long start = System.currentTimeMillis(); + setZMBCfg(cfg.zmBCfgs); + for (int i = 0; i < cfg.platInfos.size(); i++) { + applyPlatInfo(i, cfg.platInfos.get(i)); + } + for (int i = 0; i < cfg.containerInfos.size(); i++) { + if (ContainerCpyId.values()[i].equals(ContainerCpyId.NotSet)) + break; + applyContainerInfo(ContainerCpyId.values()[i], cfg.containerInfos.get(i)); + } + for (int i = 0; i < cfg.liquidInfos.size(); i++) { + if (LiquidConfigCpyIdx.values()[i].equals(LiquidConfigCpyIdx.NotSet)) + break; + applyLiquidInfo(LiquidConfigCpyIdx.values()[i], cfg.liquidInfos.get(i)); + } + for (int i = 0; i < cfg.zmVCfgs.size(); i++) { + if (ZMVCpyIdx.values()[i].equals(ZMVCpyIdx.NotSet)) + break; + setZMVCfg(ZMVCpyIdx.values()[i], cfg.zmVCfgs.get(i)); + } + for (int i = 0; i < cfg.pmVCfgs.size(); i++) { + if (PMVCpyIdx.values()[i].equals(PMVCpyIdx.NotSet)) + break; + setPMVCfg(PMVCpyIdx.values()[i], cfg.pmVCfgs.get(i)); + } + + log.info("sync config to pipette module completed, cost {} ms", System.currentTimeMillis() - start); + } + } diff --git a/src/main/java/a8k/app/hardware/type/CmdId.java b/src/main/java/a8k/app/hardware/type/CmdId.java index b53065c..afe3030 100644 --- a/src/main/java/a8k/app/hardware/type/CmdId.java +++ b/src/main/java/a8k/app/hardware/type/CmdId.java @@ -200,6 +200,8 @@ public enum CmdId { pipette_read_pressure(0x758C, "pipette_read_pressure"), pipette_read_capacitance(0x758D, "pipette_read_capacitance"), + pipette_test_pump_move_to_x100nl(0x7600, "pipette_test_pump_move_to_x100nl"), // int32_t x100nl, int32_t vcfgindex + pipette_test_lld(0x7601, "pipette_test_lld"), // int32_t container_pos, int32_t container_cpyid, int32_t liquid_cpyid ; public final static int ATTACH_IS_BYTES = 1; diff --git a/src/main/java/a8k/app/hardware/type/pipette_module/cpyidx/ZMVCpyIdx.java b/src/main/java/a8k/app/hardware/type/pipette_module/cpyidx/ZMVCpyIdx.java index 4fa5788..c18a28e 100644 --- a/src/main/java/a8k/app/hardware/type/pipette_module/cpyidx/ZMVCpyIdx.java +++ b/src/main/java/a8k/app/hardware/type/pipette_module/cpyidx/ZMVCpyIdx.java @@ -10,6 +10,7 @@ public enum ZMVCpyIdx { VLld, // 液面探测vlld VSwap, // 交换液面探测 VLlf, // 液面基础速度配置 + PickingTip,// 取tip NotSet, ; diff --git a/src/main/java/a8k/extui/mgr/ExtApiPageGroupCfgMgr.java b/src/main/java/a8k/extui/mgr/ExtApiPageGroupCfgMgr.java index c325e82..a1c7740 100644 --- a/src/main/java/a8k/extui/mgr/ExtApiPageGroupCfgMgr.java +++ b/src/main/java/a8k/extui/mgr/ExtApiPageGroupCfgMgr.java @@ -127,7 +127,10 @@ public class ExtApiPageGroupCfgMgr { new Menu("移液枪驱动", ZList.of( new Menu(PipetteGunCfgSync.class, "配置同步"), new Menu(PipetteGunZMotorCtrlPage.class, "移液枪Z电机控制"), + new Menu(PipetteGunOperationCtrlPage.class, "移液枪操作"), + new Menu(PipetteGunTestCtrlPage.class, "移液枪单元测试"), new Menu(PipetteGunZMVelConfigSettingPage.class, "移液枪Z电机VConfig配置"), + new Menu(PipetteGunPMVelConfigSettingPage.class, "移液枪泵机VConfig配置"), new Menu(PipetteGunPlatformSettingPage.class, "设置平台参数"), new Menu(PipetteGunLiquidConfigSettingPage.class, "设置液体参数"), new Menu(PipetteGunContainerConfigSettingPage.class, "设置液体容器参数") diff --git a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunCfgSync.java b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunCfgSync.java index 7229e44..ddf86d0 100644 --- a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunCfgSync.java +++ b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunCfgSync.java @@ -8,6 +8,7 @@ import a8k.app.service.data.FileMgrService; import a8k.app.type.exception.AppException; import a8k.app.utils.ZJsonHelper; import a8k.extui.mgr.ExtApiPageMgr; +import a8k.extui.type.param.ExtUIFile; import a8k.extui.type.ret.ExtUIDownloadTasks; import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; @@ -25,11 +26,14 @@ public class PipetteGunCfgSync { private final FileMgrService fileMgrService; - public PipetteConfig readConfig() throws AppException { - return pipetteCtrlDriverV2.getConfig(); + + public void syncCfgToBoard(ExtUIFile file) throws AppException { + String filecontent = new String(file.bytes); + PipetteConfig cfg = ZJsonHelper.objectFromJson(filecontent, PipetteConfig.class); + pipetteCtrlDriverV2.updateConfig(cfg); } - public ExtUIDownloadTasks downloadOptData(Integer id) throws IOException, AppException { + public ExtUIDownloadTasks readConfig(Integer id) throws IOException, AppException { ExtUIDownloadTasks tasks = new ExtUIDownloadTasks(); var cfg = pipetteCtrlDriverV2.getConfig(); String url = fileMgrService.storageTmpFile("pipetteGunCfg", ZJsonHelper.objectToJson(cfg)); @@ -43,7 +47,7 @@ public class PipetteGunCfgSync { var page = extApiPageMgr.newPage(this); page.newGroup("基础操作"); page.addFunction("读取配置", this::readConfig); - page.addFunction("下载配置", this::downloadOptData); + page.addFunction("同步配置到板子", this::syncCfgToBoard); extApiPageMgr.addPage(page); } diff --git a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunContainerConfigSettingPage.java b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunContainerConfigSettingPage.java index b705356..9fa1e9d 100644 --- a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunContainerConfigSettingPage.java +++ b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunContainerConfigSettingPage.java @@ -9,6 +9,7 @@ import a8k.app.hardware.type.pipette_module.cpyidx.LiquidConfigCpyIdx; import a8k.app.hardware.type.pipette_module.cpyidx.PMVCpyIdx; import a8k.app.type.exception.AppException; import a8k.extui.mgr.ExtApiPageMgr; +import a8k.extui.type.param.ExtUIFile; import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -29,6 +30,7 @@ public class PipetteGunContainerConfigSettingPage { } } + public void setContainerInfo(ContainerCpyId cpyid, ContainerInfoIndex index, Integer val) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyid.toInteger(), index, val); } @@ -42,56 +44,56 @@ public class PipetteGunContainerConfigSettingPage { } } - void setContainerType( Integer containerType) throws AppException { + public void setContainerType(Integer containerType) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.containerType, containerType); } - void setContainerNeckPos( Integer containerNeckPos) throws AppException { + public void setContainerNeckPos(Integer containerNeckPos) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.containerNeckPos, containerNeckPos); } - void setContainerDepth( Integer containerDepth) throws AppException { + public void setContainerDepth(Integer containerDepth) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.containerDepth, containerDepth); } - void setContainerRound( Integer containerRound) throws AppException { + public void setContainerRound(Integer containerRound) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.containerRound, containerRound); } - void setContainerBottomSectionHeight( Integer containerBottomSectionHeight) throws AppException { + public void setContainerBottomSectionHeight(Integer containerBottomSectionHeight) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.containerBottomSectionHeight, containerBottomSectionHeight); } - void setImmersionDepth( Integer immersionDepth) throws AppException { + public void setImmersionDepth(Integer immersionDepth) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.immersionDepth, immersionDepth); } - void setLeavingHeight( Integer leavingHeight) throws AppException { + public void setLeavingHeight(Integer leavingHeight) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.leavingHeight, leavingHeight); } - void setJetHeight( Integer jetHeight) throws AppException { + public void setJetHeight(Integer jetHeight) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.jetHeight, jetHeight); } - void setLldStartSearchDepth( Integer lldStartSearchDepth) throws AppException { + public void setLldStartSearchDepth(Integer lldStartSearchDepth) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.lldStartSearchDepth, lldStartSearchDepth); } - void setFixAspirationDepth( Integer fixAspirationDepth) throws AppException { + public void setFixAspirationDepth(Integer fixAspirationDepth) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.fixAspirationDepth, fixAspirationDepth); } - void setLlFvConvertCoefficient( Integer llfVConvertCoefficient) throws AppException { + public void setLlFvConvertCoefficient(Integer llfVConvertCoefficient) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.llfVConvertCoefficient, llfVConvertCoefficient); } - void setPierceDepth(Integer pierceDepth) throws AppException { + public void setPierceDepth(Integer pierceDepth) throws AppException { pipetteCtrlDriverV2.setContainerInfo(cpyId.toInteger(), ContainerInfoIndex.pierceDepth, pierceDepth); } @PostConstruct - void init() { + public void init() { var page = extApiPageMgr.newPage(this); page.newGroup("基础操作"); page.addFunction("设置容器信息CpyId", this::setCpyIdRefreshPage) diff --git a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunOperationCtrlPage.java b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunOperationCtrlPage.java index 202cdf5..184d015 100644 --- a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunOperationCtrlPage.java +++ b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunOperationCtrlPage.java @@ -6,6 +6,7 @@ import a8k.app.hardware.type.pipette_module.cfg.ContainerInfoIndex; import a8k.app.hardware.type.pipette_module.cfg.LiquidInfoIndex; import a8k.app.hardware.type.pipette_module.cfg.PlatformInfoIndex; import a8k.app.hardware.type.pipette_module.cpyidx.ContainerCpyId; +import a8k.app.hardware.type.pipette_module.cpyidx.LiquidConfigCpyIdx; import a8k.app.type.exception.AppException; import a8k.extui.mgr.ExtApiPageMgr; import jakarta.annotation.PostConstruct; @@ -24,23 +25,23 @@ public class PipetteGunOperationCtrlPage { Integer platInfoCpyId = 0; - Integer volume; - Integer containerPos; - ContainerInfoIndex containerInfoIndex; - LiquidInfoIndex liquidCfgIndex; - Integer aspirationMode;//only support 0 - Integer lldEnable; - Integer lldType;//only support 0 - Integer lldEnableProtect; - Integer mixLlfEnable; - Integer llfEnable; - Integer mixVolume; - Integer mixTimes; + Integer volume = 10; + Integer containerPos = 100; + ContainerCpyId containerInfoIndex = ContainerCpyId.Default; + LiquidConfigCpyIdx liquidCfgIndex = LiquidConfigCpyIdx.Default; + Integer aspirationMode = 0;//only support 0 + Integer lldEnable = 0; + Integer lldType = 0;//only support 0 + Integer lldEnableProtect = 0; + Integer mixLlfEnable = 0; + Integer llfEnable = 0; + Integer mixVolume = 0; + Integer mixTimes = 0; // pipetteCtrlDriverV2.pipettePumpAspirateSetParam(AspirationParamId.volume, volume); - void execAspirate() throws AppException { + public void execAspirate() throws AppException { pipetteCtrlDriverV2.pipettePumpAspirateSetParam(AspirationParamId.volume, volume); pipetteCtrlDriverV2.pipettePumpAspirateSetParam(AspirationParamId.container_pos, containerPos); pipetteCtrlDriverV2.pipettePumpAspirateSetParam(AspirationParamId.container_info_index, containerInfoIndex.toInteger()); diff --git a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunPMVelConfigSettingPage.java b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunPMVelConfigSettingPage.java new file mode 100644 index 0000000..984e630 --- /dev/null +++ b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunPMVelConfigSettingPage.java @@ -0,0 +1,69 @@ +package a8k.extui.page.driver.pipette_module; + +import a8k.app.hardware.driver.PipetteCtrlDriverV2; +import a8k.app.hardware.type.pipette_module.cfg.PMVConfigIndex; +import a8k.app.hardware.type.pipette_module.cfg.ZMVConfigIndex; +import a8k.app.hardware.type.pipette_module.cpyidx.PMVCpyIdx; +import a8k.app.type.exception.AppException; +import a8k.extui.mgr.ExtApiPageMgr; +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +@Slf4j +public class PipetteGunPMVelConfigSettingPage { + private final ExtApiPageMgr extApiPageMgr; + private final PipetteCtrlDriverV2 pipetteCtrlDriverV2; + + + PMVCpyIdx cpyId = PMVCpyIdx.VDefault; + + public void setCpyIdCxtRefreshPage(PMVCpyIdx cpyId) { + this.cpyId = cpyId; + } + + public void setVStartConfig(Integer vStart, Integer acc) throws AppException { + pipetteCtrlDriverV2.setPMVCfg(cpyId, PMVConfigIndex.acc, acc); + pipetteCtrlDriverV2.setPMVCfg(cpyId, PMVConfigIndex.vStart, vStart); + } + + public void setVStopConfig(Integer vStop, Integer dec) throws AppException { + pipetteCtrlDriverV2.setPMVCfg(cpyId, PMVConfigIndex.dec, dec); + pipetteCtrlDriverV2.setPMVCfg(cpyId, PMVConfigIndex.vStop, vStop); + } + + public void setVMax(Integer vMax) throws AppException { + pipetteCtrlDriverV2.setPMVCfg(cpyId, PMVConfigIndex.vMax, vMax); + } + + + public Integer getConfig(PMVConfigIndex index) { + try { + return pipetteCtrlDriverV2.getPMVCfg(cpyId, index); + } catch (AppException e) { + return 0; + } + } + + + @PostConstruct + void init() { + var page = extApiPageMgr.newPage(this); + page.newGroup("基础操作"); + page.addFunction("设置速度CpyId", this::setCpyIdCxtRefreshPage) + .setParamVal("cpyId", () -> cpyId); + page.addFunction("设置加速过程配置(vStart:0->319,acc:1->20)", this::setVStartConfig) + .setParamVal("vStart", () -> getConfig(PMVConfigIndex.vStart)) + .setParamVal("acc", () -> getConfig(PMVConfigIndex.acc)); + page.addFunction("设置减速过程配置(vStop:0->319,dec:1->20)", this::setVStopConfig) + .setParamVal("vStop", () -> getConfig(PMVConfigIndex.vStop)) + .setParamVal("dec", () -> getConfig(PMVConfigIndex.dec)); + page.addFunction("设置最大速度配置(vMax:0->2552 ul/s)", this::setVMax) + .setParamVal("vMax", () -> getConfig(PMVConfigIndex.vMax)); + extApiPageMgr.addPage(page); + } + +} diff --git a/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunTestCtrlPage.java b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunTestCtrlPage.java new file mode 100644 index 0000000..98c6126 --- /dev/null +++ b/src/main/java/a8k/extui/page/driver/pipette_module/PipetteGunTestCtrlPage.java @@ -0,0 +1,42 @@ +package a8k.extui.page.driver.pipette_module; + +import a8k.app.hardware.driver.PipetteCtrlDriverV2; +import a8k.app.hardware.type.pipette_module.AspirationParamId; +import a8k.app.hardware.type.pipette_module.cpyidx.ContainerCpyId; +import a8k.app.hardware.type.pipette_module.cpyidx.LiquidConfigCpyIdx; +import a8k.app.hardware.type.pipette_module.cpyidx.PMVCpyIdx; +import a8k.app.type.exception.AppException; +import a8k.extui.mgr.ExtApiPageMgr; +import jakarta.annotation.PostConstruct; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +@Slf4j +@Data +public class PipetteGunTestCtrlPage { + private final ExtApiPageMgr extApiPageMgr; + private final PipetteCtrlDriverV2 pipetteCtrlDriverV2; + + public void pipetteTestPumpMoveToX100nl(Integer x100nl, PMVCpyIdx vcpyidx) throws AppException { + pipetteCtrlDriverV2.pipetteTestPumpMoveToX100nl(x100nl, vcpyidx.toInteger()); + } + + public void pipetteTestLld(Integer containerPos, ContainerCpyId containerCpyId, LiquidConfigCpyIdx liquidCpyId) throws AppException { + pipetteCtrlDriverV2.pipetteTestLld(containerPos, containerCpyId, liquidCpyId); + } + + + @PostConstruct + void init() { + var page = extApiPageMgr.newPage(this); + page.newGroup(" 操作"); + page.addFunction("单元测试-测试泵机移动到X100nl", this::pipetteTestPumpMoveToX100nl); + page.addFunction("单元测试-测试泵机LLD", this::pipetteTestLld); + extApiPageMgr.addPage(page); + } + +}