|
|
@ -1,12 +1,16 @@ |
|
|
|
package com.dreamworks.boditech.driver.task.step; |
|
|
|
import com.dreamworks.boditech.driver.Device; |
|
|
|
import com.dreamworks.boditech.driver.actuator.*; |
|
|
|
import com.dreamworks.boditech.driver.consumable.CsmPipetteTip; |
|
|
|
import com.dreamworks.boditech.driver.consumable.CsmSampleTube; |
|
|
|
import com.dreamworks.boditech.driver.task.Task; |
|
|
|
import com.dreamworks.boditech.driver.task.Executor; |
|
|
|
import com.dreamworks.boditech.driver.actuator.ActMotor; |
|
|
|
import com.dreamworks.boditech.driver.actuator.ActuatorModule; |
|
|
|
import com.dreamworks.boditech.driver.task.TaskTest; |
|
|
|
import com.dreamworks.boditech.entity.MdbTestTube; |
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
public class StepPretreatment extends StepBase { |
|
|
|
@JsonProperty |
|
|
|
public Boolean shaking; |
|
|
@ -36,38 +40,78 @@ public class StepPretreatment extends StepBase { |
|
|
|
this.testTubeShakeMotor = (ActMotor)device.getActuator(ActuatorModule.TEST_TUBE_SHAKING_SHAKE_MOTOR); |
|
|
|
this.testTubeClipMotor = (ActMotor)device.getActuator(ActuatorModule.TEST_TUBE_SHAKING_CLIP_MOTOR); |
|
|
|
|
|
|
|
CsmSampleTube tube = this.taskTest.getSampleTube(); |
|
|
|
MdbTestTube testTube = executor.getDevice().testService.testTubeFindByKey(tube.type); |
|
|
|
if ( this.shaking ) { |
|
|
|
this.shake(); |
|
|
|
if (Objects.equals(tube.type, CsmSampleTube.TYPE_BLOOD_TUBE_5ML)) { |
|
|
|
this.shakeBloodTube5ml(); |
|
|
|
} else if ( Objects.equals(tube.type, CsmSampleTube.TYPE_BLOOD_TUBE_3ML) ) { |
|
|
|
this.shakeBloodTube3ml(); |
|
|
|
} else if (Objects.equals(MdbTestTube.MIX_TYPE_PIPETTE, testTube.mixType)) { |
|
|
|
this.mixByPipette(executor); |
|
|
|
} else { |
|
|
|
throw new RuntimeException("不支持的摇匀试管类型:"+tube.type); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( this.uncap ) { |
|
|
|
this.uncap("none"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// shake |
|
|
|
private void shake() { |
|
|
|
if ( !this.taskTest.getSampleTube().isShakable() ) { |
|
|
|
return ; |
|
|
|
// 通过移液枪混匀 |
|
|
|
private void mixByPipette(Executor executor) { |
|
|
|
Device device = executor.getDevice(); |
|
|
|
ActPipette pipette = (ActPipette)device.getActuator(ActuatorModule.ARM_Z_PIPETTE); |
|
|
|
ActArmXY armXY = (ActArmXY)device.getActuator(ActuatorModule.ARM_XY); |
|
|
|
ActMotor armZMotor = (ActMotor)device.getActuator(ActuatorModule.ARM_Z_MOTOR); |
|
|
|
CsmSampleTube sampleTube = this.taskTest.getSampleTube(); |
|
|
|
|
|
|
|
CsmPipetteTip tip = device.pipetteTips.tipAlloc(); |
|
|
|
pipette.useTip(tip); |
|
|
|
armXY.moveTo(sampleTube.getLocationX(), sampleTube.getLocationY()); |
|
|
|
armZMotor.moveTo(sampleTube.getLocationZ()); |
|
|
|
|
|
|
|
for ( int i=0; i<5; i++ ) { |
|
|
|
pipette.aspiration(100); |
|
|
|
pipette.dispense(); |
|
|
|
} |
|
|
|
|
|
|
|
armZMotor.moveTo(0); |
|
|
|
pipette.dropTip(); |
|
|
|
} |
|
|
|
|
|
|
|
// 全血3ml试管 |
|
|
|
private void shakeBloodTube3ml() { |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipOpen"); |
|
|
|
if (CsmSampleTube.TYPE_BLOOD_TUBE_5ML.equals(this.taskTest.getSampleTube().type)) { // 全血试管:高 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipClose"); |
|
|
|
} else if ( CsmSampleTube.TYPE_BLOOD_TUBE_3ML.equals(this.taskTest.getSampleTube().type) ) { // 全血试管:低 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeCapBodyClipDepth"); // 下降到试管帽中间位置,用于夹住试管帽=1200 |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipBodyClose"); //夹住试管帽=850 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeBT3mlPullUpDepth"); //往上提一点=980 |
|
|
|
this.testTubeClipMotor.rotate(ActMotor.ROTATE_DIRECTION_CLOCKWISE); //试管夹夹住试管 |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipOpen"); //试管帽夹松开 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); //试管帽夹下降 |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipBt3mlClose"); // 试管帽夹夹住整个试管帽=850 |
|
|
|
this.testTubeClipMotor.rotate(ActMotor.ROTATE_DIRECTION_COUNTER_CLOCKWISE); //试管夹松开 |
|
|
|
this.testTubeClipMotor.stop(); //试管夹停止 |
|
|
|
} |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeCapBodyClipDepth"); // 下降到试管帽中间位置,用于夹住试管帽=1200 |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipBodyClose"); //夹住试管帽=850 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeBT3mlPullUpDepth"); //往上提一点=980 |
|
|
|
this.testTubeClipMotor.rotate(ActMotor.ROTATE_DIRECTION_CLOCKWISE); //试管夹夹住试管 |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipOpen"); //试管帽夹松开 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); //试管帽夹下降 |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipBt3mlClose"); // 试管帽夹夹住整个试管帽=850 |
|
|
|
this.testTubeClipMotor.rotate(ActMotor.ROTATE_DIRECTION_COUNTER_CLOCKWISE); //试管夹松开 |
|
|
|
this.testTubeClipMotor.stop(); //试管夹停止 |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveStandby"); |
|
|
|
this.shakeMotorExecute(); |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); |
|
|
|
this.uncap("shaking"); |
|
|
|
} |
|
|
|
|
|
|
|
// 全血5ml试管 |
|
|
|
private void shakeBloodTube5ml() { |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipOpen"); |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); |
|
|
|
this.testTubeCapClipMotor.moveTo("shakeTestTubeCapClipClose"); |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveStandby"); |
|
|
|
this.shakeMotorExecute(); |
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); |
|
|
|
this.uncap("shaking"); |
|
|
|
} |
|
|
|
|
|
|
|
// 执行摇匀 |
|
|
|
private void shakeMotorExecute() { |
|
|
|
// 05. 摇晃 |
|
|
|
// @TODO : 摇不得摇不得, 没限位, 要乱的 |
|
|
|
// this.testTubeShakeMotor.rotate(ActMotor.ROTATE_DIRECTION_CLOCKWISE); |
|
|
@ -77,9 +121,6 @@ public class StepPretreatment extends StepBase { |
|
|
|
// throw new RuntimeException(e); |
|
|
|
// } |
|
|
|
// this.testTubeShakeMotor.stop(); |
|
|
|
|
|
|
|
this.testTubeMoveMotor.moveTo("shakeTestTubeMoveCapClip"); |
|
|
|
this.uncap("shaking"); |
|
|
|
} |
|
|
|
|
|
|
|
// uncap |
|
|
|