|
@ -8,6 +8,9 @@ import com.my.graphiteDigesterBg.diframe.actuator.DiActPeristalticPump; |
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; |
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; |
|
|
import com.my.graphiteDigesterBg.diframe.model.DiMdbNotification; |
|
|
import com.my.graphiteDigesterBg.diframe.model.DiMdbNotification; |
|
|
import com.my.graphiteDigesterBg.model.MdbOperationLog; |
|
|
import com.my.graphiteDigesterBg.model.MdbOperationLog; |
|
|
|
|
|
import com.my.graphiteDigesterBg.move.MoveDoorClose; |
|
|
|
|
|
import com.my.graphiteDigesterBg.move.MoveDoorOpen; |
|
|
|
|
|
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromHeatPlateToLiquidPlate; |
|
|
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromLiquidPlateToHeatPlate; |
|
|
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromLiquidPlateToHeatPlate; |
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
|
|
@Task(name="StartReset") |
|
|
@Task(name="StartReset") |
|
@ -23,12 +26,7 @@ public class TaskStartReset extends DiTaskBase { |
|
|
this.setProgressMessage("设备初始化 : 关闭设备门"); |
|
|
this.setProgressMessage("设备初始化 : 关闭设备门"); |
|
|
DiActMotor doorMotor = this.getActuator(MyDevice.ACT_DOOR_MOTOR, DiActMotor.class); |
|
|
DiActMotor doorMotor = this.getActuator(MyDevice.ACT_DOOR_MOTOR, DiActMotor.class); |
|
|
doorMotor.setEnable(true); |
|
|
doorMotor.setEnable(true); |
|
|
doorMotor.moveToIO(1, 1); |
|
|
|
|
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 关闭夹爪"); |
|
|
|
|
|
DiActServo transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); |
|
|
|
|
|
transferClipServo.setEnable(true); |
|
|
|
|
|
transferClipServo.moveTo("TransClipServoClose"); |
|
|
|
|
|
|
|
|
MoveDoorClose.execute(this.getDevice()); |
|
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 加液臂复位"); |
|
|
this.setProgressMessage("设备初始化 : 加液臂复位"); |
|
|
DiActMotor liquidMotor = this.getActuator(MyDevice.ACT_LIQUID_MOTOR, DiActMotor.class); |
|
|
DiActMotor liquidMotor = this.getActuator(MyDevice.ACT_LIQUID_MOTOR, DiActMotor.class); |
|
@ -36,6 +34,11 @@ public class TaskStartReset extends DiTaskBase { |
|
|
liquidMotor.reset(); |
|
|
liquidMotor.reset(); |
|
|
liquidMotor.moveTo("LiquidArmStandby"); |
|
|
liquidMotor.moveTo("LiquidArmStandby"); |
|
|
|
|
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 关闭夹爪"); |
|
|
|
|
|
DiActServo transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); |
|
|
|
|
|
transferClipServo.setEnable(true); |
|
|
|
|
|
transferClipServo.moveTo("TransClipServoClose"); |
|
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 搬运机械臂上下移动复位"); |
|
|
this.setProgressMessage("设备初始化 : 搬运机械臂上下移动复位"); |
|
|
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); |
|
|
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); |
|
|
transUdMotor.setEnable(true); |
|
|
transUdMotor.setEnable(true); |
|
@ -49,14 +52,6 @@ public class TaskStartReset extends DiTaskBase { |
|
|
transLrMotor.setMoveOffset("TransLrMotorGlobalOffset"); |
|
|
transLrMotor.setMoveOffset("TransLrMotorGlobalOffset"); |
|
|
transLrMotor.moveTo("TransLrMotorStandby"); |
|
|
transLrMotor.moveTo("TransLrMotorStandby"); |
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// @TODO : http://127.0.0.1:5566/issues/39 |
|
|
// @TODO : http://127.0.0.1:5566/issues/39 |
|
|
this.setProgressMessage("设备初始化 : 加液转盘复位"); |
|
|
this.setProgressMessage("设备初始化 : 加液转盘复位"); |
|
|
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); |
|
|
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); |
|
@ -70,6 +65,15 @@ public class TaskStartReset extends DiTaskBase { |
|
|
heatPlateMotor.reset(); |
|
|
heatPlateMotor.reset(); |
|
|
heatPlateMotor.moveTo("HeatPlateStandby"); |
|
|
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(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int peristalticPumpCount = 1; |
|
|
int peristalticPumpCount = 1; |
|
|
var actuators = this.getDevice().getActuators().getAll(); |
|
|
var actuators = this.getDevice().getActuators().getAll(); |
|
|
for ( var actuator : actuators ) { |
|
|
for ( var actuator : actuators ) { |
|
@ -86,7 +90,7 @@ public class TaskStartReset extends DiTaskBase { |
|
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 定时刷新加热盘温度"); |
|
|
this.setProgressMessage("设备初始化 : 定时刷新加热盘温度"); |
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
// slotMan.startTemperatureRefresh(); |
|
|
|
|
|
|
|
|
slotMan.startTemperatureRefresh(); |
|
|
|
|
|
|
|
|
this.setProgressMessage("设备初始化 : 放入异常处理试管架"); |
|
|
this.setProgressMessage("设备初始化 : 放入异常处理试管架"); |
|
|
doorMotor.reset(); // 打开设备门 |
|
|
doorMotor.reset(); // 打开设备门 |
|
@ -100,6 +104,58 @@ public class TaskStartReset extends DiTaskBase { |
|
|
this.setStatus(TaskStatus.FINISHED); |
|
|
this.setStatus(TaskStatus.FINISHED); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 清理试管架 |
|
|
|
|
|
* @issue : <a href="http://127.0.0.1:5566/issues/85">无法获取加液位置是否存在试管架</a> |
|
|
|
|
|
*/ |
|
|
|
|
|
private void clearTubeRack() { |
|
|
|
|
|
boolean isDoorOpen = false; |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
|
var currentPos = heatSlotCoverServo.getCurrentPos(); |
|
|
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : current pos = {}", i, currentPos); |
|
|
|
|
|
|
|
|
|
|
|
var rackExistsPos = heatSlotCoverServo.getLocationValue("HeatingPlateMotorSlotCoverRackExists"); |
|
|
|
|
|
if ( currentPos > rackExistsPos ) { |
|
|
|
|
|
heatSlotCoverServo.setEnable(false); |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var moveToLiquidPlate = new MoveMoveTubeRackFromHeatPlateToLiquidPlate(); |
|
|
|
|
|
moveToLiquidPlate.setDevice(this.getDevice()); |
|
|
|
|
|
moveToLiquidPlate.slotIndex = i; |
|
|
|
|
|
moveToLiquidPlate.updateSlotStatus = false; |
|
|
|
|
|
moveToLiquidPlate.run(); |
|
|
|
|
|
|
|
|
|
|
|
if ( !isDoorOpen ) { |
|
|
|
|
|
MoveDoorOpen.execute(this.getDevice()); |
|
|
|
|
|
isDoorOpen = true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
heatSlotCoverServo.moveTo("HeatingPlateMotorSlotCoverEmpty"); |
|
|
|
|
|
heatSlotCoverServo.setEnable(false); |
|
|
|
|
|
|
|
|
|
|
|
// 等待取出试管架 |
|
|
|
|
|
DiMdbNotification.taskAction(this, "TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
|
|
this.waitAction("TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
|
|
LOG.info("HeatingPlateMotorSlotCover #{} : take out", i); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ( isDoorOpen ) { |
|
|
|
|
|
MoveDoorClose.execute(this.getDevice()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 异常处理位试管架取出 |
|
|
|
|
|
public void actionErrorTubeRackTakeOut() { |
|
|
|
|
|
var action = this.getAction("TaskStartResetErrorTubeRackTakeOut"); |
|
|
|
|
|
action.finish(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 放入异常处理位试管架 |
|
|
// 放入异常处理位试管架 |
|
|
public void actionErrorTubeRackPutIn() { |
|
|
public void actionErrorTubeRackPutIn() { |
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
@ -113,6 +169,7 @@ public class TaskStartReset extends DiTaskBase { |
|
|
move.slotIndex = slot.index; |
|
|
move.slotIndex = slot.index; |
|
|
move.setDevice(this.getDevice()); |
|
|
move.setDevice(this.getDevice()); |
|
|
move.run(); |
|
|
move.run(); |
|
|
|
|
|
slot.lock(); |
|
|
|
|
|
|
|
|
var action = this.getAction("TaskStartResetErrorTubeRackPutIn"); |
|
|
var action = this.getAction("TaskStartResetErrorTubeRackPutIn"); |
|
|
action.finish(); |
|
|
action.finish(); |
|
|