|
|
@ -44,28 +44,30 @@ void StepMotorCtrlTab::construct(QTabWidget *fathertab) { |
|
|
|
{ |
|
|
|
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "方法", 4); |
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
box->newFunc("使能", {"enable"}, [this](int argn, const char **args) { ICM->step_motor_enable(getDeviceId(), atoi(args[0])); }); |
|
|
|
box->newFunc("读取位置", {}, [this](int argn, const char **args) { |
|
|
|
int32_t pos = 0; |
|
|
|
ICM->step_motor_read_pos(getDeviceId(), &pos); |
|
|
|
ZQUI::ins()->ishow("Pos:%d", pos); |
|
|
|
}); |
|
|
|
box->newFunc("停止", {}, [this](int argn, const char **args) { ICM->step_motor_stop(getDeviceId(), 0); }); |
|
|
|
box->newFunc("激活配置", {}, [this](int argn, const char **args) { ICM->step_motor_active_cfg(getDeviceId()); }); |
|
|
|
box->newFunc("", {}, [this](int argn, const char **args) {}); |
|
|
|
|
|
|
|
box->newFunc("旋转", {"direction"}, [this](int argn, const char **args) { ICM->step_motor_easy_rotate(getDeviceId(), atoi(args[0])); }); |
|
|
|
box->newFunc("相对移动", {"distance"}, [this](int argn, const char **args) { ICM->step_motor_easy_move_by(getDeviceId(), atoi(args[0])); }); |
|
|
|
box->newFunc("移动到", {"position"}, [this](int argn, const char **args) { ICM->step_motor_easy_move_to(getDeviceId(), atoi(args[0])); }); |
|
|
|
box->newFunc("归零", {}, [this](int argn, const char **args) { ICM->step_motor_easy_move_to_zero(getDeviceId()); }); |
|
|
|
box->newFunc("移动到终点", {}, [this](int argn, const char **args) { ICM->callcmd0(getDeviceId(), kstep_motor_easy_move_to_end_point); }); |
|
|
|
box->newFunc("移动到IO", {"ioindex", "direction"}, [this](int argn, const char **args) { ICM->step_motor_easy_move_to_io(getDeviceId(), atoi(args[0]), atoi(args[1])); }); |
|
|
|
|
|
|
|
box->newFunc("", {}, [this](int argn, const char **args) {}); |
|
|
|
box->newFunc("设置当前位置", {"position"}, [this](int argn, const char **args) { ICM->step_motor_easy_set_current_pos(getDeviceId(), atoi(args[0])); }); |
|
|
|
box->newFunc("移动到IO", {"ioindex"}, [this](int argn, const char **args) { ICM->step_motor_easy_move_to_io(getDeviceId(), atoi(args[0])); }); |
|
|
|
box->newFunc("激活配置", {}, [this](int argn, const char **args) { ICM->step_motor_active_cfg(getDeviceId()); }); |
|
|
|
box->newFunc("停止", {}, [this](int argn, const char **args) { ICM->step_motor_stop(getDeviceId(), 0); }); |
|
|
|
box->newFunc("读取位置", {}, [this](int argn, const char **args) { |
|
|
|
int32_t pos = 0; |
|
|
|
ICM->step_motor_read_pos(getDeviceId(), &pos); |
|
|
|
ZQUI::ins()->ishow("Pos:%d", pos); |
|
|
|
}); |
|
|
|
box->newFunc("读取IO状态", {"ioindex"}, [this](int argn, const char **args) { |
|
|
|
int32_t io = 0; |
|
|
|
ICM->step_motor_read_io_state(getDeviceId(), atoi(args[0]), &io); |
|
|
|
ZQUI::ins()->ishow("IO:%d", io); |
|
|
|
}); |
|
|
|
|
|
|
|
box->newFunc("读取5130电机详细状态", {"ioindex"}, [this](int argn, const char **args) { |
|
|
|
ICM->callcmd0(getDeviceId(), kstep_motor_read_tmc5130_status); |
|
|
|
|
|
|
|