sige 1 year ago
parent
commit
960d62027d
  1. BIN
      app.db
  2. 84
      src/main/java/com/iflytop/digester/DigestionTaskThread.java
  3. 4
      src/main/java/com/iflytop/digester/StartResetTaskThread.java
  4. 4
      src/main/java/com/iflytop/digester/deviceinstance/HeatingTurntableSlot.java
  5. 2
      web

BIN
app.db

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

@ -188,48 +188,6 @@ public class DigestionTaskThread extends Thread {
device.transferArm.moveTubeRackToHeatingTurntable(this.heatingSlot.index);
}
// 启动异常处理线程
private void startErrorProcessThread() {
this.errorProcessThread = new Thread(() -> {
if ( this.errorTubeIndexes.isEmpty() ) {
// 无异常直接返回
return ;
}
try {
// 异常处理执行
var errorRound = this.solution.getDigestionErrorRounds();
for ( int i=0; i<errorRound.maxRounds; i++ ) {
this.executeErrorRound(errorRound);
if (this.errorTubeIndexes.isEmpty()) {
break;
}
}
// 如果还存在异常 则直接取出
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();
}
} catch (InterruptedException e) {
UfMdbNotification.error("消解异常处理失败 : " + e.getMessage());
this.updateTaskStatus("Error", String.format("消解异常处理失败 : %s", e.getMessage()));
}
});
this.errorProcessThread.start();
}
// 执行消解每轮配置
private void executeRound( MdbDigestionSolution.DigestionSolutionRound digestionRound ) throws InterruptedException {
this.updateTaskStatus("RoundStart", "配置轮次开始执行");
@ -282,7 +240,8 @@ public class DigestionTaskThread extends Thread {
// 检查试管
DigestionTaskThread.this.tubeCheckAndMove();
// 启动异常处理线程
DigestionTaskThread.this.startErrorProcessThread();
DigestionTaskThread.this.errorProcessThread = new Thread(DigestionTaskThread.this::executeErrorProcess);
DigestionTaskThread.this.errorProcessThread.start();
// 预检查完成
DigestionTaskThread.this.isPrecheckFinished = true;
synchronized ( DigestionTaskThread.this.precheckLock ) {
@ -341,6 +300,45 @@ public class DigestionTaskThread extends Thread {
this.updateTaskStatus("LastRound", "执行最后一轮配置结束");
}
// 启动异常处理线程
private void executeErrorProcess() {
if ( this.errorTubeIndexes.isEmpty() ) {
return ; // 无异常直接返回
}
try {
// 异常处理执行
var errorRound = this.solution.getDigestionErrorRounds();
for ( int i=0; i<errorRound.maxRounds; i++ ) {
this.executeErrorRound(errorRound);
if (this.errorTubeIndexes.isEmpty()) {
break; // 如果没有异常试管了 后面的就不执行了
}
}
if ( this.errorTubeIndexes.isEmpty() ) {
return ;
}
// 如果还存在异常 则直接取出
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();
} catch (InterruptedException e) {
UfMdbNotification.error("消解异常处理失败 : " + e.getMessage());
this.updateTaskStatus("Error", String.format("消解异常处理失败 : %s", e.getMessage()));
}
}
/**
* 执行消解异常处理配置
* @param errorRound - 异常处理配置

4
src/main/java/com/iflytop/digester/StartResetTaskThread.java

@ -37,8 +37,8 @@ public class StartResetTaskThread extends Thread {
this.setupErrorTubeRack();
}
this.setProgressMessage("设备初始化 : 相机");
device.camera.enable();
// this.setProgressMessage("设备初始化 : 相机");
// device.camera.enable();
this.setProgressMessage("设备初始化 : 定时刷新加热盘温度");
device.heatingTurntable.temperatureMonitorStart();

4
src/main/java/com/iflytop/digester/deviceinstance/HeatingTurntableSlot.java

@ -15,6 +15,8 @@ public class HeatingTurntableSlot {
public Integer curTemperature = 0;
// 目标温度
public Integer destTemperature = 0;
//
public Integer heatingStartedAt = 0;
// 加热时长
public Integer heatingDuration = 0;
// 加热状态
@ -72,6 +74,7 @@ public class HeatingTurntableSlot {
this.destTemperature = temperature;
this.heatingDuration = duration;
this.heatingStatus = "on";
this.heatingStartedAt = (int)(System.currentTimeMillis()/1000);
var snippetName = "HeatingTurntableSlotHeating." + this.index;
Map<String,Object> snippetParams = Map.of(
@ -83,6 +86,7 @@ public class HeatingTurntableSlot {
// 加热完成
this.destTemperature = 0;
this.heatingDuration = 0;
this.heatingStartedAt = 0;
this.heatingStatus = "off";
}

2
web

@ -1 +1 @@
Subproject commit bb67f94bd77d640a6f80187d24076b54846aa9f5
Subproject commit ce67e9b72a9ff101cd15bb714b9aabbdf23ad1f5
Loading…
Cancel
Save