|
|
@ -64,7 +64,29 @@ public class StartResetTaskThread extends Thread { |
|
|
|
* @issue : <a href="http://127.0.0.1:5566/issues/85">无法获取加液位置是否存在试管架</a> |
|
|
|
*/ |
|
|
|
private void setupHeatingSlotCover() { |
|
|
|
boolean isDoorOpen = false; |
|
|
|
UfMdbNotification.action("TaskStartResetTubeRackCleanConfirm", new HashMap<>()); |
|
|
|
this.waitAction("TaskStartResetTubeRackCleanConfirm"); |
|
|
|
var cleanConfirm = (Boolean)this.actionResult.get("confirm"); |
|
|
|
if ( cleanConfirm ) { |
|
|
|
UfCmdSnippetExecutor.execute("DoorOpen"); |
|
|
|
for ( int i=0; i<5; i++ ) { |
|
|
|
// 将试管架移至加液盘 |
|
|
|
UfCmdSnippetExecutor.execute(String.format("TubeRackMoveToLiquidPlate.%d", i)); |
|
|
|
// 禁用该区位密封盖,用于后续重置状态 |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverDisable.%d", i)); |
|
|
|
|
|
|
|
// 等待取出试管架 |
|
|
|
UfMdbNotification.action("StartResetTubeRackTakeOut", new HashMap<>()); |
|
|
|
this.waitAction("TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : take out", i); |
|
|
|
|
|
|
|
// 重新启用密封盖 |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverEnable.%d", i)); |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverServoSetCurPosAsMiddle.%d", i)); |
|
|
|
} |
|
|
|
UfCmdSnippetExecutor.execute("DoorClose"); |
|
|
|
} |
|
|
|
|
|
|
|
for ( int i=0; i<5; i++ ) { |
|
|
|
this.setProgressMessage("设备初始化 : 检查试管架 " + (i+1) + "/5"); |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverEnable.%d",i)); |
|
|
@ -72,36 +94,7 @@ public class StartResetTaskThread extends Thread { |
|
|
|
var currentPosStr = UfActuatorCmdExecutor.execute(actuatorKey, "motor_read_pos"); |
|
|
|
var currentPos = Integer.parseInt(currentPosStr); |
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : current pos = {}", i, currentPos); |
|
|
|
|
|
|
|
// 如果是空的,则初始化位置后继续下一步 |
|
|
|
var rackExistsPos = UfMdbOption.getInteger("HeatingPlateMotorSlotCoverRackExists", 0); |
|
|
|
if ( currentPos > rackExistsPos ) { |
|
|
|
UfActuatorCmdExecutor.execute(actuatorKey, "motor_easy_set_current_pos", "2047"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
// 将试管架移至加液盘 |
|
|
|
UfCmdSnippetExecutor.execute(String.format("TubeRackMoveToLiquidPlate.%d", i)); |
|
|
|
// 打开柜门 |
|
|
|
if ( !isDoorOpen ) { |
|
|
|
UfCmdSnippetExecutor.execute("DoorOpen"); |
|
|
|
isDoorOpen = true; |
|
|
|
} |
|
|
|
// 禁用该区位密封盖,用于后续重置状态 |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverDisable.%d", i)); |
|
|
|
|
|
|
|
// 等待取出试管架 |
|
|
|
UfMdbNotification.action("StartResetTubeRackTakeOut", new HashMap<>()); |
|
|
|
this.waitAction("TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : take out", i); |
|
|
|
|
|
|
|
// 重新启用密封盖 |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverEnable.%d", i)); |
|
|
|
UfCmdSnippetExecutor.execute(String.format("HeatingSlotCoverServoSetCurPosAsMiddle.%d", i)); |
|
|
|
} |
|
|
|
|
|
|
|
if ( isDoorOpen ) { |
|
|
|
UfCmdSnippetExecutor.execute("DoorClose"); |
|
|
|
UfActuatorCmdExecutor.execute(actuatorKey, "motor_easy_set_current_pos", "2047"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|