|
|
@ -0,0 +1,35 @@ |
|
|
|
package com.my.graphiteDigesterBg.step; |
|
|
|
import com.my.graphiteDigesterBg.MyDevice; |
|
|
|
import com.my.graphiteDigesterBg.diframe.DiTaskStepBase; |
|
|
|
import com.my.graphiteDigesterBg.diframe.TaskStep; |
|
|
|
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; |
|
|
|
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlot; |
|
|
|
import com.my.graphiteDigesterBg.task.TaskDigestion; |
|
|
|
@TaskStep(name="Shaking") |
|
|
|
public class StepShaking extends DiTaskStepBase { |
|
|
|
// count of shaking |
|
|
|
public Integer count; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
// 检查试管架是否在摇匀区域 |
|
|
|
TaskDigestion task = (TaskDigestion)this.getTask(); |
|
|
|
|
|
|
|
var slot = task.getSlot(); |
|
|
|
if ( ResHeatingTubeRackSlot.LOCATION_HEAT_PLATE.equals(slot.rackPosition) ) { |
|
|
|
task.throwException("试管架未移至加液区域,无法执行摇匀操作"); |
|
|
|
return ; |
|
|
|
} |
|
|
|
|
|
|
|
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); |
|
|
|
liquidPlateMotor.moveTo(0); |
|
|
|
liquidPlateMotor.setVelocity(300); |
|
|
|
liquidPlateMotor.setAcc(10); |
|
|
|
for ( int i=0; i<this.count; i++ ) { |
|
|
|
liquidPlateMotor.moveTo(300); |
|
|
|
liquidPlateMotor.moveTo(0); |
|
|
|
} |
|
|
|
liquidPlateMotor.setVelocity(liquidPlateMotor.defaultVelocity); |
|
|
|
liquidPlateMotor.setAcc(liquidPlateMotor.defaultAcc); |
|
|
|
} |
|
|
|
} |