|
@ -20,28 +20,21 @@ import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; |
|
|
import a8k.service.dao.A8kProjIdCardDao; |
|
|
import a8k.service.dao.A8kProjIdCardDao; |
|
|
import a8k.service.dao.A8kProjInfoDao; |
|
|
import a8k.service.dao.A8kProjInfoDao; |
|
|
import a8k.service.dao.A8kProjOptConfigDao; |
|
|
import a8k.service.dao.A8kProjOptConfigDao; |
|
|
import a8k.service.test.fakeproj.FAKE_PROJ_01; |
|
|
|
|
|
import a8k.service.test.fakeproj.FAKE_PROJ_02; |
|
|
|
|
|
import a8k.service.test.fakeproj.FakeProjInfo; |
|
|
|
|
|
import a8k.service.test.fakeproj.FakeProjInfoFactory; |
|
|
|
|
|
|
|
|
import a8k.service.test.fakeproj.*; |
|
|
import a8k.service.test.state.TestModeState; |
|
|
import a8k.service.test.state.TestModeState; |
|
|
import a8k.service.test.state.VirtualDevice; |
|
|
import a8k.service.test.state.VirtualDevice; |
|
|
import a8k.service.test.type.MainFlowCtrlTestCaseType; |
|
|
|
|
|
import a8k.type.*; |
|
|
import a8k.type.*; |
|
|
import a8k.type.checkpoint.CheckResult; |
|
|
import a8k.type.checkpoint.CheckResult; |
|
|
import a8k.type.consumables.ConsumablesScanReportErrorType; |
|
|
import a8k.type.consumables.ConsumablesScanReportErrorType; |
|
|
import a8k.type.ecode.AECodeError; |
|
|
|
|
|
import a8k.type.exception.AppException; |
|
|
import a8k.type.exception.AppException; |
|
|
import a8k.type.tube_setting.TubeHolderSetting; |
|
|
import a8k.type.tube_setting.TubeHolderSetting; |
|
|
import a8k.type.type.A8kTubeHolderType; |
|
|
import a8k.type.type.A8kTubeHolderType; |
|
|
import a8k.type.type.TipGroup; |
|
|
import a8k.type.type.TipGroup; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
@Component |
|
|
@Component |
|
|
@Slf4j |
|
|
@Slf4j |
|
@ -127,7 +120,7 @@ public class MainflowCtrlTestService { |
|
|
return scanResult; |
|
|
return scanResult; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
TubeHolderSetting createOneActiveTubeHolderSetting(A8kTubeHolderType type, Integer tubeNum, List<Integer> projId) { |
|
|
|
|
|
|
|
|
TubeHolderSetting createOneActiveTubeHolderSetting(Integer tubeNum, List<Integer> projId) { |
|
|
TubeHolderSetting setting = new TubeHolderSetting(); |
|
|
TubeHolderSetting setting = new TubeHolderSetting(); |
|
|
// setting.tubeHolderType = type; |
|
|
// setting.tubeHolderType = type; |
|
|
setting.active = true; |
|
|
setting.active = true; |
|
@ -156,7 +149,7 @@ public class MainflowCtrlTestService { |
|
|
|
|
|
|
|
|
@ExtApiFn(name = "使能光学检查", group = "测试模式", order = 103) |
|
|
@ExtApiFn(name = "使能光学检查", group = "测试模式", order = 103) |
|
|
public void setEnableOptScan(Boolean enable) { |
|
|
public void setEnableOptScan(Boolean enable) { |
|
|
testModeState.setEnableOptScan(enable); |
|
|
|
|
|
|
|
|
testModeState.setDisableOptScan(enable); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// |
|
|
// |
|
@ -247,76 +240,83 @@ public class MainflowCtrlTestService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "执行一次简单的测试(无试管测试.流程1)", order = 400) |
|
|
|
|
|
public String doSimpleTest(Boolean isHTube, Integer tubeNum) throws AppException { |
|
|
|
|
|
|
|
|
void doOnceSimpleTest(FakeProjInfo proj, Boolean isHTube, Integer tubeNum) throws AppException { |
|
|
if (tubeNum <= 0) { |
|
|
if (tubeNum <= 0) { |
|
|
throw AppException.of("试管数量必须大于0"); |
|
|
throw AppException.of("试管数量必须大于0"); |
|
|
} |
|
|
} |
|
|
gstate.setDeviceInited(true); |
|
|
gstate.setDeviceInited(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stopAndWaittingForDeviceStop(); |
|
|
stopAndWaittingForDeviceStop(); |
|
|
//清空项目的数据库配置 |
|
|
|
|
|
resetProjDB(); |
|
|
|
|
|
|
|
|
|
|
|
//设置虚拟耗材,只有一个高试管 |
|
|
|
|
|
testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, isHTube, tubeNum)); |
|
|
|
|
|
//无校验模式 |
|
|
|
|
|
testModeState.setNoCheckMode(true); |
|
|
|
|
|
//无光学检查 |
|
|
|
|
|
testModeState.setEnableOptScan(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加项目信息 |
|
|
|
|
|
addProjInfo(FAKE_PROJ_01.class); |
|
|
|
|
|
//设置耗材状态,假定已经扫描过耗材 |
|
|
//设置耗材状态,假定已经扫描过耗材 |
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP0, new FAKE_PROJ_01()); |
|
|
|
|
|
//设置试管架扫描信息,全部设置成高试管 |
|
|
|
|
|
|
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP0, proj); |
|
|
|
|
|
//添加一个新试管配置 |
|
|
appTubeSettingMgrService.removeAllTubeSetting(); |
|
|
appTubeSettingMgrService.removeAllTubeSetting(); |
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; i++) { |
|
|
|
|
|
TubeHolderSetting setting = createOneActiveTubeHolderSetting(A8kTubeHolderType.BloodTube, tubeNum, List.of(new FAKE_PROJ_01().projId)); |
|
|
|
|
|
appTubeSettingMgrService.newTubeHolderSetting(setting); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
appTubeSettingMgrService.newTubeHolderSetting(// |
|
|
|
|
|
createOneActiveTubeHolderSetting(tubeNum, List.of(proj.projId))); |
|
|
|
|
|
|
|
|
//开始工作 |
|
|
//开始工作 |
|
|
appDeviceCtrlService.startWork(); |
|
|
appDeviceCtrlService.startWork(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void regFakeProjInfo() { |
|
|
|
|
|
resetProjDB(); |
|
|
|
|
|
addProjInfo(FAKE_PROJ_01_FLOW1.class); |
|
|
|
|
|
addProjInfo(FAKE_PROJ_02_FLOW2.class); |
|
|
|
|
|
addProjInfo(FAKE_PROJ_03.class); |
|
|
|
|
|
addProjInfo(FAKE_PROJ_04.class); |
|
|
|
|
|
addProjInfo(FAKE_PROJ_05.class); |
|
|
|
|
|
addProjInfo(FAKE_PROJ_06.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "执行一次简单的测试(无试管测试.流程1)", order = 400) |
|
|
|
|
|
public String doSimpleTest(Boolean isHTube, Integer tubeNum) throws AppException { |
|
|
|
|
|
regFakeProjInfo(); |
|
|
|
|
|
//设置虚拟耗材,只有一个高试管,无校验模式,无光学检查 |
|
|
|
|
|
testModeState.resetAll(); |
|
|
|
|
|
testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, isHTube, tubeNum)); |
|
|
|
|
|
testModeState.setNoCheckMode(true); |
|
|
|
|
|
testModeState.setDisableOptScan(true); |
|
|
|
|
|
doOnceSimpleTest(new FAKE_PROJ_01_FLOW1(), isHTube, tubeNum); |
|
|
return "开始测试"; |
|
|
return "开始测试"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ExtApiFn(name = "执行一次简单的测试(无试管测试.流程2)", order = 401) |
|
|
@ExtApiFn(name = "执行一次简单的测试(无试管测试.流程2)", order = 401) |
|
|
public String doSimpleTest2(Boolean isHTube, Integer tubeNum) throws AppException { |
|
|
public String doSimpleTest2(Boolean isHTube, Integer tubeNum) throws AppException { |
|
|
if (tubeNum <= 0) { |
|
|
|
|
|
throw AppException.of("试管数量必须大于0"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
regFakeProjInfo(); |
|
|
|
|
|
|
|
|
|
|
|
testModeState.resetAll(); |
|
|
|
|
|
testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, isHTube, tubeNum)); |
|
|
|
|
|
testModeState.setNoCheckMode(true); |
|
|
|
|
|
testModeState.setDisableOptScan(true); |
|
|
|
|
|
doOnceSimpleTest(new FAKE_PROJ_02_FLOW2(), isHTube, tubeNum); |
|
|
|
|
|
return "开始测试"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
gstate.setDeviceInited(true); |
|
|
|
|
|
|
|
|
|
|
|
stopAndWaittingForDeviceStop(); |
|
|
|
|
|
//清空项目的数据库配置 |
|
|
|
|
|
resetProjDB(); |
|
|
|
|
|
|
|
|
@ExtApiFn(name = "执行一次十个试管,双项目,无耗材测试", order = 402) |
|
|
|
|
|
public String doSimpleTest3() throws AppException { |
|
|
|
|
|
regFakeProjInfo(); |
|
|
|
|
|
|
|
|
//设置虚拟耗材,只有一个高试管 |
|
|
|
|
|
testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, isHTube, tubeNum)); |
|
|
|
|
|
//无校验模式 |
|
|
|
|
|
|
|
|
testModeState.resetAll(); |
|
|
|
|
|
testModeState.setVirtualTubeScanResult(createScanResult(A8kTubeHolderType.BloodTube, true, 10)); |
|
|
testModeState.setNoCheckMode(true); |
|
|
testModeState.setNoCheckMode(true); |
|
|
//无光学检查 |
|
|
|
|
|
testModeState.setEnableOptScan(true); |
|
|
|
|
|
|
|
|
testModeState.setDisableOptScan(true); |
|
|
|
|
|
|
|
|
|
|
|
gstate.setDeviceInited(true); |
|
|
|
|
|
|
|
|
|
|
|
stopAndWaittingForDeviceStop(); |
|
|
|
|
|
|
|
|
//添加项目信息 |
|
|
|
|
|
addProjInfo(FAKE_PROJ_02.class); |
|
|
|
|
|
//设置耗材状态,假定已经扫描过耗材 |
|
|
//设置耗材状态,假定已经扫描过耗材 |
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP1, new FAKE_PROJ_02()); |
|
|
|
|
|
//设置试管架扫描信息,全部设置成高试管 |
|
|
|
|
|
|
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP0, new FAKE_PROJ_01_FLOW1()); |
|
|
|
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP1, new FAKE_PROJ_02_FLOW2()); |
|
|
|
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP3, new FAKE_PROJ_01_FLOW1()); |
|
|
|
|
|
LoadingConsumablesDirectly(ConsumableGroup.GROUP4, new FAKE_PROJ_02_FLOW2()); |
|
|
|
|
|
//添加一个新试管配置 |
|
|
appTubeSettingMgrService.removeAllTubeSetting(); |
|
|
appTubeSettingMgrService.removeAllTubeSetting(); |
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; i++) { |
|
|
|
|
|
TubeHolderSetting setting = createOneActiveTubeHolderSetting(A8kTubeHolderType.BloodTube, tubeNum, List.of(new FAKE_PROJ_02().projId)); |
|
|
|
|
|
appTubeSettingMgrService.newTubeHolderSetting(setting); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
appTubeSettingMgrService.newTubeHolderSetting(// |
|
|
|
|
|
createOneActiveTubeHolderSetting(10, List.of(new FAKE_PROJ_01_FLOW1().projId, new FAKE_PROJ_02_FLOW2().projId))); |
|
|
|
|
|
|
|
|
//开始工作 |
|
|
//开始工作 |
|
|
appDeviceCtrlService.startWork(); |
|
|
appDeviceCtrlService.startWork(); |
|
|