11 changed files with 550 additions and 169 deletions
-
18src/main/java/a8k/config/CorsConfig.java
-
10src/main/java/a8k/extapi/service/ExtApiTabCfgService.java
-
4src/main/java/a8k/hardware/A8kModParamInitializer.java
-
1src/main/java/a8k/service/app/appctrl/AppDeviceCtrlService.java
-
40src/main/java/a8k/service/app/background/TemperatureCtrlService.java
-
10src/main/java/a8k/service/app/devicectrl/ctrlservice/HbotCtrlService.java
-
6src/main/java/a8k/service/verification/A8kOptVerification.java
-
70src/main/java/a8k/service/verification/A8kTemperaturaVerfication.java
-
52src/main/java/a8k/service/verification/A8kVerificationUtils.java
-
202src/main/java/a8k/service/verification/PipetteGunVerificationV2.java
@ -0,0 +1,18 @@ |
|||||
|
package a8k.config; |
||||
|
|
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry; |
||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
|
|
||||
|
@Configuration |
||||
|
public class CorsConfig implements WebMvcConfigurer { |
||||
|
|
||||
|
@Override |
||||
|
public void addCorsMappings(CorsRegistry registry) { |
||||
|
// 允许所有域名进行跨域访问,实际使用时应根据需要进行配置 |
||||
|
registry.addMapping("/**") |
||||
|
.allowedOrigins("*") |
||||
|
.allowedMethods("GET", "POST", "PUT", "DELETE") |
||||
|
.allowedHeaders("*"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,70 @@ |
|||||
|
package a8k.service.verification; |
||||
|
|
||||
|
import a8k.a8kproj.optalgo.type.OptScanResult; |
||||
|
import a8k.extapi.utils.ExtApiFn; |
||||
|
import a8k.extapi.utils.ExtApiStatu; |
||||
|
import a8k.extapi.utils.ExtApiTab; |
||||
|
import a8k.service.app.appdata.FileMgrService; |
||||
|
import a8k.service.app.appdata.ProjIdCardInfoMgrService; |
||||
|
import a8k.service.app.appdata.ProjInfoMgrService; |
||||
|
import a8k.service.app.background.SensorDataUpdateService; |
||||
|
import a8k.service.app.background.TemperatureCtrlService; |
||||
|
import a8k.service.app.devicectrl.ctrlservice.OptScanModuleCtrlService; |
||||
|
import a8k.service.app.devicectrl.ctrlservice.PlateBoxCtrlService; |
||||
|
import a8k.service.app.devicectrl.driver.StepMotorCtrlDriver; |
||||
|
import a8k.service.app.devicectrl.driver.TemperatureControlDriver; |
||||
|
import a8k.service.app.devicectrl.driver.type.StepMotorMId; |
||||
|
import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; |
||||
|
import a8k.service.app.devicectrl.param.param_mgr.OptModuleExtParamsMgr; |
||||
|
import a8k.type.A8kScanCurve; |
||||
|
import a8k.type.ConsumableGroup; |
||||
|
import a8k.type.IncubatorPos; |
||||
|
import a8k.type.exception.AppException; |
||||
|
import a8k.utils.ProjBuildinInfo; |
||||
|
import a8k.utils.ZList; |
||||
|
import jakarta.annotation.Resource; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
*/ |
||||
|
@ExtApiTab() |
||||
|
@Component |
||||
|
public class A8kTemperaturaVerfication { |
||||
|
|
||||
|
@Resource |
||||
|
TemperatureCtrlService temperatureCtrlService; |
||||
|
|
||||
|
@Resource |
||||
|
TemperatureControlDriver temperatureControlDriver; |
||||
|
|
||||
|
|
||||
|
@ExtApiFn(name = "启动温度控制", group = "温度控制", order = 1) |
||||
|
synchronized public void startCtrl(Integer targetTemperature) throws AppException { |
||||
|
temperatureCtrlService.startTemperatureControl(targetTemperature); |
||||
|
} |
||||
|
|
||||
|
@ExtApiFn(name = "停止温度控制", group = "温度控制", order = 2) |
||||
|
synchronized public void stopCtrl() throws AppException { |
||||
|
temperatureCtrlService.stopTemperatureControl(); |
||||
|
} |
||||
|
|
||||
|
@ExtApiStatu(name = "孵育盘温度", group = "", order = 3) |
||||
|
public Double readIncubateBoxTemperature() throws AppException { |
||||
|
Double incubateBoxTemp = temperatureControlDriver.readIncubateBoxTemperature(); |
||||
|
return (incubateBoxTemp); |
||||
|
} |
||||
|
|
||||
|
@ExtApiStatu(name = "板夹仓温度", group = "", order = 4) |
||||
|
public Double readPlateBoxTemperature() throws AppException { |
||||
|
Double pbtemp = temperatureControlDriver.readPlateBoxTemperature(); |
||||
|
return pbtemp ; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package a8k.service.verification; |
||||
|
|
||||
|
import a8k.a8kproj.optalgo.type.OptScanResult; |
||||
|
import a8k.controler.api.v1.app.ctrl.DeviceInit; |
||||
|
import a8k.extapi.utils.ExtApiFn; |
||||
|
import a8k.extapi.utils.ExtApiTab; |
||||
|
import a8k.service.app.appdata.FileMgrService; |
||||
|
import a8k.service.app.appdata.ProjInfoMgrService; |
||||
|
import a8k.service.app.devicectrl.ctrlservice.DeviceInitCtrlService; |
||||
|
import a8k.service.app.devicectrl.ctrlservice.OptScanModuleCtrlService; |
||||
|
import a8k.service.app.devicectrl.ctrlservice.PlateBoxCtrlService; |
||||
|
import a8k.service.app.devicectrl.driver.StepMotorCtrlDriver; |
||||
|
import a8k.service.app.devicectrl.driver.type.StepMotorMId; |
||||
|
import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; |
||||
|
import a8k.service.app.devicectrl.param.param_mgr.OptModuleExtParamsMgr; |
||||
|
import a8k.type.A8kScanCurve; |
||||
|
import a8k.type.ConsumableGroup; |
||||
|
import a8k.type.IncubatorPos; |
||||
|
import a8k.type.checkpoint.CheckResult; |
||||
|
import a8k.type.exception.AppException; |
||||
|
import a8k.utils.ProjBuildinInfo; |
||||
|
import a8k.utils.ZList; |
||||
|
import jakarta.annotation.Resource; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
*/ |
||||
|
@ExtApiTab() |
||||
|
@Component |
||||
|
public class A8kVerificationUtils { |
||||
|
|
||||
|
@Resource |
||||
|
DeviceInitCtrlService deviceInitializationModule; |
||||
|
|
||||
|
@ExtApiFn(name = "初始化设备", group = "测试工具", order = 11) |
||||
|
public List<CheckResult> initDevice() throws AppException { |
||||
|
List<CheckResult> checkResult = deviceInitializationModule.deviceMoveToZero(); |
||||
|
for (CheckResult result : checkResult) { |
||||
|
if (!result.pass) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
} |
||||
|
return checkResult; |
||||
|
} |
||||
|
} |
@ -0,0 +1,202 @@ |
|||||
|
package a8k.service.verification; |
||||
|
|
||||
|
import a8k.constant.AppConstant; |
||||
|
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; |
||||
|
import a8k.service.app.devicectrl.ctrlservice.HbotCtrlService; |
||||
|
import a8k.service.app.devicectrl.driver.HbotDriver; |
||||
|
import a8k.service.app.devicectrl.driver.PipetteCtrlDriver; |
||||
|
import a8k.service.app.devicectrl.driver.type.PipetteRegIndex; |
||||
|
import a8k.service.app.devicectrl.exdriver.HbotBaseMoveExDriver; |
||||
|
import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; |
||||
|
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.service.app.devicectrl.param.param_mgr.base.ParamMgr; |
||||
|
import a8k.service.dao.type.Parameter; |
||||
|
import a8k.type.ConsumableGroup; |
||||
|
import a8k.type.cfg.Pos3d; |
||||
|
import a8k.type.checkpoint.CheckResult; |
||||
|
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 |
||||
|
public class PipetteGunVerificationV2 { |
||||
|
@Resource |
||||
|
HbotFixedPosParamMgr hbotFixedPosParamMgr; |
||||
|
@Resource |
||||
|
HbotSamplePosParamMgr hbotSamplePosParamMgr; |
||||
|
@Resource |
||||
|
HbotConsumableParamMgr hbotConsumableParamMgr; |
||||
|
@Resource |
||||
|
HbotTipPosMgr hbotTipPosMgr; |
||||
|
@Resource |
||||
|
PipetteGunLLDParamMgr pipetteGunLLDParamMgr; |
||||
|
@Resource |
||||
|
PipetteGunLLFParamMgr pipetteGunLLFParamMgr; |
||||
|
@Resource |
||||
|
HbotLargeBottleBSPosMgr hbotLargeBottleBSPosMgr; |
||||
|
|
||||
|
@Resource |
||||
|
PipetteCtrlDriver pipetteCtrlDriver; |
||||
|
@Resource |
||||
|
HbotBaseMoveExDriver hbotBaseMoveExDriver; |
||||
|
@Resource |
||||
|
HbotDriver hbotDriver; |
||||
|
@Resource |
||||
|
HbotCtrlService hbotCtrlService; |
||||
|
@Resource |
||||
|
PipetteGunParamExMgr pipetteGunParamExMgr; |
||||
|
|
||||
|
|
||||
|
@Resource |
||||
|
DeviceInitCtrlService deviceInitializationModule; |
||||
|
|
||||
|
Integer tipNum = 0; |
||||
|
Integer loadUl = 0; |
||||
|
Integer lldpThreshold = 20; |
||||
|
|
||||
|
@PostConstruct |
||||
|
void initialize() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
@ExtApiFn(name = "初始化设备", group = "测试准备工作", order = 11) |
||||
|
public List<CheckResult> initDevice() throws AppException { |
||||
|
List<CheckResult> checkResult = deviceInitializationModule.deviceMoveToZero(); |
||||
|
for (CheckResult result : checkResult) { |
||||
|
if (!result.pass) { |
||||
|
return checkResult; |
||||
|
} |
||||
|
} |
||||
|
return checkResult; |
||||
|
} |
||||
|
|
||||
|
@ExtApiFn(name = "加载tip头", group = "测试准备工作", order = 12) |
||||
|
public void loadTip() throws AppException { |
||||
|
tipNum = AppConstant.TIP_NUM; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@ExtApiFn(name = "设置吸液量", group = "测试准备工作", order = 13) |
||||
|
public void setLoadUl(Integer loadUl) { |
||||
|
this.loadUl = loadUl; |
||||
|
} |
||||
|
|
||||
|
@ExtApiFn(name = "设置LLD P阈值(建议20)", group = "测试准备工作", order = 14) |
||||
|
public void setLldpThreshold(Integer lldpThreshold) { |
||||
|
this.lldpThreshold = lldpThreshold; |
||||
|
} |
||||
|
|
||||
|
Boolean takeOneTip() throws AppException { |
||||
|
hbotBaseMoveExDriver.hbotMoveTo(hbotTipPosMgr.getDropTipPos()); |
||||
|
pipetteCtrlDriver.pipetteInitDeviceBlock(); |
||||
|
pipetteCtrlDriver.lldPrepareBlock(); |
||||
|
TipPos tipPos = new TipPos(); |
||||
|
tipPos.group = TipGroup.GROUP0; |
||||
|
if (tipNum == 0) { |
||||
|
throw AppException.ofAECodeError("Tip已经用完"); |
||||
|
} |
||||
|
tipPos.index = AppConstant.TIP_NUM - tipNum; |
||||
|
tipNum--; |
||||
|
log.info(" 取TIP {}", tipPos); |
||||
|
return hbotCtrlService.takeTipNoCheck(tipPos.group, tipPos.index);//取tip |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@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 = pipetteGunLLFParamMgr.getLargeBSBottleLlfVel(); |
||||
|
|
||||
|
// |
||||
|
//1. Init pipette gun and take tip |
||||
|
//2. lld prepare |
||||
|
// |
||||
|
|
||||
|
if (!pipetteCtrlDriver.isHasTip()) { |
||||
|
while (true) { |
||||
|
if (takeOneTip()) { |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
pipetteCtrlDriver.lldPrepareBlock(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// |
||||
|
// lld |
||||
|
// |
||||
|
hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP0); |
||||
|
pipetteCtrlDriver.setStartZ(startZPos); |
||||
|
pipetteCtrlDriver.setEndZ(endZPos); |
||||
|
pipetteCtrlDriver.setLldType(LldType.kplld); |
||||
|
pipetteCtrlDriver.setLldCThreshold(15); |
||||
|
pipetteCtrlDriver.setLldPThreshold(lldpThreshold); |
||||
|
pipetteCtrlDriver.lldBlock(); |
||||
|
|
||||
|
if (!pipetteCtrlDriver.lldIsDetectLiquid()) { |
||||
|
throw AppException.ofAECodeError("没有液体"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// |
||||
|
// aspirate |
||||
|
// |
||||
|
pipetteCtrlDriver.setLlfStartZ(pipetteCtrlDriver.getReg(PipetteRegIndex.kreg_pipette_zm_pos)); |
||||
|
pipetteCtrlDriver.setLlfStartZ(endZPos); |
||||
|
pipetteCtrlDriver.aspirateSetLlfVelocity(llfv); |
||||
|
pipetteCtrlDriver.aspiratePrepareBlock(); |
||||
|
pipetteCtrlDriver.aspirateBlock(loadUl); |
||||
|
pipetteCtrlDriver.zMotorMoveToZeroPointQuickBlock(); |
||||
|
|
||||
|
// |
||||
|
// move to distrube pos |
||||
|
// |
||||
|
hbotCtrlService.moveToLargeBSSamplePos(ConsumableGroup.GROUP1); |
||||
|
pipetteCtrlDriver.aspirateBlock(-loadUl); |
||||
|
pipetteCtrlDriver.clearHangingLiquid(3); |
||||
|
|
||||
|
hbotCtrlService.moveQuickToZero(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@ExtApiStatu(name = "val", group = "tipNum", order = 100) |
||||
|
public Integer readTipNum() throws AppException { |
||||
|
return tipNum; |
||||
|
} |
||||
|
|
||||
|
@ExtApiStatu(name = "val", group = "loadUl", order = 101) |
||||
|
public Integer readLoadUl() throws AppException { |
||||
|
return loadUl; |
||||
|
} |
||||
|
|
||||
|
@ExtApiStatu(name = "val", group = "lldpThreshold", order = 102) |
||||
|
public Integer readLldpThreshold() throws AppException { |
||||
|
return lldpThreshold; |
||||
|
} |
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue