9 changed files with 181 additions and 0 deletions
-
15src/pom.xml
-
4src/src/main/java/com/my/graphiteDigesterBg/diframe/DiActiveRecord.java
-
18src/src/main/java/com/my/graphiteDigesterBg/diframe/DiTaskMoveBase.java
-
7src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActPeristalticPump.java
-
9src/src/main/java/com/my/graphiteDigesterBg/diframe/mapper/DiActiveRecordMapper.java
-
5src/src/main/java/com/my/graphiteDigesterBg/diframe/model/MdbUser.java
-
13src/src/main/java/com/my/graphiteDigesterBg/move/MoveMoveTubeRackFromHeatPlateToLiquidPlate.java
-
103src/src/main/java/com/my/graphiteDigesterBg/task/TaskLiquidAdd.java
-
7src/src/main/resources/application.yml
@ -0,0 +1,4 @@ |
|||
package com.my.graphiteDigesterBg.diframe; |
|||
abstract public class DiActiveRecord { |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.my.graphiteDigesterBg.diframe; |
|||
abstract public class DiTaskMoveBase { |
|||
// device |
|||
private DiDevice device; |
|||
|
|||
// set device |
|||
public void setDevice(DiDevice device) { |
|||
this.device = device; |
|||
} |
|||
|
|||
// get device |
|||
public DiDevice getDevice() { |
|||
return this.device; |
|||
} |
|||
|
|||
// run |
|||
abstract public void run(); |
|||
} |
@ -0,0 +1,9 @@ |
|||
package com.my.graphiteDigesterBg.diframe.mapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Select; |
|||
import java.util.Map; |
|||
@Mapper |
|||
public interface DiActiveRecordMapper { |
|||
@Select("SELECT * FROM ${tableName} WHERE id = #{id}") |
|||
Map<String,Object> findById(String tableName, Integer id); |
|||
} |
@ -0,0 +1,5 @@ |
|||
package com.my.graphiteDigesterBg.diframe.model; |
|||
import com.my.graphiteDigesterBg.diframe.DiActiveRecord; |
|||
public class MdbUser extends DiActiveRecord { |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.my.graphiteDigesterBg.move; |
|||
import com.my.graphiteDigesterBg.diframe.DiDevice; |
|||
import com.my.graphiteDigesterBg.diframe.DiTaskMoveBase; |
|||
public class MoveMoveTubeRackFromHeatPlateToLiquidPlate extends DiTaskMoveBase { |
|||
// slot index |
|||
public Integer slotIndex; |
|||
|
|||
// execute |
|||
@Override |
|||
public void run() { |
|||
|
|||
} |
|||
} |
@ -0,0 +1,103 @@ |
|||
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.diframe.actuator.DiActMotor; |
|||
import com.my.graphiteDigesterBg.diframe.actuator.DiActPeristalticPump; |
|||
import com.my.graphiteDigesterBg.diframe.actuator.DiActServo; |
|||
import com.my.graphiteDigesterBg.move.MoveMoveTubeRackFromHeatPlateToLiquidPlate; |
|||
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlot; |
|||
import com.my.graphiteDigesterBg.resource.ResHeatingTubeRackSlotManager; |
|||
@Task(name="LiquidAdd") |
|||
public class TaskLiquidAdd extends DiTaskBase { |
|||
// slot index |
|||
public Integer slotIndex; |
|||
// liquid index |
|||
public Integer liquidIndex; |
|||
// liquid volume |
|||
public Integer liquidVolume; |
|||
// shake times |
|||
public Integer shakeTimes; |
|||
|
|||
@Override |
|||
public void run() { |
|||
ResHeatingTubeRackSlotManager heatingSlotMan = this.getResourceManager(ResHeatingTubeRackSlotManager.class); |
|||
ResHeatingTubeRackSlot slot = heatingSlotMan.getSlotByIndex(this.slotIndex); |
|||
|
|||
DiActMotor heatPlateMotor = this.getActuator(MyDevice.ACT_HEAT_PLATE_MOTOR, DiActMotor.class); |
|||
DiActMotor transLrMotor = this.getActuator(MyDevice.ACT_TRANSFER_LR_MOTOR, DiActMotor.class); |
|||
DiActMotor transUdMotor = this.getActuator(MyDevice.ACT_TRANSFER_UD_MOTOR, DiActMotor.class); |
|||
DiActServo transferClipServo = this.getActuator(MyDevice.ACT_TRANSFER_CLIP_SERVO, DiActServo.class); |
|||
DiActMotor liquidPlateMotor = this.getActuator(MyDevice.ACT_LIQUID_PLATE_MOTOR, DiActMotor.class); |
|||
DiActMotor liquidMotor = this.getActuator(MyDevice.ACT_LIQUID_MOTOR, DiActMotor.class); |
|||
|
|||
// move tube rack from heat plate to liquid plate |
|||
var moveTubeRackFromHeatPlateToLiquidPlate = new MoveMoveTubeRackFromHeatPlateToLiquidPlate(); |
|||
moveTubeRackFromHeatPlateToLiquidPlate.setDevice(this.getDevice()); |
|||
moveTubeRackFromHeatPlateToLiquidPlate.slotIndex = this.slotIndex; |
|||
moveTubeRackFromHeatPlateToLiquidPlate.run(); |
|||
|
|||
// // 加热盘转盘移动到取放架位置 |
|||
// heatPlateMotor.moveTo(8580); // @TODO : 这里要根据位置计算 ~~~ |
|||
// // 打开试管架盖 |
|||
// slot.coverOpen(); |
|||
// 搬运上升到顶部 |
|||
transUdMotor.moveTo(1300); |
|||
// // 搬运移动到加热取架位置 |
|||
// transLrMotor.moveTo(1620); |
|||
// // 搬运下降到取架位置 |
|||
// transUdMotor.moveTo(130); |
|||
// // 打开试管架夹爪 |
|||
// transferClipServo.moveTo(2670); |
|||
// // 搬运上升到顶部 |
|||
// transUdMotor.moveTo(1300); |
|||
// // 搬运移动到加液取放架位置 |
|||
// transLrMotor.moveTo(365); |
|||
// // 加液转盘移动到取放位置 |
|||
// liquidPlateMotor.moveTo(642); |
|||
// // 搬运下降到放架位置 |
|||
// transUdMotor.moveTo(540); |
|||
// // 关闭试管架夹爪 |
|||
// transferClipServo.moveTo(2073); |
|||
// // 搬运上升到顶部 |
|||
// transUdMotor.moveTo(1300); |
|||
// // 关闭试管架盖 |
|||
// slot.coverClose(); |
|||
// 搬运移动到就绪位置 |
|||
transLrMotor.moveTo(1000); |
|||
|
|||
String liquidPeristalticPumpKey = "liquidPeristalticPump_" + this.liquidIndex; |
|||
DiActPeristalticPump liquidPump = this.getActuator(liquidPeristalticPumpKey, DiActPeristalticPump.class); |
|||
|
|||
// 外圈试管加液 |
|||
// 加液机械臂移动到加液位置 |
|||
// liquidMotor.moveTo(1100); |
|||
// for ( int i=0; i<4; i++ ) { |
|||
// // 加液转盘移动到加液位置 |
|||
// liquidPlateMotor.moveTo(800 + 2500 * i); |
|||
// // 加液指定数量 |
|||
// liquidPump.pump(this.liquidVolume); |
|||
// } |
|||
// 内圈试管加液 |
|||
// 加液转盘移动到加液位置 |
|||
liquidPlateMotor.moveTo(800); |
|||
for ( int i=0; i<4; i++ ) { |
|||
// 加液转盘移动到加液位置 |
|||
liquidPlateMotor.moveTo(800 + 2500 * i); |
|||
// 加液指定数量 |
|||
liquidPump.pump(this.liquidVolume); |
|||
} |
|||
liquidMotor.moveTo(0); |
|||
|
|||
// 加液盘摇匀 |
|||
for ( int i=0; i<this.shakeTimes; i++ ) { |
|||
liquidPlateMotor.moveTo(200); |
|||
liquidPlateMotor.moveTo(0); |
|||
} |
|||
|
|||
// 加液完了再放回去 ~~~ |
|||
// @TODO : 放回去, 这里要直接用 Step 了 ~~~ |
|||
|
|||
this.setStatus(TaskStatus.FINISHED); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue