Browse Source

Merge branch 'fix'

master
zhaohe 3 months ago
parent
commit
168e8f6f9c
  1. 59
      src/main/java/a8k/app/engineer/service/qatest/ExperimentConsistencyTestingService.java
  2. 1
      src/main/java/a8k/app/service/lowerctrl/HbotMoveExCtrlService.java
  3. 7
      src/main/java/a8k/app/service/utils/UISender.java
  4. 9
      src/main/java/a8k/extui/page/extapp/profession_test/ExperimentConsistencyTestingPage.java

59
src/main/java/a8k/app/engineer/service/qatest/ExperimentConsistencyTestingService.java

@ -38,12 +38,14 @@ import a8k.app.type.exception.AppException;
import a8k.app.type.param.type.A8kSamplePos;
import a8k.app.type.ui.TubeHolderSetting;
import a8k.app.type.ui.TubeSetting;
import a8k.app.utils.ZJsonHelper;
import a8k.app.utils.ZList;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import javax.swing.*;
import java.util.List;
import java.util.Objects;
@ -111,6 +113,7 @@ public class ExperimentConsistencyTestingService {
if (tubeExTubeHolderExConfig != null) {
this.tubeHolderExConfig = tubeExTubeHolderExConfig;
}
log.info("更新试管架配置 {}", ZJsonHelper.objectToJson(tubeHolderExConfig));
}
synchronized public TubeHolderExConfig getTubeExConfig() {
@ -160,7 +163,7 @@ public class ExperimentConsistencyTestingService {
int testTotalTimes = 0;
for (TubeSetting tubeSetting : tubeHolderSetting.tubeSettings) {
for (Integer ignored : tubeSetting.projId) {
testTotalTimes++;
testTotalTimes += tubeHolderExConfig.tubeExConfigs.get(tubeSetting.tubeIndex).repeatTimes;
}
}
if (consumablesMgrService.getConsumableNum(1/*hscrp项目*/) < testTotalTimes) {
@ -289,44 +292,44 @@ public class ExperimentConsistencyTestingService {
}
Assert.isTrue(scanResult.tube[tubeoff].isTubeExist, String.format("位置[%d]未放入是试管", tubeoff + 1));
//移动试管架到预处理位置
int finalTubeoff = tubeoff;
UISender.txInfoMsg(log, "开始处理第%d个试管", finalTubeoff + 1);
docmd("移动试管到处理位", () -> tubeFeedingCtrlService.moveTubeToPreProcessPos(finalTubeoff));
//尝试处理孵育完成的反应板
incubationPlateProcess(false);
for (int j = 0; j < getRepeatTimes(tubeoff); j++) {
//申请耗材
var consumableInfo = consumablesMgrService.reserveConsumable(expectedProjId);
if (consumableInfo == null) {
throw AppException.of(A8kEcode.CODEERROR, "耗材不足?"); //理论上开始阶段已经核对过了耗材数量此时应该不会不足
}
consumablesMgrService.useReserveConsumable(consumableInfo);
//尝试处理孵育完成的反应板
incubationPlateProcess(false);
//构造项目信息
ProjBuildinInfo projBuildinInfo = projInfoMgrService.getProjBuildInInfo(expectedProjId);
ProjExtInfoCard projExtInfoCard = projInfoMgrService.getProjExtInfoCard(consumableInfo.lotid);
ProjBriefInfo projBriefInfo = ProjInfoUtils.buildProjBrefInfo(projBuildinInfo);
//申请耗材
var consumableInfo = consumablesMgrService.reserveConsumable(expectedProjId);
if (consumableInfo == null) {
throw AppException.of(A8kEcode.CODEERROR, "耗材不足?"); //理论上开始阶段已经核对过了耗材数量此时应该不会不足
}
consumablesMgrService.useReserveConsumable(consumableInfo);
Assert.notNull(projBuildinInfo, "projBuildInInfo is null");
Assert.notNull(projExtInfoCard, "projExtInfoCard is null");
//构造项目信息
ProjBuildinInfo projBuildinInfo = projInfoMgrService.getProjBuildInInfo(expectedProjId);
ProjExtInfoCard projExtInfoCard = projInfoMgrService.getProjExtInfoCard(consumableInfo.lotid);
ProjBriefInfo projBriefInfo = ProjInfoUtils.buildProjBrefInfo(projBuildinInfo);
//处理样本
Tube tube = new Tube(tubeoff);
tube.setIsHighTube(false);
tube.setIsEmergency(false);
tube.setBloodType(BloodType.WHOLE_BLOOD);
tube.setSampleBarcode(tubeSetting.sampleBarcode);
tube.setUserid(tubeSetting.userid);
tube.setProjInfo(ZList.of(projBriefInfo));
tube.setProjIds(ZList.of(expectedProjId));
String sampleId = tubeStateMgrService.newSample(tube);
tube.setSampleId(sampleId);
Assert.notNull(projBuildinInfo, "projBuildInInfo is null");
Assert.notNull(projExtInfoCard, "projExtInfoCard is null");
//处理样本
Tube tube = new Tube(tubeoff);
tube.setIsHighTube(false);
tube.setIsEmergency(false);
tube.setBloodType(BloodType.WHOLE_BLOOD);
tube.setSampleBarcode(tubeSetting.sampleBarcode);
tube.setUserid(tubeSetting.userid);
tube.setProjInfo(ZList.of(projBriefInfo));
tube.setProjIds(ZList.of(expectedProjId));
String sampleId = tubeStateMgrService.newSample(tube);
tube.setSampleId(sampleId);
for (int j = 0; j < getRepeatTimes(tubeoff); j++) {
//处理试管
processTube(tube, tubeoff, consumableInfo, tubeSetting);
if (!tube.getErrors().isEmpty()) {

1
src/main/java/a8k/app/service/lowerctrl/HbotMoveExCtrlService.java

@ -160,6 +160,7 @@ public class HbotMoveExCtrlService {
hbotMoveCtrlService.hbotMoveTo(hbotTipPosMgr.getDropTipPos());
pipetteCtrlDriver.pipetteInitDeviceBlock();
pipetteCtrlDriver.zMotorMoveToZeroPointQuickBlock();
moveQuickToZero();
}
public void quickResetHbot() throws AppException {

7
src/main/java/a8k/app/service/utils/UISender.java

@ -25,6 +25,13 @@ public class UISender {
service.pushMessageBox(new MessageBox(MessageLevel.Error, String.format(msg, args)));
}
public static void txErrorMsg(Logger logger, AppError e, String msg, Object... args) {
logger.error("{}", String.format(msg, args), e);
var service = SpringBootBeanUtil.getBean(FrontEndMessageBoxAndEventMgr.class);
service.pushMessageBox(new MessageBox(MessageLevel.Error, String.format(msg, args)));
}
public static void txErrorPrompt(AppError error) {
var ebus = SpringBootBeanUtil.getBean(AppEventBusService.class);
ebus.pushEvent(ZAppPromoptFactory.buildAppPromoptEvent(error));

9
src/main/java/a8k/extui/page/extapp/profession_test/ExperimentConsistencyTestingPage.java

@ -2,6 +2,8 @@ package a8k.extui.page.extapp.profession_test;
import a8k.app.engineer.service.qatest.ExperimentConsistencyTestingService;
import a8k.app.engineer.service.state.EngineerModeStateMgrService;
import a8k.app.engineer.service.type.EngineerModeState;
import a8k.app.engineer.service.type.TubeExConfig;
import a8k.app.engineer.service.type.TubeHolderExConfig;
import a8k.app.type.exception.AppException;
@ -20,6 +22,8 @@ public class ExperimentConsistencyTestingPage {
private final ExtApiPageMgr extApiPageMgr;
private final ExperimentConsistencyTestingService experimentConsistencyTestingService;
private final EngineerModeStateMgrService engineerModeStateMgrService;
@ExtApiStatu(name = "", group = "试管1", order = 1)
public TubeExConfig getTubeExConfig1() {
@ -71,6 +75,11 @@ public class ExperimentConsistencyTestingPage {
return experimentConsistencyTestingService.getTubeExConfig().tubeExConfigs.get(9);
}
@ExtApiStatu(name = "", group = "获取状态", order = 11)
public EngineerModeState getState() {
return engineerModeStateMgrService.getState();
}
@PostConstruct
void init() {

Loading…
Cancel
Save