|
|
@ -1,9 +1,7 @@ |
|
|
|
package a8k.service.verification; |
|
|
|
|
|
|
|
import a8k.constant.AppConstant; |
|
|
|
import a8k.constant.PipetteGunConstant; |
|
|
|
import a8k.extapi.utils.ExtApiFn; |
|
|
|
import a8k.extapi.utils.ExtApiStatu; |
|
|
|
import a8k.extapi.utils.ExtApiTab; |
|
|
|
import a8k.hardware.type.LldType; |
|
|
|
import a8k.service.app.devicectrl.ctrlservice.DeviceInitCtrlService; |
|
|
@ -16,17 +14,14 @@ import a8k.service.app.devicectrl.param.ext_param_mgr.HbotConsumableParamMgr; |
|
|
|
import a8k.service.app.devicectrl.param.ext_param_mgr.PipetteGunParamExMgr; |
|
|
|
import a8k.service.app.devicectrl.param.param_mgr.*; |
|
|
|
import a8k.type.ConsumableGroup; |
|
|
|
import a8k.type.checkpoint.CheckResult; |
|
|
|
import a8k.type.cfg.Pos3d; |
|
|
|
import a8k.type.exception.AppException; |
|
|
|
import a8k.type.pos.TipPos; |
|
|
|
import a8k.type.type.TipGroup; |
|
|
|
import jakarta.annotation.PostConstruct; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ExtApiTab() |
|
|
|
@Component |
|
|
|
@Slf4j |
|
|
@ -65,56 +60,50 @@ public class PipetteGunVerificationV2 { |
|
|
|
PipetteGunExParamMgr pipetteGunExParamMgr; |
|
|
|
|
|
|
|
|
|
|
|
Integer tipNum = 0; |
|
|
|
Integer m_loadUl = 0; |
|
|
|
Integer lldpThreshold = 20; |
|
|
|
Integer tipNum = 0; |
|
|
|
Integer liquidPos = null; |
|
|
|
|
|
|
|
@PostConstruct |
|
|
|
void initialize() { |
|
|
|
pipetteCtrlDriver.setVolumeCalibrationCoefficient(pipetteGunExParamMgr.getVolumeCalibrationCoefficient()); |
|
|
|
public void pipetteGunInit() throws AppException { |
|
|
|
pipetteCtrlDriver.liquidOperationClearParams(); // |
|
|
|
pipetteCtrlDriver.liquidOperationSetGunRunParams(14, 14, 0, 900, 8000); //pump param |
|
|
|
pipetteCtrlDriver.liquidOperationFreshParams(); |
|
|
|
|
|
|
|
pipetteCtrlDriver.pipetteInitDeviceBlock(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "初始化设备", group = "测试准备工作", order = 11) |
|
|
|
public List<CheckResult> initDevice() throws AppException { |
|
|
|
List<CheckResult> checkResult = deviceInitializationModule.initDevice(); |
|
|
|
for (CheckResult result : checkResult) { |
|
|
|
if (!result.pass) { |
|
|
|
return checkResult; |
|
|
|
} |
|
|
|
} |
|
|
|
return checkResult; |
|
|
|
} |
|
|
|
@ExtApiFn(name = "初始化设备", group = "基础", order = 11) |
|
|
|
public void initDevice() throws AppException { |
|
|
|
pipetteCtrlDriver.zMotorEnable(1); |
|
|
|
hbotBaseMoveExDriver.enable(1); |
|
|
|
|
|
|
|
@ExtApiFn(name = "加载tip头", group = "测试准备工作", order = 12) |
|
|
|
public void loadTip() throws AppException { |
|
|
|
tipNum = AppConstant.TIP_NUM; |
|
|
|
} |
|
|
|
pipetteCtrlDriver.zMotorMoveZeroBlock(); |
|
|
|
hbotBaseMoveExDriver.moveToZero(); |
|
|
|
hbotBaseMoveExDriver.hbotMoveTo(hbotTipPosMgr.getDropTipPos()); |
|
|
|
|
|
|
|
pipetteGunInit(); |
|
|
|
|
|
|
|
hbotBaseMoveExDriver.hbotMoveTo(new Pos3d(0, 0, 0)); |
|
|
|
tipNum = AppConstant.TIP_NUM; |
|
|
|
|
|
|
|
@ExtApiFn(name = "设置吸液量", group = "测试准备工作", order = 13) |
|
|
|
public void setM_loadUl(Integer m_loadUl) { |
|
|
|
this.m_loadUl = m_loadUl; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "设置LLD P阈值(建议20)", group = "测试准备工作", order = 14) |
|
|
|
public void setLldpThreshold(Integer lldpThreshold) { |
|
|
|
this.lldpThreshold = lldpThreshold; |
|
|
|
@ExtApiFn(name = "停止测试", group = "基础", order = 12) |
|
|
|
public void stopTest() throws AppException { |
|
|
|
pipetteCtrlDriver.zMotorEnable(0); |
|
|
|
hbotBaseMoveExDriver.enable(0); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "校准系数(realul:实际体积)", group = "测试准备工作", order = 15) |
|
|
|
public void calibration(Double realul) { |
|
|
|
Double nowcoefficient = pipetteCtrlDriver.getVolumeCalibrationCoefficient(); |
|
|
|
Double coefficient = m_loadUl * nowcoefficient / realul; |
|
|
|
pipetteGunExParamMgr.setVolumeCalibrationCoefficient(coefficient); |
|
|
|
pipetteCtrlDriver.setVolumeCalibrationCoefficient(coefficient); |
|
|
|
public void calibration(Double coefficientK, Double coefficientB) { |
|
|
|
pipetteGunExParamMgr.setVolumeCalibrationCoefficient(coefficientK, coefficientB); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Boolean takeOneTip() throws AppException { |
|
|
|
hbotBaseMoveExDriver.hbotMoveTo(hbotTipPosMgr.getDropTipPos()); |
|
|
|
pipetteCtrlDriver.pipetteInitDeviceBlock(); |
|
|
|
pipetteGunInit(); |
|
|
|
|
|
|
|
TipPos tipPos = new TipPos(); |
|
|
|
tipPos.group = TipGroup.GROUP0; |
|
|
|
if (tipNum == 0) { |
|
|
@ -135,174 +124,96 @@ public class PipetteGunVerificationV2 { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// @ExtApiFn(name = "吸取并释放一次", group = "测试", order = 21) |
|
|
|
// public void aspirateAndDistruptOnce() throws AppException { |
|
|
|
// if (loadUl == 0) { |
|
|
|
// throw AppException.ofAECodeError("吸液量为0"); |
|
|
|
// } |
|
|
|
// |
|
|
|
// // |
|
|
|
// // param |
|
|
|
// // |
|
|
|
// |
|
|
|
// Integer startZPos = hbotConsumableParamMgr.getLargeBufferSamplePos(ConsumableGroup.GROUP0).z; |
|
|
|
// Integer endZPos = hbotConsumableParamMgr.getLargeBufferSamplePosEnd(ConsumableGroup.GROUP0).z; |
|
|
|
// Integer llfv = 5; |
|
|
|
// |
|
|
|
// while (!pipetteCtrlDriver.isHasTip()) { |
|
|
|
// if (takeOneTip()) { |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// // |
|
|
|
// // lld |
|
|
|
// // |
|
|
|
// hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP0); |
|
|
|
// pipetteCtrlDriver.zMotorMoveToBlock(startZPos); |
|
|
|
// |
|
|
|
// pipetteCtrlDriver.pipetteLld(LldType.kclld, endZPos, 20, 20); |
|
|
|
// if (!pipetteCtrlDriver.lldIsDetectLiquid()) { |
|
|
|
// throw AppException.ofAECodeError("没有液体"); |
|
|
|
// } |
|
|
|
// |
|
|
|
// Integer liquidZPos = pipetteCtrlDriver.getReg(PipetteRegIndex.kreg_pipette_zm_pos); |
|
|
|
// pipetteCtrlDriver.pipetteAspirate(0, 0, PipetteGunConstant.ASPIRATE_PUMP_V, 20); |
|
|
|
// pipetteCtrlDriver.zMotorMoveToBlock(liquidZPos - 100); |
|
|
|
// // pipetteCtrlDriver.pipetteClearHangingLiquid(3); |
|
|
|
// pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //移除探测吸入的液体 |
|
|
|
// pipetteCtrlDriver.pipettePumpMoveTo(500, 50); //吸入10ul的空气消除部分误差 |
|
|
|
// pipetteCtrlDriver.zMotorMoveToBlock(liquidZPos); |
|
|
|
// |
|
|
|
// // |
|
|
|
// // aspirate |
|
|
|
// // |
|
|
|
// if (loadUl < 50) { |
|
|
|
// pipetteCtrlDriver.pipetteAspirate(llfv, endZPos, PipetteGunConstant.ASPIRATE_PUMP_V, loadUl + 10); |
|
|
|
// pipetteCtrlDriver.pipetteDistribu(0, PipetteGunConstant.ASPIRATE_PUMP_V, 10); |
|
|
|
// // pipetteCtrlDriver.pipetteAspirate(0, endZPos, PipetteGunConstant.ASPIRATE_PUMP_V, loadUl); |
|
|
|
// } else { |
|
|
|
// pipetteCtrlDriver.pipetteAspirate(llfv, endZPos, PipetteGunConstant.ASPIRATE_PUMP_V, loadUl); |
|
|
|
// } |
|
|
|
// pipetteCtrlDriver.zMotorMoveToZeroPointQuickBlock(); |
|
|
|
// |
|
|
|
// // |
|
|
|
// // move to distrube pos |
|
|
|
// // |
|
|
|
// hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP1); |
|
|
|
// // pipetteCtrlDriver.pipetteDistribu(0, PipetteGunConstant.ASPIRATE_PUMP_V, loadUl); |
|
|
|
// pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //分配所有液体 |
|
|
|
// pipetteCtrlDriver.pipetteClearHangingLiquid(1); |
|
|
|
// hbotCtrlService.moveQuickToZero(); |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "取一次10ul", group = "测试", order = 22) |
|
|
|
public void aspirate10ul() throws AppException { |
|
|
|
var loadUl = 10; |
|
|
|
public void pumpMoveTo(Integer pumpvmax, Double ul) throws AppException { |
|
|
|
pipetteCtrlDriver.liquidOperationClearParams(); |
|
|
|
pipetteCtrlDriver.liquidOperationSetGunRunParams(14, 14, 0, 1000, pumpvmax); |
|
|
|
pipetteCtrlDriver.liquidOperationFreshParams(); |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(ul); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// |
|
|
|
// param |
|
|
|
// |
|
|
|
public Integer lld() throws AppException { |
|
|
|
liquidPos = 0; |
|
|
|
hbotCtrlService.moveToLargeBSSamplePosXY(ConsumableGroup.GROUP0); |
|
|
|
|
|
|
|
Integer startZPos = hbotConsumableParamMgr.getLargeBufferSamplePos(ConsumableGroup.GROUP0).z; |
|
|
|
Integer endZPos = hbotConsumableParamMgr.getLargeBufferSamplePosEnd(ConsumableGroup.GROUP0).z; |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(0); |
|
|
|
|
|
|
|
// |
|
|
|
// lld |
|
|
|
// |
|
|
|
hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP0); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(startZPos); |
|
|
|
pumpMoveTo(8000, 0.0); |
|
|
|
pumpMoveTo(8000, 50.0); |
|
|
|
|
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //移除探测吸入的液体 |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(500, 100); //吸入10ul的空气消除部分误差 |
|
|
|
|
|
|
|
pipetteCtrlDriver.liquidOperationClearParams(); // |
|
|
|
pipetteCtrlDriver.liquidOperationSetGunRunParams(14, 14, 0, 900, 30); //pump param |
|
|
|
pipetteCtrlDriver.liquidOperationSetZMotorRunParams(0, 300, 30); // z motor param |
|
|
|
pipetteCtrlDriver.liquidOperationFreshParams(); |
|
|
|
pipetteCtrlDriver.pipetteLld(LldType.kplld, 0, 15); |
|
|
|
|
|
|
|
pipetteCtrlDriver.pipetteLld(LldType.kclld, endZPos, 20, 20); |
|
|
|
if (!pipetteCtrlDriver.lldIsDetectLiquid()) { |
|
|
|
throw AppException.ofAECodeError("没有液体"); |
|
|
|
if (pipetteCtrlDriver.lldIsDetectLiquid()) { |
|
|
|
liquidPos = pipetteCtrlDriver.getReg(PipetteRegIndex.kreg_pipette_zm_pos); |
|
|
|
} |
|
|
|
|
|
|
|
pipetteCtrlDriver.pipetteAspirate(0, 10, 50, loadUl + 10); |
|
|
|
pipetteCtrlDriver.pipetteDistribu(0, 50, 10); |
|
|
|
|
|
|
|
pipetteCtrlDriver.zMotorMoveToZeroPointQuickBlock(); |
|
|
|
// |
|
|
|
// move to distrube pos |
|
|
|
// |
|
|
|
hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP1); |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //分配所有液体 |
|
|
|
hbotCtrlService.moveQuickToZero(); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(0); |
|
|
|
pumpMoveTo(8000, 0.0); |
|
|
|
return liquidPos; |
|
|
|
} |
|
|
|
@ExtApiFn(name = "取多次", group = "测试", order = 23) |
|
|
|
public void takeMuti(Integer times,Integer loadUl) throws AppException { |
|
|
|
for (int i = 0; i < times; i++) { |
|
|
|
takeOnce(loadUl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "取一次", group = "测试", order = 23) |
|
|
|
public void takeOnce(Integer loadUl) throws AppException { |
|
|
|
takeTip(); |
|
|
|
|
|
|
|
Integer startZPos = hbotConsumableParamMgr.getLargeBufferSamplePos(ConsumableGroup.GROUP0).z; |
|
|
|
Integer endZPos = hbotConsumableParamMgr.getLargeBufferSamplePosEnd(ConsumableGroup.GROUP0).z; |
|
|
|
|
|
|
|
// move To Take Pos |
|
|
|
hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP0); |
|
|
|
|
|
|
|
|
|
|
|
// lld |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //移除探测吸入的液体 |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(500, 100); //吸入10ul的空气消除部分误差 |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(startZPos); |
|
|
|
pipetteCtrlDriver.pipetteLld(LldType.kplld, endZPos, 20, 10); |
|
|
|
if (!pipetteCtrlDriver.lldIsDetectLiquid()) { |
|
|
|
throw AppException.ofAECodeError("没有液体"); |
|
|
|
} |
|
|
|
pipetteCtrlDriver.pipetteAspirate(10, endZPos, 200, 50);// |
|
|
|
|
|
|
|
public void takeLiquid(Double ul) throws AppException { |
|
|
|
/* |
|
|
|
* 1. |
|
|
|
*/ |
|
|
|
hbotCtrlService.moveToLargeBSSamplePosXY(ConsumableGroup.GROUP0); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(0); |
|
|
|
pumpMoveTo(8000, 0.0); |
|
|
|
pumpMoveTo(8000, 150.0); |
|
|
|
|
|
|
|
Integer liquidZPos = pipetteCtrlDriver.getReg(PipetteRegIndex.kreg_pipette_zm_pos); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(startZPos); |
|
|
|
pipetteCtrlDriver.pipetteAspirate(0, 0, 200, 5); |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(500, 100); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(liquidPos); |
|
|
|
|
|
|
|
pipetteCtrlDriver.liquidOperationClearParams(); // |
|
|
|
pipetteCtrlDriver.liquidOperationSetGunRunParams(14, 14, 0, 900, 100); //pump param |
|
|
|
pipetteCtrlDriver.liquidOperationSetZMotorRunParams(0, 300, 10); // z motor param |
|
|
|
pipetteCtrlDriver.liquidOperationFreshParams(); |
|
|
|
|
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(liquidZPos); |
|
|
|
pipetteCtrlDriver.pipetteAspirate(0, 12, 50, loadUl + 50); |
|
|
|
pipetteCtrlDriver.pipetteDistribu(0, 200, 50); |
|
|
|
|
|
|
|
// move to distrube pos |
|
|
|
hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP1); |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //分配所有液体 |
|
|
|
ul = pipetteGunExParamMgr.calibrateVolume(ul); |
|
|
|
log.info("取液体 {}", ul); |
|
|
|
|
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(200, 100); //分配所有液体 |
|
|
|
pipetteCtrlDriver.pipettePumpMoveTo(1000, 0); //分配所有液体 |
|
|
|
|
|
|
|
|
|
|
|
hbotCtrlService.moveQuickToZero(); |
|
|
|
pipetteCtrlDriver.pipetteAspirate(ul); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(0); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiStatu(name = "val", group = "tipNum", order = 100) |
|
|
|
public Integer readTipNum() throws AppException { |
|
|
|
return tipNum; |
|
|
|
public void distributeLiquid() throws AppException { |
|
|
|
hbotCtrlService.moveToLargeBSSamplePosXY(ConsumableGroup.GROUP5); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(50); |
|
|
|
pumpMoveTo(8000, 0.0); |
|
|
|
pipetteCtrlDriver.zMotorMoveToBlock(0); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiStatu(name = "val", group = "loadUl", order = 101) |
|
|
|
public Integer readLoadUl() throws AppException { |
|
|
|
return m_loadUl; |
|
|
|
public void resetPos() throws AppException { |
|
|
|
hbotCtrlService.moveToLargeBSSamplePosXY(ConsumableGroup.GROUP1); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiStatu(name = "val", group = "lldpThreshold", order = 102) |
|
|
|
public Integer readLldpThreshold() throws AppException { |
|
|
|
return lldpThreshold; |
|
|
|
|
|
|
|
@ExtApiFn(name = "取一次10ul", group = "测试", order = 22) |
|
|
|
public void aspirate10ul() throws AppException { |
|
|
|
takeTip(); |
|
|
|
lld(); |
|
|
|
if (liquidPos == 0) |
|
|
|
throw AppException.ofAECodeError("未检测到液体"); |
|
|
|
takeLiquid(10.0); |
|
|
|
distributeLiquid(); |
|
|
|
resetPos(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiStatu(name = "val", group = "volumeCalibrationConff", order = 103) |
|
|
|
public Double readVolumeCalibrationConff() throws AppException { |
|
|
|
return pipetteCtrlDriver.getVolumeCalibrationCoefficient(); |
|
|
|
@ExtApiFn(name = "取一次75ul", group = "测试", order = 23) |
|
|
|
public void aspirate75ul() throws AppException { |
|
|
|
takeTip(); |
|
|
|
lld(); |
|
|
|
if (liquidPos == 0) |
|
|
|
throw AppException.ofAECodeError("未检测到液体"); |
|
|
|
takeLiquid(75.0); |
|
|
|
distributeLiquid(); |
|
|
|
resetPos(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |