From 08a11de9c0f81e43576df2a0ea2c2df512fa49cb Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 22 Jul 2024 12:59:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4ModId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/a8k/a8k_can_protocol/ModId.java | 94 ------------------- src/main/java/a8k/appbean/HardwareException.java | 1 - .../java/a8k/controller/TmpTestController.java | 7 +- .../hardware/MotorTubeRackMoveCtrlService.java | 52 +++++------ .../SamplesPreProcessModuleCtrlService.java | 102 ++++++++++----------- 5 files changed, 80 insertions(+), 176 deletions(-) delete mode 100644 src/main/java/a8k/a8k_can_protocol/ModId.java diff --git a/src/main/java/a8k/a8k_can_protocol/ModId.java b/src/main/java/a8k/a8k_can_protocol/ModId.java deleted file mode 100644 index 5910fb0..0000000 --- a/src/main/java/a8k/a8k_can_protocol/ModId.java +++ /dev/null @@ -1,94 +0,0 @@ -package a8k.a8k_can_protocol; - -public class ModId { - - - public static final int HbotBoard = 10;//机械臂板模块 - public static final int HbotM = 11;//机械臂XY - - public static final int PlatesBoxBoard = 20;//板夹仓模块 - public static final int PlatesBoxYM = 21;//板夹仓移动电机 - public static final int PlatesBoxPusherM = 22;//板夹仓推杆电机 - public static final int PlatesBoxScanner = 23;//板夹仓扫码模组 - - public static final int ShakeModBoard = 30;//摇匀模组板 - public static final int ShakeModClampingM = 31;//试管固定夹爪电机 - public static final int ShakeModGripperZM = 32;//摇匀升降电机 - public static final int ShakeModShakeM = 33;//试管摇匀电机 - public static final int ShakeModGripperYM = 34;//摇匀前后电机 - public static final int ShakeModGripperSV = 35;//摇匀试管帽夹爪 - public static final int ShakeModTubeScanerClampingSV = 36;//试管架旋转固定舵机 - public static final int ShakeModTubeScanerRotateSV = 37;//试管架旋转舵机 - - public static final int PlatesBoxTCMBoard = 40;//反应板夹温度控制板 - public static final int PlatesBoxTCM = 41;//反应板夹温度控制模块 - public static final int WbTubeFanMod = 42;//气溶胶风扇 - - public static final int IncubatorTCMBoard = 50;//温度控制 - public static final int IncubatorTCM = 51;//温度控制 - - public static final int FeedingModBoard = 60;//出入料模块 - public static final int FeedingModInfeedM = 61;//入料电机 - public static final int FeedingModXM = 62;//试管架平移电机 - public static final int FeedingModOutfeedM = 63;//出料电机 - public static final int FeedingModScannerMod = 64;//试管架扫码器 - - public static final int IncubatorRotateBoard = 70;//孵育盘旋转板 - public static final int IncubatorRotateCtrlM = 71;//孵育盘旋转 - - public static final int PipetteModBoard = 80;//机械臂Z轴板 - public static final int PipetteModZM = 81;//机械臂Z - public static final int PipetteMod = 82;//移液枪 - public static final int PipetteModCodeScanner = 83;//物料扫码器 - - public static final int OptModBoard = 90;//光学模组板 - public static final int OptModScannerM = 91;//板卡扫描电机 - public static final int OptModPullM = 92;//板卡推杆电机 - public static final int OptMod = 93;//扫描仪 - - public static final int A8kIdCardReaderBoard = 100; //A8K读卡器板 - public static final int A8kIdCardReader = 101; //A8K读卡器 - - - public static String ModuleId2Name(int moduleId) { - return switch (moduleId) { - case HbotBoard -> "HbotBoard"; - case HbotM -> "HbotM"; - case PlatesBoxBoard -> "PlatesBoxBoard"; - case PlatesBoxYM -> "PlatesBoxYM"; - case PlatesBoxPusherM -> "PlatesBoxPusherM"; - case PlatesBoxScanner -> "PlatesBoxScanner"; - case ShakeModBoard -> "ShakeModBoard"; - case ShakeModClampingM -> "ShakeModClampingM"; - case ShakeModGripperZM -> "ShakeModGripperZM"; - case ShakeModShakeM -> "ShakeModShakeM"; - case ShakeModGripperYM -> "ShakeModGripperYM"; - case ShakeModGripperSV -> "ShakeModGripperSV"; - case ShakeModTubeScanerClampingSV -> "ShakeModTubeScanerClampingSV"; - case ShakeModTubeScanerRotateSV -> "ShakeModTubeScanerRotateSV"; - case PlatesBoxTCMBoard -> "PlatesBoxTCMBoard"; - case PlatesBoxTCM -> "PlatesBoxTCM"; - case WbTubeFanMod -> "WbTubeFanMod"; - case IncubatorTCMBoard -> "IncubatorTCMBoard"; - case IncubatorTCM -> "IncubatorTCM"; - case FeedingModBoard -> "FeedingModBoard"; - case FeedingModInfeedM -> "FeedingModInfeedM"; - case FeedingModXM -> "FeedingModXM"; - case FeedingModOutfeedM -> "FeedingModOutfeedM"; - case FeedingModScannerMod -> "FeedingModScannerMod"; - case IncubatorRotateBoard -> "IncubatorRotateBoard"; - case IncubatorRotateCtrlM -> "IncubatorRotateCtrlM"; - case PipetteModBoard -> "PipetteModBoard"; - case PipetteModZM -> "PipetteModZM"; - case PipetteMod -> "PipetteMod"; - case PipetteModCodeScanner -> "PipetteModCodeScanner"; - case OptModBoard -> "OptModBoard"; - case OptModScannerM -> "OptModScannerM"; - case OptModPullM -> "OptModPullM"; - case OptMod -> "OptMod"; - case A8kIdCardReaderBoard -> "A8kIdCardReaderBoard"; - case A8kIdCardReader -> "A8kIdCardReader"; - default -> "UnknownModuleId(" + moduleId + ")"; - }; - } -} diff --git a/src/main/java/a8k/appbean/HardwareException.java b/src/main/java/a8k/appbean/HardwareException.java index 132d204..6013f16 100644 --- a/src/main/java/a8k/appbean/HardwareException.java +++ b/src/main/java/a8k/appbean/HardwareException.java @@ -2,7 +2,6 @@ package a8k.appbean; import a8k.a8k_can_protocol.A8kEcode; import a8k.a8k_can_protocol.MId; -import a8k.a8k_can_protocol.ModId; public class HardwareException extends Exception { // 构造函数 diff --git a/src/main/java/a8k/controller/TmpTestController.java b/src/main/java/a8k/controller/TmpTestController.java index d787531..74fbfdf 100644 --- a/src/main/java/a8k/controller/TmpTestController.java +++ b/src/main/java/a8k/controller/TmpTestController.java @@ -1,7 +1,7 @@ package a8k.controller; import a8k.a8k_can_protocol.CmdId; -import a8k.a8k_can_protocol.ModId; +import a8k.a8k_can_protocol.MId; import a8k.appbean.HardwareException; import a8k.appbean.ecode.AppEcode; import a8k.base_hardware.A8kCanBusService; @@ -58,9 +58,8 @@ public class TmpTestController { @GetMapping("/tmp-test/a8k-can-bus-service-call") @ResponseBody public String a8kCanBusServiceCall() throws HardwareException, InterruptedException { - - this.a8kCanBusService.callcmd(ModId.ShakeModTubeScanerRotateSV, CmdId.mini_servo_enable.toInt(), new Integer[]{1}); - this.a8kCanBusService.callblockcmd(ModId.FeedingModInfeedM, CmdId.step_motor_easy_move_by.toInt(), new Integer[]{5000}, 20000); + this.a8kCanBusService.callcmd(MId.ShakeModTubeScanerRotateSV.toInt(), CmdId.mini_servo_enable.toInt(), new Integer[]{1}); + this.a8kCanBusService.callblockcmd(MId.FeedingModInfeedM.toInt(), CmdId.step_motor_easy_move_by.toInt(), new Integer[]{5000}, 20000); return "OK"; } diff --git a/src/main/java/a8k/service/hardware/MotorTubeRackMoveCtrlService.java b/src/main/java/a8k/service/hardware/MotorTubeRackMoveCtrlService.java index 654d81c..05d2289 100644 --- a/src/main/java/a8k/service/hardware/MotorTubeRackMoveCtrlService.java +++ b/src/main/java/a8k/service/hardware/MotorTubeRackMoveCtrlService.java @@ -47,17 +47,17 @@ public class MotorTubeRackMoveCtrlService { public void setEnable( Boolean enable ) throws HardwareException { this.a8kCanBusService.callcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_enable.toInt(), enable ? 1 : 0 ); this.a8kCanBusService.callcmd( - ModId.FeedingModInfeedM, + MId.FeedingModInfeedM.toInt(), CmdId.step_motor_enable.toInt(), enable ? 1 : 0 ); this.a8kCanBusService.callcmd( - ModId.FeedingModOutfeedM, + MId.FeedingModOutfeedM.toInt(), CmdId.step_motor_enable.toInt(), enable ? 1 : 0 ); @@ -65,17 +65,17 @@ public class MotorTubeRackMoveCtrlService { public void stop() throws HardwareException { this.a8kCanBusService.callcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_stop.toInt(), 1 ); this.a8kCanBusService.callcmd( - ModId.FeedingModInfeedM, + MId.FeedingModInfeedM.toInt(), CmdId.step_motor_stop.toInt(), 1 ); this.a8kCanBusService.callcmd( - ModId.FeedingModOutfeedM, + MId.FeedingModOutfeedM.toInt(), CmdId.step_motor_stop.toInt(), 1 ); @@ -89,7 +89,7 @@ public class MotorTubeRackMoveCtrlService { public void moveToZeroWhenDeviceSetup() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); @@ -98,15 +98,15 @@ public class MotorTubeRackMoveCtrlService { public void moveToZero() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; - var beforePosResponse = this.a8kCanBusService.callcmd(ModId.FeedingModXM, CmdId.step_motor_read_pos.toInt()); + var beforePosResponse = this.a8kCanBusService.callcmd(MId.FeedingModXM.toInt(), CmdId.step_motor_read_pos.toInt()); var beforePos = beforePosResponse.getContentI32(0); - this.a8kCanBusService.callblockcmd(ModId.FeedingModXM, CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime()); - var afterPosResponse = this.a8kCanBusService.callcmd(ModId.FeedingModXM, CmdId.step_motor_read_pos.toInt()); + this.a8kCanBusService.callblockcmd(MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime()); + var afterPosResponse = this.a8kCanBusService.callcmd(MId.FeedingModXM.toInt(), CmdId.step_motor_read_pos.toInt()); var afterPos = afterPosResponse.getContentI32(0); var distance = beforePos - afterPos; - var dval = a8kCanBusService.module_read_reg(ModId.FeedingModXM, RegIndex.kreg_step_motor_dpos); + var dval = a8kCanBusService.module_read_reg(MId.FeedingModXM.toInt(), RegIndex.kreg_step_motor_dpos); if (Math.abs(dval - distance) > params.getHorizontalMotorLostStepThresholdVal() ) { throw new HardwareException(MId.FeedingModXM, A8kEcode.MotorLostStep); @@ -133,7 +133,7 @@ public class MotorTubeRackMoveCtrlService { public void moveTubeRackToEnterPos() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getTubeRackEnterPos(), params.getActionOvertime() @@ -146,7 +146,7 @@ public class MotorTubeRackMoveCtrlService { public void moveTubeRackToExitPos() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getTubeRackExitPos(), params.getActionOvertime() @@ -159,7 +159,7 @@ public class MotorTubeRackMoveCtrlService { public void moveTubeRackToScanPos() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getTubeRackScanCodePos(), params.getActionOvertime() @@ -171,10 +171,10 @@ public class MotorTubeRackMoveCtrlService { */ public String moveTubeRackToScanPosAndScan() throws HardwareException, InterruptedException { this.moveTubeRackToScanPos(); - this.a8kCanBusService.callcmd(ModId.FeedingModScannerMod, CmdId.code_scaner_start_scan.toInt()); + this.a8kCanBusService.callcmd(MId.FeedingModScannerMod.toInt(), CmdId.code_scaner_start_scan.toInt()); Thread.sleep(5000); - var response = this.a8kCanBusService.callcmd(ModId.FeedingModScannerMod, CmdId.code_scaner_read_scaner_result.toInt()); - this.a8kCanBusService.callcmd(ModId.FeedingModScannerMod, CmdId.code_scaner_stop_scan.toInt()); + var response = this.a8kCanBusService.callcmd(MId.FeedingModScannerMod.toInt(), CmdId.code_scaner_read_scaner_result.toInt()); + this.a8kCanBusService.callcmd(MId.FeedingModScannerMod.toInt(), CmdId.code_scaner_stop_scan.toInt()); var contentBytes = response.getCmdContent(); return new String(contentBytes); } @@ -193,7 +193,7 @@ public class MotorTubeRackMoveCtrlService { var params = this.serviceParameterDao; var scanPos = params.getTubeScanPos() + tubeIndex * params.getTubeSpacing(); this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), scanPos, params.getActionOvertime() @@ -208,10 +208,10 @@ public class MotorTubeRackMoveCtrlService { public String moveTubeToScanPosAndScan(String tubeType, Integer tubeIndex) throws HardwareException, InterruptedException { this.moveTubeToScanPos(tubeType, tubeIndex); - this.a8kCanBusService.callcmd(ModId.FeedingModScannerMod, CmdId.code_scaner_start_scan.toInt()); + this.a8kCanBusService.callcmd(MId.FeedingModScannerMod.toInt(), CmdId.code_scaner_start_scan.toInt()); Thread.sleep(5000); - var response = this.a8kCanBusService.callcmd(ModId.FeedingModScannerMod, CmdId.code_scaner_read_scaner_result.toInt()); - this.a8kCanBusService.callcmd(ModId.FeedingModScannerMod, CmdId.code_scaner_stop_scan.toInt()); + var response = this.a8kCanBusService.callcmd(MId.FeedingModScannerMod.toInt(), CmdId.code_scaner_read_scaner_result.toInt()); + this.a8kCanBusService.callcmd(MId.FeedingModScannerMod.toInt(), CmdId.code_scaner_stop_scan.toInt()); var contentBytes = response.getCmdContent(); return new String(contentBytes); } @@ -225,7 +225,7 @@ public class MotorTubeRackMoveCtrlService { var params = this.serviceParameterDao; var detectPos = params.getTubeHeighJudgmentPos() + tubeIndex * params.getTubeSpacing(); this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), detectPos, params.getActionOvertime() @@ -241,7 +241,7 @@ public class MotorTubeRackMoveCtrlService { var params = this.serviceParameterDao; var pos = params.getTubePreProcessPos() + tubeIndex * params.getTubeSpacing(); this.a8kCanBusService.callblockcmd( - ModId.FeedingModXM, + MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), pos, params.getActionOvertime() @@ -260,7 +260,7 @@ public class MotorTubeRackMoveCtrlService { public void moveTubeToExistJudgmentPos(String tubeType, Integer tubeIndex) throws HardwareException, InterruptedException { var params = this.serviceParameterDao; var pos = params.getTubeRackExitPos() + tubeIndex * params.getTubeSpacing(); - this.a8kCanBusService.callblockcmd(ModId.FeedingModXM, CmdId.step_motor_easy_move_to.toInt(), new Integer[]{pos}, params.getActionOvertime()); + this.a8kCanBusService.callblockcmd(MId.FeedingModXM.toInt(), CmdId.step_motor_easy_move_to.toInt(), new Integer[]{pos}, params.getActionOvertime()); } public boolean isTubeRackInEnterPos() throws HardwareException { @@ -292,7 +292,7 @@ public class MotorTubeRackMoveCtrlService { public void scanClampModuleCompress() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; this.a8kCanBusService.callblockcmd( - ModId.ShakeModTubeScanerClampingSV, + MId.ShakeModTubeScanerClampingSV.toInt(), CmdId.mini_servo_move_to.toInt(), new Integer[]{params.getScanCodeClampPos()}, params.getActionOvertime() @@ -305,7 +305,7 @@ public class MotorTubeRackMoveCtrlService { public void scanClampModuleReset() throws HardwareException, InterruptedException { var params = this.serviceParameterDao; this.a8kCanBusService.callblockcmd( - ModId.ShakeModTubeScanerClampingSV, + MId.ShakeModTubeScanerClampingSV.toInt(), CmdId.mini_servo_move_to.toInt(), new Integer[]{params.getScanCodeReleasePos()}, params.getActionOvertime() diff --git a/src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java b/src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java index 29ac754..340dcd6 100644 --- a/src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java +++ b/src/main/java/a8k/service/hardware/SamplesPreProcessModuleCtrlService.java @@ -2,7 +2,7 @@ package a8k.service.hardware; import a8k.a8k_can_protocol.CmdId; import a8k.a8k_can_protocol.A8kEcode; -import a8k.a8k_can_protocol.ModId; +import a8k.a8k_can_protocol.MId; import a8k.appbean.A8kTubeType; import a8k.appbean.HardwareException; import a8k.base_hardware.A8kCanBusService; @@ -35,33 +35,33 @@ public class SamplesPreProcessModuleCtrlService { public void moveToZero() throws HardwareException, InterruptedException { var params = this.samplesPreProcessModuleCtrlParamsService; this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_move_to.toInt(), params.getGripperServo_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.mini_servo_move_to.toInt(), params.getHorizontalMotor_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModShakeM, + MId.ShakeModShakeM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); @@ -78,27 +78,27 @@ public class SamplesPreProcessModuleCtrlService { */ public void enableModule(Boolean enable) throws HardwareException { this.a8kCanBusService.callcmd( - ModId.ShakeModShakeM, + MId.ShakeModShakeM.toInt(), CmdId.step_motor_enable.toInt(), enable ? 1 : 0 ); this.a8kCanBusService.callcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.step_motor_enable.toInt(), enable ? 1 : 0 ); this.a8kCanBusService.callcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.step_motor_enable.toInt(), enable ? 1 : 0 ); this.a8kCanBusService.callcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.mini_servo_enable.toInt(), enable ? 1 : 0 ); this.a8kCanBusService.callcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_enable.toInt(), enable ? 1 : 0 ); @@ -122,7 +122,7 @@ public class SamplesPreProcessModuleCtrlService { public A8kEcode takeTube(String tubeType,boolean judgeCapExist) throws HardwareException, InterruptedException { var params = this.samplesPreProcessModuleCtrlParamsService; this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getHorizontalMotor_takeCapPos(), params.getActionOvertime() @@ -134,7 +134,7 @@ public class SamplesPreProcessModuleCtrlService { motorUdTubeTaskPos = params.getZMotor_HighBloodTakeCapHeight(); } this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), motorUdTubeTaskPos, params.getActionOvertime() @@ -142,17 +142,17 @@ public class SamplesPreProcessModuleCtrlService { if ( judgeCapExist ) { this.a8kCanBusService.callblockcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.mini_servo_rotate_with_torque.toInt(), params.getGripperServo_takeCapTorque(), params.getActionOvertime() ); this.a8kCanBusService.callcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_stop.toInt() ); var pos = this.a8kCanBusService.callcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_read_pos.toInt() ); if ( pos.getContentI32(0) > params.getGripperServo_hatDeterminesPosThres() ) { @@ -161,49 +161,49 @@ public class SamplesPreProcessModuleCtrlService { } this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_rotate_with_torque.toInt(), params.getGripperServo_takeCapTorque(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.mini_servo_move_to.toInt(), params.getHorizontalMotor_takePushCapPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getZMotor_placeShakeHeight(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getGripperServo_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getHorizontalMotor_standbyPos(), params.getActionOvertime() @@ -227,14 +227,14 @@ public class SamplesPreProcessModuleCtrlService { public A8kEcode takeTubeCap( String tubeType ) throws HardwareException, InterruptedException { var params = this.samplesPreProcessModuleCtrlParamsService; this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getHorizontalMotor_takePushCapPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getGripperServo_standbyPos(), params.getActionOvertime() @@ -246,28 +246,28 @@ public class SamplesPreProcessModuleCtrlService { motorUdTakeCapPos = params.getZMotor_HighBloodTakeCapHeight(); } this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), motorUdTakeCapPos, params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getGripperServo_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getHorizontalMotor_standbyPos(), params.getActionOvertime() @@ -281,14 +281,14 @@ public class SamplesPreProcessModuleCtrlService { public void pushBackTubeCapAndTakeBakTube(String tubeType) throws HardwareException, InterruptedException { var params = this.samplesPreProcessModuleCtrlParamsService; this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getHorizontalMotor_takePushCapPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getGripperServo_standbyPos(), params.getActionOvertime() @@ -300,28 +300,28 @@ public class SamplesPreProcessModuleCtrlService { motorUdTakeCapPos = params.getZMotor_HighBloodTakeCapHeight(); } this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), motorUdTakeCapPos, params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getGripperServo_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.step_motor_easy_move_to.toInt(), params.getHorizontalMotor_standbyPos(), params.getActionOvertime() @@ -345,7 +345,7 @@ public class SamplesPreProcessModuleCtrlService { var startPos = standByPos - shakeDegree/2; var endPos = standByPos + shakeDegree/2; this.a8kCanBusService.callblockcmd( - ModId.ShakeModShakeM, + MId.ShakeModShakeM.toInt(), CmdId.step_motor_easy_reciprocating_motion.toInt(), startPos, endPos, @@ -359,14 +359,14 @@ public class SamplesPreProcessModuleCtrlService { */ public void openAerosolFan() throws HardwareException { var params = this.samplesPreProcessModuleCtrlParamsService; - this.a8kCanBusService.callcmd(ModId.WbTubeFanMod, CmdId.fan_controler_set_speed.toInt(), params.getAerosolFanLevel()); + this.a8kCanBusService.callcmd(MId.WbTubeFanMod.toInt(), CmdId.fan_controler_set_speed.toInt(), params.getAerosolFanLevel()); } /** * 关闭气溶胶风扇 */ public void closeAerosolFan() throws HardwareException { - this.a8kCanBusService.callcmd(ModId.WbTubeFanMod, CmdId.fan_controler_set_speed.toInt(), 0); + this.a8kCanBusService.callcmd(MId.WbTubeFanMod.toInt(), CmdId.fan_controler_set_speed.toInt(), 0); } /** @@ -375,28 +375,28 @@ public class SamplesPreProcessModuleCtrlService { public void moduleResetWhenPowerOn() throws HardwareException, InterruptedException { var params = this.samplesPreProcessModuleCtrlParamsService; this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_move_to.toInt(), params.getTubeClampMotor_standbyPos() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.mini_servo_move_to.toInt(), params.getHorizontalMotor_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModShakeM, + MId.ShakeModShakeM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); @@ -408,46 +408,46 @@ public class SamplesPreProcessModuleCtrlService { public void moduleRuntimeReset() throws HardwareException, InterruptedException { var params = this.samplesPreProcessModuleCtrlParamsService; this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperSV, + MId.ShakeModGripperSV.toInt(), CmdId.mini_servo_move_to.toInt(), params.getTubeClampMotor_standbyPos() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperZM, + MId.ShakeModGripperZM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModGripperYM, + MId.ShakeModGripperYM.toInt(), CmdId.mini_servo_move_to.toInt(), params.getHorizontalMotor_standbyPos(), params.getActionOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModClampingM, + MId.ShakeModClampingM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModShakeM, + MId.ShakeModShakeM.toInt(), CmdId.step_motor_easy_move_to.toInt(), 0, params.getMoveToZeroOvertime() ); this.a8kCanBusService.callblockcmd( - ModId.ShakeModShakeM, + MId.ShakeModShakeM.toInt(), CmdId.step_motor_easy_move_to_zero.toInt(), params.getMoveToZeroOvertime() );