Browse Source

update

tags/v0
zhaohe 9 months ago
parent
commit
c40aa61033
  1. 1
      src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java
  2. 6
      src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java
  3. 4
      src/main/java/a8k/service/app/devicectrl/param/calibration/HbotLittleBSPosCalibration.java
  4. 4
      src/main/java/a8k/service/app/devicectrl/param/calibration/HbotProbeSubstancePosCalibration.java
  5. 8
      src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/HbotConsumableParamMgr.java
  6. 16
      src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotLittleBSPosMgr.java
  7. 12
      src/main/java/a8k/service/app/devicectrl/param/param_mgr/HbotProbeSubstancePosMgr.java
  8. 2
      src/main/java/a8k/service/app/devicectrl/param/type/HbotLittleBSPos.java
  9. 4
      src/main/java/a8k/service/app/devicectrl/param/type/HbotProbeSubstancePos.java
  10. 63
      src/main/java/a8k/service/app/devicectrl/test/PosMeasureUtils.java
  11. 32
      src/main/java/a8k/service/test/MainflowCtrlTestService.java
  12. 2
      src/main/java/a8k/service/test/fakeproj/FakeProjInfo.java
  13. 16
      src/main/java/a8k/utils/ProjProcessContextUtils.java
  14. BIN
      src/main/resources/app.db

1
src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java

@ -24,6 +24,7 @@ public enum ExtApiTabConfig {
PipetteGunTest("测试.PipetteGun",true),
PosMeasureUtils("测试.坐标测量",true),
A8kPipetteCtrlModule("硬件驱动.移液枪测试", true),

6
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));

4
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 {

4
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*/);}

8
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);

16
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;
}

12
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;
}

2
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;

4
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;

63
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();
}
}

32
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));

2
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;

16
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);

BIN
src/main/resources/app.db

Loading…
Cancel
Save