|
|
@ -17,10 +17,10 @@ void ZModuleDeviceManager::initialize(IZcanCmderMaster *cancmder) { |
|
|
|
m_cancmder = cancmder; |
|
|
|
assert(m_cancmder != nullptr); |
|
|
|
|
|
|
|
m_cancmder->regEventPacketListener([this](uint8_t *data, size_t len) { |
|
|
|
if (len < 4) return; |
|
|
|
m_cancmder->regEventPacketListener([this](int32_t fromboard, zcr_cmd_header_t *packet, int32_t datalen) { |
|
|
|
if (datalen < 4) return; |
|
|
|
|
|
|
|
int32_t *pdata = (int32_t *)data; |
|
|
|
int32_t *pdata = (int32_t *)packet->data; |
|
|
|
int32_t event = pdata[0]; |
|
|
|
if (event == kreg_change_event) { |
|
|
|
int32_t moduleid = pdata[1]; |
|
|
@ -45,8 +45,12 @@ int32_t ZModuleDeviceManager::module_stop(uint16_t id) { PROXY_IMPL(ZIModule, mo |
|
|
|
int32_t ZModuleDeviceManager::module_break(uint16_t id) { PROXY_IMPL(ZIModule, module_break); } |
|
|
|
int32_t ZModuleDeviceManager::module_get_last_exec_status(uint16_t id, int32_t *ack0) { PROXY_IMPL(ZIModule, module_get_last_exec_status, ack0); } |
|
|
|
int32_t ZModuleDeviceManager::module_get_status(uint16_t id, int32_t *status) { PROXY_IMPL(ZIModule, module_get_status, status); } |
|
|
|
int32_t ZModuleDeviceManager::module_set_reg(uint16_t id, int32_t param_id, int32_t param_value) { PROXY_IMPL(ZIModule, module_set_reg, param_id, param_value); } |
|
|
|
int32_t ZModuleDeviceManager::module_get_reg(uint16_t id, int32_t param_id, int32_t *param_value) { PROXY_IMPL(ZIModule, module_get_reg, param_id, param_value); } |
|
|
|
int32_t ZModuleDeviceManager::module_set_reg(uint16_t id, int32_t param_id, int32_t param_value) { |
|
|
|
PROXY_IMPL(ZIModule, module_set_reg, param_id, param_value); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::module_get_reg(uint16_t id, int32_t param_id, int32_t *param_value) { |
|
|
|
PROXY_IMPL(ZIModule, module_get_reg, param_id, param_value); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::module_readio(uint16_t id, int32_t *io) { PROXY_IMPL(ZIModule, module_readio, io); } |
|
|
|
int32_t ZModuleDeviceManager::module_writeio(uint16_t id, int32_t ioindex, int32_t io) { PROXY_IMPL(ZIModule, module_writeio, ioindex, io); } |
|
|
|
int32_t ZModuleDeviceManager::module_read_adc(uint16_t id, int32_t adcindex, int32_t *adc) { PROXY_IMPL(ZIModule, module_read_adc, adcindex, adc); } |
|
|
@ -57,7 +61,9 @@ int32_t ZModuleDeviceManager::module_get_inited_flag(uint16_t id, int32_t *flag) |
|
|
|
int32_t ZModuleDeviceManager::module_factory_reset(uint16_t id) { PROXY_IMPL(ZIModule, module_factory_reset); } |
|
|
|
int32_t ZModuleDeviceManager::module_flush_cfg(uint16_t id) { PROXY_IMPL(ZIModule, module_flush_cfg); } |
|
|
|
int32_t ZModuleDeviceManager::module_active_cfg(uint16_t id) { PROXY_IMPL(ZIModule, module_active_cfg); } |
|
|
|
int32_t ZModuleDeviceManager::module_read_raw(uint16_t id, int32_t startadd, uint8_t *data, int32_t *len) { PROXY_IMPL(ZIModule, module_read_raw, startadd, data, len); } |
|
|
|
int32_t ZModuleDeviceManager::module_read_raw(uint16_t id, int32_t startadd, uint8_t *data, int32_t *len) { |
|
|
|
PROXY_IMPL(ZIModule, module_read_raw, startadd, data, len); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::module_enable(uint16_t id, int32_t enable) { PROXY_IMPL(ZIModule, module_enable, enable); } |
|
|
|
int32_t ZModuleDeviceManager::module_start(uint16_t id) { PROXY_IMPL(ZIModule, module_start); } |
|
|
|
|
|
|
@ -84,25 +90,53 @@ int32_t ZModuleDeviceManager::module_start(uint16_t id) { PROXY_IMPL(ZIModule, m |
|
|
|
virtual int32_t motor_move_to_zero_backward_and_calculated_shift(int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { return err::koperation_not_support; } |
|
|
|
|
|
|
|
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_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); } |
|
|
|
int32_t ZModuleDeviceManager::motor_rotate(uint16_t id, int32_t direction, int32_t motor_velocity, int32_t acc) { PROXY_IMPL(ZIMotor, motor_rotate, direction, motor_velocity, acc); } |
|
|
|
int32_t ZModuleDeviceManager::motor_move_by(uint16_t id, int32_t distance, int32_t motor_velocity, int32_t acc) { PROXY_IMPL(ZIMotor, motor_move_by, distance, motor_velocity, acc); } |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to(uint16_t id, int32_t position, int32_t motor_velocity, int32_t acc) { PROXY_IMPL(ZIMotor, motor_move_to, position, motor_velocity, acc); } |
|
|
|
int32_t ZModuleDeviceManager::motor_rotate_with_torque(uint16_t id, int32_t direction, int32_t torque) { PROXY_IMPL(ZIMotor, motor_rotate_with_torque, direction, torque); } |
|
|
|
int32_t ZModuleDeviceManager::motor_rotate_acctime(uint16_t id, int32_t direction, int32_t motor_velocity, int32_t acctime) { PROXY_IMPL(ZIMotor, motor_rotate_acctime, direction, motor_velocity, acctime); } |
|
|
|
int32_t ZModuleDeviceManager::motor_move_by_acctime(uint16_t id, int32_t distance, int32_t motor_velocity, int32_t acctime) { PROXY_IMPL(ZIMotor, motor_move_by_acctime, distance, motor_velocity, acctime); } |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to_acctime(uint16_t id, int32_t position, int32_t motor_velocity, int32_t acctime) { PROXY_IMPL(ZIMotor, motor_move_to_acctime, position, motor_velocity, acctime); } |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to_zero_forward(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { PROXY_IMPL(ZIMotor, motor_move_to_zero_forward, findzerospeed, findzeroedge_speed, acc, overtime); } |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to_zero_backward(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { PROXY_IMPL(ZIMotor, motor_move_to_zero_backward, findzerospeed, findzeroedge_speed, acc, overtime); } |
|
|
|
int32_t ZModuleDeviceManager::motor_rotate(uint16_t id, int32_t direction, int32_t motor_velocity, int32_t acc) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_rotate, direction, motor_velocity, acc); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_move_by(uint16_t id, int32_t distance, int32_t motor_velocity, int32_t acc) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_move_by, distance, motor_velocity, acc); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to(uint16_t id, int32_t position, int32_t motor_velocity, int32_t acc) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_move_to, position, motor_velocity, acc); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_rotate_with_torque(uint16_t id, int32_t direction, int32_t torque) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_rotate_with_torque, direction, torque); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_rotate_acctime(uint16_t id, int32_t direction, int32_t motor_velocity, int32_t acctime) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_rotate_acctime, direction, motor_velocity, acctime); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_move_by_acctime(uint16_t id, int32_t distance, int32_t motor_velocity, int32_t acctime) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_move_by_acctime, distance, motor_velocity, acctime); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to_acctime(uint16_t id, int32_t position, int32_t motor_velocity, int32_t acctime) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_move_to_acctime, position, motor_velocity, acctime); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to_zero_forward(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_move_to_zero_forward, findzerospeed, findzeroedge_speed, acc, overtime); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_move_to_zero_backward(uint16_t id, int32_t findzerospeed, int32_t findzeroedge_speed, int32_t acc, int32_t overtime) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_move_to_zero_backward, findzerospeed, findzeroedge_speed, acc, overtime); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::motor_read_pos(uint16_t id, int32_t *pos) { PROXY_IMPL(ZIMotor, motor_read_pos, pos); } |
|
|
|
int32_t ZModuleDeviceManager::motor_set_current_pos_by_change_shift(uint16_t id, int32_t pos) { PROXY_IMPL(ZIMotor, motor_set_current_pos_by_change_shift, pos); } |
|
|
|
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_set_current_pos_by_change_shift(uint16_t id, int32_t pos) { |
|
|
|
PROXY_IMPL(ZIMotor, motor_set_current_pos_by_change_shift, pos); |
|
|
|
} |
|
|
|
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 * |
|
|
@ -116,8 +150,12 @@ int32_t ZModuleDeviceManager::motor_calculated_pos_by_move_to_zero(uint16_t id) |
|
|
|
virtual int32_t xymotor_read_pos(int32_t *x, int32_t *y) { return err::koperation_not_support; } |
|
|
|
#endif
|
|
|
|
int32_t ZModuleDeviceManager::xymotor_enable(uint16_t id, int32_t enable) { PROXY_IMPL(ZIXYMotor, xymotor_enable, enable); } |
|
|
|
int32_t ZModuleDeviceManager::xymotor_move_by(uint16_t id, int32_t dx, int32_t dy, int32_t motor_velocity) { PROXY_IMPL(ZIXYMotor, xymotor_move_by, dx, dy, motor_velocity); } |
|
|
|
int32_t ZModuleDeviceManager::xymotor_move_to(uint16_t id, int32_t x, int32_t y, int32_t motor_velocity) { PROXY_IMPL(ZIXYMotor, xymotor_move_to, x, y, motor_velocity); } |
|
|
|
int32_t ZModuleDeviceManager::xymotor_move_by(uint16_t id, int32_t dx, int32_t dy, int32_t motor_velocity) { |
|
|
|
PROXY_IMPL(ZIXYMotor, xymotor_move_by, dx, dy, motor_velocity); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::xymotor_move_to(uint16_t id, int32_t x, int32_t y, int32_t motor_velocity) { |
|
|
|
PROXY_IMPL(ZIXYMotor, xymotor_move_to, x, y, motor_velocity); |
|
|
|
} |
|
|
|
int32_t ZModuleDeviceManager::xymotor_move_to_zero(uint16_t id) { PROXY_IMPL(ZIXYMotor, xymotor_move_to_zero); } |
|
|
|
int32_t ZModuleDeviceManager::xymotor_move_to_zero_and_calculated_shift(uint16_t id) { PROXY_IMPL(ZIXYMotor, xymotor_move_to_zero_and_calculated_shift); } |
|
|
|
int32_t ZModuleDeviceManager::xymotor_read_pos(uint16_t id, int32_t *x, int32_t *y) { PROXY_IMPL(ZIXYMotor, xymotor_read_pos, x, y); } |
|
|
@ -130,7 +168,9 @@ int32_t ZModuleDeviceManager::xymotor_calculated_pos_by_move_to_zero(uint16_t id |
|
|
|
#endif
|
|
|
|
int32_t ZModuleDeviceManager::code_scaner_start_scan(uint16_t id) { PROXY_IMPL(ZICodeScaner, code_scaner_start_scan); } |
|
|
|
int32_t ZModuleDeviceManager::code_scaner_stop_scan(uint16_t id) { PROXY_IMPL(ZICodeScaner, code_scaner_stop_scan); } |
|
|
|
int32_t ZModuleDeviceManager::code_scaner_read_scaner_result(uint16_t id, int32_t startadd, uint8_t *data, int32_t *len) { PROXY_IMPL(ZICodeScaner, code_scaner_read_scaner_result, startadd, data, len); } |
|
|
|
int32_t ZModuleDeviceManager::code_scaner_read_scaner_result(uint16_t id, int32_t startadd, uint8_t *data, int32_t *len) { |
|
|
|
PROXY_IMPL(ZICodeScaner, code_scaner_read_scaner_result, startadd, data, len); |
|
|
|
} |
|
|
|
|
|
|
|
#if 0
|
|
|
|
virtual int32_t pipette_ctrl_init_device() { return err::koperation_not_support; }; |
|
|
|