|
|
@ -8,10 +8,18 @@ import a8k.extapi_controler.utils.ExtApiTab; |
|
|
|
import a8k.hardware.type.a8kcanprotocol.A8kEcode; |
|
|
|
import a8k.hardware.type.a8kcanprotocol.CmdId; |
|
|
|
import a8k.hardware.type.a8kcanprotocol.MId; |
|
|
|
import a8k.service.app.appctrl.AppDeviceCtrlService; |
|
|
|
import a8k.service.app.appctrl.CheckPointType; |
|
|
|
import a8k.service.app.appctrl.MainFlowCtrlService; |
|
|
|
import a8k.service.app.appctrl.TubeSettingMgrService; |
|
|
|
import a8k.service.app.appctrl.mainflowctrl.CondtionMgrService; |
|
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kActionStepType; |
|
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kErrorContext; |
|
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kStepAction; |
|
|
|
import a8k.service.app.appstate.ConsumablesMgrService; |
|
|
|
import a8k.service.app.appstate.GStateService; |
|
|
|
import a8k.service.app.appstate.ProjectProcessContextMgrService; |
|
|
|
import a8k.service.app.appstate.type.ProjProcessContext; |
|
|
|
import a8k.service.bases.AppEventBusService; |
|
|
|
import a8k.service.bases.appevent.*; |
|
|
|
import a8k.service.db.A8kProjIdCardDBService; |
|
|
@ -31,13 +39,17 @@ import a8k.type.ecode.ConsumeNotEnoughError; |
|
|
|
import a8k.type.ecode.HardwareError; |
|
|
|
import a8k.type.exception.AppException; |
|
|
|
import a8k.type.reaction_result_type.ReactionResultStatus; |
|
|
|
import a8k.type.tube_setting.TubeHolderSetting; |
|
|
|
import a8k.type.type.A8kTubeHolderType; |
|
|
|
import a8k.type.type.BloodType; |
|
|
|
import a8k.type.type.TipGroup; |
|
|
|
import a8k.utils.A8kPacketBuilder; |
|
|
|
import a8k.utils.ReactionPlate2DCodeHelper; |
|
|
|
import a8k.utils.ZDateUtils; |
|
|
|
import jakarta.annotation.PostConstruct; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
@ -48,6 +60,7 @@ import java.util.List; |
|
|
|
@ExtApiTab(cfg = ExtApiTabConfig.AppDebugHelperService) |
|
|
|
public class AppDebugHelperService { |
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(AppDebugHelperService.class); |
|
|
|
Boolean debugFlag = true; |
|
|
|
|
|
|
|
@Resource |
|
|
@ -243,6 +256,80 @@ public class AppDebugHelperService { |
|
|
|
eventBus.pushEvent(new A8kEcodeContextListPromptEvent(errorContexts)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "获取运行步骤状态", group = "调试") |
|
|
|
public List<A8kStepAction> getA8kStepActionList() { |
|
|
|
MainFlowCtrlService mainFlowCtrlService = SpringBootBeanUtil.getBean(MainFlowCtrlService.class); |
|
|
|
return mainFlowCtrlService.getA8kStepActionList(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "获取设备状态()", group = "调试") |
|
|
|
public GStateService getGState() { |
|
|
|
return gstate; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "获取所有项目<运行中>Context", group = "调试") |
|
|
|
public List<ProjProcessContext> getAllProcessingProjProcessContexts() { |
|
|
|
ProjectProcessContextMgrService projectProcessContextMgrService = SpringBootBeanUtil.getBean(ProjectProcessContextMgrService.class); |
|
|
|
return projectProcessContextMgrService.getAllProcessingProjProcessContexts(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "获取所有项目Context", group = "调试") |
|
|
|
public List<ProjProcessContext> getAllContext() { |
|
|
|
ProjectProcessContextMgrService projectProcessContextMgrService = SpringBootBeanUtil.getBean(ProjectProcessContextMgrService.class); |
|
|
|
return projectProcessContextMgrService.getAllContexts(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "获取所有项目<异常>Context", group = "调试") |
|
|
|
public List<ProjProcessContext> getAllErrorProjProcessContexts() { |
|
|
|
ProjectProcessContextMgrService projectProcessContextMgrService = SpringBootBeanUtil.getBean(ProjectProcessContextMgrService.class); |
|
|
|
return projectProcessContextMgrService.getAllErrorProjProcessContexts(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "获取动作运行条件", group = "调试") |
|
|
|
public CondtionMgrService getCondtions() { |
|
|
|
return SpringBootBeanUtil.getBean(CondtionMgrService.class); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "测试0", group = "虚拟测试", order = 1) |
|
|
|
public void virtulaTest0() throws AppException { |
|
|
|
//插入ID卡 |
|
|
|
logger.info("保存测试的ID卡信息"); |
|
|
|
saveAllIDCard(); |
|
|
|
|
|
|
|
//添加试管配置 |
|
|
|
logger.info("添加试管配置"); |
|
|
|
TubeSettingMgrService tubeSettingMgrService = SpringBootBeanUtil.getBean(TubeSettingMgrService.class); |
|
|
|
tubeSettingMgrService.newTubeHolderSetting(); |
|
|
|
TubeHolderSetting setting = tubeSettingMgrService.newTubeHolderSettingV2(); |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
tubeSettingMgrService.setTubeSettingUserIdAndSampleBarcode(setting.uuid, i, String.format("USR%d", i), ""); |
|
|
|
tubeSettingMgrService.setTubeSetting(setting.uuid, i, BloodType.WHOLE_BLOOD,// |
|
|
|
String.format("%d,%d,%d,%d,%d,%d", p01_hscrr.projIndex, p02_pct.projIndex, p03_tsh.projIndex, p05_t3.projIndex, p06_t4.projIndex, p22_pctAndHsCRP.projIndex)); |
|
|
|
} |
|
|
|
tubeSettingMgrService.tubeHodlerSettingSetActiveState(setting.uuid, true); |
|
|
|
|
|
|
|
//初始化设备 |
|
|
|
logger.info("初始化设备"); |
|
|
|
AppDeviceCtrlService appDeviceCtrlService = SpringBootBeanUtil.getBean(AppDeviceCtrlService.class); |
|
|
|
appDeviceCtrlService.initDevice(); |
|
|
|
|
|
|
|
//扫描耗材 |
|
|
|
logger.info("扫描耗材"); |
|
|
|
putRightConsumable(); |
|
|
|
appDeviceCtrlService.scanConsumables(); |
|
|
|
|
|
|
|
ConsumablesMgrService consumablesMgrService = SpringBootBeanUtil.getBean(ConsumablesMgrService.class); |
|
|
|
consumablesMgrService.setTipNum(TipGroup.GROUP0.ordinal(),120); |
|
|
|
|
|
|
|
|
|
|
|
//放入一个虚拟试管 |
|
|
|
logger.info("放入一个虚拟试管"); |
|
|
|
insertVirtualBloodTubeHolder(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//InterUse |
|
|
|
public Boolean getVirtualIDCard() { |
|
|
|
return mountIdcard != null; |
|
|
@ -280,7 +367,7 @@ public class AppDebugHelperService { |
|
|
|
|
|
|
|
|
|
|
|
public ConsumableOneChResult scanOneCH(Integer ch) { |
|
|
|
OS.forceSleep(1500); |
|
|
|
doVirtualThings("扫描耗材-板夹" + ch, 1); |
|
|
|
ConsumableOneChResult result = new ConsumableOneChResult(ch); |
|
|
|
switch (consumablesErrorType[ch]) { |
|
|
|
case PASS: //通过 |
|
|
@ -364,8 +451,16 @@ public class AppDebugHelperService { |
|
|
|
synchronized public TubeHolderScanResult takeTubeHolderScanResult() { |
|
|
|
TubeHolderScanResult tubeHolderScanResult = this.tubeHolderScanResult; |
|
|
|
this.tubeHolderScanResult = null; |
|
|
|
doVirtualThings("进入一个新的试管架", 2); |
|
|
|
return tubeHolderScanResult; |
|
|
|
} |
|
|
|
|
|
|
|
synchronized public void doVirtualThings(String dowhat, Integer time) { |
|
|
|
// for (int i = 0; i < time; i++) { |
|
|
|
logger.info("VirtualDoing:" + dowhat); |
|
|
|
OS.forceSleep(100); |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |