Browse Source

删除多余设备文件以及修改名称

master
sige 2 years ago
parent
commit
b5b83ff306
  1. 41
      src/main/java/com/dreamworks/boditech/driver/Command.java
  2. 10
      src/main/java/com/dreamworks/boditech/driver/CommandMeta.java
  3. 19
      src/main/java/com/dreamworks/boditech/driver/DeviceCommand.java
  4. 2
      src/main/java/com/dreamworks/boditech/driver/DeviceRegister.java
  5. 4
      src/main/java/com/dreamworks/boditech/driver/TestStep.java
  6. 6
      src/main/java/com/dreamworks/boditech/driver/actuator/ActArmXY.java
  7. 1
      src/main/java/com/dreamworks/boditech/driver/actuator/ActIncubator.java
  8. 18
      src/main/java/com/dreamworks/boditech/driver/actuator/ActMotor.java
  9. 8
      src/main/java/com/dreamworks/boditech/driver/actuator/ActPipette.java
  10. 14
      src/main/java/com/dreamworks/boditech/driver/actuator/ActuatorBase.java
  11. 6
      src/main/java/com/dreamworks/boditech/driver/command/CmdMotorEasyMoveTo.java
  12. 4
      src/main/java/com/dreamworks/boditech/driver/entity/TestCard.java
  13. 20
      src/main/java/com/dreamworks/boditech/driver/task/Executor.java
  14. 4
      src/main/java/com/dreamworks/boditech/driver/task/Task.java
  15. 3
      src/main/java/com/dreamworks/boditech/driver/task/TaskBatchTubeExit.java
  16. 3
      src/main/java/com/dreamworks/boditech/driver/task/TaskBatchTubePrepare.java
  17. 7
      src/main/java/com/dreamworks/boditech/driver/task/TaskReset.java
  18. 6
      src/main/java/com/dreamworks/boditech/driver/task/TaskTest.java
  19. 4
      src/main/java/com/dreamworks/boditech/driver/task/step/Step.java
  20. 4
      src/main/java/com/dreamworks/boditech/driver/task/step/StepAnalysis.java
  21. 4
      src/main/java/com/dreamworks/boditech/driver/task/step/StepPuncture.java
  22. 4
      src/main/java/com/dreamworks/boditech/driver/task/step/StepSampling.java
  23. 4
      src/main/java/com/dreamworks/boditech/driver/task/step/StepShake.java
  24. 8
      src/main/java/com/dreamworks/boditech/service/DeviceService.java

41
src/main/java/com/dreamworks/boditech/driver/Command.java

@ -1,41 +0,0 @@
package com.dreamworks.boditech.driver;
import java.util.HashMap;
import java.util.Map;
public class Command {
// command constants
public static final Integer CMD_MODULE_STOP = 0x0101;
public static final Integer CMD_MODULE_GET_STATUS = 0x0104;
public static final Integer CMD_MODULE_GET_REG = 0x0106;
public static final Integer CMD_MODULE_READ_IO = 0x0107;
public static final Integer CMD_MODULE_READ_RAW = 0x0113;
public static final Integer CMD_MODULE_START = 0x0115;
public static final Integer CMD_MOTOR_CALCULATED_POS_BY_MOVE_TO_ZERO = 0x0210;
public static final Integer CMD_MOTOR_EASY_ROTATE = 0x0211;
public static final Integer CMD_MOTOR_EASY_MOVE_BY = 0x0212;
public static final Integer CMD_MOTOR_EASY_MOVE_TO = 0x0213;
public static final Integer CMD_MOTOR_EASY_MOVE_TO_ZERO = 0x0214;
public static final Integer CMD_XYMOTOR_MOVE_TO = 0x0303;
public static final Integer CMD_XYMOTOR_MOVE_TO_ZERO = 0x0304;
public static final Integer CMD_PIPETTE_CTRL_INIT_DEVICE = 0x0501;
public static final Integer CMD_PIPETTE_CTRL_MOVE_TO_UL = 0x0503;
// command meta data
public static final Map<Integer,CommandMeta> cmdMetaMap = new HashMap<Integer,CommandMeta>();
// get command metadata by command
public static CommandMeta getCommandMeta(Integer cmd) {
if ( Command.cmdMetaMap.isEmpty() ) {
Command.cmdMetaMap.put(CMD_MODULE_START, new CommandMeta("module_start"));
Command.cmdMetaMap.put(CMD_MODULE_STOP, new CommandMeta("module_stop"));
Command.cmdMetaMap.put(CMD_MODULE_GET_STATUS, new CommandMeta("module_get_status"));
Command.cmdMetaMap.put(CMD_MODULE_READ_IO, new CommandMeta("module_readio"));
Command.cmdMetaMap.put(CMD_MODULE_READ_RAW, new CommandMeta("module_read_raw"));
Command.cmdMetaMap.put(CMD_MOTOR_EASY_MOVE_TO, new CommandMeta("motor_easy_move_to"));
Command.cmdMetaMap.put(CMD_MOTOR_EASY_MOVE_BY, new CommandMeta("motor_easy_move_by"));
Command.cmdMetaMap.put(CMD_MOTOR_EASY_ROTATE, new CommandMeta("motor_easy_rotate"));
}
return cmdMetaMap.get(cmd);
}
}

10
src/main/java/com/dreamworks/boditech/driver/CommandMeta.java

@ -1,10 +0,0 @@
package com.dreamworks.boditech.driver;
public class CommandMeta {
// name of the command
public String name;
// constructor
CommandMeta(String name) {
this.name = name;
}
}

19
src/main/java/com/dreamworks/boditech/driver/DeviceCommand.java

@ -0,0 +1,19 @@
package com.dreamworks.boditech.driver;
public class DeviceCommand {
// command constants
public static final Integer CMD_MODULE_STOP = 0x0101;
public static final Integer CMD_MODULE_GET_STATUS = 0x0104;
public static final Integer CMD_MODULE_GET_REG = 0x0106;
public static final Integer CMD_MODULE_READ_IO = 0x0107;
public static final Integer CMD_MODULE_READ_RAW = 0x0113;
public static final Integer CMD_MODULE_START = 0x0115;
public static final Integer CMD_MOTOR_CALCULATED_POS_BY_MOVE_TO_ZERO = 0x0210;
public static final Integer CMD_MOTOR_EASY_ROTATE = 0x0211;
public static final Integer CMD_MOTOR_EASY_MOVE_BY = 0x0212;
public static final Integer CMD_MOTOR_EASY_MOVE_TO = 0x0213;
public static final Integer CMD_MOTOR_EASY_MOVE_TO_ZERO = 0x0214;
public static final Integer CMD_XYMOTOR_MOVE_TO = 0x0303;
public static final Integer CMD_XYMOTOR_MOVE_TO_ZERO = 0x0304;
public static final Integer CMD_PIPETTE_CTRL_INIT_DEVICE = 0x0501;
public static final Integer CMD_PIPETTE_CTRL_MOVE_TO_UL = 0x0503;
}

2
src/main/java/com/dreamworks/boditech/driver/Register.java → src/main/java/com/dreamworks/boditech/driver/DeviceRegister.java

@ -1,5 +1,5 @@
package com.dreamworks.boditech.driver;
public class Register {
public class DeviceRegister {
public static final Integer MODULE_INPUT_STATE = 8;
public static final Integer MODULE_LAST_CMD_EXEC_VAL0 = 21;
}

4
src/main/java/com/dreamworks/boditech/driver/TestStep.java

@ -1,4 +0,0 @@
package com.dreamworks.boditech.driver;
public class TestStep {
}

6
src/main/java/com/dreamworks/boditech/driver/actuator/ActArmXY.java

@ -1,5 +1,5 @@
package com.dreamworks.boditech.driver.actuator;
import com.dreamworks.boditech.driver.Command;
import com.dreamworks.boditech.driver.DeviceCommand;
import com.dreamworks.boditech.driver.Device;
public class ActArmXY extends ActuatorBase {
// constructor
@ -23,7 +23,7 @@ public class ActArmXY extends ActuatorBase {
* @param velocity 0: default velocity, otherwise: rpm per minute for motor
*/
public void moveTo(int x, int y, int velocity) {
this.call(Command.CMD_XYMOTOR_MOVE_TO, x, y, velocity);
this.call(DeviceCommand.CMD_XYMOTOR_MOVE_TO, x, y, velocity);
this.waitForFinish();
}
@ -41,7 +41,7 @@ public class ActArmXY extends ActuatorBase {
* reset arm xy
*/
public void reset() {
this.call(Command.CMD_XYMOTOR_MOVE_TO_ZERO);
this.call(DeviceCommand.CMD_XYMOTOR_MOVE_TO_ZERO);
this.waitForFinish();
}
}

1
src/main/java/com/dreamworks/boditech/driver/actuator/ActIncubator.java

@ -1,5 +1,4 @@
package com.dreamworks.boditech.driver.actuator;
import com.dreamworks.boditech.driver.Command;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.entity.IncubatorSlot;
public class ActIncubator extends ActMotor {

18
src/main/java/com/dreamworks/boditech/driver/actuator/ActMotor.java

@ -1,9 +1,7 @@
package com.dreamworks.boditech.driver.actuator;
import com.dreamworks.boditech.driver.Command;
import com.dreamworks.boditech.driver.DeviceCommand;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.Register;
import java.nio.ByteBuffer;
import com.dreamworks.boditech.driver.DeviceRegister;
public class ActMotor extends ActuatorBase {
// rotate direction
@ -22,21 +20,21 @@ public class ActMotor extends ActuatorBase {
// reset
public void reset() {
this.call(Command.CMD_MOTOR_EASY_MOVE_TO_ZERO, -1);
this.call(DeviceCommand.CMD_MOTOR_EASY_MOVE_TO_ZERO, -1);
this.waitForFinish();
}
// reset and get source location
public Integer resetAndGetSourceLocation() {
this.call(Command.CMD_MOTOR_CALCULATED_POS_BY_MOVE_TO_ZERO);
this.call(DeviceCommand.CMD_MOTOR_CALCULATED_POS_BY_MOVE_TO_ZERO);
this.waitForFinish();
Integer location = this.getRegister(Register.MODULE_LAST_CMD_EXEC_VAL0);
Integer location = this.getRegister(DeviceRegister.MODULE_LAST_CMD_EXEC_VAL0);
return location;
}
// move to given position
public void moveTo(int position) {
this.call(Command.CMD_MOTOR_EASY_MOVE_TO, position);
this.call(DeviceCommand.CMD_MOTOR_EASY_MOVE_TO, position);
this.waitForFinish();
}
@ -48,13 +46,13 @@ public class ActMotor extends ActuatorBase {
// move by given distance
public void moveBy(int distance) {
this.call(Command.CMD_MOTOR_EASY_MOVE_BY, distance);
this.call(DeviceCommand.CMD_MOTOR_EASY_MOVE_BY, distance);
this.waitForFinish();
}
// rotate
public void rotate( int direction ) {
this.call(Command.CMD_MOTOR_EASY_ROTATE, direction);
this.call(DeviceCommand.CMD_MOTOR_EASY_ROTATE, direction);
this.waitForFinish();
}

8
src/main/java/com/dreamworks/boditech/driver/actuator/ActPipette.java

@ -1,5 +1,5 @@
package com.dreamworks.boditech.driver.actuator;
import com.dreamworks.boditech.driver.Command;
import com.dreamworks.boditech.driver.DeviceCommand;
import com.dreamworks.boditech.driver.Device;
public class ActPipette extends ActuatorBase {
// indicate whether the pipette has tip
@ -23,19 +23,19 @@ public class ActPipette extends ActuatorBase {
// init device
public void initDevice() {
this.call(Command.CMD_PIPETTE_CTRL_INIT_DEVICE);
this.call(DeviceCommand.CMD_PIPETTE_CTRL_INIT_DEVICE);
this.waitForFinish();
}
// move to given position
public void aspiration(int volume) {
this.call(Command.CMD_PIPETTE_CTRL_MOVE_TO_UL, volume);
this.call(DeviceCommand.CMD_PIPETTE_CTRL_MOVE_TO_UL, volume);
this.waitForFinish();
}
// move to given position
public void dispense(int volume) {
this.call(Command.CMD_PIPETTE_CTRL_MOVE_TO_UL, volume);
this.call(DeviceCommand.CMD_PIPETTE_CTRL_MOVE_TO_UL, volume);
this.waitForFinish();
}

14
src/main/java/com/dreamworks/boditech/driver/actuator/ActuatorBase.java

@ -1,5 +1,5 @@
package com.dreamworks.boditech.driver.actuator;
import com.dreamworks.boditech.driver.Command;
import com.dreamworks.boditech.driver.DeviceCommand;
import com.dreamworks.boditech.driver.Device;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@ -35,7 +35,7 @@ public class ActuatorBase implements Actuator {
protected void waitForFinish() {
Integer status = ActuatorModule.MODULE_STATUS_BUSY;
do {
ByteBuffer response = this.call(Command.CMD_MODULE_GET_STATUS);
ByteBuffer response = this.call(DeviceCommand.CMD_MODULE_GET_STATUS);
if ( null == response ) {
continue ;
}
@ -50,7 +50,7 @@ public class ActuatorBase implements Actuator {
// read io
public Integer readIO(Integer index) {
ByteBuffer response = this.call(Command.CMD_MODULE_READ_IO);
ByteBuffer response = this.call(DeviceCommand.CMD_MODULE_READ_IO);
Integer value = this.getIntegerFromResponse(response, 0);
value = (value >> (index - 1)) & 0x01;
return value;
@ -58,25 +58,25 @@ public class ActuatorBase implements Actuator {
// module start
public void start() {
this.call(Command.CMD_MODULE_START);
this.call(DeviceCommand.CMD_MODULE_START);
}
// module stop
public void stop() {
this.call(Command.CMD_MODULE_STOP);
this.call(DeviceCommand.CMD_MODULE_STOP);
}
// read raw
// TODO: 数据长度需要使用扇区大小 * 扇区数量
public String readRawText( Integer startIndex ) {
ByteBuffer response = this.call(Command.CMD_MODULE_READ_RAW, startIndex);
ByteBuffer response = this.call(DeviceCommand.CMD_MODULE_READ_RAW, startIndex);
String rawText = new String(response.array(), 8, response.array().length - 8);
return rawText.trim();
}
// get register
public Integer getRegister( Integer index ) {
ByteBuffer response = this.call(Command.CMD_MODULE_GET_REG, index);
ByteBuffer response = this.call(DeviceCommand.CMD_MODULE_GET_REG, index);
Integer value = this.getIntegerFromResponse(response, 0);
return value;
}

6
src/main/java/com/dreamworks/boditech/driver/command/CmdMotorEasyMoveTo.java

@ -1,6 +0,0 @@
package com.dreamworks.boditech.driver.command;
public class CmdMotorEasyMoveTo {
public void execute() {
}
}

4
src/main/java/com/dreamworks/boditech/driver/ConsumableTestCard.java → src/main/java/com/dreamworks/boditech/driver/entity/TestCard.java

@ -1,5 +1,5 @@
package com.dreamworks.boditech.driver;
public class ConsumableTestCard {
package com.dreamworks.boditech.driver.entity;
public class TestCard {
// project id
public Integer projectId;
// project name

20
src/main/java/com/dreamworks/boditech/driver/TaskExecutor.java → src/main/java/com/dreamworks/boditech/driver/task/Executor.java

@ -1,11 +1,11 @@
package com.dreamworks.boditech.driver;
import com.dreamworks.boditech.driver.task.Task;
package com.dreamworks.boditech.driver.task;
import com.dreamworks.boditech.driver.Device;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Objects;
public class TaskExecutor implements Runnable {
private static final Logger LOG = LoggerFactory.getLogger(TaskExecutor.class);
public class Executor implements Runnable {
private static final Logger LOG = LoggerFactory.getLogger(Executor.class);
public static final Integer STATUS_STOPPED = 0;
public static final Integer STATUS_RUNNING = 1;
@ -13,23 +13,23 @@ public class TaskExecutor implements Runnable {
private final Device device;
private final List<Task> tasks;
private Integer status = TaskExecutor.STATUS_STOPPED;
private Integer status = Executor.STATUS_STOPPED;
public TaskExecutor(List<Task> tasks, Device device ) {
public Executor(List<Task> tasks, Device device ) {
this.tasks = tasks;
this.device = device;
}
public void stop() {
this.status = TaskExecutor.STATUS_STOP_REQUEST;
this.status = Executor.STATUS_STOP_REQUEST;
}
@Override
public void run() {
LOG.info("task executor start");
this.status = TaskExecutor.STATUS_RUNNING;
this.status = Executor.STATUS_RUNNING;
while (!Objects.equals(this.status, TaskExecutor.STATUS_STOP_REQUEST)) {
while (!Objects.equals(this.status, Executor.STATUS_STOP_REQUEST)) {
Task task = null;
synchronized (this.tasks) {
if (this.tasks.isEmpty()) {
@ -45,7 +45,7 @@ public class TaskExecutor implements Runnable {
task.execute(this);
}
this.status = TaskExecutor.STATUS_STOPPED;
this.status = Executor.STATUS_STOPPED;
LOG.info("task executor stop");
}

4
src/main/java/com/dreamworks/boditech/driver/task/Task.java

@ -1,7 +1,5 @@
package com.dreamworks.boditech.driver.task;
import com.dreamworks.boditech.driver.TaskExecutor;
public interface Task {
public void execute(TaskExecutor executor);
public void execute(Executor executor);
}

3
src/main/java/com/dreamworks/boditech/driver/task/TaskBatchTubeExit.java

@ -1,11 +1,10 @@
package com.dreamworks.boditech.driver.task;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.actuator.ActMotor;
import com.dreamworks.boditech.driver.actuator.ActuatorModule;
public class TaskBatchTubeExit implements Task {
@Override
public void execute(TaskExecutor executor) {
public void execute(Executor executor) {
Device device = executor.getDevice();
// move to exit position

3
src/main/java/com/dreamworks/boditech/driver/task/TaskBatchTubePrepare.java

@ -1,6 +1,5 @@
package com.dreamworks.boditech.driver.task;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.actuator.ActCodeScanner;
import com.dreamworks.boditech.driver.actuator.ActModuleTestTubeRackMovement;
import com.dreamworks.boditech.driver.actuator.ActuatorModule;
@ -17,7 +16,7 @@ public class TaskBatchTubePrepare implements Task {
}
@Override
public void execute( TaskExecutor executor ) {
public void execute( Executor executor ) {
Device device = executor.getDevice();
ActMotor testTubeFeedMotor = (ActMotor)device.getActuator(ActuatorModule.TEST_TUBE_RACK_FEED_MOTOR);
ActMotor testTubeMoveMotor = (ActMotor)device.getActuator(ActuatorModule.TEST_TUBE_RACK_MOVE_MOTOR);

7
src/main/java/com/dreamworks/boditech/driver/task/TaskReset.java

@ -1,7 +1,6 @@
package com.dreamworks.boditech.driver.task;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.Register;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.DeviceRegister;
import com.dreamworks.boditech.driver.actuator.ActArmXY;
import com.dreamworks.boditech.driver.actuator.ActIncubator;
import com.dreamworks.boditech.driver.actuator.ActMotor;
@ -20,7 +19,7 @@ public class TaskReset implements Task {
public Integer mode = MODE_NORMAL;
@Override
public void execute(TaskExecutor executor) {
public void execute(Executor executor) {
Device device = executor.getDevice();
//01. 试管夹复位
@ -98,7 +97,7 @@ public class TaskReset implements Task {
// 11. 光学推杆电机复位
ActMotor analysisPushMotor = (ActMotor)device.getActuator(ActuatorModule.ANALYSIS_PUSH_MOTOR);
Integer analysisPushMotorInputState = analysisPushMotor.getRegister(Register.MODULE_INPUT_STATE);
Integer analysisPushMotorInputState = analysisPushMotor.getRegister(DeviceRegister.MODULE_INPUT_STATE);
boolean isAnalysisPushMotorPushing = ((analysisPushMotorInputState >> 1) & 0x01) == 0x00;
if ( isAnalysisPushMotorPushing ) {
analysisPushMotor.reset();

6
src/main/java/com/dreamworks/boditech/driver/task/TaskTest.java

@ -1,6 +1,4 @@
package com.dreamworks.boditech.driver.task;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.TestStep;
import com.dreamworks.boditech.driver.consumable.CsmBufferTubeA;
import com.dreamworks.boditech.driver.consumable.CsmSampleTube;
import com.dreamworks.boditech.driver.consumable.ReactionTube;
@ -27,7 +25,7 @@ public class TaskTest implements Task {
// is reaction timeout
public Boolean isReactionTimeout;
// steps
public List<TestStep> steps;
public List<Step> steps;
// step index
public Integer stepIndex;
// reaction tube
@ -68,7 +66,7 @@ public class TaskTest implements Task {
}
@Override
public void execute(TaskExecutor executor) {
public void execute(Executor executor) {
// @TODO : use real sample tube
this.sampleTube = new CsmSampleTube();
this.reactionTube = new CsmBufferTubeA();

4
src/main/java/com/dreamworks/boditech/driver/task/step/Step.java

@ -1,7 +1,7 @@
package com.dreamworks.boditech.driver.task.step;
import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.task.Executor;
public interface Step {
// execute step
public void execute(TaskExecutor executor, Task task );
public void execute(Executor executor, Task task );
}

4
src/main/java/com/dreamworks/boditech/driver/task/step/StepAnalysis.java

@ -1,7 +1,7 @@
package com.dreamworks.boditech.driver.task.step;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.task.Executor;
import com.dreamworks.boditech.driver.actuator.ActAnalysisScanner;
import com.dreamworks.boditech.driver.actuator.ActIncubator;
import com.dreamworks.boditech.driver.actuator.ActMotor;
@ -14,7 +14,7 @@ public class StepAnalysis extends StepBase {
public String action;
@Override
public void execute(TaskExecutor executor, Task task) {
public void execute(Executor executor, Task task) {
TaskTest taskTest = (TaskTest)task;
Device device = executor.getDevice();
ActIncubator incubator = (ActIncubator)device.getActuator(ActuatorModule.INCUBATOR_MOTOR);

4
src/main/java/com/dreamworks/boditech/driver/task/step/StepPuncture.java

@ -1,7 +1,7 @@
package com.dreamworks.boditech.driver.task.step;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.task.Executor;
import com.dreamworks.boditech.driver.actuator.ActArmXY;
import com.dreamworks.boditech.driver.actuator.ActMotor;
import com.dreamworks.boditech.driver.actuator.ActuatorModule;
@ -18,7 +18,7 @@ public class StepPuncture extends StepBase {
public String tubeType;
@Override
public void execute(TaskExecutor executor, Task task) {
public void execute(Executor executor, Task task) {
Device device = executor.getDevice();
ActArmXY armXY = (ActArmXY)device.getActuator(ActuatorModule.ARM_XY);
ActMotor armZMotor = (ActMotor)device.getActuator(ActuatorModule.ARM_Z_MOTOR);

4
src/main/java/com/dreamworks/boditech/driver/task/step/StepSampling.java

@ -1,7 +1,7 @@
package com.dreamworks.boditech.driver.task.step;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.task.Executor;
import com.dreamworks.boditech.driver.actuator.ActArmXY;
import com.dreamworks.boditech.driver.actuator.ActMotor;
import com.dreamworks.boditech.driver.actuator.ActPipette;
@ -26,7 +26,7 @@ public class StepSampling extends StepBase {
public String requireNewTip = "YES";
@Override
public void execute(TaskExecutor executor, Task task) {
public void execute(Executor executor, Task task) {
Device device = executor.getDevice();
ActPipette pipette = (ActPipette)device.getActuator(ActuatorModule.ARM_Z_PIPETTE);
ActArmXY armXY = (ActArmXY)device.getActuator(ActuatorModule.ARM_XY);

4
src/main/java/com/dreamworks/boditech/driver/task/step/StepShake.java

@ -1,7 +1,7 @@
package com.dreamworks.boditech.driver.task.step;
import com.dreamworks.boditech.driver.Device;
import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.driver.TaskExecutor;
import com.dreamworks.boditech.driver.task.Executor;
import com.dreamworks.boditech.driver.actuator.ActMotor;
import com.dreamworks.boditech.driver.actuator.ActuatorModule;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -10,7 +10,7 @@ public class StepShake extends StepBase {
public String action;
@Override
public void execute(TaskExecutor executor, Task task) {
public void execute(Executor executor, Task task) {
Device device = executor.getDevice();
ActMotor testTubeCapClipMotor = (ActMotor)device.getActuator(ActuatorModule.TEST_TUBE_SHAKING_CAP_CLIP_MOTOR);
ActMotor testTubeShakeMotor = (ActMotor)device.getActuator(ActuatorModule.TEST_TUBE_SHAKING_SHAKE_MOTOR);

8
src/main/java/com/dreamworks/boditech/service/DeviceService.java

@ -2,7 +2,9 @@ package com.dreamworks.boditech.service;
import com.dreamworks.boditech.driver.*;
import com.dreamworks.boditech.driver.consumable.CsmLargeBufferTube;
import com.dreamworks.boditech.driver.consumable.CsmPipetteTip;
import com.dreamworks.boditech.driver.entity.TestCard;
import com.dreamworks.boditech.driver.task.Task;
import com.dreamworks.boditech.driver.task.Executor;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@ -19,11 +21,11 @@ public class DeviceService {
// buffer tubes
public List<CsmLargeBufferTube> bufferTubes;
// test cards
public List<ConsumableTestCard> testCards;
public List<TestCard> testCards;
// tasks
private final List<Task> tasks = new ArrayList<>();
// task executor
private TaskExecutor taskExecutor;
private Executor taskExecutor;
// task executor thread
private Thread taskExecutorThread;
@ -39,7 +41,7 @@ public class DeviceService {
this.device.appendPipetteTip(2, 10);
this.device.appendBufferTubeA(0, 10);
this.taskExecutor = new TaskExecutor(this.tasks, this.device);
this.taskExecutor = new Executor(this.tasks, this.device);
this.taskExecutorThread = new Thread(this.taskExecutor);
this.taskExecutorThread.setName("task-executor");
this.taskExecutorThread.start();

Loading…
Cancel
Save