|
|
@ -3,11 +3,12 @@ package a8k.service.app.devicectrl.calibration; |
|
|
|
import a8k.extapi_controler.pagecontrol.ExtApiTabConfig; |
|
|
|
import a8k.extapi_controler.utils.ExtApiFn; |
|
|
|
import a8k.extapi_controler.utils.ExtApiTab; |
|
|
|
import a8k.service.app.devicectrl.exdriver.MiniServoExDriver; |
|
|
|
import a8k.service.app.devicectrl.driver.MiniServoDriver; |
|
|
|
import a8k.service.app.devicectrl.driver.StepMotorCtrlDriver; |
|
|
|
import a8k.service.app.devicectrl.driver.type.MiniServoMId; |
|
|
|
import a8k.service.app.devicectrl.driver.type.StepMotorMId; |
|
|
|
import a8k.service.app.devicectrl.ctrlservice.TubePreProcesCtrlService; |
|
|
|
import a8k.service.app.devicectrl.exdriver.MotorEnableExDriver; |
|
|
|
import a8k.service.app.devicectrl.param.TubePreProcesPosParamMgr; |
|
|
|
import a8k.type.exception.AppException; |
|
|
|
import jakarta.annotation.Resource; |
|
|
@ -23,19 +24,21 @@ public class TubePreProcesPosCalibration { |
|
|
|
TubePreProcesPosParamMgr posMgr; |
|
|
|
|
|
|
|
@Resource |
|
|
|
MiniServoExDriver miniServoExDriver; |
|
|
|
MiniServoDriver miniServoDriver; |
|
|
|
@Resource |
|
|
|
StepMotorCtrlDriver stepMotorCtrlDriver; |
|
|
|
@Resource |
|
|
|
TubePreProcesCtrlService controler; |
|
|
|
@Resource |
|
|
|
MotorEnableExDriver motorEnableExDriver; |
|
|
|
|
|
|
|
//基础工具 |
|
|
|
@ExtApiFn(name = "归零", group = "测试工具", order = 1) |
|
|
|
public void deviceReset() throws AppException { |
|
|
|
enableModule(); |
|
|
|
miniServoExDriver.miniServoMoveToZeroBlock(MiniServoMId.ShakeModGripperSV); |
|
|
|
miniServoDriver.miniServoMoveToZeroBlock(MiniServoMId.ShakeModGripperSV); |
|
|
|
stepMotorCtrlDriver.stepMotorEasyMoveToZeroBlock(StepMotorMId.ShakeModGripperZM, overtime); |
|
|
|
miniServoExDriver.miniServoMoveToZeroBlock(MiniServoMId.ShakeModGripperYSV); |
|
|
|
miniServoDriver.miniServoMoveToZeroBlock(MiniServoMId.ShakeModGripperYSV); |
|
|
|
|
|
|
|
stepMotorCtrlDriver.stepMotorEasyMoveToZeroBlock(StepMotorMId.ShakeModClampingM, overtime); |
|
|
|
stepMotorCtrlDriver.stepMotorEasyMoveToZeroBlock(StepMotorMId.ShakeModShakeM, overtime); |
|
|
@ -45,21 +48,13 @@ public class TubePreProcesPosCalibration { |
|
|
|
|
|
|
|
@ExtApiFn(name = "使能相关模块", group = "测试工具", order = 2) |
|
|
|
public void enableModule() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.ShakeModClampingM, 1); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.ShakeModGripperZM, 1); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.ShakeModShakeM, 1); |
|
|
|
motorEnableExDriver.preProcessRelatedModuleEnable(true); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "失能相关模块", group = "测试工具", order = 3) |
|
|
|
public void disableModule() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 0); |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 0); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.ShakeModClampingM, 0); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.ShakeModGripperZM, 0); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.ShakeModShakeM, 0); |
|
|
|
stepMotorCtrlDriver.stepMotorEnable(StepMotorMId.FeedingModXM, 0); |
|
|
|
motorEnableExDriver.preProcessRelatedModuleEnable(false); |
|
|
|
motorEnableExDriver.tubeFeedRelatedModuleEnable(false); |
|
|
|
} |
|
|
|
|
|
|
|
// @ExtApiFn(name = "读取夹爪当前位置", group = "测试工具", order = 4) |
|
|
@ -85,48 +80,48 @@ public class TubePreProcesPosCalibration { |
|
|
|
// 夹爪标定,校准,校验 |
|
|
|
// |
|
|
|
|
|
|
|
// @ExtApiFn(name = "设置当前位置为<参考点>(完全张开的位置)", group = "标定.夹爪", order = 21, newline = true) |
|
|
|
// public Integer gripperSVSetCurrentPosAsRef() throws AppException { |
|
|
|
// miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
// return 1800; |
|
|
|
// } |
|
|
|
// @ExtApiFn(name = "设置当前位置为<参考点>(完全张开的位置)", group = "标定.夹爪", order = 21, newline = true) |
|
|
|
// public Integer gripperSVSetCurrentPosAsRef() throws AppException { |
|
|
|
// miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
// return 1800; |
|
|
|
// } |
|
|
|
|
|
|
|
@ExtApiFn(name = "<标定>当前点为<抓手张开位置>", group = "标定.夹爪", order = 22) |
|
|
|
public Integer gripperSVSetCurrentPosAsOpenPos() throws AppException { |
|
|
|
Integer pos = miniServoExDriver.miniServoReadPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
Integer pos = miniServoDriver.miniServoReadPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
posMgr.setGripperServoOpenPos(pos); |
|
|
|
return pos; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<标定>当前点为<抓手闭合位置>", group = "标定.夹爪", order = 23) |
|
|
|
public Integer gripperSVSetCurrentPosAsClosePos() throws AppException { |
|
|
|
int pos = miniServoExDriver.miniServoReadPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
int pos = miniServoDriver.miniServoReadPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
posMgr.setGripperServoClosePos(pos + 2); |
|
|
|
return pos; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<标定>当前点为<抓手取试管位置>", group = "标定.夹爪", order = 24) |
|
|
|
public Integer gripperSVSetCurrentPosAsTakeCapPos() throws AppException { |
|
|
|
Integer pos = miniServoExDriver.miniServoReadPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
Integer pos = miniServoDriver.miniServoReadPos(MiniServoMId.ShakeModGripperSV); |
|
|
|
posMgr.setGripperServoTakeCapPos(pos - 5); |
|
|
|
return pos; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<校验>张开", group = "校验.夹爪", order = 26) |
|
|
|
public void gripperSVOpen() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
miniServoDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
controler.gripperSVOpen(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<校验>夹紧", group = "校验.夹爪", order = 25) |
|
|
|
public void gripperSVCClose() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
miniServoDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
controler.gripperSVCClose(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<校验>夹住试管", group = "校验.夹爪", order = 25) |
|
|
|
public void gripperSVClampTube() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
miniServoDriver.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); |
|
|
|
controler.gripperSVClampTube(); |
|
|
|
} |
|
|
|
|
|
|
@ -134,40 +129,40 @@ public class TubePreProcesPosCalibration { |
|
|
|
//YSV : 设置参考点,标定,验证 |
|
|
|
// |
|
|
|
|
|
|
|
// @ExtApiFn(name = "设置当前位置为<参考点>(Y轴最外侧的位置)", group = "标定.YSV", order = 31, newline = true) |
|
|
|
// public Integer YAxixServoSetCurrentPosAsRef() throws AppException { |
|
|
|
// return miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModGripperYSV); |
|
|
|
// } |
|
|
|
// @ExtApiFn(name = "设置当前位置为<参考点>(Y轴最外侧的位置)", group = "标定.YSV", order = 31, newline = true) |
|
|
|
// public Integer YAxixServoSetCurrentPosAsRef() throws AppException { |
|
|
|
// return miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModGripperYSV); |
|
|
|
// } |
|
|
|
|
|
|
|
@ExtApiFn(name = "<标定>当前点为<取试管位置>", group = "标定.YSV", order = 32) |
|
|
|
public Integer YAxixServoSetCurrentPosAsTakeTubePos() throws AppException { |
|
|
|
Integer pos = miniServoExDriver.miniServoReadPos(MiniServoMId.ShakeModGripperYSV); |
|
|
|
Integer pos = miniServoDriver.miniServoReadPos(MiniServoMId.ShakeModGripperYSV); |
|
|
|
posMgr.setYServoTakeTubePos(pos); |
|
|
|
return pos; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<标定>当前点为<摇晃位置>", group = "标定.YSV", order = 33) |
|
|
|
public Integer YAxixServoSetCurrentPosAsShakePos() throws AppException { |
|
|
|
Integer pos = miniServoExDriver.miniServoReadPos(MiniServoMId.ShakeModGripperYSV); |
|
|
|
Integer pos = miniServoDriver.miniServoReadPos(MiniServoMId.ShakeModGripperYSV); |
|
|
|
posMgr.setYServoShakePos(pos); |
|
|
|
return pos; |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<校验>移动到摇匀位", group = "校验.YSV", order = 35) |
|
|
|
public void YAxixServoShake() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
miniServoDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
controler.YSVMoveToShakePos(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<校验>移动到取试管位", group = "校验.YSV", order = 36) |
|
|
|
public void YAxixServoTakeTube() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
miniServoDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
controler.YSVMoveToTakeTubePos(); |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "<校验>移动到待机位", group = "校验.YSV", order = 37) |
|
|
|
public void YAxixServoMoveToStandyPos() throws AppException { |
|
|
|
miniServoExDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
miniServoDriver.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); |
|
|
|
controler.YSVMoveToStandyPos(); |
|
|
|
} |
|
|
|
|
|
|
|