|
@ -0,0 +1,103 @@ |
|
|
|
|
|
package com.my.graphiteDigesterBg.task; |
|
|
|
|
|
import com.my.graphiteDigesterBg.MyDevice; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.DiTaskBase; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.Task; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActPeristalticPump; |
|
|
|
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; |
|
|
|
|
|
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromHeatPlateToLiquidPlate; |
|
|
|
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlot; |
|
|
|
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
|
|
|
|
|
@Task(name="LiquidAdd") |
|
|
|
|
|
public class TaskLiquidAdd extends DiTaskBase { |
|
|
|
|
|
// slot index |
|
|
|
|
|
public Integer slotIndex; |
|
|
|
|
|
// liquid index |
|
|
|
|
|
public Integer liquidIndex; |
|
|
|
|
|
// liquid volume |
|
|
|
|
|
public Integer liquidVolume; |
|
|
|
|
|
// shake times |
|
|
|
|
|
public Integer shakeTimes; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
ResHeatingTubeRackSlotManager heatingSlotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|
|
|
|
|
ResHeatingTubeRackSlot slot = heatingSlotMan.getSlotByIndex(this.slotIndex); |
|
|
|
|
|
|
|
|
|
|
|
DiActMotor heatPlateMotor = this.getActuator(MyDevice.ACT_HEAT_PLATE_MOTOR, DiActMotor.class); |
|
|
|
|
|
DiActMotor transLrMotor = this.getActuator(MyDevice.ACT_TRANSFER_LR_MOTOR, DiActMotor.class); |
|
|
|
|
|
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); |
|
|
|
|
|
DiActServo transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); |
|
|
|
|
|
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); |
|
|
|
|
|
DiActMotor liquidMotor = this.getActuator(MyDevice.ACT_LIQUID_MOTOR, DiActMotor.class); |
|
|
|
|
|
|
|
|
|
|
|
// move tube rack from heat plate to liquid plate |
|
|
|
|
|
var moveTubeRackFromHeatPlateToLiquidPlate = new MoveMoveTubeRackFromHeatPlateToLiquidPlate(); |
|
|
|
|
|
moveTubeRackFromHeatPlateToLiquidPlate.setDevice(this.getDevice()); |
|
|
|
|
|
moveTubeRackFromHeatPlateToLiquidPlate.slotIndex = this.slotIndex; |
|
|
|
|
|
moveTubeRackFromHeatPlateToLiquidPlate.run(); |
|
|
|
|
|
|
|
|
|
|
|
// // 加热盘转盘移动到取放架位置 |
|
|
|
|
|
// heatPlateMotor.moveTo(8580); // @TODO : 这里要根据位置计算 ~~~ |
|
|
|
|
|
// // 打开试管架盖 |
|
|
|
|
|
// slot.coverOpen(); |
|
|
|
|
|
// 搬运上升到顶部 |
|
|
|
|
|
transUdMotor.moveTo(1300); |
|
|
|
|
|
// // 搬运移动到加热取架位置 |
|
|
|
|
|
// transLrMotor.moveTo(1620); |
|
|
|
|
|
// // 搬运下降到取架位置 |
|
|
|
|
|
// transUdMotor.moveTo(130); |
|
|
|
|
|
// // 打开试管架夹爪 |
|
|
|
|
|
// transferClipServo.moveTo(2670); |
|
|
|
|
|
// // 搬运上升到顶部 |
|
|
|
|
|
// transUdMotor.moveTo(1300); |
|
|
|
|
|
// // 搬运移动到加液取放架位置 |
|
|
|
|
|
// transLrMotor.moveTo(365); |
|
|
|
|
|
// // 加液转盘移动到取放位置 |
|
|
|
|
|
// liquidPlateMotor.moveTo(642); |
|
|
|
|
|
// // 搬运下降到放架位置 |
|
|
|
|
|
// transUdMotor.moveTo(540); |
|
|
|
|
|
// // 关闭试管架夹爪 |
|
|
|
|
|
// transferClipServo.moveTo(2073); |
|
|
|
|
|
// // 搬运上升到顶部 |
|
|
|
|
|
// transUdMotor.moveTo(1300); |
|
|
|
|
|
// // 关闭试管架盖 |
|
|
|
|
|
// slot.coverClose(); |
|
|
|
|
|
// 搬运移动到就绪位置 |
|
|
|
|
|
transLrMotor.moveTo(1000); |
|
|
|
|
|
|
|
|
|
|
|
String liquidPeristalticPumpKey = "liquidPeristalticPump_" + this.liquidIndex; |
|
|
|
|
|
DiActPeristalticPump liquidPump = this.getActuator(liquidPeristalticPumpKey, DiActPeristalticPump.class); |
|
|
|
|
|
|
|
|
|
|
|
// 外圈试管加液 |
|
|
|
|
|
// 加液机械臂移动到加液位置 |
|
|
|
|
|
// liquidMotor.moveTo(1100); |
|
|
|
|
|
// for ( int i=0; i<4; i++ ) { |
|
|
|
|
|
// // 加液转盘移动到加液位置 |
|
|
|
|
|
// liquidPlateMotor.moveTo(800 + 2500 * i); |
|
|
|
|
|
// // 加液指定数量 |
|
|
|
|
|
// liquidPump.pump(this.liquidVolume); |
|
|
|
|
|
// } |
|
|
|
|
|
// 内圈试管加液 |
|
|
|
|
|
// 加液转盘移动到加液位置 |
|
|
|
|
|
liquidPlateMotor.moveTo(800); |
|
|
|
|
|
for ( int i=0; i<4; i++ ) { |
|
|
|
|
|
// 加液转盘移动到加液位置 |
|
|
|
|
|
liquidPlateMotor.moveTo(800 + 2500 * i); |
|
|
|
|
|
// 加液指定数量 |
|
|
|
|
|
liquidPump.pump(this.liquidVolume); |
|
|
|
|
|
} |
|
|
|
|
|
liquidMotor.moveTo(0); |
|
|
|
|
|
|
|
|
|
|
|
// 加液盘摇匀 |
|
|
|
|
|
for ( int i=0; i<this.shakeTimes; i++ ) { |
|
|
|
|
|
liquidPlateMotor.moveTo(200); |
|
|
|
|
|
liquidPlateMotor.moveTo(0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 加液完了再放回去 ~~~ |
|
|
|
|
|
// @TODO : 放回去, 这里要直接用 Step 了 ~~~ |
|
|
|
|
|
|
|
|
|
|
|
this.setStatus(TaskStatus.FINISHED); |
|
|
|
|
|
} |
|
|
|
|
|
} |