Browse Source

update

change_pipette_api
zhaohe 2 years ago
parent
commit
f20a0f5aff
  1. 1
      api/zi_motor.hpp
  2. 9
      cmdid.hpp
  3. 4
      protocol_proxy.cpp
  4. 2
      protocol_proxy.hpp
  5. 2
      zmodule_device_manager.cpp
  6. 3
      zmodule_device_manager.hpp
  7. 4
      zmodule_device_script_cmder_paser.cpp

1
api/zi_motor.hpp

@ -38,6 +38,7 @@ class ZIMotor {
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_set_current_pos(int32_t pos) { return err::koperation_not_support; };
// virtual int32_t motor_set_shaft();

9
cmdid.hpp

@ -85,10 +85,11 @@ typedef enum {
kmotor_move_to_torque = CMDID(2, 15), // para:{4,4,4}, ack:{}
kmotor_calculated_pos_by_move_to_zero = CMDID(2, 16), // para:{}, ack:{}
kmotor_easy_rotate = CMDID(2, 17), // para:{4}, ack:{}
kmotor_easy_move_by = CMDID(2, 18), // para:{4}, ack:{}
kmotor_easy_move_to = CMDID(2, 19), // para:{4}, ack:{}
kmotor_easy_move_to_zero = CMDID(2, 20), // para:{1}, ack:{}
kmotor_easy_rotate = CMDID(2, 17), // para:{4}, ack:{}
kmotor_easy_move_by = CMDID(2, 18), // para:{4}, ack:{}
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:{}
#if 0
virtual ~ZIXYMotor() {}

4
protocol_proxy.cpp

@ -139,6 +139,8 @@ int32_t ZIProtocolProxy::module_enable(int32_t para0) { PROXY_IMPL_10(kmodule_en
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_set_current_pos(int32_t pos) { return err::koperation_not_support; };
#endif
int32_t ZIProtocolProxy::motor_enable(int32_t para0) { PROXY_IMPL_10(kmotor_enable, OVERTIME); }
@ -167,7 +169,7 @@ int32_t ZIProtocolProxy::motor_easy_rotate(int32_t para0) { PROXY_IMPL_10(kmotor
int32_t ZIProtocolProxy::motor_easy_move_by(int32_t para0) { PROXY_IMPL_10(kmotor_easy_move_by, OVERTIME); }
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); }
/*******************************************************************************
* ZIXYMotor *
*******************************************************************************/

2
protocol_proxy.hpp

@ -90,6 +90,7 @@ class ZIProtocolProxy : public ZIMotor, //
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_set_current_pos(int32_t pos) { return err::koperation_not_support; };
#endif
@ -119,6 +120,7 @@ class ZIProtocolProxy : public ZIMotor, //
virtual int32_t motor_easy_move_by(int32_t distance) override;
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;
/*******************************************************************************
* ZIXYMotor *

2
zmodule_device_manager.cpp

@ -93,6 +93,7 @@ int32_t ZModuleDeviceManager::module_start(uint16_t id) { PROXY_IMPL(ZIModule, m
virtual int32_t motor_easy_move_by(uint16_t id, int32_t distance);
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; };
#endif
int32_t ZModuleDeviceManager::motor_enable(uint16_t id, int32_t enable) { PROXY_IMPL(ZIMotor, motor_enable, enable); }
@ -115,6 +116,7 @@ int32_t ZModuleDeviceManager::motor_easy_rotate(uint16_t id, int32_t direction)
int32_t ZModuleDeviceManager::motor_easy_move_by(uint16_t id, int32_t distance) { PROXY_IMPL(ZIMotor, motor_easy_move_by, 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); }
/*******************************************************************************
* ZIXYMotor *
*******************************************************************************/

3
zmodule_device_manager.hpp

@ -135,6 +135,8 @@ class ZModuleDeviceManager {
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_set_current_pos(int32_t pos) { return err::koperation_not_support; };
#endif
virtual int32_t motor_enable(uint16_t id, int32_t enable);
@ -158,6 +160,7 @@ class ZModuleDeviceManager {
virtual int32_t motor_easy_move_by(uint16_t id, int32_t distance);
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);
/*******************************************************************************
* ZIXYMotor *

4
zmodule_device_script_cmder_paser.cpp

@ -155,7 +155,8 @@ void ZModuleDeviceScriptCmderPaser::regfn() {
virtual int32_t motor_easy_rotate(uint16_t id, int32_t direction);
virtual int32_t motor_easy_move_by(uint16_t id, int32_t distance);
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_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; };
#endif
PROCESS_PACKET_20(motor_enable, "(mid, enable)");
@ -184,6 +185,7 @@ void ZModuleDeviceScriptCmderPaser::regfn() {
PROCESS_PACKET_20(motor_easy_move_by, "(mid, distance)");
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)");
#if 0
virtual ~ZIXYMotor() {}

Loading…
Cancel
Save