diff --git a/app.db b/app.db index 9c51585..7f44262 100644 Binary files a/app.db and b/app.db differ diff --git a/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java b/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java index b0bf04e..789d198 100644 --- a/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java +++ b/src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java @@ -13,7 +13,7 @@ public enum ExtApiTabConfig { AppProjInfoMgrService("应用数据.项目与ID卡管理", true), //OK AppReactionResultMgrService("应用数据.反应结果管理", true), //OK - + MiniServoReferencePointSetting("校准.舵机参考点设置", true), Hbot2DCodeScanPosCalibration("校准.耗材扫描校准", true), TubeFeedingModulePosCalibration("校准.试管入料校准", true), TubePreProcesPosCalibration("校准.试管预处理校准", true), diff --git a/src/main/java/a8k/service/app/devicedriver/calibration/MiniServoReferencePointSetting.java b/src/main/java/a8k/service/app/devicedriver/calibration/MiniServoReferencePointSetting.java new file mode 100644 index 0000000..74dc0c0 --- /dev/null +++ b/src/main/java/a8k/service/app/devicedriver/calibration/MiniServoReferencePointSetting.java @@ -0,0 +1,65 @@ +package a8k.service.app.devicedriver.calibration; + + +import a8k.extapi_controler.pagecontrol.ExtApiTabConfig; +import a8k.extapi_controler.utils.ExtApiFn; +import a8k.extapi_controler.utils.ExtApiTab; +import a8k.service.app.devicedriver.basectrl.MiniServoControler; +import a8k.service.app.devicedriver.basectrl.type.MiniServoMId; +import a8k.type.exception.AppException; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Component; + +@Component +@ExtApiTab(cfg = ExtApiTabConfig.MiniServoReferencePointSetting) +public class MiniServoReferencePointSetting { + + @Resource + MiniServoControler miniServoControler; + + @ExtApiFn(name = "失能相关模块", group = "测试工具", order = 1) + public void disableMotor() throws AppException { + miniServoControler.miniServoEnable(MiniServoMId.ShakeModGripperSV, 0); + miniServoControler.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 0); + miniServoControler.miniServoEnable(MiniServoMId.ShakeModTubeScanerClampingSV, 0); + } + + @ExtApiFn(name = "使能相关模块", group = "测试工具", order = 2) + public void enableMotor() throws AppException { + miniServoControler.miniServoEnable(MiniServoMId.ShakeModGripperSV, 1); + miniServoControler.miniServoEnable(MiniServoMId.ShakeModGripperYSV, 1); + miniServoControler.miniServoEnable(MiniServoMId.ShakeModTubeScanerClampingSV, 1); + } + + + @ExtApiFn(name = "设置<夹爪><参考点>(完全张开的位置)", group = "参考点设置", order = 11, newline = true) + public Integer gripperSVSetCurrentPosAsRef() throws AppException { + miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModGripperSV); + return 1800; + } + + @ExtApiFn(name = "设置<摇匀模组Y轴舵机><参考点>(Y轴最外侧的位置)", group = "参考点设置", order = 12, newline = true) + public Integer YAxixServoSetCurrentPosAsRef() throws AppException { + return miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModGripperYSV); + } + + @ExtApiFn(name = "设置<夹紧舵机>参考点(水平位置)", group = "参考点设置", order = 13) + public void setTubeScanClampPos() throws AppException { + miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModTubeScanerClampingSV); + } + + @ExtApiFn(name = "夹紧舵机移动到待机位(在参考点附近)", group = "校验", order = 21) + public void gripperSVMoveToZeroBlock() throws AppException { + miniServoControler.miniServoMoveToZeroBlock(MiniServoMId.ShakeModGripperSV); + } + + @ExtApiFn(name = "摇匀模组Y轴舵机移动到待机位(在参考点附近)", group = "校验", order = 22) + public void YAxixServoMoveToZeroBlock() throws AppException { + miniServoControler.miniServoMoveToZeroBlock(MiniServoMId.ShakeModGripperYSV); + } + + @ExtApiFn(name = "夹紧舵机移动到待机位(在参考点附近)", group = "校验", order = 23) + public void tubeScanClampMoveToZeroBlock() throws AppException { + miniServoControler.miniServoMoveToZeroBlock(MiniServoMId.ShakeModTubeScanerClampingSV); + } +} diff --git a/src/main/java/a8k/service/app/devicedriver/calibration/PositionCalibration.java b/src/main/java/a8k/service/app/devicedriver/calibration/PositionCalibration.java deleted file mode 100644 index b5c4d07..0000000 --- a/src/main/java/a8k/service/app/devicedriver/calibration/PositionCalibration.java +++ /dev/null @@ -1,117 +0,0 @@ -package a8k.service.app.devicedriver.calibration; - -import a8k.extapi_controler.pagecontrol.ExtApiTabConfig; -import a8k.extapi_controler.utils.ExtApiFn; -import a8k.extapi_controler.utils.ExtApiStatu; -import a8k.extapi_controler.utils.ExtApiTab; -import a8k.type.exception.AppException; -import a8k.type.cfg.Pos2d; -import a8k.hardware.A8kCanBusService; -import a8k.hardware.type.a8kcanprotocol.MId; -import jakarta.annotation.Resource; -import org.springframework.stereotype.Component; - -//@Component -//@ExtApiTab(cfg = ExtApiTabConfig.PositionCalibration) -//public class PositionCalibration { -// -// @Resource -// A8kCanBusService canBus; -// @Resource -// TimeParam timep; -// @Resource -// PosParam pp; -// @Resource -// DebugParam dp; -// -// @ExtApiFn(name = "试管夹平移电机-使能", group = "电机使能") -// public void FeedingModXMEnable(Boolean enable) throws AppException { -// stepMotorControler.stepMotorEnable(StepMotorMId.FeedingModXM, enable ? 1 : 0); -// } -// -// @ExtApiFn(name = "板夹仓Y轴-使能", group = "电机使能") -// public void platesBoxYMEndble(Boolean enable) throws AppException { -// stepMotorControler.stepMotorEnable(StepMotorMId.PlatesBoxYM, enable ? 1 : 0); -// } -// -// @ExtApiFn(name = "板夹仓推杆-使能", group = "电机使能") -// public void platesBoxPusherMEndble(Boolean enable) throws AppException { -// stepMotorControler.stepMotorEnable(StepMotorMId.PlatesBoxPusherM, enable ? 1 : 0); -// } -// -// @ExtApiFn(name = "拉杆-使能", group = "电机使能") -// public void optModPullMEndble(Boolean enable) throws AppException { -// stepMotorControler.stepMotorEnable(StepMotorMId.OptModPullM, enable ? 1 : 0); -// } -// -// @ExtApiFn(name = "光学模组扫描器-使能", group = "电机使能") -// public void optModScannerMEndble(Boolean enable) throws AppException { -// stepMotorControler.stepMotorEnable(StepMotorMId.OptModScannerM, enable ? 1 : 0); -// } -// -// @ExtApiFn(name = "转盘-使能", group = "电机使能") -// public void incubatorRotateCtrlMEndble(Boolean enable) throws AppException { -// stepMotorControler.stepMotorEnable(StepMotorMId.IncubatorRotateCtrlM, enable ? 1 : 0); -// -// } -// -// -// @ExtApiFn(name = "试管夹平移电机-读取位置", group = "通过归零测量位置") -// public Integer readXPosByMoveZero() throws AppException { -// return (stepMotorControler.stepMotorReadPosByMoveToZeroBlock(StepMotorMId.FeedingModXM, timep.getActionOvertime())); -// } -// -// -// @ExtApiFn(name = "通过归零读取<板夹仓>位置", group = "通过归零测量位置") -// public Integer readPlatesBoxYMPosByMoveToZero() throws AppException { -// return (stepMotorControler.stepMotorReadPosByMoveToZeroBlock(StepMotorMId.PlatesBoxYM, timep.getActionOvertime())); -// } -// -// @ExtApiFn(name = "通过归零读取<推杆>位置", group = "通过归零测量位置") -// public Integer readPlatesBoxPusherMPosByMoveToZero() throws AppException { -// return (stepMotorControler.stepMotorReadPosByMoveToZeroBlock(StepMotorMId.PlatesBoxPusherM, timep.getActionOvertime())); -// } -// -// @ExtApiFn(name = "通过归零读取<拉杆>位置", group = "通过归零测量位置") -// public Integer readOptModPullMPosByMoveToZero() throws AppException { -// return (stepMotorControler.stepMotorReadPosByMoveToZeroBlock(StepMotorMId.OptModPullM, timep.getActionOvertime())); -// } -// -// @ExtApiFn(name = "通过归零读取<光学模组扫描器>位置", group = "通过归零测量位置") -// public Integer readOptModScannerMPosByMoveToZero() throws AppException { -// return (stepMotorControler.stepMotorReadPosByMoveToZeroBlock(StepMotorMId.OptModScannerM, timep.getActionOvertime())); -// } -// -// @ExtApiFn(name = "通过归零读取<摇匀模组Z轴>位置", group = "通过归零测量位置") -// public Integer readShakeModGripperZMPosByMoveToZero() throws AppException { -// return (stepMotorControler.stepMotorReadPosByMoveToZeroBlock(StepMotorMId.ShakeModGripperZM, timep.getActionOvertime())); -// } -// -// -// @ExtApiStatu(name = "HbotPos", group = "Hbot") -// public String getHbotPos() throws AppException { -// Pos2d pos = canBus.hbotReadPos(MId.HbotM); -// return pos.toString(); -// } -// -// -// @ExtApiStatu(name = "转盘位置") -// public String getIncubatorRotateCtrlMPos() throws AppException { -// Integer pos = stepMotorControler.stepMotorReadPos(StepMotorMId.IncubatorRotateCtrlM); -// return pos.toString(); -// } -// -// @ExtApiStatu(name = "抓手Y轴位置", group = "摇匀模组") -// public String getShakeModGripperYPos() throws AppException { -// Integer pos = miniServoControler.miniServoReadPos(MiniServoMid.ShakeModGripperYSV); -// return pos.toString(); -// } -// -// @ExtApiStatu(name = "抓手位置", group = "摇匀模组") -// public String getGripperPos() throws AppException { -// Integer pos = miniServoControler.miniServoReadPos(MiniServoMid.ShakeModGripperSV); -// return pos.toString(); -// } -// -// -//} diff --git a/src/main/java/a8k/service/app/devicedriver/calibration/TubeFeedingModulePosCalibration.java b/src/main/java/a8k/service/app/devicedriver/calibration/TubeFeedingModulePosCalibration.java index 95afef0..f8ff3eb 100644 --- a/src/main/java/a8k/service/app/devicedriver/calibration/TubeFeedingModulePosCalibration.java +++ b/src/main/java/a8k/service/app/devicedriver/calibration/TubeFeedingModulePosCalibration.java @@ -101,10 +101,10 @@ public class TubeFeedingModulePosCalibration { tubeScanPosMgr.setTube0ExistJudgXPos(readFeedingModXMPos()); } - @ExtApiFn(name = "<夹紧舵机>设置当前位置参考点(水平位置)", group = "设定", order = 26) - public void setTubeScanClampPos() throws AppException { - miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModTubeScanerClampingSV); - } +// @ExtApiFn(name = "<夹紧舵机>设置当前位置参考点(水平位置)", group = "设定", order = 26) +// public void setTubeScanClampPos() throws AppException { +// miniServoControler.miniServoSetRefPos(MiniServoMId.ShakeModTubeScanerClampingSV); +// } @ExtApiFn(name = "夹紧试管架", group = "校验", order = 31) diff --git a/src/main/java/a8k/service/app/devicedriver/calibration/TubePreProcesPosCalibration.java b/src/main/java/a8k/service/app/devicedriver/calibration/TubePreProcesPosCalibration.java index 3b8c2b4..b1773f7 100644 --- a/src/main/java/a8k/service/app/devicedriver/calibration/TubePreProcesPosCalibration.java +++ b/src/main/java/a8k/service/app/devicedriver/calibration/TubePreProcesPosCalibration.java @@ -85,11 +85,11 @@ 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 { @@ -134,10 +134,10 @@ 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 {