Browse Source

增加子弹头0.5ml支持

master
sige 2 years ago
parent
commit
c3b6872ee1
  1. 2
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmSampleTube.java
  2. 32
      src/main/java/com/dreamworks/boditech/driver/task/TaskTestTubeRackPrepare.java
  3. 89
      src/main/java/com/dreamworks/boditech/driver/task/step/StepPretreatment.java
  4. 6
      src/main/java/com/dreamworks/boditech/entity/MdbTestTube.java
  5. 3
      src/main/java/com/dreamworks/boditech/mapper/TestTubeMapper.java
  6. 5
      src/main/java/com/dreamworks/boditech/service/TestService.java

2
src/main/java/com/dreamworks/boditech/driver/consumable/CsmSampleTube.java

@ -53,6 +53,8 @@ public class CsmSampleTube {
return this.device.getLocationByName("regularBloodTube5mlDepth");
} else if ( CsmSampleTube.TYPE_BLOOD_TUBE_3ML.equals(this.type) ) {
return this.device.getLocationByName("regularBloodTube3mlDepth");
} else if (CsmSampleTube.TYPE_EPP05.equals(this.type)) {
return this.device.getLocationByName("regularEpp0.5mlDepth");
} else {
throw new RuntimeException("unknown tube type " + this.type);
}

32
src/main/java/com/dreamworks/boditech/driver/task/TaskTestTubeRackPrepare.java

@ -72,21 +72,23 @@ public class TaskTestTubeRackPrepare extends TaskBase {
}
// 03. 试管架类型检测
this.testTubeRackTypeDetect();
MdbTestTube testTube = this.testTubeRackTypeDetect();
// 03. 逐个扫描试管
this.testTubeBarcodes = new String[10];
int scanStartPos = this.device.getLocationByName("testTubeRackScanStart");
for ( int i = 0; i < 10; i++ ) {
if ( !this.testTubeExistsStatus[i] ) {
this.testTubeBarcodes[i] = "";
continue ;
if ( testTube.scanable ) {
int scanStartPos = this.device.getLocationByName("testTubeRackScanStart");
for ( int i = 0; i < 10; i++ ) {
if ( !this.testTubeExistsStatus[i] ) {
this.testTubeBarcodes[i] = "";
continue ;
}
this.testTubeMoveMotor.moveTo(scanStartPos + i * tubeDistance);
testTubeRotateMotor.rotate(ActMotor.ROTATE_DIRECTION_CLOCKWISE);
String code = this.testTubeScanner.scan(1000);
testTubeRotateMotor.reset();
this.testTubeBarcodes[i] = code;
}
this.testTubeMoveMotor.moveTo(scanStartPos + i * tubeDistance);
testTubeRotateMotor.rotate(ActMotor.ROTATE_DIRECTION_CLOCKWISE);
String code = this.testTubeScanner.scan(1000);
testTubeRotateMotor.reset();
this.testTubeBarcodes[i] = code;
}
// 04. 扫描完成后推送到预备区域
@ -111,6 +113,9 @@ public class TaskTestTubeRackPrepare extends TaskBase {
if ( tube.barCode.isEmpty() ) {
tube.barCode = this.testTubeBarcodes[tube.index];
if ( null == tube.barCode ) {
tube.barCode = "";
}
}
List<Integer> projectIds = (List<Integer>) MyCommon.jsonToObject(tube.projectIds, List.class);
@ -162,9 +167,9 @@ public class TaskTestTubeRackPrepare extends TaskBase {
}
// 试管架类型检测
private void testTubeRackTypeDetect() {
private MdbTestTube testTubeRackTypeDetect() {
if ( !this.mdbTask.tubeType.isEmpty() ) {
return ;
return this.testService.testTubeFindByKey(this.mdbTask.tubeType);
}
this.testTubeMoveMotor.moveTo("testTubeRackTubeTypeScan");
@ -193,5 +198,6 @@ public class TaskTestTubeRackPrepare extends TaskBase {
}
this.mdbTask.tubeType = testTube.key;
this.testService.regularTaskUpdate(this.mdbTask);
return testTube;
}
}

89
src/main/java/com/dreamworks/boditech/driver/task/step/StepPretreatment.java

@ -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

6
src/main/java/com/dreamworks/boditech/entity/MdbTestTube.java

@ -1,5 +1,7 @@
package com.dreamworks.boditech.entity;
public class MdbTestTube {
public static String MIX_TYPE_PIPETTE = "PIPETTE";
// id
public Integer id;
// key
@ -8,4 +10,8 @@ public class MdbTestTube {
public String name;
// code
public String code;
// scanable
public Boolean scanable;
// mix type
public String mixType;
}

3
src/main/java/com/dreamworks/boditech/mapper/TestTubeMapper.java

@ -6,4 +6,7 @@ import org.apache.ibatis.annotations.Select;
public interface TestTubeMapper {
@Select("SELECT * FROM bdt_test_tubes WHERE code = #{code}")
MdbTestTube findByCode(String code);
@Select("SELECT * FROM bdt_test_tubes WHERE `key` = #{key}")
MdbTestTube findByKey(String key);
}

5
src/main/java/com/dreamworks/boditech/service/TestService.java

@ -419,4 +419,9 @@ public class TestService {
public MdbTestTube testTubeFindByCode( String code) {
return this.testTubeMapper.findByCode(code);
}
// test tube by key
public MdbTestTube testTubeFindByKey( String key ) {
return this.testTubeMapper.findByKey(key);
}
}
Loading…
Cancel
Save