|
|
@ -149,7 +149,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
this.taskModel.save(); |
|
|
|
|
|
|
|
if ( "auto".equals(this.taskModel.mode) ) { |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("消解准备"); |
|
|
|
// 打开门 |
|
|
|
device.door.open(); |
|
|
|
// 等待放入试管架 |
|
|
@ -178,7 +178,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
|
|
|
|
// 搬运到加热转盘 |
|
|
|
device.transferArm.moveTubeRackToHeatingTurntable(this.heatingSlot.index); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("正常消解轮次加液完成"); |
|
|
|
|
|
|
|
// 加热 |
|
|
|
for ( var heating : digestionRound.heatings ) { |
|
|
@ -188,7 +188,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
} |
|
|
|
|
|
|
|
// 移至加液区, 以便执行下一轮 |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("正常消解轮次加热完成"); |
|
|
|
device.transferArm.moveTubeRackToLiquidPlate(this.heatingSlot.index); |
|
|
|
this.updateTaskStatus("RoundFinish", "配置轮次执行结束"); |
|
|
|
} |
|
|
@ -212,7 +212,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
liquidAddition.shake(digestionRound.shakingCount); |
|
|
|
// 搬运到加热转盘 |
|
|
|
device.transferArm.moveTubeRackToHeatingTurntable(this.heatingSlot.index); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("正常消解最后一轮加液完成"); |
|
|
|
|
|
|
|
// 预检查定时, 在结束前10分钟执行 |
|
|
|
Integer totalDurationCount = 0; |
|
|
@ -255,7 +255,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
} |
|
|
|
|
|
|
|
// 移动到加液盘准备取出 |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("正常消解最后一轮预检与加热完成"); |
|
|
|
device.transferArm.moveTubeRackToLiquidPlate(this.heatingSlot.index); // 移动到加液盘 |
|
|
|
|
|
|
|
// 加水定容 |
|
|
@ -271,7 +271,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
device.door.close(); // 关闭门 |
|
|
|
this.heatingSlot.setTubeRackNo(null); // 释放加热位 |
|
|
|
this.updateTaskStatus("LastRound", "执行最后一轮配置结束"); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("正常消解样品已取出"); |
|
|
|
} |
|
|
|
|
|
|
|
// 执行消解最后一轮预检查 |
|
|
@ -281,14 +281,13 @@ public class DigestionTaskThread extends Thread { |
|
|
|
|
|
|
|
// 检查试管 |
|
|
|
var device = Device.getInstance(); |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("正常消解最后一轮开始预检"); |
|
|
|
|
|
|
|
// 移动到加液盘 |
|
|
|
device.transferArm.moveTubeRackToLiquidPlate(this.heatingSlot.index); |
|
|
|
// 拍照检查异常试管 |
|
|
|
this.executeLastRoundTakeShotAndCheckErrorTubes(); |
|
|
|
|
|
|
|
|
|
|
|
// 如果启用异常处理则执行异常处理操作 |
|
|
|
Boolean errorProcessEnable = UfMdbOption.getBoolean("DigestionTaskErrorProcessEnable", true); |
|
|
|
if ( errorProcessEnable ) { |
|
|
@ -321,7 +320,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
|
|
|
|
// 将正常试管放入加热转盘 |
|
|
|
device.transferArm.moveTubeRackToHeatingTurntable(this.heatingSlot.index); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("正常消解最后一轮异常试管已搬运至异常处理区域"); |
|
|
|
|
|
|
|
// 启动异常处理线程 |
|
|
|
DigestionTaskThread.this.errorProcessThread = new Thread(DigestionTaskThread.this::executeErrorProcess); |
|
|
@ -329,7 +328,9 @@ public class DigestionTaskThread extends Thread { |
|
|
|
} |
|
|
|
|
|
|
|
// 预检查完成 |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
if ( !errorProcessEnable ) { |
|
|
|
this.unlockLiquidPlate("正常消解最后一轮预检完成"); |
|
|
|
} |
|
|
|
this.isPrecheckFinished = true; |
|
|
|
synchronized ( DigestionTaskThread.this.precheckLock ) { |
|
|
|
DigestionTaskThread.this.precheckLock.notifyAll(); |
|
|
@ -386,7 +387,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
this.updateTaskStatus("TubeCheck", String.format("取出剩余异常试管 : [%s]", errorTubeIndexes)); |
|
|
|
// 如果还存在异常, 则直接取出 |
|
|
|
var device = Device.getInstance(); |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("异常处理强制取出剩余试管"); |
|
|
|
// 等待放入空试管架 |
|
|
|
device.door.open(); |
|
|
|
this.waitForEmptyTubeRackPutIn(); |
|
|
@ -403,7 +404,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
device.door.open(); |
|
|
|
this.waitForTubeRackTakeOut(); |
|
|
|
device.door.close(); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("异常处理:剩余试管已取出"); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
UfMdbNotification.error("消解异常处理失败 : " + e.getMessage()); |
|
|
|
this.updateTaskStatus("Error", String.format("消解异常处理失败 : %s", e.getMessage())); |
|
|
@ -426,7 +427,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
} |
|
|
|
|
|
|
|
this.updateTaskStatus("ErrorRound", "移动异常试管架至加液区"); |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("异常处理:开始加液"); |
|
|
|
device.transferArm.moveTubeRackToLiquidPlate(errorSlot.index); |
|
|
|
|
|
|
|
var liquidAddition = device.liquidAddition; |
|
|
@ -441,7 +442,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
|
|
|
|
this.updateTaskStatus("ErrorRound", "移动异常试管架至加热区"); |
|
|
|
device.transferArm.moveTubeRackToHeatingTurntable(errorSlot.index); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("异常处理:加液完成"); |
|
|
|
|
|
|
|
for ( var heating : errorRound.heatings ) { |
|
|
|
this.updateTaskStatus("ErrorRoundHeating", String.format("异常加热 %d℃ %d分钟", heating.temperature, heating.duration)); |
|
|
@ -450,7 +451,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
} |
|
|
|
|
|
|
|
this.updateTaskStatus("ErrorRound", "移动异常试管架至加液区"); |
|
|
|
this.lockLiquidPlate(); |
|
|
|
this.lockLiquidPlate("异常处理:检查是否存在消解完成的试管"); |
|
|
|
device.transferArm.moveTubeRackToLiquidPlate(errorSlot.index); |
|
|
|
|
|
|
|
// 拍照检查是否存在消解完成的试管 |
|
|
@ -461,7 +462,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
|
|
|
|
// 如果不存在消解完成的试管则本轮次结束 |
|
|
|
if (this.finishedErrorTubeIndexes.isEmpty()) { |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("异常处理:无消解完成的试管"); |
|
|
|
return ; |
|
|
|
} |
|
|
|
|
|
|
@ -478,7 +479,7 @@ public class DigestionTaskThread extends Thread { |
|
|
|
device.door.open(); |
|
|
|
this.waitForTubeRackTakeOut(); |
|
|
|
device.door.close(); |
|
|
|
this.unlockLiquidPlate(); |
|
|
|
this.unlockLiquidPlate("异常处理:消解完成的试管已取出"); |
|
|
|
|
|
|
|
// 更新异常试管索引列表 |
|
|
|
this.errorTubeIndexes.removeAll(this.finishedErrorTubeIndexes); |
|
|
@ -573,28 +574,28 @@ public class DigestionTaskThread extends Thread { |
|
|
|
} |
|
|
|
|
|
|
|
// 使用加液盘 |
|
|
|
private void lockLiquidPlate() { |
|
|
|
private void lockLiquidPlate( String comment ) { |
|
|
|
var lockName = this.taskModel.id; |
|
|
|
if ( "manual".equals(this.taskModel.mode) ) { |
|
|
|
lockName = this.taskModel.batchNo; |
|
|
|
} |
|
|
|
|
|
|
|
var device = Device.getInstance(); |
|
|
|
this.updateTaskStatus("WaitForLiquidPlate", "等待加液盘空闲"); |
|
|
|
device.liquidAddition.lockLiquidPlate(lockName); |
|
|
|
this.updateTaskStatus("WaitForLiquidPlate", "锁定加液盘"); |
|
|
|
this.updateTaskStatus("WaitForLiquidPlate", String.format("等待加液盘空闲 : %s", comment)); |
|
|
|
device.liquidAddition.lockLiquidPlate(lockName, comment); |
|
|
|
this.updateTaskStatus("WaitForLiquidPlate", String.format("锁定加液盘 : %s", comment)); |
|
|
|
} |
|
|
|
|
|
|
|
// 释放加液盘 |
|
|
|
private void unlockLiquidPlate() { |
|
|
|
private void unlockLiquidPlate( String comment ) { |
|
|
|
var lockName = this.taskModel.id; |
|
|
|
if ( "manual".equals(this.taskModel.mode) ) { |
|
|
|
lockName = this.taskModel.batchNo; |
|
|
|
} |
|
|
|
|
|
|
|
var device = Device.getInstance(); |
|
|
|
this.updateTaskStatus("WaitForLiquidPlate", "释放加液盘"); |
|
|
|
device.liquidAddition.unlockLiquidPlate(lockName); |
|
|
|
this.updateTaskStatus("WaitForLiquidPlate", String.format("释放加液盘 : %s", comment)); |
|
|
|
device.liquidAddition.unlockLiquidPlate(lockName, comment); |
|
|
|
} |
|
|
|
|
|
|
|
// 更新任务状态 |
|
|
|