sige 2 years ago
parent
commit
055068b693
  1. 1
      src/src/main/java/com/my/graphiteDigesterBg/diframe/DiCommand.java
  2. 1
      src/src/main/java/com/my/graphiteDigesterBg/diframe/DiDeviceIO.java
  3. 7
      src/src/main/java/com/my/graphiteDigesterBg/diframe/DiDeviceIOManager.java
  4. 25
      src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActMotor.java
  5. 11
      src/src/main/java/com/my/graphiteDigesterBg/move/MoveLiquidAdd.java
  6. 16
      src/src/main/java/com/my/graphiteDigesterBg/move/MoveMoveTubeRackFromHeatPlateToLiquidPlate.java
  7. 16
      src/src/main/java/com/my/graphiteDigesterBg/move/MoveMoveTubeRackFromLiquidPlateToHeatPlate.java
  8. 21
      src/src/main/java/com/my/graphiteDigesterBg/move/MoveTubeToErrorRackSlot.java
  9. 4
      src/src/main/java/com/my/graphiteDigesterBg/resource/ResHeatingTubeRackSlot.java
  10. 9
      src/src/main/java/com/my/graphiteDigesterBg/task/TaskHeating.java
  11. 32
      src/src/main/java/com/my/graphiteDigesterBg/task/TaskSampleMoveToHeatPlate.java
  12. 22
      src/src/main/java/com/my/graphiteDigesterBg/task/TaskSampleMoveToLiquidPlate.java
  13. 11
      src/src/main/java/com/my/graphiteDigesterBg/task/TaskStartReset.java
  14. 21
      src/src/main/java/com/my/graphiteDigesterBg/task/TaskTubeMoveToErrorSlot.java
  15. 2
      src/src/main/resources/application.yml
  16. 59
      src/src/main/resources/device.yml
  17. 2
      src/web/src/pages/main/contents/Operation.vue
  18. 6
      src/web/src/pages/main/contents/OperationCamera.vue
  19. 45
      src/web/src/pages/main/contents/OperationSampleTakeShot.vue

1
src/src/main/java/com/my/graphiteDigesterBg/diframe/DiCommand.java

@ -5,6 +5,7 @@ public enum DiCommand {
MODULE_SET_REG("module_set_reg", 0x0105), MODULE_SET_REG("module_set_reg", 0x0105),
MODULE_GET_REG("module_get_reg", 0x0106), MODULE_GET_REG("module_get_reg", 0x0106),
MODULE_READ_IO("module_readio", 0x0107), MODULE_READ_IO("module_readio", 0x0107),
MODULE_WRITE_IO("module_writeio", 0x0108),
MODULE_ENABLE("module_enable", 0x0114), MODULE_ENABLE("module_enable", 0x0114),
MOTOR_EASY_MOVE_BY("motor_easy_move_by", 0x0212), MOTOR_EASY_MOVE_BY("motor_easy_move_by", 0x0212),
MOTOR_EASY_MOVE_TO("motor_easy_move_to", 0x0213), MOTOR_EASY_MOVE_TO("motor_easy_move_to", 0x0213),

1
src/src/main/java/com/my/graphiteDigesterBg/diframe/DiDeviceIO.java

@ -3,4 +3,5 @@ public class DiDeviceIO {
protected String key; protected String key;
protected Integer mid; protected Integer mid;
protected Integer index; protected Integer index;
protected String type;
} }

7
src/src/main/java/com/my/graphiteDigesterBg/diframe/DiDeviceIOManager.java

@ -31,6 +31,7 @@ public class DiDeviceIOManager {
io.key = (String)item.get("key"); io.key = (String)item.get("key");
io.mid = (Integer)item.get("mid"); io.mid = (Integer)item.get("mid");
io.index = (Integer)item.get("index"); io.index = (Integer)item.get("index");
io.type = (String)item.get("type");
this.ios.put(io.key, io); this.ios.put(io.key, io);
} }
} }
@ -43,4 +44,10 @@ public class DiDeviceIOManager {
value = (value >> io.index) & 0x01; value = (value >> io.index) & 0x01;
return value; return value;
} }
// set io value
public void setValue( String key, Integer value ) {
DiDeviceIO io = this.ios.get(key);
this.device.call(DiCommand.MODULE_WRITE_IO, io.mid, io.index, value);
}
} }

25
src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActMotor.java

@ -9,9 +9,9 @@ public class DiActMotor extends DiActuatorBase {
// one circle pulse denominator // one circle pulse denominator
protected Integer oneCirclePulseDenominator; protected Integer oneCirclePulseDenominator;
// default velocity // default velocity
protected Integer defaultVelocity;
public Integer defaultVelocity;
// default acc // default acc
protected Integer defaultAcc;
public Integer defaultAcc;
// default dec // default dec
protected Integer defaultDec; protected Integer defaultDec;
// run to zero speed // run to zero speed
@ -68,6 +68,27 @@ public class DiActMotor extends DiActuatorBase {
this.activeConfig(); this.activeConfig();
} }
// set velocity
public void setVelocity( Integer velocity ) {
this.log("setVelocity({})", velocity);
this.call(DiCommand.MODULE_SET_REG, 1054, velocity);
this.activeConfig();
}
// set acc
public void setAcc( Integer acc ) {
this.log("setAcc({})", acc);
this.call(DiCommand.MODULE_SET_REG, 1055, acc);
this.activeConfig();
}
// set dec
public void setDec( Integer dec ) {
this.log("setDec({})", dec);
this.call(DiCommand.MODULE_SET_REG, 1056, dec);
this.activeConfig();
}
// dump register // dump register
public void dumpReg() { public void dumpReg() {
this.log("Reg @{} => {}", this.key, this.type, this.name, 1051, this.getRegValue(1051)); this.log("Reg @{} => {}", this.key, this.type, this.name, 1051, this.getRegValue(1051));

11
src/src/main/java/com/my/graphiteDigesterBg/move/MoveLiquidAdd.java

@ -41,11 +41,18 @@ public class MoveLiquidAdd extends DiTaskMoveBase {
liquidMotor.moveTo("LiquidArmStandby"); liquidMotor.moveTo("LiquidArmStandby");
// 加液盘摇匀
// 摇匀
liquidPlateMotor.moveTo(0);
liquidPlateMotor.setVelocity(300);
liquidPlateMotor.setAcc(10);
for ( int i=0; i<this.shakeTimes; i++ ) { for ( int i=0; i<this.shakeTimes; i++ ) {
liquidPlateMotor.moveTo(200);
liquidPlateMotor.moveTo(300);
liquidPlateMotor.moveTo(0); liquidPlateMotor.moveTo(0);
} }
liquidPlateMotor.setVelocity(liquidPlateMotor.defaultVelocity);
liquidPlateMotor.setAcc(liquidPlateMotor.defaultAcc);
liquidMotor.moveTo("LiquidArmStandby"); liquidMotor.moveTo("LiquidArmStandby");
} }
} }

16
src/src/main/java/com/my/graphiteDigesterBg/move/MoveMoveTubeRackFromHeatPlateToLiquidPlate.java

@ -3,6 +3,8 @@ import com.my.graphiteDigesterBg.MyDevice;
import com.my.graphiteDigesterBg.diframe.DiTaskMoveBase; import com.my.graphiteDigesterBg.diframe.DiTaskMoveBase;
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor;
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; import com.my.graphiteDigesterBg.diframe.actuator.DiActServo;
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager;
public class MoveMoveTubeRackFromHeatPlateToLiquidPlate extends DiTaskMoveBase { public class MoveMoveTubeRackFromHeatPlateToLiquidPlate extends DiTaskMoveBase {
// slot index // slot index
public Integer slotIndex; public Integer slotIndex;
@ -16,11 +18,13 @@ public class MoveMoveTubeRackFromHeatPlateToLiquidPlate extends DiTaskMoveBase {
var transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); var transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class);
var liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); var liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class);
String key = "HeatingPlateMotorSlotCover_" + this.slotIndex;
DiActServo slotCoverServo = this.getActuator(key, DiActServo.class);
// 加热盘转盘移动到取放架位置 // 加热盘转盘移动到取放架位置
heatPlateMotor.moveTo("HeatPlateSlot", this.slotIndex); heatPlateMotor.moveTo("HeatPlateSlot", this.slotIndex);
// 打开试管架盖 // 打开试管架盖
// @TODO : 这里没配置设备暂时注释掉 ~~~
// slot.coverOpen();
slotCoverServo.moveTo("HeatPlateSlotCoverOpen", this.slotIndex);
// 搬运上升到顶部 // 搬运上升到顶部
transUdMotor.moveTo("TransUdMotorTop"); transUdMotor.moveTo("TransUdMotorTop");
// 搬运移动到加热取架位置 // 搬运移动到加热取架位置
@ -42,12 +46,16 @@ public class MoveMoveTubeRackFromHeatPlateToLiquidPlate extends DiTaskMoveBase {
// 搬运上升到顶部 // 搬运上升到顶部
transUdMotor.moveTo("TransUdMotorTop"); transUdMotor.moveTo("TransUdMotorTop");
// 关闭试管架盖 // 关闭试管架盖
// @TODO : 这里没配置设备暂时注释掉 ~~~
// slot.coverClose();
slotCoverServo.moveTo("HeatPlateSlotCoverClose", this.slotIndex);
// 搬运移动到就绪位置 // 搬运移动到就绪位置
transLrMotor.moveTo("TransLrMotorStandby"); transLrMotor.moveTo("TransLrMotorStandby");
// 加热盘移动到就绪位置 // 加热盘移动到就绪位置
heatPlateMotor.moveTo("HeatPlateStandby"); heatPlateMotor.moveTo("HeatPlateStandby");
liquidPlateMotor.moveTo("LiquidPlateStandby"); liquidPlateMotor.moveTo("LiquidPlateStandby");
// 更新试管架位置
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class);
var slot = slotMan.getSlotByIndex(this.slotIndex);
slot.rackPosition = "LIQUID_PLATE";
} }
} }

16
src/src/main/java/com/my/graphiteDigesterBg/move/MoveMoveTubeRackFromLiquidPlateToHeatPlate.java

@ -3,6 +3,8 @@ import com.my.graphiteDigesterBg.MyDevice;
import com.my.graphiteDigesterBg.diframe.DiTaskMoveBase; import com.my.graphiteDigesterBg.diframe.DiTaskMoveBase;
import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor; import com.my.graphiteDigesterBg.diframe.actuator.DiActMotor;
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; import com.my.graphiteDigesterBg.diframe.actuator.DiActServo;
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager;
public class MoveMoveTubeRackFromLiquidPlateToHeatPlate extends DiTaskMoveBase { public class MoveMoveTubeRackFromLiquidPlateToHeatPlate extends DiTaskMoveBase {
// slot index // slot index
public Integer slotIndex; public Integer slotIndex;
@ -15,6 +17,9 @@ public class MoveMoveTubeRackFromLiquidPlateToHeatPlate extends DiTaskMoveBase {
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class);
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class);
String key = "HeatingPlateMotorSlotCover_" + this.slotIndex;
DiActServo slotCoverServo = this.getActuator(key, DiActServo.class);
// 加液转盘移动到取架位置 // 加液转盘移动到取架位置
liquidPlateMotor.moveTo("LiquidPlatePlaceTubeRack"); liquidPlateMotor.moveTo("LiquidPlatePlaceTubeRack");
// 搬运移动到加液取放架位置 // 搬运移动到加液取放架位置
@ -30,8 +35,7 @@ public class MoveMoveTubeRackFromLiquidPlateToHeatPlate extends DiTaskMoveBase {
heatPlateMotor.moveTo("HeatPlateSlot", this.slotIndex); heatPlateMotor.moveTo("HeatPlateSlot", this.slotIndex);
// 打开试管架盖 // 打开试管架盖
// @TODO : 这里没配置设备暂时注释掉 ~~~
// slot.coverOpen();
slotCoverServo.moveTo("HeatPlateSlotCoverOpen", this.slotIndex);
// 搬运移动到加热盘取放位置 // 搬运移动到加热盘取放位置
transLrMotor.moveTo("TransLrMotorHeatPlateSlot"); transLrMotor.moveTo("TransLrMotorHeatPlateSlot");
@ -45,10 +49,14 @@ public class MoveMoveTubeRackFromLiquidPlateToHeatPlate extends DiTaskMoveBase {
transLrMotor.moveTo("TransLrMotorStandby"); transLrMotor.moveTo("TransLrMotorStandby");
// 试管架盖关闭 // 试管架盖关闭
// @TODO : 这里没配置设备暂时注释掉 ~~~
// slot.coverClose();
slotCoverServo.moveTo("HeatPlateSlotCoverClose", this.slotIndex);
heatPlateMotor.moveTo("HeatPlateStandby"); heatPlateMotor.moveTo("HeatPlateStandby");
liquidPlateMotor.moveTo("LiquidPlateStandby"); liquidPlateMotor.moveTo("LiquidPlateStandby");
// 更新试管架位置
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class);
var slot = slotMan.getSlotByIndex(this.slotIndex);
slot.rackPosition = "HEAT_PLATE";
} }
} }

21
src/src/main/java/com/my/graphiteDigesterBg/move/MoveTubeToErrorRackSlot.java

@ -19,6 +19,9 @@ public class MoveTubeToErrorRackSlot extends DiTaskMoveBase {
var heatPlateMotor = this.getActuator(MyDevice.ACT_HEAT_PLATE_MOTOR, DiActMotor.class); var heatPlateMotor = this.getActuator(MyDevice.ACT_HEAT_PLATE_MOTOR, DiActMotor.class);
var transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); var transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class);
String srcSlotKey = "HeatingPlateMotorSlotCover_" + this.srcSlotIndex;
DiActServo srcSlotCoverServo = this.getActuator(srcSlotKey, DiActServo.class);
// 升降移动到顶部 // 升降移动到顶部
transUdMotor.moveTo("TransUdMotorTop"); transUdMotor.moveTo("TransUdMotorTop");
@ -27,6 +30,9 @@ public class MoveTubeToErrorRackSlot extends DiTaskMoveBase {
Integer heatPlateSlotTubeOffset = heatPlateMotor.getLocationValue("HeatPlateSlotTubeOffset", this.srcTubeIndex); Integer heatPlateSlotTubeOffset = heatPlateMotor.getLocationValue("HeatPlateSlotTubeOffset", this.srcTubeIndex);
heatPlateMotor.moveTo(heatPlateSlotLocation + heatPlateSlotTubeOffset); heatPlateMotor.moveTo(heatPlateSlotLocation + heatPlateSlotTubeOffset);
// 打开试管架盖
srcSlotCoverServo.moveTo("HeatPlateSlotCoverOpen", this.srcSlotIndex);
// 搬运左右移动到试管位置 // 搬运左右移动到试管位置
Integer transLrMotorHeatPlateSlotLocation = transLrMotor.getLocationValue("TransLrMotorHeatPlateSlot"); Integer transLrMotorHeatPlateSlotLocation = transLrMotor.getLocationValue("TransLrMotorHeatPlateSlot");
Integer transLrMotorTubeOffset = transLrMotor.getLocationValue("TransLrMotorTubeOffset", this.srcTubeIndex); Integer transLrMotorTubeOffset = transLrMotor.getLocationValue("TransLrMotorTubeOffset", this.srcTubeIndex);
@ -47,14 +53,23 @@ public class MoveTubeToErrorRackSlot extends DiTaskMoveBase {
// 搬运左右移动就绪位置 // 搬运左右移动就绪位置
transLrMotor.moveTo("TransLrMotorStandby"); transLrMotor.moveTo("TransLrMotorStandby");
// 试管架盖关闭
srcSlotCoverServo.moveTo("HeatPlateSlotCoverClose", this.srcSlotIndex);
// 错误准备 // 错误准备
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class);
var errorSlot = slotMan.getErrorSlot(); var errorSlot = slotMan.getErrorSlot();
String errSlotKey = "HeatingPlateMotorSlotCover_" + errorSlot.index;
DiActServo errSlotCoverServo = this.getActuator(errSlotKey, DiActServo.class);
// 加热盘移动到试管位置 // 加热盘移动到试管位置
Integer errorHeatPlateSlotLocation = heatPlateMotor.getLocationValue("HeatPlateSlot", errorSlot.index); Integer errorHeatPlateSlotLocation = heatPlateMotor.getLocationValue("HeatPlateSlot", errorSlot.index);
Integer errorHeatPlateSlotTubeOffset = heatPlateMotor.getLocationValue("HeatPlateSlotTubeOffset", errorSlot.index); Integer errorHeatPlateSlotTubeOffset = heatPlateMotor.getLocationValue("HeatPlateSlotTubeOffset", errorSlot.index);
heatPlateMotor.moveTo(errorHeatPlateSlotLocation + errorHeatPlateSlotTubeOffset); heatPlateMotor.moveTo(errorHeatPlateSlotLocation + errorHeatPlateSlotTubeOffset);
// 打开试管架盖
errSlotCoverServo.moveTo("HeatPlateSlotCoverOpen", errorSlot.index);
// 搬运左右移动到试管位置 // 搬运左右移动到试管位置
transLrMotorTubeOffset = transLrMotor.getLocationValue("TransLrMotorTubeOffset", this.errorTubeIndex); transLrMotorTubeOffset = transLrMotor.getLocationValue("TransLrMotorTubeOffset", this.errorTubeIndex);
transLrMotor.moveTo(transLrMotorHeatPlateSlotLocation + transLrMotorTubeOffset); transLrMotor.moveTo(transLrMotorHeatPlateSlotLocation + transLrMotorTubeOffset);
@ -73,5 +88,11 @@ public class MoveTubeToErrorRackSlot extends DiTaskMoveBase {
// 搬运左右移动就绪位置 // 搬运左右移动就绪位置
transLrMotor.moveTo("TransLrMotorStandby"); transLrMotor.moveTo("TransLrMotorStandby");
// 试管架盖关闭
errSlotCoverServo.moveTo("HeatPlateSlotCoverClose", errorSlot.index);
// 加热盘移动到就绪位置
heatPlateMotor.moveTo("HeatPlateStandby");
} }
} }

4
src/src/main/java/com/my/graphiteDigesterBg/resource/ResHeatingTubeRackSlot.java

@ -28,10 +28,12 @@ public class ResHeatingTubeRackSlot {
public String digestionName; public String digestionName;
// is error slot // is error slot
public Boolean isErrorSlot; public Boolean isErrorSlot;
// rack status
public String rackPosition;
// is slot locked // is slot locked
private Boolean isLocked; private Boolean isLocked;
// is heating // is heating
private Boolean isHeating;
public Boolean isHeating;
// manager // manager
private final ResHeatingTubeRackSlotManager manager; private final ResHeatingTubeRackSlotManager manager;
// tube status list // tube status list

9
src/src/main/java/com/my/graphiteDigesterBg/task/TaskHeating.java

@ -25,12 +25,17 @@ public class TaskHeating extends DiTaskBase {
slot.destTemperature = this.temperature; slot.destTemperature = this.temperature;
slot.heatingDuration = this.duration * 60; slot.heatingDuration = this.duration * 60;
slot.heatingStartedAt = (int)(System.currentTimeMillis()/1000); slot.heatingStartedAt = (int)(System.currentTimeMillis()/1000);
slot.heatingOn();
slot.isHeating = true;
String heaterKey = "HeatPlateSlotHeater" + this.slotIndex;
this.getDevice().getIO().setValue(heaterKey, 1);
this.setStatus(DiTask.TaskStatus.WAITING); this.setStatus(DiTask.TaskStatus.WAITING);
TimerTask timerTask = new TimerTask() { TimerTask timerTask = new TimerTask() {
@Override @Override
public void run() { public void run() {
slot.heatingOff();
TaskHeating.this.getDevice().getIO().setValue(heaterKey, 0);
slot.isHeating = false;
TaskHeating.this.setStatus(TaskStatus.FINISHED); TaskHeating.this.setStatus(TaskStatus.FINISHED);
} }
}; };

32
src/src/main/java/com/my/graphiteDigesterBg/task/TaskSampleMoveToHeatPlate.java

@ -0,0 +1,32 @@
package com.my.graphiteDigesterBg.task;
import com.my.graphiteDigesterBg.diframe.DiTaskBase;
import com.my.graphiteDigesterBg.diframe.Task;
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromLiquidPlateToHeatPlate;
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager;
@Task(name="SampleMoveToHeatPlate")
public class TaskSampleMoveToHeatPlate extends DiTaskBase {
@Override
public void run() {
this.setStatus(TaskStatus.RUNNING);
Integer slotIndex = null;
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class);
for ( var slot : slotMan.getSlots() ) {
if ( slot.rackPosition.equals("LIQUID_PLATE") ) {
slotIndex = slot.index;
break;
}
}
if ( slotIndex == null ) {
throw new RuntimeException("liquid plate slot not found");
}
var move = new MoveMoveTubeRackFromLiquidPlateToHeatPlate();
move.setDevice(this.getDevice());
move.slotIndex = slotIndex;
move.run();
this.setStatus(TaskStatus.FINISHED);
}
}

22
src/src/main/java/com/my/graphiteDigesterBg/task/TaskSampleMoveToLiquidPlate.java

@ -0,0 +1,22 @@
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.move.MoveMoveTubeRackFromHeatPlateToLiquidPlate;
@Task(name="SampleMoveToLiquidPlate")
public class TaskSampleMoveToLiquidPlate extends DiTaskBase {
// slot index
public Integer slotIndex;
@Override
public void run() {
this.setStatus(TaskStatus.RUNNING);
var move = new MoveMoveTubeRackFromHeatPlateToLiquidPlate();
move.setDevice(this.getDevice());
move.slotIndex = this.slotIndex;
move.run();
this.setStatus(TaskStatus.FINISHED);
}
}

11
src/src/main/java/com/my/graphiteDigesterBg/task/TaskStartReset.java

@ -29,9 +29,6 @@ public class TaskStartReset extends DiTaskBase {
liquidMotor.reset(); liquidMotor.reset();
liquidMotor.moveTo("LiquidArmStandby"); liquidMotor.moveTo("LiquidArmStandby");
// @TODO : 加热盘卡位初始化
LOG.error("@TODO : 加热盘卡位初始化");
// @TODO: 这里要先手动移动到一个安全位置 // @TODO: 这里要先手动移动到一个安全位置
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class);
transUdMotor.setEnable(true); transUdMotor.setEnable(true);
@ -44,6 +41,14 @@ public class TaskStartReset extends DiTaskBase {
transLrMotor.reset(); transLrMotor.reset();
transLrMotor.moveTo("TransLrMotorStandby"); transLrMotor.moveTo("TransLrMotorStandby");
// 初始化加热盘盖舵机
for ( int i=0; i<5; i++ ) {
String key = "HeatingPlateMotorSlotCover_" + i;
DiActServo heatSlotCoverServo = this.getActuator(key, DiActServo.class);
heatSlotCoverServo.setEnable(true);
heatSlotCoverServo.moveTo("HeatPlateSlotCoverClose", i);
}
// 加液转盘 // 加液转盘
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class);
liquidPlateMotor.setEnable(true); liquidPlateMotor.setEnable(true);

21
src/src/main/java/com/my/graphiteDigesterBg/task/TaskTubeMoveToErrorSlot.java

@ -1,13 +1,12 @@
package com.my.graphiteDigesterBg.task; package com.my.graphiteDigesterBg.task;
import com.my.graphiteDigesterBg.diframe.DiTaskBase; import com.my.graphiteDigesterBg.diframe.DiTaskBase;
import com.my.graphiteDigesterBg.diframe.Task; import com.my.graphiteDigesterBg.diframe.Task;
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromLiquidPlateToHeatPlate;
import com.my.graphiteDigesterBg.move.MoveTubeToErrorRackSlot; import com.my.graphiteDigesterBg.move.MoveTubeToErrorRackSlot;
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager;
import java.util.List; import java.util.List;
@Task(name="TubeMoveToErrorSlot") @Task(name="TubeMoveToErrorSlot")
public class TaskTubeMoveToErrorSlot extends DiTaskBase { public class TaskTubeMoveToErrorSlot extends DiTaskBase {
// slot index
public Integer slotIndex;
// tube index list // tube index list
private List<Integer> tubeIndexList; private List<Integer> tubeIndexList;
@ -17,6 +16,22 @@ public class TaskTubeMoveToErrorSlot extends DiTaskBase {
var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); var slotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class);
var errorSlot = slotMan.getErrorSlot(); var errorSlot = slotMan.getErrorSlot();
var emptyTubeIndexList = errorSlot.allocEmptyTubeIndexes(this.tubeIndexList.size()); var emptyTubeIndexList = errorSlot.allocEmptyTubeIndexes(this.tubeIndexList.size());
Integer slotIndex = null;
for ( var slot : slotMan.getSlots() ) {
if ( "LIQUID_PLATE".equals(slot.rackPosition) ) {
slotIndex = slot.index;
break;
}
}
if ( slotIndex == null ) {
throw new RuntimeException("liquid plate slot not found");
}
// move tube rack from liquid plate to heat plate
var move = new MoveMoveTubeRackFromLiquidPlateToHeatPlate();
move.setDevice(this.getDevice());
move.slotIndex = slotIndex;
move.run();
for ( int i=0; i<this.tubeIndexList.size(); i++ ) { for ( int i=0; i<this.tubeIndexList.size(); i++ ) {
var tubeIndex = this.tubeIndexList.get(i); var tubeIndex = this.tubeIndexList.get(i);
@ -24,7 +39,7 @@ public class TaskTubeMoveToErrorSlot extends DiTaskBase {
var moveTubeToErrorRackSlot = new MoveTubeToErrorRackSlot(); var moveTubeToErrorRackSlot = new MoveTubeToErrorRackSlot();
moveTubeToErrorRackSlot.setDevice(this.getDevice()); moveTubeToErrorRackSlot.setDevice(this.getDevice());
moveTubeToErrorRackSlot.srcSlotIndex = this.slotIndex;
moveTubeToErrorRackSlot.srcSlotIndex = slotIndex;
moveTubeToErrorRackSlot.srcTubeIndex = tubeIndex; moveTubeToErrorRackSlot.srcTubeIndex = tubeIndex;
moveTubeToErrorRackSlot.errorTubeIndex = emptyTubeIndex; moveTubeToErrorRackSlot.errorTubeIndex = emptyTubeIndex;
moveTubeToErrorRackSlot.run(); moveTubeToErrorRackSlot.run();

2
src/src/main/resources/application.yml

@ -6,4 +6,4 @@ spring:
encoding: utf-8 encoding: utf-8
app : app :
errorSlotIndex : 4
errorSlotIndex : 1

59
src/src/main/resources/device.yml

@ -3,9 +3,9 @@ connection :
path : COM3 path : COM3
baudRate : 921600 baudRate : 921600
frameTimeout : 100 frameTimeout : 100
callTimeout : 5000
callTimeout : 1000
mode : binary # text | hex | binary mode : binary # text | hex | binary
commandLogEnable : true
commandLogEnable : false
# class : com.my.graphiteDigesterBg.diframe.connection.DiConWebsocket # class : com.my.graphiteDigesterBg.diframe.connection.DiConWebsocket
# uri : ws://127.0.0.1:8899/device # uri : ws://127.0.0.1:8899/device
# mode : hex # mode : hex
@ -73,7 +73,7 @@ actuators :
defaultVelocity : 300 defaultVelocity : 300
defaultAcc : 100 defaultAcc : 100
defaultDec : 100 defaultDec : 100
runToZeroSpeed : 50
runToZeroSpeed : 100
runToZeroDec : 100 runToZeroDec : 100
lookZeroEdgeSpeed : 25 lookZeroEdgeSpeed : 25
lookZeroEdgeDec : 100 lookZeroEdgeDec : 100
@ -345,16 +345,53 @@ actuators :
stepMotorIHold: 0 stepMotorIHold: 0
stepMotorIRun: 4 stepMotorIRun: 4
- name: 加热盘试管架盖舵机 - 0
key: HeatingPlateMotorSlotCover_0
mid: 83
type: Servo
defaultVelocity: 200
defaultTorque: 300
- name: 加热盘试管架盖舵机 - 1
key: HeatingPlateMotorSlotCover_1
mid: 82
type: Servo
defaultVelocity: 200
defaultTorque: 300
- name: 加热盘试管架盖舵机 - 2
key: HeatingPlateMotorSlotCover_2
mid: 81
type: Servo
defaultVelocity: 200
defaultTorque: 300
- name: 加热盘试管架盖舵机 - 3
key: HeatingPlateMotorSlotCover_3
mid: 85
type: Servo
defaultVelocity: 200
defaultTorque: 300
- name: 加热盘试管架盖舵机 - 4
key: HeatingPlateMotorSlotCover_4
mid: 84
type: Servo
defaultVelocity: 200
defaultTorque: 300
# device io # device io
io : io :
- {key: "AcidLiquidLevelSensor0", mid: 70, index: 0}
- {key: "AcidLiquidLevelSensor1", mid: 70, index: 1}
- {key: "AcidLiquidLevelSensor2", mid: 70, index: 2}
- {key: "AcidLiquidLevelSensor3", mid: 70, index: 3}
- {key: "AcidLiquidLevelSensor4", mid: 70, index: 4}
- {key: "AcidLiquidLevelSensor5", mid: 70, index: 5}
- {key: "AcidLiquidLevelSensor6", mid: 70, index: 6}
- {key: "AcidLiquidLevelSensor7", mid: 70, index: 7}
- {key: "AcidLiquidLevelSensor0", mid: 70, index: 0, type : "output"}
- {key: "AcidLiquidLevelSensor1", mid: 70, index: 1, type : "output"}
- {key: "AcidLiquidLevelSensor2", mid: 70, index: 2, type : "output"}
- {key: "AcidLiquidLevelSensor3", mid: 70, index: 3, type : "output"}
- {key: "AcidLiquidLevelSensor4", mid: 70, index: 4, type : "output"}
- {key: "AcidLiquidLevelSensor5", mid: 70, index: 5, type : "output"}
- {key: "AcidLiquidLevelSensor6", mid: 70, index: 6, type : "output"}
- {key: "AcidLiquidLevelSensor7", mid: 70, index: 7, type : "output"}
- {key: "HeatPlateSlotHeater0", mid: 70, index: 2, type : "input"}
- {key: "Condenser", mid: 70, index: 5, type : "input"}
# device registers # device registers
registers : registers :

2
src/web/src/pages/main/contents/Operation.vue

@ -40,6 +40,7 @@
<a-button @click="actionPresetSetup"><SettingOutlined /></a-button> <a-button @click="actionPresetSetup"><SettingOutlined /></a-button>
<a-button class="ml-1" @click="actionAcidAdd"><ExperimentOutlined /></a-button> <a-button class="ml-1" @click="actionAcidAdd"><ExperimentOutlined /></a-button>
<a-button class="ml-1" @click="actionHeating"><FireOutlined /></a-button> <a-button class="ml-1" @click="actionHeating"><FireOutlined /></a-button>
<operation-sample-take-shot />
</a-col> </a-col>
<a-col :span="11" class="text-right"> <a-col :span="11" class="text-right">
<operation-sample-add /> <operation-sample-add />
@ -181,6 +182,7 @@ import { onMounted, ref, onUnmounted } from 'vue';
import ApiClient from '@/utils/ApiClient.js'; import ApiClient from '@/utils/ApiClient.js';
import OperationCamera from './OperationCamera.vue'; import OperationCamera from './OperationCamera.vue';
import OperationSampleAdd from './OperationSampleAdd.vue'; import OperationSampleAdd from './OperationSampleAdd.vue';
import OperationSampleTakeShot from './OperationSampleTakeShot.vue';
/** @var {Object} */ /** @var {Object} */
const sampleTakeout = ref({enable:false,slotIndex:0}); const sampleTakeout = ref({enable:false,slotIndex:0});
/** @var {Object} */ /** @var {Object} */

6
src/web/src/pages/main/contents/OperationCamera.vue

@ -10,6 +10,7 @@
<div class="mt-3 flex flex-row justify-between"> <div class="mt-3 flex flex-row justify-between">
<div> <div>
<a-button @click="actionTakeShot"><CameraOutlined /></a-button> <a-button @click="actionTakeShot"><CameraOutlined /></a-button>
<a-button class="ml-1" @click="actionTakeShotCancel"><EyeInvisibleOutlined /></a-button>
</div> </div>
<div> <div>
<a-button @click="actionDoorOpen"><SplitCellsOutlined /></a-button> <a-button @click="actionDoorOpen"><SplitCellsOutlined /></a-button>
@ -112,6 +113,11 @@ async function actionTubeMoveToErrorSlot() {
tubeIndexList: errorTubes.value tubeIndexList: errorTubes.value
}); });
} }
//
async function actionTakeShotCancel() {
await client.taskAppend('SampleMoveToHeatPlate');
}
</script> </script>
<style> <style>
.camera {background: linear-gradient(180deg, rgba(5, 10, 39, 0.5) 0%, rgba(4, 10, 52, 0.5) 97%);backdrop-filter: blur(194px);} .camera {background: linear-gradient(180deg, rgba(5, 10, 39, 0.5) 0%, rgba(4, 10, 52, 0.5) 97%);backdrop-filter: blur(194px);}

45
src/web/src/pages/main/contents/OperationSampleTakeShot.vue

@ -0,0 +1,45 @@
<template>
<a-button class="ml-1" @click="actionSampleTakeShot"><eye-outlined /></a-button>
<!-- 取出位置弹框 -->
<a-modal v-if="enable" v-model:open="enable" title="观察样本" @ok="actionOk" @cancel="actionCancel" ok-text="确认" cancel-text="取消">
<a-form :label-col="{span:4}" :wrapper-col="{span:20}" label-align="left" class="py-5">
<a-form-item label="位置">
<a-radio-group v-model:value="slotIndex" button-style="solid">
<a-radio-button value="0">A-1</a-radio-button>
<a-radio-button value="1">A-2</a-radio-button>
<a-radio-button value="2">A-3</a-radio-button>
<a-radio-button value="3">A-4</a-radio-button>
<a-radio-button value="4">A-5</a-radio-button>
</a-radio-group>
</a-form-item>
</a-form>
</a-modal>
</template>
<script setup>
import ApiClient from '@/utils/ApiClient';
import { ref } from 'vue';
/** @var {Boolean} */
const enable = ref(false);
/** @var {Number} */
const slotIndex = ref(0);
//
function actionSampleTakeShot() {
enable.value = true;
}
//
async function actionOk() {
enable.value = false;
let client = ApiClient.getClient();
await client.taskAppend('SampleMoveToLiquidPlate',{
slotIndex : slotIndex.value * 1,
});
}
//
function actionCancel() {
enable.value = false;
}
</script>
Loading…
Cancel
Save