|
|
@ -15,6 +15,9 @@ import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromLiquidPlateToHeatPlate |
|
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
|
|
|
@Task(name="StartReset") |
|
|
|
public class TaskStartReset extends DiTaskBase { |
|
|
|
// 是否需要放置异常处理试管架 |
|
|
|
private Boolean isErrorTubeRackRequired = true; |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void execute() { |
|
|
|
MdbOperationLog.log(this.getUser(), "设备初始化"); |
|
|
@ -65,14 +68,7 @@ public class TaskStartReset extends DiTaskBase { |
|
|
|
heatPlateMotor.reset(); |
|
|
|
heatPlateMotor.moveTo("HeatPlateStandby"); |
|
|
|
|
|
|
|
this.clearTubeRack(); |
|
|
|
for ( int i=0; i<5; i++ ) { |
|
|
|
this.setProgressMessage("设备初始化 : 加热盘转盘槽盖关闭 " + (i+1) + "/5"); |
|
|
|
String key = "HeatingPlateMotorSlotCover_" + i; |
|
|
|
DiActServo heatSlotCoverServo = this.getActuator(key, DiActServo.class); |
|
|
|
heatSlotCoverServo.setEnable(true); |
|
|
|
heatSlotCoverServo.setCurrentPosAsMiddle(); |
|
|
|
} |
|
|
|
this.setupHeatingSlotCover(); |
|
|
|
|
|
|
|
int peristalticPumpCount = 1; |
|
|
|
var actuators = this.getDevice().getActuators().getAll(); |
|
|
@ -92,10 +88,12 @@ public class TaskStartReset extends DiTaskBase { |
|
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
|
slotMan.startTemperatureRefresh(); |
|
|
|
|
|
|
|
if ( this.isErrorTubeRackRequired ) { |
|
|
|
this.setProgressMessage("设备初始化 : 放入异常处理试管架"); |
|
|
|
doorMotor.reset(); // 打开设备门 |
|
|
|
DiMdbNotification.taskAction(this, "TaskStartResetErrorTubeRackPutIn"); |
|
|
|
this.waitAction("TaskStartResetErrorTubeRackPutIn"); |
|
|
|
} |
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 完成"); |
|
|
|
runtimeVars.setString("YES","IsDeviceReady"); |
|
|
@ -108,8 +106,9 @@ public class TaskStartReset extends DiTaskBase { |
|
|
|
* 清理试管架 |
|
|
|
* @issue : <a href="http://127.0.0.1:5566/issues/85">无法获取加液位置是否存在试管架</a> |
|
|
|
*/ |
|
|
|
private void clearTubeRack() { |
|
|
|
private void setupHeatingSlotCover() { |
|
|
|
boolean isDoorOpen = false; |
|
|
|
Integer errorSlotIndex = this.getDevice().getEnv().getProperty("app.errorSlotIndex",Integer.class); |
|
|
|
|
|
|
|
for ( int i=0; i<5; i++ ) { |
|
|
|
this.setProgressMessage("设备初始化 : 检查试管架 " + (i+1) + "/5"); |
|
|
@ -119,9 +118,17 @@ public class TaskStartReset extends DiTaskBase { |
|
|
|
var currentPos = heatSlotCoverServo.getCurrentPos(); |
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : current pos = {}", i, currentPos); |
|
|
|
|
|
|
|
// 如果是空的,则初始化位置后继续下一步 |
|
|
|
var rackExistsPos = heatSlotCoverServo.getLocationValue("HeatingPlateMotorSlotCoverRackExists"); |
|
|
|
if ( currentPos > rackExistsPos ) { |
|
|
|
heatSlotCoverServo.setEnable(false); |
|
|
|
heatSlotCoverServo.setCurrentPosAsMiddle(); |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
// 如果是空试管架, 又是异常区域则不处理, 因为异常区域始终要有个试管架 |
|
|
|
var emptyRackExistsPos = heatSlotCoverServo.getLocationValue("HeatingPlateMotorSlotCoverEmptyRackExists"); |
|
|
|
if ( currentPos > emptyRackExistsPos && null != errorSlotIndex && errorSlotIndex == i ) { // 异常区域存在空试管架 |
|
|
|
this.isErrorTubeRackRequired = false; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
@ -143,6 +150,9 @@ public class TaskStartReset extends DiTaskBase { |
|
|
|
DiMdbNotification.taskAction(this, "TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
this.waitAction("TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : take out", i); |
|
|
|
|
|
|
|
heatSlotCoverServo.setEnable(true); |
|
|
|
heatSlotCoverServo.setCurrentPosAsMiddle(); |
|
|
|
} |
|
|
|
|
|
|
|
if ( isDoorOpen ) { |
|
|
|