sige 1 year ago
parent
commit
9079e59cc1
  1. BIN
      app.db
  2. 57
      src/main/java/com/iflytop/digester/DigestionTaskThread.java

BIN
app.db

57
src/main/java/com/iflytop/digester/DigestionTaskThread.java

@ -210,9 +210,15 @@ public class DigestionTaskThread extends Thread {
if ( !this.errorTubeIndexes.isEmpty() ) {
var device = Device.getInstance();
// 等待放入空试管架
device.door.open();
this.waitForEmptyTubeRackPutIn();
device.door.close();
// 取出剩余异常试管
device.door.open();
device.transferArm.takeOutTubesFromErrorSlot(this.errorTubeIndexes);
device.door.close();
// 等待取出试管架
this.waitForTubeRackTakeOut();
}
@ -354,6 +360,7 @@ public class DigestionTaskThread extends Thread {
for ( var liquid : errorRound.liquids ) {
this.updateTaskStatus("ErrorRoundLiquidAdd", String.format("异常加液 %s %d", liquid.type, liquid.volume));
liquidAddition.addLiquidToTubes(this.errorTubeIndexes, liquid.type, liquid.volume);
this.updateTaskStatus("ErrorRoundLiquidAdd", "异常加液完成");
}
this.updateTaskStatus("ErrorRoundLiquidAdd", "异常摇匀");
liquidAddition.shake(errorRound.shakingCount);
@ -364,13 +371,14 @@ public class DigestionTaskThread extends Thread {
for ( var heating : errorRound.heatings ) {
this.updateTaskStatus("ErrorRoundHeating", String.format("异常加热 %d℃ %d分钟", heating.temperature, heating.duration));
this.heatingSlot.heating(heating.temperature, heating.duration);
this.updateTaskStatus("ErrorRoundHeating", "异常加液完成");
}
this.updateTaskStatus("ErrorRound", "移动异常试管架至加液区");
device.transferArm.moveTubeRackToLiquidPlate(errorSlot.index);
// 拍照检查是否存在消解完成的试管
this.takeShotAndCheckFinishedTubes();
this.executeErrorRoundTakeShotAndCheckFinishedTubes();
// 如果不存在消解完成的试管则本轮次结束
if (this.finishedErrorTubeIndexes.isEmpty()) {
@ -401,6 +409,38 @@ public class DigestionTaskThread extends Thread {
this.updateTaskStatus("ErrorRound", String.format("异常轮次执行结束, 异常试管剩余 : [%s]", remainTubeIndexListStr));
}
// 拍照检查试管
private void executeErrorRoundTakeShotAndCheckFinishedTubes() {
this.updateTaskStatus("ErrorTubeCheck", "拍照检查异常试管,等待确认完成试管");
Map<String,Object> message = Map.of("batchNo", this.taskModel.batchNo, "taskId", this.taskModel.outTaskId);
UfMdbNotification.action("ErrorTubeCheck", message);
this.finishedErrorTubeIndexes.clear();
synchronized ( this.finishedErrorTubeIndexes ) {
try {
this.finishedErrorTubeIndexes.wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
String finishedTubeIndexes = String.join(",", this.finishedErrorTubeIndexes.stream().map(Object::toString).toArray(String[]::new));
this.updateTaskStatus("ErrorTubeCheck", String.format("完成试管已确认 : [%s]", finishedTubeIndexes));
}
// 等待放入试管架
private void waitForTubeRackPutIn() {
this.updateTaskStatus("TubeRackPutInWait", "等待放入试管架");
@ -481,22 +521,7 @@ public class DigestionTaskThread extends Thread {
this.updateTaskStatus("TubeCheck", "异常试管已确认");
}
// 拍照检查试管
private void takeShotAndCheckFinishedTubes() {
this.updateTaskStatus("ErrorTubeCheck", "拍照检查异常试管,等待确认完成试管");
Map<String,Object> message = Map.of("batchNo", this.taskModel.batchNo, "taskId", this.taskModel.outTaskId);
UfMdbNotification.action("ErrorTubeCheck", message);
this.finishedErrorTubeIndexes.clear();
synchronized ( this.finishedErrorTubeIndexes ) {
try {
this.finishedErrorTubeIndexes.wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
this.updateTaskStatus("ErrorTubeCheck", "完成试管已确认");
}
// 更新任务状态
private void updateTaskStatus(String status, String message) {

Loading…
Cancel
Save