51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
|
|
#ifndef DIALOGCONFIG_H
|
|||
|
|
#define DIALOGCONFIG_H
|
|||
|
|
|
|||
|
|
#include <QDialog>
|
|||
|
|
#include <QSettings>
|
|||
|
|
|
|||
|
|
namespace Ui {
|
|||
|
|
class DialogConfig;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
class DemoControlPresenter;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief 配置对话框
|
|||
|
|
*
|
|||
|
|
* 用于配置控制器IP、机械臂IP、准备位置、放置位置等参数
|
|||
|
|
*/
|
|||
|
|
class DialogConfig : public QDialog
|
|||
|
|
{
|
|||
|
|
Q_OBJECT
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
explicit DialogConfig(DemoControlPresenter* presenter, QWidget *parent = nullptr);
|
|||
|
|
~DialogConfig();
|
|||
|
|
|
|||
|
|
// 静态方法:从配置文件加载配置到Presenter
|
|||
|
|
static void LoadConfigToPresenter(DemoControlPresenter* presenter);
|
|||
|
|
|
|||
|
|
private slots:
|
|||
|
|
void on_btn_save_clicked();
|
|||
|
|
void on_btn_cancel_clicked();
|
|||
|
|
void on_btn_test_controller_clicked();
|
|||
|
|
void on_btn_test_robot_clicked();
|
|||
|
|
void on_btn_test_ready_clicked();
|
|||
|
|
void on_btn_test_place_clicked();
|
|||
|
|
void on_btn_read_ready_clicked();
|
|||
|
|
void on_btn_read_place_clicked();
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
void loadCurrentConfig();
|
|||
|
|
void saveConfig();
|
|||
|
|
void saveConfigToFile();
|
|||
|
|
void loadConfigFromFile();
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
Ui::DialogConfig *ui;
|
|||
|
|
DemoControlPresenter* m_presenter;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
#endif // DIALOGCONFIG_H
|