From 84960d9e38f591e8cc737e7231e7bc5e9abb0bc7 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sun, 22 Oct 2023 17:31:29 +0800 Subject: [PATCH] update --- components/step_motor_ctrl_module/step_motor_ctrl_module.cpp | 3 +++ components/step_motor_ctrl_module/step_motor_ctrl_module.hpp | 3 +++ components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp | 6 ++++++ components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp | 2 ++ 4 files changed, 14 insertions(+) diff --git a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp index 552e6d6..164b953 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -779,6 +779,9 @@ int32_t StepMotorCtrlModule::motor_move_to_zero_backward(int32_t findzerospeed, return move_to_zero(nullptr); } +int32_t StepMotorCtrlModule::motor_move_to_zero_forward_and_calculated_shift(int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { return err::koperation_not_support; } +int32_t StepMotorCtrlModule::motor_move_to_zero_backward_and_calculated_shift(int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { return move_to_zero_with_calibrate(0, nullptr); } + int32_t StepMotorCtrlModule::motor_read_pos(int32_t* pos) { int32_t xnow = 0; getnowpos(xnow); diff --git a/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp b/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp index d060441..fc802d8 100644 --- a/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp +++ b/components/step_motor_ctrl_module/step_motor_ctrl_module.hpp @@ -141,6 +141,9 @@ class StepMotorCtrlModule : public I_StepMotorCtrlModule, public ZIModule, publi virtual int32_t motor_read_pos(int32_t* pos) override; + virtual int32_t motor_move_to_zero_forward_and_calculated_shift(int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) override; + virtual int32_t motor_move_to_zero_backward_and_calculated_shift(int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) override; + private: void active_cfg(); diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp index 61aa1cc..86dd9e2 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.cpp @@ -694,3 +694,9 @@ int32_t XYRobotCtrlModule::xymotor_enable(int32_t varenable) { int32_t XYRobotCtrlModule::xymotor_move_by(int32_t dx, int32_t dy, int32_t motor_velocity) { return move_by(dx, dy, motor_velocity, nullptr); } int32_t XYRobotCtrlModule::xymotor_move_to(int32_t x, int32_t y, int32_t motor_velocity) { return move_to(x, y, motor_velocity, nullptr); } int32_t XYRobotCtrlModule::xymotor_move_to_zero() { return move_to_zero(nullptr); } + +int32_t XYRobotCtrlModule::xymotor_move_to_zero_and_calculated_shift() { return move_to_zero_with_calibrate(0, 0, nullptr); } +int32_t XYRobotCtrlModule::xymotor_read_pos(int32_t* x, int32_t* y) { + getnowpos(*x, *y); + return 0; +} \ No newline at end of file diff --git a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp index 1e8a503..5843aea 100644 --- a/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp +++ b/components/xy_robot_ctrl_module/xy_robot_ctrl_module.hpp @@ -90,6 +90,8 @@ class XYRobotCtrlModule : public I_XYRobotCtrlModule, public ZIXYMotor, public Z virtual int32_t xymotor_move_by(int32_t dx, int32_t dy, int32_t motor_velocity); virtual int32_t xymotor_move_to(int32_t x, int32_t y, int32_t motor_velocity); virtual int32_t xymotor_move_to_zero(); + virtual int32_t xymotor_move_to_zero_and_calculated_shift() { return err::koperation_not_support; } + virtual int32_t xymotor_read_pos(int32_t* x, int32_t* y) { return err::koperation_not_support; } private: virtual int32_t _module_set_or_get_param(bool set, int32_t param_id, int32_t& param_value);