Browse Source

addm cmd

change_pipette_api
zhaohe 2 years ago
parent
commit
acab0c3069
  1. 2
      cmdid.hpp
  2. 4
      protocol_parser.cpp
  3. 2
      protocol_proxy.cpp
  4. 2
      protocol_proxy.hpp
  5. 2
      zmodule_device_manager.cpp
  6. 2
      zmodule_device_manager.hpp
  7. 4
      zmodule_device_script_cmder_paser.cpp

2
cmdid.hpp

@ -69,7 +69,7 @@ typedef enum {
kmotor_motor_move_to_zero_forward_and_calculated_shift = CMDID(2, 13), // para:{4,4,4,4}, ack:{} //int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime
kmotor_motor_move_to_zero_backward_and_calculated_shift = CMDID(2, 14), // para:{4,4,4,4}, ack:{} //int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime
kmotor_move_to_torque = CMDID(2, 15), // para:{4,4,4}, ack:{}
kmotor_calculated_pos_by_move_to_zero = CMDID(2, 16), // para:{}, ack:{}
#if 0
virtual ~ZIXYMotor() {}

4
protocol_parser.cpp

@ -200,6 +200,9 @@ void ZIProtocolParser::onRceivePacket(zcr_cmd_header_t* rxcmd, uint8_t* data, in
virtual int32_t motor_read_pos(int32_t* pos) { return err::koperation_not_support; }
virtual int32_t motor_set_current_pos_by_change_shift(int32_t pos) { return err::koperation_not_support; } // Ò»°ãÓÃÓÚ¶æ»ú
virtual int32_t motor_calculated_pos_by_move_to_zero() { return err::koperation_not_support; }
#endif
PROCESS_PACKET_10(kmotor_enable, ZIMotor, motor_enable);
PROCESS_PACKET_30(kmotor_rotate, ZIMotor, motor_rotate);
@ -216,6 +219,7 @@ void ZIProtocolParser::onRceivePacket(zcr_cmd_header_t* rxcmd, uint8_t* data, in
PROCESS_PACKET_40(kmotor_motor_move_to_zero_forward_and_calculated_shift, ZIMotor, motor_move_to_zero_forward_and_calculated_shift);
PROCESS_PACKET_40(kmotor_motor_move_to_zero_backward_and_calculated_shift, ZIMotor, motor_move_to_zero_backward_and_calculated_shift);
PROCESS_PACKET_30(kmotor_move_to_torque, ZIMotor, motor_move_to_torque);
PROCESS_PACKET_00(kmotor_calculated_pos_by_move_to_zero, ZIMotor, motor_calculated_pos_by_move_to_zero);
/*******************************************************************************
* xymotor *

2
protocol_proxy.cpp

@ -130,6 +130,7 @@ int32_t ZIProtocolProxy::module_enable(int32_t para0) { PROXY_IMPL_10(kmodule_en
virtual int32_t motor_read_pos(int32_t* pos) { return err::koperation_not_support; }
virtual int32_t motor_set_current_pos_by_change_shift(int32_t pos) { return err::koperation_not_support; } // Ò»°ãÓÃÓÚ¶æ»ú
virtual int32_t motor_calculated_pos_by_move_to_zero() { return err::koperation_not_support; }
#endif
@ -153,6 +154,7 @@ int32_t ZIProtocolProxy::motor_move_to_zero_forward_and_calculated_shift(int32_t
int32_t ZIProtocolProxy::motor_move_to_zero_backward_and_calculated_shift(int32_t para0, int32_t para1, int32_t para2, int32_t para3) { PROXY_IMPL_40(kmotor_motor_move_to_zero_backward_and_calculated_shift, 30); };
int32_t ZIProtocolProxy::motor_move_to_torque(int32_t para0, int32_t para1, int32_t para2) { PROXY_IMPL_30(kmotor_move_to_torque, 30); }
int32_t ZIProtocolProxy::motor_calculated_pos_by_move_to_zero() { PROXY_IMPL_00(kmotor_calculated_pos_by_move_to_zero, 30); }
/*******************************************************************************
* ZIXYMotor *

2
protocol_proxy.hpp

@ -80,6 +80,7 @@ class ZIProtocolProxy : public ZIMotor, //
virtual int32_t motor_read_pos(int32_t* pos) { return err::koperation_not_support; }
virtual int32_t motor_set_current_pos_by_change_shift(int32_t pos) { return err::koperation_not_support; } // Ò»°ãÓÃÓÚ¶æ»ú
virtual int32_t motor_calculated_pos_by_move_to_zero() { return err::koperation_not_support; }
#endif
@ -103,6 +104,7 @@ class ZIProtocolProxy : public ZIMotor, //
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;
virtual int32_t motor_move_to_torque(int32_t pos, int32_t torque, int32_t overtime) override;
virtual int32_t motor_calculated_pos_by_move_to_zero() override;
/*******************************************************************************
* ZIXYMotor *

2
zmodule_device_manager.cpp

@ -72,6 +72,7 @@ int32_t ZModuleDeviceManager::module_start(uint16_t id) { PROXY_IMPL(ZIModule, m
virtual int32_t motor_read_pos(int32_t* pos) { return err::koperation_not_support; }
virtual int32_t motor_set_current_pos_by_change_shift(int32_t pos) { return err::koperation_not_support; } // Ò»°ãÓÃÓÚ¶æ»ú
virtual int32_t motor_calculated_pos_by_move_to_zero() { return err::koperation_not_support; }
#endif
int32_t ZModuleDeviceManager::motor_enable(uint16_t id, int32_t enable) { PROXY_IMPL(ZIMotor, motor_enable, enable); }
@ -89,6 +90,7 @@ int32_t ZModuleDeviceManager::motor_set_current_pos_by_change_shift(uint16_t id,
int32_t ZModuleDeviceManager::motor_move_to_zero_forward_and_calculated_shift(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { PROXY_IMPL(ZIMotor, motor_move_to_zero_forward_and_calculated_shift, findzerospeed, findzeroedge_speed, acc, overtime); }
int32_t ZModuleDeviceManager::motor_move_to_zero_backward_and_calculated_shift(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { PROXY_IMPL(ZIMotor, motor_move_to_zero_backward_and_calculated_shift, findzerospeed, findzeroedge_speed, acc, overtime); }
int32_t ZModuleDeviceManager::motor_move_to_torque(uint16_t id, int32_t pos, int32_t torque, int32_t overtime) { PROXY_IMPL(ZIMotor, motor_move_to_torque, pos, torque, overtime); }
int32_t ZModuleDeviceManager::motor_calculated_pos_by_move_to_zero(uint16_t id) { PROXY_IMPL(ZIMotor, motor_calculated_pos_by_move_to_zero); }
/*******************************************************************************
* ZIXYMotor *
*******************************************************************************/

2
zmodule_device_manager.hpp

@ -110,6 +110,7 @@ class ZModuleDeviceManager {
virtual int32_t motor_read_pos(int32_t* pos) { return err::koperation_not_support; }
virtual int32_t motor_set_current_pos_by_change_shift(int32_t pos) { return err::koperation_not_support; } // Ò»°ãÓÃÓÚ¶æ»ú
virtual int32_t motor_calculated_pos_by_move_to_zero() { return err::koperation_not_support; }
#endif
virtual int32_t motor_enable(uint16_t id, int32_t enable);
@ -127,6 +128,7 @@ class ZModuleDeviceManager {
virtual int32_t motor_move_to_zero_forward_and_calculated_shift(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime);
virtual int32_t motor_move_to_zero_backward_and_calculated_shift(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime);
virtual int32_t motor_move_to_torque(uint16_t id, int32_t pos, int32_t torque, int32_t overtime);
virtual int32_t motor_calculated_pos_by_move_to_zero(uint16_t id);
/*******************************************************************************
* ZIXYMotor *

4
zmodule_device_script_cmder_paser.cpp

@ -115,7 +115,7 @@ void ZModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDevi
PROCESS_PACKET_10(module_flush_cfg, "(mid)");
PROCESS_PACKET_10(module_active_cfg, "(mid)");
cancmder->regCMD("module_read_raw", "(mid, readsize)", 2, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) {
if (atoi(paraV[2]) > sizeof(ack->rawdata)) {
if (atoi(paraV[2]) > (int32_t)sizeof(ack->rawdata)) {
ack->ecode = err::kbuffer_not_enough;
return;
}
@ -146,6 +146,7 @@ void ZModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDevi
virtual int32_t motor_read_pos(int32_t* pos) { return err::koperation_not_support; }
virtual int32_t motor_set_current_pos_by_change_shift(int32_t pos) { return err::koperation_not_support; } // Ò»°ãÓÃÓÚ¶æ»ú
virtual int32_t motor_calculated_pos_by_move_to_zero() { return err::koperation_not_support; }
#endif
PROCESS_PACKET_20(motor_enable, "(mid, enable)");
@ -168,6 +169,7 @@ void ZModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDevi
PROCESS_PACKET_50(motor_move_to_zero_forward_and_calculated_shift, "(mid, findzerospeed, findzeroedge_speed, acc, overtime)");
PROCESS_PACKET_50(motor_move_to_zero_backward_and_calculated_shift, "(mid, findzerospeed, findzeroedge_speed, acc, overtime)");
PROCESS_PACKET_10(motor_calculated_pos_by_move_to_zero, "(mid)");
#if 0
virtual ~ZIXYMotor() {}

Loading…
Cancel
Save