|
|
@ -44,17 +44,68 @@ using namespace std; |
|
|
|
#define PROCESS_PACKET_53(var_funcname, cmdhelp) PROCESS_PACKET_XX(var_funcname, cmdhelp, 5, 3, atoi(paraV[0]), atoi(paraV[1]), atoi(paraV[2]), atoi(paraV[3]), atoi(paraV[4]), ack->getAck(0), ack->getAck(1), ack->getAck(2))
|
|
|
|
|
|
|
|
void ZModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDeviceManager* deviceManager) { |
|
|
|
PROCESS_PACKET_10(module_stop, "stop (mid)"); |
|
|
|
#if 0
|
|
|
|
/*******************************************************************************
|
|
|
|
* ZIModule * |
|
|
|
*******************************************************************************/ |
|
|
|
int32_t module_stop(uint16_t id); |
|
|
|
int32_t module_break(uint16_t id); |
|
|
|
|
|
|
|
int32_t module_get_last_exec_status(uint16_t id, int32_t *status); |
|
|
|
int32_t module_get_status(uint16_t id, int32_t *status); |
|
|
|
|
|
|
|
int32_t module_set_param(uint16_t id, int32_t param_id, int32_t param_value); |
|
|
|
int32_t module_get_param(uint16_t id, int32_t param_id, int32_t *param_value); |
|
|
|
|
|
|
|
int32_t module_readio(uint16_t id, int32_t *io); |
|
|
|
int32_t module_writeio(uint16_t id, int32_t io); |
|
|
|
|
|
|
|
int32_t module_read_adc(uint16_t id, int32_t adcindex, int32_t *adc); |
|
|
|
|
|
|
|
int32_t module_get_error(uint16_t id, int32_t *iserror); |
|
|
|
int32_t module_clear_error(uint16_t id); |
|
|
|
|
|
|
|
int32_t module_set_inited_flag(uint16_t id, int32_t flag); |
|
|
|
int32_t module_get_inited_flag(uint16_t id, int32_t *flag); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* ZIMotor * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
int32_t motor_enable(uint16_t id, int32_t enable); |
|
|
|
int32_t motor_rotate(uint16_t id, int32_t direction, int32_t motor_velocity, int32_t acc); |
|
|
|
int32_t motor_move_by(uint16_t id, int32_t distance, int32_t motor_velocity, int32_t acc); |
|
|
|
int32_t motor_move_to(uint16_t id, int32_t position, int32_t motor_velocity, int32_t acc); |
|
|
|
int32_t motor_rotate_acctime(uint16_t id, int32_t direction, int32_t motor_velocity, int32_t acctime); |
|
|
|
int32_t motor_move_by_acctime(uint16_t id, int32_t distance, int32_t motor_velocity, int32_t acctime); |
|
|
|
int32_t motor_move_to_acctime(uint16_t id, int32_t position, int32_t motor_velocity, int32_t acctime); |
|
|
|
int32_t motor_move_to_zero_forward(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime); |
|
|
|
int32_t motor_move_to_zero_backward(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime); |
|
|
|
int32_t motor_move_to_with_torque(uint16_t id, int32_t pos, int32_t torque); |
|
|
|
int32_t motor_read_pos(uint16_t id, int32_t *pos); |
|
|
|
int32_t motor_set_current_pos_by_change_shift(uint16_t id, int32_t pos); |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* ZIXYMotor * |
|
|
|
*******************************************************************************/ |
|
|
|
int32_t xymotor_enable(uint16_t id, int32_t enable); |
|
|
|
int32_t xymotor_move_by(uint16_t id, int32_t dx, int32_t dy, int32_t motor_velocity); |
|
|
|
int32_t xymotor_move_to(uint16_t id, int32_t x, int32_t y, int32_t motor_velocity); |
|
|
|
#endif
|
|
|
|
|
|
|
|
PROCESS_PACKET_10(module_stop, "module_stop (mid)"); |
|
|
|
PROCESS_PACKET_10(module_break, "module_break (mid)"); |
|
|
|
PROCESS_PACKET_11(module_get_last_exec_status, "get_last_exec_status (mid)"); |
|
|
|
PROCESS_PACKET_11(module_get_status, "get_status (mid)"); |
|
|
|
PROCESS_PACKET_30(module_set_param, "set_param (mid, param_id, param_value)"); |
|
|
|
PROCESS_PACKET_21(module_get_param, "get_param (mid, param_id)"); |
|
|
|
PROCESS_PACKET_11(module_readio, "readio (mid)"); |
|
|
|
PROCESS_PACKET_20(module_writeio, "writeio (mid, io)"); |
|
|
|
PROCESS_PACKET_21(module_read_adc, "read_adc (mid,adc_id, adcindex)"); |
|
|
|
PROCESS_PACKET_11(module_get_error, "get_error (mid)"); |
|
|
|
PROCESS_PACKET_10(module_clear_error, "clear_error (mid)"); |
|
|
|
PROCESS_PACKET_11(module_get_last_exec_status, "module_get_last_exec_status (mid)"); |
|
|
|
PROCESS_PACKET_11(module_get_status, "module_get_status (mid)"); |
|
|
|
PROCESS_PACKET_30(module_set_param, "module_set_param (mid, param_id, param_value)"); |
|
|
|
PROCESS_PACKET_21(module_get_param, "module_get_param (mid, param_id)"); |
|
|
|
PROCESS_PACKET_11(module_readio, "module_readio (mid)"); |
|
|
|
PROCESS_PACKET_20(module_writeio, "module_writeio (mid, io)"); |
|
|
|
PROCESS_PACKET_21(module_read_adc, "module_read_adc (mid,adc_id, adcindex)"); |
|
|
|
PROCESS_PACKET_11(module_get_error, "module_get_error (mid)"); |
|
|
|
PROCESS_PACKET_10(module_clear_error, "module_clear_error (mid)"); |
|
|
|
PROCESS_PACKET_20(module_set_inited_flag, "module_set_inited_flag (mid, flag)"); |
|
|
|
PROCESS_PACKET_11(module_get_inited_flag, "module_get_inited_flag (mid)"); |
|
|
|
|
|
|
|
PROCESS_PACKET_20(motor_enable, "motor_enable (mid, enable)"); |
|
|
|
PROCESS_PACKET_40(motor_rotate, "motor_rotate (mid, direction, motor_velocity, acc)"); |
|
|
@ -69,6 +120,9 @@ void ZModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDevi |
|
|
|
PROCESS_PACKET_50(motor_move_to_zero_forward, "motor_move_to_zero_forward (mid, findzerospeed, findzeroedge_speed, acc, overtime)"); |
|
|
|
PROCESS_PACKET_50(motor_move_to_zero_backward, "motor_move_to_zero_backward (mid, findzerospeed, findzeroedge_speed, acc, overtime)"); |
|
|
|
|
|
|
|
PROCESS_PACKET_11(motor_read_pos, "motor_read_pos (mid)"); |
|
|
|
PROCESS_PACKET_20(motor_set_current_pos_by_change_shift, "motor_set_current_pos_by_change_shift (mid, pos)"); |
|
|
|
|
|
|
|
PROCESS_PACKET_20(xymotor_enable, "xymotor_enable (mid, enable)"); |
|
|
|
PROCESS_PACKET_40(xymotor_move_by, "xymotor_move_by (mid, dx, dy, motor_velocity)"); |
|
|
|
PROCESS_PACKET_40(xymotor_move_to, "xymotor_move_to (mid, x, y, motor_velocity)"); |
|
|
|