Browse Source

update

tags/v0
zhaohe 9 months ago
parent
commit
9204fc11cc
  1. 6
      src/main/java/a8k/hardware/type/a8kcanprotocol/CmdId.java
  2. 81
      src/main/java/a8k/service/app/devicectrl/driver/PipetteCtrlDriver.java
  3. 4
      src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLDParamCalibration.java
  4. 90
      src/main/java/a8k/service/app/devicectrl/param/calibration/PipetteGunLLFParamCalibration.java
  5. 18
      src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/PipetteGunParamExMgr.java
  6. 4
      src/main/java/a8k/service/app/devicectrl/param/ext_param_mgr/base/LLFParamPack.java
  7. 6
      src/main/java/a8k/service/app/devicectrl/script/DeviceCtrlScripter.java
  8. BIN
      src/main/resources/app.db

6
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, "移动枪设置液面跟随结束限制高度"),
;

81
src/main/java/a8k/service/app/devicectrl/driver/PipetteCtrlDriver.java

@ -53,33 +53,40 @@ public class PipetteCtrlDriver {
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 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 {

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

90
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);
}
}

18
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.llfStartPos = hbotSamplePosParamMgr.getSampleStartPos(samplePos).z;
paramPack.llfEndPos = hbotSamplePosParamMgr.getSampleStartPos(samplePos).z;
}
case TAKE_LARGE_BUFFER_SOLUTION -> { //取大瓶缓冲液
//取大瓶缓冲液
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;
paramPack.llfStartPos = 0;
paramPack.llfEndPos = 0;
}
}

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

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

BIN
src/main/resources/app.db

Loading…
Cancel
Save