Browse Source

add motor_easy_move_to_io

change_pipette_api
zhaohe 2 years ago
parent
commit
445108a216
  1. 2
      api/zi_motor.hpp
  2. 2
      cmdid.hpp
  3. 2
      protocol_parser.cpp
  4. 2
      protocol_proxy.cpp
  5. 2
      protocol_proxy.hpp
  6. 2
      zmodule_device_manager.cpp
  7. 2
      zmodule_device_manager.hpp
  8. 3
      zmodule_device_script_cmder_paser.cpp

2
api/zi_motor.hpp

@ -39,7 +39,7 @@ class ZIMotor {
virtual int32_t motor_easy_move_to(int32_t position) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_set_current_pos(int32_t pos) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t direction, int32_t io_index) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
// virtual int32_t motor_set_shaft();

2
cmdid.hpp

@ -65,6 +65,7 @@ typedef enum {
virtual int32_t motor_easy_move_by(int32_t distance) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to(int32_t position) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
#endif
@ -90,6 +91,7 @@ typedef enum {
kmotor_easy_move_to = CMDID(2, 19), // para:{4}, ack:{}
kmotor_easy_move_to_zero = CMDID(2, 20), // para:{1}, ack:{}
kmotor_easy_set_current_pos = CMDID(2, 21), // para:{4}, ack:{}
kmotor_easy_move_to_io = CMDID(2, 22), // para:{4,4}, ack:{}
#if 0
virtual ~ZIXYMotor() {}

2
protocol_parser.cpp

@ -208,6 +208,7 @@ void ZIProtocolParser::onRceivePacket(zcr_cmd_header_t* rxcmd, uint8_t* data, in
virtual int32_t motor_easy_move_by(int32_t distance) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to(int32_t position) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
#endif
PROCESS_PACKET_10(kmotor_enable, ZIMotor, motor_enable);
@ -230,6 +231,7 @@ void ZIProtocolParser::onRceivePacket(zcr_cmd_header_t* rxcmd, uint8_t* data, in
PROCESS_PACKET_10(kmotor_easy_move_by, ZIMotor, motor_easy_move_by);
PROCESS_PACKET_10(kmotor_easy_move_to, ZIMotor, motor_easy_move_to);
PROCESS_PACKET_10(kmotor_easy_move_to_zero, ZIMotor, motor_easy_move_to_zero);
PROCESS_PACKET_20(kmotor_easy_move_to_io, ZIMotor, motor_easy_move_to_io);
/*******************************************************************************
* xymotor *

2
protocol_proxy.cpp

@ -140,6 +140,7 @@ int32_t ZIProtocolProxy::module_enable(int32_t para0) { PROXY_IMPL_10(kmodule_en
virtual int32_t motor_easy_move_to(int32_t position) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_set_current_pos(int32_t pos) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
#endif
@ -170,6 +171,7 @@ int32_t ZIProtocolProxy::motor_easy_move_by(int32_t para0) { PROXY_IMPL_10(kmoto
int32_t ZIProtocolProxy::motor_easy_move_to(int32_t para0) { PROXY_IMPL_10(kmotor_easy_move_to, OVERTIME); }
int32_t ZIProtocolProxy::motor_easy_move_to_zero(int32_t para0) { PROXY_IMPL_10(kmotor_easy_move_to_zero, OVERTIME); }
int32_t ZIProtocolProxy::motor_easy_set_current_pos(int32_t para0) { PROXY_IMPL_10(kmotor_easy_set_current_pos, OVERTIME); }
int32_t ZIProtocolProxy::motor_easy_move_to_io(int32_t para0, int32_t para1) { PROXY_IMPL_20(kmotor_easy_move_to_io, OVERTIME); }
/*******************************************************************************
* ZIXYMotor *
*******************************************************************************/

2
protocol_proxy.hpp

@ -91,6 +91,7 @@ class ZIProtocolProxy : public ZIMotor, //
virtual int32_t motor_easy_move_to(int32_t position) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_set_current_pos(int32_t pos) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
#endif
@ -121,6 +122,7 @@ class ZIProtocolProxy : public ZIMotor, //
virtual int32_t motor_easy_move_to(int32_t position) override;
virtual int32_t motor_easy_move_to_zero(int32_t direction) override;
virtual int32_t motor_easy_set_current_pos(int32_t pos) override;
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) override;
/*******************************************************************************
* ZIXYMotor *

2
zmodule_device_manager.cpp

@ -91,6 +91,7 @@ int32_t ZModuleDeviceManager::module_start(uint16_t id) { PROXY_IMPL(ZIModule, m
virtual int32_t motor_easy_move_to(uint16_t id, int32_t position);
virtual int32_t motor_easy_move_to_zero(uint16_t id, int32_t direction);
virtual int32_t motor_easy_set_current_pos(int32_t pos) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
#endif
int32_t ZModuleDeviceManager::motor_enable(uint16_t id, int32_t enable) { PROXY_IMPL(ZIMotor, motor_enable, enable); }
@ -114,6 +115,7 @@ int32_t ZModuleDeviceManager::motor_easy_move_by(uint16_t id, int32_t distance)
int32_t ZModuleDeviceManager::motor_easy_move_to(uint16_t id, int32_t position) { PROXY_IMPL(ZIMotor, motor_easy_move_to, position); }
int32_t ZModuleDeviceManager::motor_easy_move_to_zero(uint16_t id, int32_t direction) { PROXY_IMPL(ZIMotor, motor_easy_move_to_zero, direction); }
int32_t ZModuleDeviceManager::motor_easy_set_current_pos(uint16_t id, int32_t pos) { PROXY_IMPL(ZIMotor, motor_easy_set_current_pos, pos); }
int32_t ZModuleDeviceManager::motor_easy_move_to_io(uint16_t id, int32_t ioindex, int32_t direction) { PROXY_IMPL(ZIMotor, motor_easy_move_to_io, ioindex, direction); }
/*******************************************************************************
* ZIXYMotor *
*******************************************************************************/

2
zmodule_device_manager.hpp

@ -136,6 +136,7 @@ class ZModuleDeviceManager {
virtual int32_t motor_easy_move_to(int32_t position) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_set_current_pos(int32_t pos) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(int32_t ioindex, int32_t direction) { return err::koperation_not_support; };
#endif
@ -161,6 +162,7 @@ class ZModuleDeviceManager {
virtual int32_t motor_easy_move_to(uint16_t id, int32_t position);
virtual int32_t motor_easy_move_to_zero(uint16_t id, int32_t direction);
virtual int32_t motor_easy_set_current_pos(uint16_t id, int32_t pos);
virtual int32_t motor_easy_move_to_io(uint16_t id, int32_t ioindex, int32_t direction);
/*******************************************************************************
* ZIXYMotor *

3
zmodule_device_script_cmder_paser.cpp

@ -157,6 +157,8 @@ void ZModuleDeviceScriptCmderPaser::regfn() {
virtual int32_t motor_easy_move_to(uint16_t id, int32_t position);
virtual int32_t motor_easy_move_to_zero(int32_t direction) { return err::koperation_not_support; };
virtual int32_t motor_easy_set_current_pos(int32_t pos) { return err::koperation_not_support; };
virtual int32_t motor_easy_move_to_io(uint16_t id, int32_t ioindex, int32_t direction);
#endif
PROCESS_PACKET_20(motor_enable, "(mid, enable)");
@ -186,6 +188,7 @@ void ZModuleDeviceScriptCmderPaser::regfn() {
PROCESS_PACKET_20(motor_easy_move_to, "(mid, position)");
PROCESS_PACKET_20(motor_easy_move_to_zero, "(mid, direction)");
PROCESS_PACKET_20(motor_easy_set_current_pos, "(mid, pos)");
PROCESS_PACKET_30(motor_easy_move_to_io, "(mid, ioindex, direction)");
#if 0
virtual ~ZIXYMotor() {}

Loading…
Cancel
Save