diff --git a/app.db b/app.db index 947884d..d0b2ed7 100644 Binary files a/app.db and b/app.db differ diff --git a/src/main/java/com/iflytop/digester/DigestionTaskTheadManager.java b/src/main/java/com/iflytop/digester/DigestionTaskTheadManager.java index ac6aca2..30d85d3 100644 --- a/src/main/java/com/iflytop/digester/DigestionTaskTheadManager.java +++ b/src/main/java/com/iflytop/digester/DigestionTaskTheadManager.java @@ -2,6 +2,7 @@ package com.iflytop.digester; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.iflytop.digester.deviceinstance.Device; import com.iflytop.digester.model.MdbDigestionSolution; import com.iflytop.digester.model.MdbDigestionTask; import com.iflytop.digester.model.MdbRuntimeLog; @@ -115,6 +116,14 @@ public class DigestionTaskTheadManager { if ( "StartNewDigestion".equals(actionName) ) { this.startNewDigestion(actionJsonTree.get("parameters")); return; + } else if ( "DoorOpen".equals(actionName) ) { + Device.getInstance().door.open(); + this.sendMessageToTransBot("DoorOpenDone", new HashMap<>()); + return ; + } else if ( "DoorClose".equals(actionName) ) { + Device.getInstance().door.close(); + this.sendMessageToTransBot("DoorCloseDone", new HashMap<>()); + return ; } Map actionParams = new HashMap<>(); diff --git a/src/main/java/com/iflytop/digester/DigestionTaskThread.java b/src/main/java/com/iflytop/digester/DigestionTaskThread.java index 4716001..4fd28f9 100644 --- a/src/main/java/com/iflytop/digester/DigestionTaskThread.java +++ b/src/main/java/com/iflytop/digester/DigestionTaskThread.java @@ -267,7 +267,7 @@ public class DigestionTaskThread extends Thread { // 正常消解结束; this.updateTaskStatus("LastRound", "取出试管架"); device.door.open(); // 打开门 - this.waitForTubeRackTakeOut(this.heatingSlot.tubes); // 等待取出 + this.waitForTubeRackTakeOut(this.heatingSlot.tubes, "Normal"); // 等待取出 device.door.close(); // 关闭门 this.heatingSlot.setTubeRackNo(null); // 释放加热位 this.updateTaskStatus("LastRound", "执行最后一轮配置结束"); @@ -399,7 +399,7 @@ public class DigestionTaskThread extends Thread { // 等待取出试管架 device.door.open(); var errorSlot = device.heatingTurntable.getErrorSlot(); - this.waitForTubeRackTakeOut(errorSlot.tubes); + this.waitForTubeRackTakeOut(errorSlot.tubes,"Failed"); for ( var index : this.errorTubeIndexes ) { errorSlot.tubes.set(index, null); } @@ -487,7 +487,7 @@ public class DigestionTaskThread extends Thread { for ( var index : this.finishedErrorTubeIndexes ) { tubes.add(errorSlot.tubes.get(index)); } - this.waitForTubeRackTakeOut(tubes); + this.waitForTubeRackTakeOut(tubes, "Abnormal"); device.door.close(); this.unlockLiquidPlate("异常处理:消解完成的试管已取出"); @@ -573,15 +573,17 @@ public class DigestionTaskThread extends Thread { } // 等待取出试管架 - private void waitForTubeRackTakeOut( List tubes ) { + private void waitForTubeRackTakeOut( List tubes, String type ) { this.updateTaskStatus("TubeRackTakeOutWait", "等待取出试管架"); Map message = new HashMap<>(); message.put("taskId", this.taskModel.outTaskId); message.put("batchNo", this.taskModel.batchNo); + message.put("type", type); message.put("tubes", tubes); if ( "auto".equals(this.taskModel.mode) ) { - this.manager.sendMessageToTransBot("TubeRackTakeOut", message); + String actionName = String.format("%sTubeRackTakeOut", type); + this.manager.sendMessageToTransBot(actionName, message); } else { UfMdbNotification.action("TubeRackTakeOut", message); }