|
|
@ -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() |
|
|
|
); |
|
|
|