|
|
@ -70,18 +70,75 @@ void MicroComputerModuleDeviceScriptCmderPaser::do_dumpstate(int32_t paramN, con |
|
|
|
#if 0
|
|
|
|
typedef enum { |
|
|
|
|
|
|
|
kstate_module_status = STATE_INDEX(0, 0), //
|
|
|
|
kstate_module_status = STATE_INDEX(0, 0), // 0idle,1busy,2error
|
|
|
|
kstate_module_errorcode = STATE_INDEX(0, 1), //
|
|
|
|
|
|
|
|
kstate_motor_x_pos = STATE_INDEX(100, 0), // x偏移
|
|
|
|
kstate_motor_y_pos = STATE_INDEX(100, 1), // y偏移
|
|
|
|
kstate_motor_z_pos = STATE_INDEX(100, 2), // z偏移
|
|
|
|
|
|
|
|
kstate_motor_move = STATE_INDEX(100, 3), // 电机是否移动
|
|
|
|
kstate_motor_enable = STATE_INDEX(100, 4), // 电机是否使能
|
|
|
|
kstate_motor1_move = STATE_INDEX(100, 0), //
|
|
|
|
kstate_motor1_enable = STATE_INDEX(100, 1), //
|
|
|
|
kstate_motor1_current = STATE_INDEX(100, 2), //
|
|
|
|
kstate_motor1_vel = STATE_INDEX(100, 3), //
|
|
|
|
kstate_motor1_pos = STATE_INDEX(100, 4), //
|
|
|
|
kstate_motor1_temperature = STATE_INDEX(100, 5), //
|
|
|
|
kstate_motor1_dpos = STATE_INDEX(100, 6), //
|
|
|
|
|
|
|
|
kstate_motor2_move = STATE_INDEX(110, 0), //
|
|
|
|
kstate_motor2_enable = STATE_INDEX(110, 1), //
|
|
|
|
kstate_motor2_current = STATE_INDEX(110, 2), //
|
|
|
|
kstate_motor2_vel = STATE_INDEX(110, 3), //
|
|
|
|
kstate_motor2_pos = STATE_INDEX(110, 4), //
|
|
|
|
kstate_motor2_temperature = STATE_INDEX(110, 5), //
|
|
|
|
kstate_motor2_dpos = STATE_INDEX(110, 6), //
|
|
|
|
|
|
|
|
kstate_xyrobot_move = STATE_INDEX(1000, 0), //
|
|
|
|
kstate_xyrobot_enable = STATE_INDEX(1000, 1), //
|
|
|
|
kstate_xyrobot_x_pos = STATE_INDEX(1000, 2), //
|
|
|
|
kstate_xyrobot_y_pos = STATE_INDEX(1000, 3), //
|
|
|
|
kstate_xyrobot_z_pos = STATE_INDEX(1000, 4), //
|
|
|
|
kstate_xyrobot_x_dpos = STATE_INDEX(1000, 5), //
|
|
|
|
kstate_xyrobot_y_dpos = STATE_INDEX(1000, 6), //
|
|
|
|
kstate_xyrobot_z_dpos = STATE_INDEX(1000, 7), //
|
|
|
|
|
|
|
|
} config_index_t; |
|
|
|
#endif
|
|
|
|
|
|
|
|
ack->ecode = 0; |
|
|
|
|
|
|
|
uint16_t moduleId = atoi(paraV[0]); |
|
|
|
int32_t configval = 0; |
|
|
|
int32_t ecode = 0; |
|
|
|
ZLOGI(TAG, "dumpstate %s", paraV[0]); |
|
|
|
|
|
|
|
#define DUMP_STATE(tag, configid) \
|
|
|
|
ecode = m_deviceManager->module_get_state(moduleId, configid, &configval); \ |
|
|
|
if (ecode == 0) { \ |
|
|
|
ZLOGI(TAG, "%-30s :%d", tag, configval); \ |
|
|
|
} |
|
|
|
DUMP_STATE("kstate_module_status", kstate_module_status); |
|
|
|
DUMP_STATE("kstate_module_errorcode", kstate_module_errorcode); |
|
|
|
DUMP_STATE("kstate_motor1_move", kstate_motor1_move); |
|
|
|
DUMP_STATE("kstate_motor1_enable", kstate_motor1_enable); |
|
|
|
DUMP_STATE("kstate_motor1_current", kstate_motor1_current); |
|
|
|
DUMP_STATE("kstate_motor1_vel", kstate_motor1_vel); |
|
|
|
DUMP_STATE("kstate_motor1_pos", kstate_motor1_pos); |
|
|
|
DUMP_STATE("kstate_motor1_temperature", kstate_motor1_temperature); |
|
|
|
DUMP_STATE("kstate_motor1_dpos", kstate_motor1_dpos); |
|
|
|
DUMP_STATE("kstate_motor2_move", kstate_motor2_move); |
|
|
|
DUMP_STATE("kstate_motor2_enable", kstate_motor2_enable); |
|
|
|
DUMP_STATE("kstate_motor2_current", kstate_motor2_current); |
|
|
|
DUMP_STATE("kstate_motor2_vel", kstate_motor2_vel); |
|
|
|
DUMP_STATE("kstate_motor2_pos", kstate_motor2_pos); |
|
|
|
DUMP_STATE("kstate_motor2_temperature", kstate_motor2_temperature); |
|
|
|
DUMP_STATE("kstate_motor2_dpos", kstate_motor2_dpos); |
|
|
|
DUMP_STATE("kstate_xyrobot_move", kstate_xyrobot_move); |
|
|
|
DUMP_STATE("kstate_xyrobot_enable", kstate_xyrobot_enable); |
|
|
|
DUMP_STATE("kstate_xyrobot_x_pos", kstate_xyrobot_x_pos); |
|
|
|
DUMP_STATE("kstate_xyrobot_y_pos", kstate_xyrobot_y_pos); |
|
|
|
DUMP_STATE("kstate_xyrobot_z_pos", kstate_xyrobot_z_pos); |
|
|
|
DUMP_STATE("kstate_xyrobot_x_dpos", kstate_xyrobot_x_dpos); |
|
|
|
DUMP_STATE("kstate_xyrobot_y_dpos", kstate_xyrobot_y_dpos); |
|
|
|
DUMP_STATE("kstate_xyrobot_z_dpos", kstate_xyrobot_z_dpos); |
|
|
|
|
|
|
|
// module_get_state
|
|
|
|
} |
|
|
|
void MicroComputerModuleDeviceScriptCmderPaser::do_dumpstate(int32_t moduleId) { |
|
|
|
ICmdParserACK ack; |
|
|
|