From c40aa61033b40bb55640b1f52edaf4125e1352de Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 31 Oct 2024 18:44:45 +0800 Subject: [PATCH] update --- .../pagecontrol/ExtApiTabConfig.java | 1 + .../devicectrl/ctrlservice/HbotCtrlService.java | 6 +- .../calibration/HbotLittleBSPosCalibration.java | 4 +- .../HbotProbeSubstancePosCalibration.java | 4 +- .../ext_param_mgr/HbotConsumableParamMgr.java | 8 +-- .../param/param_mgr/HbotLittleBSPosMgr.java | 16 +++--- .../param/param_mgr/HbotProbeSubstancePosMgr.java | 12 ++-- .../app/devicectrl/param/type/HbotLittleBSPos.java | 2 +- .../param/type/HbotProbeSubstancePos.java | 4 +- .../app/devicectrl/test/PosMeasureUtils.java | 63 +++++++++++++++++++++ .../a8k/service/test/MainflowCtrlTestService.java | 32 +++++++++-- .../a8k/service/test/fakeproj/FakeProjInfo.java | 2 +- .../java/a8k/utils/ProjProcessContextUtils.java | 16 +++--- src/main/resources/app.db | Bin 225280 -> 225280 bytes 14 files changed, 124 insertions(+), 46 deletions(-) create mode 100644 src/main/java/a8k/service/app/devicectrl/test/PosMeasureUtils.java diff --git a/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java b/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java index f5e16ae..f2ba419 100644 --- a/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java +++ b/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java @@ -24,6 +24,7 @@ public enum ExtApiTabConfig { PipetteGunTest("测试.PipetteGun",true), + PosMeasureUtils("测试.坐标测量",true), A8kPipetteCtrlModule("硬件驱动.移液枪测试", true), diff --git a/src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java b/src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java index e0dff1b..93820f9 100644 --- a/src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java +++ b/src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java @@ -122,9 +122,9 @@ public class HbotCtrlService { hbotBaseMoveExDriver.hbotMoveTo(hbotConsumableParamMgr.getLittleBufferSamplePosEnd(group, off)); } - public void moveToProbeSubstanceSamplePos(ConsumableGroup group, Integer off) throws AppException { - hbotBaseMoveExDriver.hbotMoveTo(hbotConsumableParamMgr.getProbeSubstanceSamplePos(group, off)); - } +// public void moveToProbeSubstanceSamplePos(ConsumableGroup group, Integer off) throws AppException { +// hbotBaseMoveExDriver.hbotMoveTo(hbotConsumableParamMgr.getProbeSubstanceSamplePos(group, off)); +// } public void moveToProbeSubstanceSamplePosEnd(ConsumableGroup group, Integer off) throws AppException { hbotBaseMoveExDriver.hbotMoveTo(hbotConsumableParamMgr.getProbeSubstanceSamplePosEnd(group, off)); diff --git a/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotLittleBSPosCalibration.java b/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotLittleBSPosCalibration.java index 968e059..1361045 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotLittleBSPosCalibration.java +++ b/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotLittleBSPosCalibration.java @@ -146,8 +146,8 @@ public class HbotLittleBSPosCalibration { @ExtApiFn(name = "校准.小瓶穿孔Z轴位置", group = "标定Z轴", order = 101) public void calibrationPierceZPos() throws AppException {calibrationZPos(HbotLittleBSPos.LittleBSPierceZPos, 0);} - @ExtApiFn(name = "校准.小瓶取样Z轴位置", group = "标定Z轴", order = 102) - public void calibrationSampleZPos() throws AppException {calibrationZPos(HbotLittleBSPos.LittleBSSampleZPos, 0);} + // @ExtApiFn(name = "校准.小瓶取样Z轴位置", group = "标定Z轴", order = 102) + // public void calibrationSampleZPos() throws AppException {calibrationZPos(HbotLittleBSPos.LittleBSSampleZPos, 0);} @ExtApiFn(name = "校准.小瓶缓冲液取样结束Z轴位置", group = "标定Z轴", order = 104) public void calibrationSampleEndZPos() throws AppException { diff --git a/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotProbeSubstancePosCalibration.java b/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotProbeSubstancePosCalibration.java index bc2a914..6a8ddb7 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotProbeSubstancePosCalibration.java +++ b/src/main/java/a8k/service/app/devicectrl/param/calibration/HbotProbeSubstancePosCalibration.java @@ -147,8 +147,8 @@ public class HbotProbeSubstancePosCalibration { disableModule(); } - @ExtApiFn(name = "校准.小瓶取样Z轴位置", group = "标定Z轴", order = 102) - public void setSampleZPos() throws AppException {setZPos(HbotProbeSubstancePos.ProbeSubstanceSampleZPos, 0);} +// @ExtApiFn(name = "校准.小瓶取样Z轴位置", group = "标定Z轴", order = 102) +// public void setSampleZPos() throws AppException {setZPos(HbotProbeSubstancePos.ProbeSubstanceSampleZPos, 0);} @ExtApiFn(name = "校准.小瓶缓冲液取样结束Z轴位置", group = "标定Z轴", order = 104) public void setSampleEndZPos() throws AppException {setZPos(HbotProbeSubstancePos.ProbeSubstanceSampleEndZPos, -25/*2mm*/);} diff --git a/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/HbotConsumableParamMgr.java b/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/HbotConsumableParamMgr.java index 331bbda..08a046e 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/HbotConsumableParamMgr.java +++ b/src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/HbotConsumableParamMgr.java @@ -37,17 +37,11 @@ public class HbotConsumableParamMgr { return hbotLittleBSPosMgr.getPiercePos(group, off); } - public Pos3d getLittleBufferSamplePos(ConsumableGroup group, Integer off) { - return hbotLittleBSPosMgr.getSamplePos(group, off); - } - public Pos3d getLittleBufferSamplePosEnd(ConsumableGroup group, Integer off) { return hbotLittleBSPosMgr.getSampleEndPos(group, off); } - public Pos3d getProbeSubstanceSamplePos(ConsumableGroup group, Integer off) { - return hbotProbeSubstancePosMgr.getSamplePos(group, off); - } + public Pos3d getProbeSubstanceSamplePosEnd(ConsumableGroup group, Integer off) { return hbotProbeSubstancePosMgr.getSampleEndPos(group, off); diff --git a/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotLittleBSPosMgr.java b/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotLittleBSPosMgr.java index 50b035d..37e3125 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotLittleBSPosMgr.java +++ b/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotLittleBSPosMgr.java @@ -14,7 +14,7 @@ import org.springframework.stereotype.Component; * HBOT二维码扫描坐标参数 */ @Component -public class HbotLittleBSPosMgr extends ParamMgr { +public class HbotLittleBSPosMgr extends ParamMgr { static final Logger logger = LoggerFactory.getLogger(HbotLittleBSPosMgr.class); @@ -35,7 +35,7 @@ public class HbotLittleBSPosMgr extends ParamMgr { setParam(param, pos); } - public Pos3d getPiercePos(ConsumableGroup group, Integer off) { + public Pos3d getConsumablePos(ConsumableGroup group, Integer off) { HbotLittleBSPos param = HbotLittleBSPos.valueOf(HbotLittleBSPos.LittleBufferGroup0_000Pos.ordinal() + group.ordinal()); Pos2d pos00 = getParam(param, Pos2d.class); @@ -48,20 +48,18 @@ public class HbotLittleBSPosMgr extends ParamMgr { double x = pos00.x + xoff * dx; double y = pos00.y + yoff * dy; - Double z = getParam(HbotLittleBSPos.LittleBSPierceZPos, Double.class); - + return new Pos3d((int) x, (int) y, 0); - return new Pos3d((int) x, (int) y, z.intValue()); } - public Pos3d getSamplePos(ConsumableGroup group, Integer off) { - Pos3d pos = getPiercePos(group, off); - pos.z = getParam(HbotLittleBSPos.LittleBSSampleZPos, Double.class).intValue(); + public Pos3d getPiercePos(ConsumableGroup group, Integer off) { + Pos3d pos = getConsumablePos(group, off); + pos.z = getParam(HbotLittleBSPos.LittleBSPierceZPos, Double.class).intValue(); return pos; } public Pos3d getSampleEndPos(ConsumableGroup group, Integer off) { - Pos3d pos = getSamplePos(group, off); + Pos3d pos = getConsumablePos(group, off); pos.z = getParam(HbotLittleBSPos.LittleBSSampleEndZPos, Double.class).intValue(); return pos; } diff --git a/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotProbeSubstancePosMgr.java b/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotProbeSubstancePosMgr.java index a80353a..7334527 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotProbeSubstancePosMgr.java +++ b/src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotProbeSubstancePosMgr.java @@ -54,14 +54,14 @@ public class HbotProbeSubstancePosMgr extends ParamMgr { return new Pos3d((int) x, (int) y, 0); } - public Pos3d getSamplePos(ConsumableGroup group, Integer off) { - Pos3d pos = getXYPos(group, off); - pos.z = getParam(HbotProbeSubstancePos.ProbeSubstanceSampleZPos, Double.class).intValue(); - return pos; - } +// public Pos3d getSamplePos(ConsumableGroup group, Integer off) { +// Pos3d pos = getXYPos(group, off); +// pos.z = getParam(HbotProbeSubstancePos.ProbeSubstanceSampleZPos, Double.class).intValue(); +// return pos; +// } public Pos3d getSampleEndPos(ConsumableGroup group, Integer off) { - Pos3d pos = getSamplePos(group, off); + Pos3d pos = getXYPos(group, off); pos.z = getParam(HbotProbeSubstancePos.ProbeSubstanceSampleEndZPos, Double.class).intValue(); return pos; } diff --git a/src/main/java/a8k/service/app/devicectrl/param/type/HbotLittleBSPos.java b/src/main/java/a8k/service/app/devicectrl/param/type/HbotLittleBSPos.java index d0c4489..3909356 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/type/HbotLittleBSPos.java +++ b/src/main/java/a8k/service/app/devicectrl/param/type/HbotLittleBSPos.java @@ -11,7 +11,7 @@ public enum HbotLittleBSPos { LittleBufferGroupDY("小瓶缓冲液的Y间距"), LittleBSPierceZPos("小瓶缓冲液刺破Z坐标"), - LittleBSSampleZPos("小瓶缓冲液取样Z坐标"), + // LittleBSSampleZPos("小瓶缓冲液取样Z坐标"), LittleBSSampleEndZPos("小瓶缓冲液取样结束Z坐标"), ; final public String chName; diff --git a/src/main/java/a8k/service/app/devicectrl/param/type/HbotProbeSubstancePos.java b/src/main/java/a8k/service/app/devicectrl/param/type/HbotProbeSubstancePos.java index e44bd20..0565542 100644 --- a/src/main/java/a8k/service/app/devicectrl/param/type/HbotProbeSubstancePos.java +++ b/src/main/java/a8k/service/app/devicectrl/param/type/HbotProbeSubstancePos.java @@ -10,8 +10,8 @@ public enum HbotProbeSubstancePos { ProbeSubstanceDX("探测物质的X间距"), ProbeSubstanceDY("探测物质的Y间距"), - ProbeSubstanceSampleZPos("探测物质取样Z坐标"), - ProbeSubstanceSampleEndZPos("探测物质取样结束Z坐标"), + // ProbeSubstanceSampleZPos("探测物质取样Z坐标"), + ProbeSubstanceSampleEndZPos("探测物质取样结束Z坐标"),//刺破高度和取样高度一样 ; final public String chName; diff --git a/src/main/java/a8k/service/app/devicectrl/test/PosMeasureUtils.java b/src/main/java/a8k/service/app/devicectrl/test/PosMeasureUtils.java new file mode 100644 index 0000000..cf8971c --- /dev/null +++ b/src/main/java/a8k/service/app/devicectrl/test/PosMeasureUtils.java @@ -0,0 +1,63 @@ +package a8k.service.app.devicectrl.test; + +import a8k.extapi_controler.pagecontrol.ExtApiTabConfig; +import a8k.extapi_controler.utils.ExtApiFn; +import a8k.extapi_controler.utils.ExtApiTab; +import a8k.hardware.type.LldType; +import a8k.service.app.devicectrl.driver.HbotDriver; +import a8k.service.app.devicectrl.driver.PipetteCtrlDriver; +import a8k.service.app.devicectrl.exdriver.HbotBaseMoveExDriver; +import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; +import a8k.service.app.devicectrl.param.param_mgr.PipetteGunLLDParamMgr; +import a8k.type.cfg.Pos2d; +import a8k.type.exception.AppException; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Component; + +@ExtApiTab(cfg = ExtApiTabConfig.PosMeasureUtils) +@Component +public class PosMeasureUtils { + + @Resource + PipetteGunLLDParamMgr pipetteGunLLDParamMgr; + + @Resource + PipetteCtrlDriver pipetteCtrlDriver; + @Resource + HbotBaseMoveExDriver hbotBaseMoveExDriver; + @Resource + MotorEnableExDriver motorEnableExDriver; + @Resource + HbotDriver hbotDriver; + + + // 测试工具 + // @ExtApiFn(name = "归零", group = "基础", order = 1) + // public void moveToZero() throws AppException { + // enableModule(); + // pipetteCtrlDriver.zMotorMoveZeroBlock(); + // } + + + @ExtApiFn(name = "失能相关模块", group = "基础", order = 4) + public void disableModule() throws AppException { + motorEnableExDriver.forceDisableAllMotor(); + } + + + @ExtApiFn(name = "测量Z轴高度", group = "测试", order = 100) + public Integer mHbotZPos() throws AppException { + pipetteCtrlDriver.zMotorEnable(1); + pipetteCtrlDriver.zMotorMeasureDistance(); + pipetteCtrlDriver.zMotorEnable(0); + return pipetteCtrlDriver.zMotorReadMeasureDistanceResult(); + } + + @ExtApiFn(name = "测量Hbot位置", group = "测试", order = 101) + public Pos2d mHbotPos() throws AppException { + return hbotDriver.readPos(); + } + + + +} diff --git a/src/main/java/a8k/service/test/MainflowCtrlTestService.java b/src/main/java/a8k/service/test/MainflowCtrlTestService.java index bdc612a..e1ce99c 100644 --- a/src/main/java/a8k/service/test/MainflowCtrlTestService.java +++ b/src/main/java/a8k/service/test/MainflowCtrlTestService.java @@ -240,7 +240,7 @@ public class MainflowCtrlTestService { } } - void doOnceSimpleTest(FakeProjInfo proj, Boolean isHTube, Integer tubeNum) throws AppException { + void doOnceSimpleTest(FakeProjInfo proj, ConsumableGroup consumablegroup,Integer tubeNum) throws AppException { if (tubeNum <= 0) { throw AppException.of("试管数量必须大于0"); } @@ -249,7 +249,7 @@ public class MainflowCtrlTestService { stopAndWaittingForDeviceStop(); //设置耗材状态,假定已经扫描过耗材 - LoadingConsumablesDirectly(ConsumableGroup.GROUP0, proj); + LoadingConsumablesDirectly(consumablegroup, proj); //添加一个新试管配置 appTubeSettingMgrService.removeAllTubeSetting(); appTubeSettingMgrService.newTubeHolderSetting(// @@ -279,7 +279,7 @@ public class MainflowCtrlTestService { testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, isHTube, tubeNum)); testModeState.setNoCheckMode(true); testModeState.setDisableOptScan(true); - doOnceSimpleTest(new FAKE_PROJ_01_FLOW1(), isHTube, tubeNum); + doOnceSimpleTest(new FAKE_PROJ_01_FLOW1(), ConsumableGroup.GROUP0, tubeNum); return "开始测试"; } @@ -291,13 +291,35 @@ public class MainflowCtrlTestService { testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, isHTube, tubeNum)); testModeState.setNoCheckMode(true); testModeState.setDisableOptScan(true); - doOnceSimpleTest(new FAKE_PROJ_02_FLOW2(), isHTube, tubeNum); + doOnceSimpleTest(new FAKE_PROJ_02_FLOW2(), ConsumableGroup.GROUP1, tubeNum); return "开始测试"; } - @ExtApiFn(name = "执行一次十个试管,双项目,无耗材测试", order = 402) + @ExtApiFn(name = "执行一次简单的测试(使用水测试.流程1)", order = 402) public String doSimpleTest3() throws AppException { regFakeProjInfo(); + //设置虚拟耗材,只有一个高试管,无校验模式,无光学检查 + testModeState.resetAll(); + testModeState.setNoCheckMode(false); + testModeState.setDisableOptScan(true); + doOnceSimpleTest(new FAKE_PROJ_01_FLOW1(), ConsumableGroup.GROUP0, 10); + return "开始测试"; + } + + @ExtApiFn(name = "执行一次简单的测试(使用水测试.流程2)", order = 403) + public String doSimpleTest4() throws AppException { + regFakeProjInfo(); + testModeState.resetAll(); + testModeState.setNoCheckMode(true); + testModeState.setDisableOptScan(true); + doOnceSimpleTest(new FAKE_PROJ_02_FLOW2(), ConsumableGroup.GROUP1, 10); + return "开始测试"; + } + + + @ExtApiFn(name = "执行一次十个试管,双项目,无耗材测试", order = 404) + public String doSimpleTest5() throws AppException { + regFakeProjInfo(); testModeState.resetAll(); testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, true, 10)); diff --git a/src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java b/src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java index ae69ed1..622478e 100644 --- a/src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java +++ b/src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java @@ -25,7 +25,7 @@ public class FakeProjInfo { public Integer wBloodSampleVolUl = 100; public Integer serumSampleVolUl = 100; public Integer shakeTimes = 5; - public Integer bigBufferSampleUl = 100; + public Integer bigBufferSampleUl = 200; public Integer mixLiquidAspirMixingCnt = 1; public Integer reactionPlateIncubationTimeMin = 1; public Integer reactionPlateDropletVolUl = 50; diff --git a/src/main/java/a8k/utils/ProjProcessContextUtils.java b/src/main/java/a8k/utils/ProjProcessContextUtils.java index 7553aed..af66550 100644 --- a/src/main/java/a8k/utils/ProjProcessContextUtils.java +++ b/src/main/java/a8k/utils/ProjProcessContextUtils.java @@ -164,14 +164,14 @@ public class ProjProcessContextUtils { return samplePos; } - static public Pos3d getReactionStartPos(ProjProcessContext ctx) { - HbotConsumableParamMgr hbotConsumableParamMgr = SpringBootBeanUtil.getBean(HbotConsumableParamMgr.class); - A8kReactionFlowType type = ctx.projCfg.projectInfo.reactionFlowType; - return switch (type) { - case FlowType1 -> hbotConsumableParamMgr.getLittleBufferSamplePos(ctx.consumable.getGroup(), ctx.consumable.getPos()); - case FlowType2 -> hbotConsumableParamMgr.getProbeSubstanceSamplePos(ctx.consumable.getGroup(), ctx.consumable.getPos()); - }; - } +// static public Pos3d getReactionStartPos(ProjProcessContext ctx) { +// HbotConsumableParamMgr hbotConsumableParamMgr = SpringBootBeanUtil.getBean(HbotConsumableParamMgr.class); +// A8kReactionFlowType type = ctx.projCfg.projectInfo.reactionFlowType; +// return switch (type) { +// case FlowType1 -> hbotConsumableParamMgr.getLittleBufferSamplePos(ctx.consumable.getGroup(), ctx.consumable.getPos()); +// case FlowType2 -> hbotConsumableParamMgr.getProbeSubstanceSamplePos(ctx.consumable.getGroup(), ctx.consumable.getPos()); +// }; +// } static public Pos3d getReactionEndPos(ProjProcessContext ctx) { HbotConsumableParamMgr hbotConsumableParamMgr = SpringBootBeanUtil.getBean(HbotConsumableParamMgr.class); diff --git a/src/main/resources/app.db b/src/main/resources/app.db index 3ac30b234137dd69946d5761e6ebedf565d4f638..7dc4a5d94d88c3a4685430855b10a6d390874335 100644 GIT binary patch delta 843 zcmbu7O=uHA6vyYyZa$_>GBH*mYH2n(NJ>LyXLlzJUfQn4i`XC*db8HFD6L;87C~`E zJU0?y5l`Z+H(l(4LcMqpJO~lb_9DfCXH#3$-E3M(3tl|D%a7j-@4f%CR^!%cynZOv z$|HnIUJ0*`Ae8$0Xo%xh{>9W6sh5X6h|v90b=Ce5hmXMArwNz=`N5fb(Oro^6P$_Y zQUr=Glf6mEIc)fP0hYV*cZLE*JjjOE#&KXmySK1 zw{=t1HFI0%fj$Hjk-sex@NCt$D;1NObZlD>es_M4$C4q9ZsH9`8Tp1A8`EY~=u9=r zLUu_3e&EKj*$xtAse|rb>L8ur4thIpM*N3**>K3^*I7tA?-n1{;2)cBU8JD-F?)!VM+y7ImSHPhQ!X!S!Z%qP&vv8`55q&_y^%!d{8t hARWPZsLfK#Ba(ODiXE#;b42l`%zCA`R#mbF{s10L(82%! delta 770 zcmZp8z}xVEcY>7A7e)pK26G@b17aBl2BE_fb&Qz4Fm6n^&&;jH1{7pqX!Mz&I{h>+ z<9SAv?X&q9QyE#BgC;0%-^b2)iE(o%$0~M4{YEzJEH#b8QOJg+EENH4(fT~R(s?98&On|EEkqu`?Q_c)j zZVXcH;$&`sFx(L06ecv)OhDB}VAalsCdSUFPSIxMXW&HkCQz{IdgX@F^X+I(%+iGh$pswWbiYpgQD&#Bcs~(DV&UEER33v$khNv?m`iY zodR;)?@QZR6qt8&LJTuAXM?zS`aT_Is4q;-SRrED8kiUbKnYEftA9GX0+TT?P(r!3 z_iHhgg>GeKD&l80H8q)@P{XJ&J^LS1+O`Qy9(iz~?LeWKid$KjiqVuUXEb0G*yg|t aOqQC{c>V+7z459_J#oF26+JX?7*!6