Browse Source

Version5

master
zhaohe 1 year ago
parent
commit
d27d03b79b
  1. 26
      src/tab/step_motor_ctrl_tab.cpp

26
src/tab/step_motor_ctrl_tab.cpp

@ -42,21 +42,14 @@ void StepMotorCtrlTab::construct(QTabWidget *fathertab) {
ZQVTabPage *tab = new ZQVTabPage(fathertab, "步进电机");
{
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "方法", 4);
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "方法组1", 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) { 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) {});
{
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "方法组2", 4);
box->newFunc("设置当前位置", {"position"}, [this](int argn, const char **args) { ICM->step_motor_easy_set_current_pos(getDeviceId(), atoi(args[0])); });
box->newFunc("读取位置", {}, [this](int argn, const char **args) {
int32_t pos = 0;
@ -91,6 +84,17 @@ void StepMotorCtrlTab::construct(QTabWidget *fathertab) {
ZQUI::ins()->ishow("stst :%d", status.stst);
});
}
{
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "方法组3", 4);
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])); });
}
tab->addSpacer();
}

Loading…
Cancel
Save