Browse Source

update

tags/v0
zhaohe 1 year ago
parent
commit
b998c632c6
  1. 8
      src/main/java/a8k/service/devicectrl/ctrl/SamplesPreProcesCtrl.java
  2. 70
      src/main/java/a8k/service/devicectrl/testscript/TestScript.java
  3. 3
      src/main/java/a8k/service/hardware/canbus/A8kModParamInitializer.java
  4. 2
      src/main/java/a8k/service/hardware/canbus/protocol/A8kEcode.java
  5. BIN
      zhaohe_app.db

8
src/main/java/a8k/service/devicectrl/ctrl/SamplesPreProcesCtrl.java

@ -95,6 +95,11 @@ public class SamplesPreProcesCtrl {
canBus.stepMotorEnable(MId.ShakeModShakeM, 0); canBus.stepMotorEnable(MId.ShakeModShakeM, 0);
} }
@EnginnerPageAction(name = "夹紧试管", group = "辅助调试", order = ORDER.moduleDisable)
public void clampTube() throws HardwareException, InterruptedException {
canBus.stepMotorEasyMoveToBlock(MId.ShakeModClampingM, pp.getShakeClampingPos(), timep.getActionOvertime());
}
void tryClampTube() throws HardwareException, InterruptedException { void tryClampTube() throws HardwareException, InterruptedException {
canBus.miniServoMoveToBlock(MId.ShakeModGripperSV, pp.getGripperTakeCapPos() - 20, timep.getActionOvertime()); canBus.miniServoMoveToBlock(MId.ShakeModGripperSV, pp.getGripperTakeCapPos() - 20, timep.getActionOvertime());
@ -213,6 +218,7 @@ public class SamplesPreProcesCtrl {
//Z上移动到零位 //Z上移动到零位
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.ShakeModGripperZM, timep.getActionOvertime()); canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.ShakeModGripperZM, timep.getActionOvertime());
// tryClampTube(); // tryClampTube();
// canBus.miniServoMoveToBlock(MId.ShakeModGripperSV, pp.getGripperTakeCapPos()-30, timep.getActionOvertime());
//Y移动到待机位 //Y移动到待机位
@ -227,7 +233,7 @@ public class SamplesPreProcesCtrl {
//移动Y轴到取试管帽位置 //移动Y轴到取试管帽位置
canBus.miniServoMoveToBlock(MId.ShakeModGripperYSV, pp.getGripperShakeYPos(), timep.getActionOvertime()); canBus.miniServoMoveToBlock(MId.ShakeModGripperYSV, pp.getGripperShakeYPos(), timep.getActionOvertime());
//移动Z轴盖帽 //移动Z轴盖帽
canBus.stepMotorEasyMoveToBlock(MId.ShakeModGripperZM, pp.getGripperTakeCapZPos() + 10, timep.getActionOvertime());
canBus.stepMotorEasyMoveToBlock(MId.ShakeModGripperZM, pp.getGripperTakeCapZPos() + 20, timep.getActionOvertime());
//打开试管夹 //打开试管夹
canBus.stepMotorEasyMoveToBlock(MId.ShakeModClampingM, 70, timep.getActionOvertime()); canBus.stepMotorEasyMoveToBlock(MId.ShakeModClampingM, 70, timep.getActionOvertime());
//移动Z轴到零位 //移动Z轴到零位

70
src/main/java/a8k/service/devicectrl/testscript/TestScript.java

@ -8,6 +8,8 @@ import a8k.appbase.cfg.BottleGroupsPosInfo;
import a8k.appbase.cfg.BottlesPosInfo; import a8k.appbase.cfg.BottlesPosInfo;
import a8k.appbase.cfg.TipPickUpPosInfo; import a8k.appbase.cfg.TipPickUpPosInfo;
import a8k.controler.engineer.utils.*; import a8k.controler.engineer.utils.*;
import a8k.service.devicectrl.ctrl.SamplesPreProcesCtrl;
import a8k.service.devicectrl.ctrl.TubeRackMoveCtrl;
import a8k.service.hardware.canbus.A8kCanBusService; import a8k.service.hardware.canbus.A8kCanBusService;
import a8k.service.hardware.canbus.protocol.A8kEcode; import a8k.service.hardware.canbus.protocol.A8kEcode;
import a8k.service.hardware.canbus.protocol.MId; import a8k.service.hardware.canbus.protocol.MId;
@ -50,6 +52,13 @@ public class TestScript {
@Resource @Resource
ReactionPlatesTransmitCtrl reactionPlatesTransmitCtrl; ReactionPlatesTransmitCtrl reactionPlatesTransmitCtrl;
@Resource
SamplesPreProcesCtrl samplesPreProcesCtrl;
@Resource
TubeRackMoveCtrl tubeRackMoveCtrl;
EnginnerParamReader settingReader = new EnginnerParamReader(HbotControlService.class); EnginnerParamReader settingReader = new EnginnerParamReader(HbotControlService.class);
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -57,6 +66,13 @@ public class TestScript {
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Boolean testScriptWorkFlag = false; Boolean testScriptWorkFlag = false;
void checkTestScriptWorkFlag() throws HardwareException {
if (testScriptWorkFlag) {
testScriptWorkFlag = false;
throw new HardwareException(A8kEcode.TestScripIsRunning);
}
}
@EnginnerPageAction(name = "停止测试脚本", group = "控制") @EnginnerPageAction(name = "停止测试脚本", group = "控制")
public void testTakeAllTipStop() { public void testTakeAllTipStop() {
testScriptWorkFlag = false; testScriptWorkFlag = false;
@ -64,6 +80,8 @@ public class TestScript {
@EnginnerPageAction(name = "取放Tip-单步", group = "Hbot测试脚本") @EnginnerPageAction(name = "取放Tip-单步", group = "Hbot测试脚本")
public AppRet<Boolean> takeTipTestStep(Integer tipgroup, Integer index) throws HardwareException, InterruptedException { public AppRet<Boolean> takeTipTestStep(Integer tipgroup, Integer index) throws HardwareException, InterruptedException {
checkTestScriptWorkFlag();
testScriptWorkFlag = true;
var ret = hbotcs.takeTip(tipgroup, index); var ret = hbotcs.takeTip(tipgroup, index);
TipPickUpPosInfo tipPos = pp.getTipPickUpPosInfo(); TipPickUpPosInfo tipPos = pp.getTipPickUpPosInfo();
@ -75,13 +93,13 @@ public class TestScript {
} }
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime()); canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime());
testScriptWorkFlag = false;
return ret; return ret;
} }
@EnginnerPageAction(name = "取放Tip-全部", group = "Hbot测试脚本") @EnginnerPageAction(name = "取放Tip-全部", group = "Hbot测试脚本")
public AppRet<Map<String, String>> testTakeAllTip(Integer groupId, Integer startFrom) throws HardwareException, InterruptedException { public AppRet<Map<String, String>> testTakeAllTip(Integer groupId, Integer startFrom) throws HardwareException, InterruptedException {
// ObjectMapper mapper = new ObjectMapper();
checkTestScriptWorkFlag();
testScriptWorkFlag = true; testScriptWorkFlag = true;
Map<String, String> result = new HashMap<>(); Map<String, String> result = new HashMap<>();
@ -103,6 +121,8 @@ public class TestScript {
@EnginnerPageAction(name = "测试所有小瓶缓冲液位置", group = "Hbot测试脚本") @EnginnerPageAction(name = "测试所有小瓶缓冲液位置", group = "Hbot测试脚本")
public void testAllLittleBottleBufferPos(ConsumableGroup group) throws HardwareException, InterruptedException { public void testAllLittleBottleBufferPos(ConsumableGroup group) throws HardwareException, InterruptedException {
checkTestScriptWorkFlag();
testScriptWorkFlag = true; testScriptWorkFlag = true;
BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo(); BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo();
for (int i = 0; i < BottlesPosInfo.cgetMAX(); i++) { for (int i = 0; i < BottlesPosInfo.cgetMAX(); i++) {
@ -119,6 +139,8 @@ public class TestScript {
@EnginnerPageAction(name = "测试所有探测物质位置", group = "Hbot测试脚本") @EnginnerPageAction(name = "测试所有探测物质位置", group = "Hbot测试脚本")
public void testAllDetectMaterialPos(ConsumableGroup group) throws HardwareException, InterruptedException { public void testAllDetectMaterialPos(ConsumableGroup group) throws HardwareException, InterruptedException {
checkTestScriptWorkFlag();
testScriptWorkFlag = true; testScriptWorkFlag = true;
for (int i = 0; i < BottlesPosInfo.cgetMAX(); i++) { for (int i = 0; i < BottlesPosInfo.cgetMAX(); i++) {
BottleGroupsPosInfo pos = pp.getBottleBufferPosInfo(); BottleGroupsPosInfo pos = pp.getBottleBufferPosInfo();
@ -134,6 +156,8 @@ public class TestScript {
@EnginnerPageAction(name = "测试所有大瓶缓冲液位置", group = "Hbot测试脚本") @EnginnerPageAction(name = "测试所有大瓶缓冲液位置", group = "Hbot测试脚本")
public void testAllBigBottleBufferPos() throws HardwareException, InterruptedException { public void testAllBigBottleBufferPos() throws HardwareException, InterruptedException {
checkTestScriptWorkFlag();
testScriptWorkFlag = true; testScriptWorkFlag = true;
// 遍历枚举 ConsumableGroup // 遍历枚举 ConsumableGroup
for (ConsumableGroup group : ConsumableGroup.values()) { for (ConsumableGroup group : ConsumableGroup.values()) {
@ -149,6 +173,7 @@ public class TestScript {
@EnginnerPageAction(name = "推全部板同时丢弃", group = "板夹移动测试脚本") @EnginnerPageAction(name = "推全部板同时丢弃", group = "板夹移动测试脚本")
public void pushAllPlateAndDrop(ConsumableGroup PBCh, IncubatorPos startPos) throws HardwareException, InterruptedException { public void pushAllPlateAndDrop(ConsumableGroup PBCh, IncubatorPos startPos) throws HardwareException, InterruptedException {
checkTestScriptWorkFlag();
testScriptWorkFlag = true; testScriptWorkFlag = true;
reactionPlatesTransmitCtrl.checkBeforeMoveTrunable(); reactionPlatesTransmitCtrl.checkBeforeMoveTrunable();
reactionPlatesTransmitCtrl.checkBeforeMovePlateBox(); reactionPlatesTransmitCtrl.checkBeforeMovePlateBox();
@ -161,11 +186,50 @@ public class TestScript {
reactionPlatesTransmitCtrl.pushPlateQuick(PBCh, index); reactionPlatesTransmitCtrl.pushPlateQuick(PBCh, index);
reactionPlatesTransmitCtrl.pullPlate(index); reactionPlatesTransmitCtrl.pullPlate(index);
reactionPlatesTransmitCtrl.dropPlate(); reactionPlatesTransmitCtrl.dropPlate();
if (testScriptWorkFlag) {
if (!testScriptWorkFlag) {
break; break;
} }
} }
testScriptWorkFlag = false; testScriptWorkFlag = false;
} }
@EnginnerPageAction(name = "测试摇匀模组", group = "摇匀模组测试")
public AppRet<Object> testSamplePreProcessModule() throws HardwareException, InterruptedException {
checkTestScriptWorkFlag();
testScriptWorkFlag = true;
try {
tubeRackMoveCtrl.enterTubeHolder();
AppRet<String> scanResult = tubeRackMoveCtrl.moveTubeRackToScanPosAndScan();
if (!scanResult.isSuccess()) {
tubeRackMoveCtrl.ejectTubeHolder();
return AppRet.message("没有扫到试管架的码", null);
}
if (scanResult.getData().equals("1111\r")) {
tubeRackMoveCtrl.ejectTubeHolder();
return AppRet.message("不是全血试管架", null);
}
AppRet<Boolean> isExistTube = tubeRackMoveCtrl.judgeTubeExist(0);
AppRet<Boolean> isHighTube = tubeRackMoveCtrl.moveTubeToAltitJudgXPos(0);
if (!isExistTube.getData()) {
tubeRackMoveCtrl.ejectTubeHolder();
return AppRet.message("试管架上没有试管", null);
}
samplesPreProcesCtrl.takeTubeAndJudgeTubeExist(isHighTube.getData());
samplesPreProcesCtrl.shakeTube(50, 5);
samplesPreProcesCtrl.takeTubeCap();
samplesPreProcesCtrl.pushBackTubeCapAndTakeBakTube();
tubeRackMoveCtrl.ejectTubeHolder();
} finally {
testScriptWorkFlag = false;
}
return AppRet.message("测试完成", null);
}
} }

3
src/main/java/a8k/service/hardware/canbus/A8kModParamInitializer.java

@ -68,6 +68,9 @@ public class A8kModParamInitializer implements AppEventListener {
canBus.moduleSetReg(MId.PipetteModZM, RegIndex.kret_step_motor_io_trigger_append_distance, 10); canBus.moduleSetReg(MId.PipetteModZM, RegIndex.kret_step_motor_io_trigger_append_distance, 10);
canBus.moduleSetReg(MId.IncubatorRotateCtrlM, RegIndex.kret_step_motor_io_trigger_append_distance, 10); canBus.moduleSetReg(MId.IncubatorRotateCtrlM, RegIndex.kret_step_motor_io_trigger_append_distance, 10);
canBus.moduleSetReg(MId.ShakeModGripperYSV, RegIndex.kreg_mini_servo_limit_torque, 700);
// //
canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_run_to_zero_speed, 500); canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_run_to_zero_speed, 500);
canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_default_velocity, 2200); canBus.moduleSetReg(MId.OptModPullM, RegIndex.kreg_step_motor_default_velocity, 2200);

2
src/main/java/a8k/service/hardware/canbus/protocol/A8kEcode.java

@ -35,6 +35,8 @@ public enum A8kEcode {
ScanTimeout(30, "扫码超时"),// ScanTimeout(30, "扫码超时"),//
InfeedOvertimeFail(31, "入料超时"),// InfeedOvertimeFail(31, "入料超时"),//
OutfeedOvertimeFail(32, "出料超时"),// OutfeedOvertimeFail(32, "出料超时"),//
TestScripIsRunning(33, "测试脚本正在运行"),//
PasswdError(100, "密码错误"), // PasswdError(100, "密码错误"), //
UsrNotExitError(101, "用户不存在"), // UsrNotExitError(101, "用户不存在"), //

BIN
zhaohe_app.db

Loading…
Cancel
Save