|
|
@ -1,17 +1,29 @@ |
|
|
|
package a8k.service.debug; |
|
|
|
|
|
|
|
import a8k.OS; |
|
|
|
import a8k.SpringBootBeanUtil; |
|
|
|
import a8k.extapi_controler.pagecontrol.ExtApiTabConfig; |
|
|
|
import a8k.extapi_controler.utils.ExtApiFn; |
|
|
|
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.CheckPointType; |
|
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kActionStepType; |
|
|
|
import a8k.service.app.appctrl.mainflowctrl.base.A8kErrorContext; |
|
|
|
import a8k.service.app.appdata.ReactionRecordMgrService; |
|
|
|
import a8k.service.app.appstate.GStateService; |
|
|
|
import a8k.service.app.appstate.type.ProjProcessContext; |
|
|
|
import a8k.service.bases.AppEventBusService; |
|
|
|
import a8k.service.bases.appevent.A8kHardwareReport; |
|
|
|
import a8k.service.bases.appevent.*; |
|
|
|
import a8k.service.db.A8kProjIdCardDBService; |
|
|
|
import a8k.service.db.A8kProjInfoDBService; |
|
|
|
import a8k.service.db.ReactionRecordDBService; |
|
|
|
import a8k.service.db.type.A8kIdCardInfo; |
|
|
|
import a8k.service.db.type.A8kProjOptConfig; |
|
|
|
import a8k.service.db.type.A8kProjectInfo; |
|
|
|
import a8k.service.db.type.ReactionResultRecord; |
|
|
|
import a8k.service.db.type.a8kidcard.zenum.A8kReactionFlowType; |
|
|
|
import a8k.service.debug.fakeprojinfo.*; |
|
|
|
import a8k.type.ConsumableGroup; |
|
|
|
import a8k.type.ConsumableOneChResult; |
|
|
@ -19,15 +31,24 @@ import a8k.type.ConsumableScanRawResult; |
|
|
|
import a8k.type.checkpoint.CheckResult; |
|
|
|
import a8k.type.checkpoint.Checkpoint; |
|
|
|
import a8k.type.consumables.ConsumablesErrorType; |
|
|
|
import a8k.type.ecode.AppCodeError; |
|
|
|
import a8k.type.ecode.AppError; |
|
|
|
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.type.BloodType; |
|
|
|
import a8k.utils.A8kPacketBuilder; |
|
|
|
import a8k.utils.AppExceptionBuilder; |
|
|
|
import a8k.utils.ReactionPlate2DCodeHelper; |
|
|
|
import a8k.utils.ZDateUtils; |
|
|
|
import jakarta.annotation.PostConstruct; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Component |
|
|
@ -50,9 +71,12 @@ public class AppDebugHelperService { |
|
|
|
P22_PCTAndHsCRP p22_pctAndHsCRP; |
|
|
|
@Resource |
|
|
|
AppEventBusService eventBus; |
|
|
|
@Resource |
|
|
|
GStateService gstate; |
|
|
|
|
|
|
|
FakeProjInfo mountIdcard; |
|
|
|
|
|
|
|
|
|
|
|
String[] consumables = new String[6]; |
|
|
|
ConsumablesErrorType[] consumablesErrorType = new ConsumablesErrorType[6]; |
|
|
|
|
|
|
@ -149,6 +173,71 @@ public class AppDebugHelperService { |
|
|
|
Arrays.fill(consumables, ""); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "添加反应结果记录", group = "虚拟数据", order = 4) |
|
|
|
public void addVirtualReactionRecord() { |
|
|
|
ReactionRecordDBService service = SpringBootBeanUtil.getBean(ReactionRecordDBService.class); |
|
|
|
ReactionResultRecord record = new ReactionResultRecord(); |
|
|
|
|
|
|
|
record.sampleBloodType = BloodType.WHOLE_BLOOD; |
|
|
|
record.sampleBarcode = "XXXXXXXXXXXXXXX"; |
|
|
|
record.sampleUserid = "ABCDEFG"; |
|
|
|
record.projName = "hscrp"; |
|
|
|
record.lotId = "CAHAC46U"; |
|
|
|
record.projIndex = 1; |
|
|
|
record.sampleId = "20120904_1"; |
|
|
|
record.expiryDate = ZDateUtils.nextDay(); |
|
|
|
record.operator = "admin"; // 操作员 |
|
|
|
record.appVersion = gstate.getAppVersion();//上层应用版本 |
|
|
|
record.mcuVersion = gstate.getMcuVersion(); // MCU软件版本 |
|
|
|
record.sn = gstate.getSn(); // 仪器序列号 =; |
|
|
|
record.subProjResultStatus1 = ReactionResultStatus.SUCCESS; |
|
|
|
record.subProjResultStatus2 = ReactionResultStatus.ERROR_RESULT_OUT_OF_RANGE; |
|
|
|
record.subProjResultStatus3 = ReactionResultStatus.ERROR_QUALITY_PEAK_DETECTION; |
|
|
|
record.subProjResult1 = "12.3mg/L,12.5g/ml,125mol/L"; //子项目1 结果 |
|
|
|
record.subProjResult2 = ""; //子项目2 结果 |
|
|
|
record.subProjResult3 = ""; //子项目3 结果 |
|
|
|
service.add(record); |
|
|
|
} |
|
|
|
//A8kEcodeContextListPromptEvent |
|
|
|
//AppWarningNotifyEvent |
|
|
|
//A8kErrorPromptEvent |
|
|
|
//AppTubeholderSettingUpdateEvent |
|
|
|
//DoA8kStepActionEvent |
|
|
|
|
|
|
|
|
|
|
|
@ExtApiFn(name = "发送AppWarningNotifyEvent", group = "虚拟事件", order = 1) |
|
|
|
public void buildAndSendAppWarningNotifyEvent() { |
|
|
|
AppWarningNotifyEvent event = new AppWarningNotifyEvent(A8kEcode.UsrNotExitError); |
|
|
|
eventBus.pushEvent(event); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "A8kErrorPromptEvent", group = "虚拟事件", order = 2) |
|
|
|
public void buildAndSendA8kErrorPromptEvent() { |
|
|
|
A8kErrorPromptEvent event = new A8kErrorPromptEvent(new ConsumeNotEnoughError("Hscrp")); |
|
|
|
eventBus.pushEvent(event); |
|
|
|
event = new A8kErrorPromptEvent(new AppCodeError("XXXX额外的错误说明XXXX")); |
|
|
|
eventBus.pushEvent(event); |
|
|
|
event = new A8kErrorPromptEvent(new HardwareError(A8kEcode.StepMotorOverVoltage, MId.HbotM, CmdId.step_motor_read_pos)); |
|
|
|
eventBus.pushEvent(event); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "发送AppTubeholderSettingUpdateEvent", group = "虚拟事件", order = 3) |
|
|
|
public void buildAndSendAppTubeholderSettingUpdateEvent() { |
|
|
|
eventBus.pushEvent(new AppTubeholderSettingUpdateEvent()); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "发送DoA8kStepActionEvent", group = "虚拟事件", order = 4) |
|
|
|
public void buildAndSendDoA8kStepActionEvent() { |
|
|
|
eventBus.pushEvent(new DoA8kStepActionEvent(A8kActionStepType.SEQ1_ENTER_TUBEHOLDER_AND_SCAN)); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "发送A8kEcodeContextListPromptEvent", group = "虚拟事件", order = 5) |
|
|
|
public void buildAndSendA8kEcodeContextListPromptEvent() { |
|
|
|
List<A8kErrorContext> errorContexts = new ArrayList<>(); |
|
|
|
errorContexts.add(new A8kErrorContext(A8kActionStepType.SEQ1_ENTER_TUBEHOLDER_AND_SCAN, new AppError(A8kEcode.TubeHolderTypeIsNotSupport))); |
|
|
|
errorContexts.add(new A8kErrorContext(A8kActionStepType.SEQ5_PROCESS, new AppError(A8kEcode.NoTubeInHolder))); |
|
|
|
eventBus.pushEvent(new A8kEcodeContextListPromptEvent(errorContexts)); |
|
|
|
} |
|
|
|
|
|
|
|
//InterUse |
|
|
|
public Boolean getVirtualIDCard() { |
|
|
@ -187,6 +276,7 @@ public class AppDebugHelperService { |
|
|
|
|
|
|
|
|
|
|
|
public ConsumableOneChResult scanOneCH(Integer ch) { |
|
|
|
OS.forceSleep(1500); |
|
|
|
ConsumableOneChResult result = new ConsumableOneChResult(ch); |
|
|
|
switch (consumablesErrorType[ch]) { |
|
|
|
case PASS: //通过 |
|
|
|