74 lines
2.0 KiB
C++
74 lines
2.0 KiB
C++
#ifndef DIALOGALGOARG_H
|
||
#define DIALOGALGOARG_H
|
||
|
||
#include <QDialog>
|
||
#include <QString>
|
||
|
||
class QLineEdit;
|
||
class HandEyeCalibWidget;
|
||
class NetworkConfigWidget;
|
||
class TireHolePosePresenter;
|
||
|
||
namespace Ui {
|
||
class DialogAlgoArg;
|
||
}
|
||
|
||
/**
|
||
* @brief 轮胎孔定位 - 算法参数配置对话框(类比 WorkpieceHole 风格)
|
||
*
|
||
* 包含四个 Tab:
|
||
* - 角点检测(6 个 corner 参数,所有相机共用)
|
||
* - 轮胎参数(diameter / thickness,所有相机共用)
|
||
* - 手眼标定(多相机独立矩阵,存储在 handEyeCalibMatrixList)
|
||
* - 网络配置(TCP 端口、姿态输出顺序、字节序)
|
||
*/
|
||
class DialogAlgoArg : public QDialog
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit DialogAlgoArg(QWidget *parent = nullptr);
|
||
~DialogAlgoArg();
|
||
|
||
void SetPresenter(TireHolePosePresenter* presenter);
|
||
|
||
private slots:
|
||
void on_btnOK_clicked();
|
||
void on_btnCancel_clicked();
|
||
void on_btnApply_clicked();
|
||
void on_btnReset_clicked();
|
||
|
||
void onCalibMatrixLoaded(int cameraIndex, const double* matrix);
|
||
void onSaveCalibRequested(int cameraIndex, const double* matrix);
|
||
|
||
private:
|
||
void initNumericEditors();
|
||
void initTireParamEditors();
|
||
void initHandEyeCalibTab();
|
||
void initNetworkConfigTab();
|
||
|
||
void loadParams();
|
||
void loadHandEyeCalibConfig();
|
||
void loadNetworkConfig();
|
||
|
||
bool saveParams();
|
||
void resetParams();
|
||
|
||
void setDoubleEditorText(QLineEdit* edit, double value);
|
||
void setIntEditorText(QLineEdit* edit, int value);
|
||
bool tryGetDouble(QLineEdit* edit, const QString& label, double& value);
|
||
bool tryGetInt(QLineEdit* edit, const QString& label, int& value);
|
||
|
||
private:
|
||
Ui::DialogAlgoArg *ui = nullptr;
|
||
TireHolePosePresenter* m_presenter = nullptr;
|
||
HandEyeCalibWidget* m_handEyeCalibWidget = nullptr;
|
||
NetworkConfigWidget* m_networkConfigWidget = nullptr;
|
||
|
||
// 轮胎参数编辑器(动态创建在独立 Tab 页中)
|
||
QLineEdit* m_editTireDiameter = nullptr;
|
||
QLineEdit* m_editTireThickness = nullptr;
|
||
};
|
||
|
||
#endif // DIALOGALGOARG_H
|