|
@ -1,4 +1,5 @@ |
|
|
#include "micro_computer_module_device_script_cmder_paser.hpp"
|
|
|
#include "micro_computer_module_device_script_cmder_paser.hpp"
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
#include "sdk/os/zos.hpp"
|
|
|
#include "sdk/os/zos.hpp"
|
|
@ -7,17 +8,13 @@ using namespace std; |
|
|
|
|
|
|
|
|
#define TAG "CMD"
|
|
|
#define TAG "CMD"
|
|
|
|
|
|
|
|
|
void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDeviceManager* deviceManager) { |
|
|
|
|
|
ZModuleDeviceScriptCmderPaser::initialize(cancmder, deviceManager); |
|
|
|
|
|
m_cmdParser = cancmder; |
|
|
|
|
|
m_deviceManager = deviceManager; |
|
|
|
|
|
|
|
|
|
|
|
cancmder->regCMD("dumpconfig", "dumpconfig (mid)", 1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { //
|
|
|
|
|
|
ack->ecode = 0; |
|
|
|
|
|
|
|
|
void MicroComputerModuleDeviceScriptCmderPaser::do_dumpconfig(int32_t paramN, const char* paraV[], ICmdParserACK* ack) { |
|
|
|
|
|
//
|
|
|
|
|
|
ack->ecode = 0; |
|
|
|
|
|
|
|
|
uint16_t moduleId = atoi(paraV[0]); |
|
|
|
|
|
int32_t configval = 0; |
|
|
|
|
|
int32_t ecode = 0; |
|
|
|
|
|
|
|
|
uint16_t moduleId = atoi(paraV[0]); |
|
|
|
|
|
int32_t configval = 0; |
|
|
|
|
|
int32_t ecode = 0; |
|
|
|
|
|
|
|
|
#define DUMP_CONFIG(tag, configid) \
|
|
|
#define DUMP_CONFIG(tag, configid) \
|
|
|
ecode = m_deviceManager->module_get_param(moduleId, configid, &configval); \ |
|
|
ecode = m_deviceManager->module_get_param(moduleId, configid, &configval); \ |
|
@ -25,33 +22,39 @@ void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, |
|
|
ZLOGI(TAG, "%30s :%d", tag, configval); \ |
|
|
ZLOGI(TAG, "%30s :%d", tag, configval); \ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
DUMP_CONFIG("motor_x_shift", kcfg_motor_x_shift); |
|
|
|
|
|
DUMP_CONFIG("motor_y_shift", kcfg_motor_y_shift); |
|
|
|
|
|
DUMP_CONFIG("motor_z_shift", kcfg_motor_z_shift); |
|
|
|
|
|
DUMP_CONFIG("motor_x_shaft", kcfg_motor_x_shaft); |
|
|
|
|
|
DUMP_CONFIG("motor_y_shaft", kcfg_motor_y_shaft); |
|
|
|
|
|
DUMP_CONFIG("motor_z_shaft", kcfg_motor_z_shaft); |
|
|
|
|
|
DUMP_CONFIG("motor_x_one_circle_pulse", kcfg_motor_x_one_circle_pulse); |
|
|
|
|
|
DUMP_CONFIG("motor_y_one_circle_pulse", kcfg_motor_y_one_circle_pulse); |
|
|
|
|
|
DUMP_CONFIG("motor_z_one_circle_pulse", kcfg_motor_z_one_circle_pulse); |
|
|
|
|
|
DUMP_CONFIG("motor_default_velocity", kcfg_motor_default_velocity); |
|
|
|
|
|
DUMP_CONFIG("motor_default_acc", kcfg_motor_default_acc); |
|
|
|
|
|
DUMP_CONFIG("motor_default_dec", kcfg_motor_default_dec); |
|
|
|
|
|
DUMP_CONFIG("motor_default_break_dec", kcfg_motor_default_break_dec); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_max_x_d", kcfg_motor_run_to_zero_max_x_d); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_max_y_d", kcfg_motor_run_to_zero_max_y_d); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_max_z_d", kcfg_motor_run_to_zero_max_z_d); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_max_x_d", kcfg_motor_look_zero_edge_max_x_d); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_max_y_d", kcfg_motor_look_zero_edge_max_y_d); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_max_z_d", kcfg_motor_look_zero_edge_max_z_d); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_speed", kcfg_motor_run_to_zero_speed); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_dec", kcfg_motor_run_to_zero_dec); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_speed", kcfg_motor_look_zero_edge_speed); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_dec", kcfg_motor_look_zero_edge_dec); |
|
|
|
|
|
DUMP_CONFIG("cfg_stepmotor_ihold", k_cfg_stepmotor_ihold); |
|
|
|
|
|
DUMP_CONFIG("cfg_stepmotor_irun", k_cfg_stepmotor_irun); |
|
|
|
|
|
DUMP_CONFIG("cfg_stepmotor_iholddelay", k_cfg_stepmotor_iholddelay); |
|
|
|
|
|
DUMP_CONFIG("cfg_xyrobot_robot_type", k_cfg_xyrobot_robot_type); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
DUMP_CONFIG("motor_x_shift", kcfg_motor_x_shift); |
|
|
|
|
|
DUMP_CONFIG("motor_y_shift", kcfg_motor_y_shift); |
|
|
|
|
|
DUMP_CONFIG("motor_z_shift", kcfg_motor_z_shift); |
|
|
|
|
|
DUMP_CONFIG("motor_x_shaft", kcfg_motor_x_shaft); |
|
|
|
|
|
DUMP_CONFIG("motor_y_shaft", kcfg_motor_y_shaft); |
|
|
|
|
|
DUMP_CONFIG("motor_z_shaft", kcfg_motor_z_shaft); |
|
|
|
|
|
DUMP_CONFIG("motor_x_one_circle_pulse", kcfg_motor_x_one_circle_pulse); |
|
|
|
|
|
DUMP_CONFIG("motor_y_one_circle_pulse", kcfg_motor_y_one_circle_pulse); |
|
|
|
|
|
DUMP_CONFIG("motor_z_one_circle_pulse", kcfg_motor_z_one_circle_pulse); |
|
|
|
|
|
DUMP_CONFIG("motor_default_velocity", kcfg_motor_default_velocity); |
|
|
|
|
|
DUMP_CONFIG("motor_default_acc", kcfg_motor_default_acc); |
|
|
|
|
|
DUMP_CONFIG("motor_default_dec", kcfg_motor_default_dec); |
|
|
|
|
|
DUMP_CONFIG("motor_default_break_dec", kcfg_motor_default_break_dec); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_max_x_d", kcfg_motor_run_to_zero_max_x_d); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_max_y_d", kcfg_motor_run_to_zero_max_y_d); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_max_z_d", kcfg_motor_run_to_zero_max_z_d); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_max_x_d", kcfg_motor_look_zero_edge_max_x_d); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_max_y_d", kcfg_motor_look_zero_edge_max_y_d); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_max_z_d", kcfg_motor_look_zero_edge_max_z_d); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_speed", kcfg_motor_run_to_zero_speed); |
|
|
|
|
|
DUMP_CONFIG("motor_run_to_zero_dec", kcfg_motor_run_to_zero_dec); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_speed", kcfg_motor_look_zero_edge_speed); |
|
|
|
|
|
DUMP_CONFIG("motor_look_zero_edge_dec", kcfg_motor_look_zero_edge_dec); |
|
|
|
|
|
DUMP_CONFIG("cfg_stepmotor_ihold", k_cfg_stepmotor_ihold); |
|
|
|
|
|
DUMP_CONFIG("cfg_stepmotor_irun", k_cfg_stepmotor_irun); |
|
|
|
|
|
DUMP_CONFIG("cfg_stepmotor_iholddelay", k_cfg_stepmotor_iholddelay); |
|
|
|
|
|
DUMP_CONFIG("cfg_xyrobot_robot_type", k_cfg_xyrobot_robot_type); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MicroComputerModuleDeviceScriptCmderPaser::initialize(ICmdParser* cancmder, ZModuleDeviceManager* deviceManager) { |
|
|
|
|
|
ZModuleDeviceScriptCmderPaser::initialize(cancmder, deviceManager); |
|
|
|
|
|
m_cmdParser = cancmder; |
|
|
|
|
|
m_deviceManager = deviceManager; |
|
|
|
|
|
|
|
|
|
|
|
cancmder->regCMD("dumpconfig", "dumpconfig (mid)", 1, [this](int32_t paramN, const char* paraV[], ICmdParserACK* ack) { do_dumpconfig(paramN, paraV, ack); }); |
|
|
} |
|
|
} |