2026-07-03 19:21:24 +08:00

77 lines
2.2 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef DIALOGALGOARG_H
#define DIALOGALGOARG_H
#include <QDialog>
#include <QString>
class QLineEdit;
class HandEyeCalibWidget;
class NetworkConfigWidget;
class JiuruiWorkpiecePosePresenter;
namespace Ui {
class DialogAlgoArg;
}
/**
* @brief 工件定位 - 算法参数配置对话框(类比 WorkpieceHole 风格)
*
* 包含五个 Tab
* - 角点检测6 个 corner 参数,所有相机共用)
* - 工件参数len / width / thickness所有相机共用
* - 手眼标定(多相机独立矩阵,存储在 handEyeCalibMatrixList
* - 工具参数(欧拉角顺序、姿态调整、目标点偏移,每相机独立)
* - 网络配置TCP 端口、姿态输出顺序、字节序)
*/
class DialogAlgoArg : public QDialog
{
Q_OBJECT
public:
explicit DialogAlgoArg(QWidget *parent = nullptr);
~DialogAlgoArg();
void SetPresenter(JiuruiWorkpiecePosePresenter* 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 initWorkpieceParamEditors();
void initHandEyeCalibTab();
void initNetworkConfigTab();
void loadParams();
void loadHandEyeCalibConfig();
void loadToolExtrinsicConfig();
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;
JiuruiWorkpiecePosePresenter* m_presenter = nullptr;
HandEyeCalibWidget* m_handEyeCalibWidget = nullptr;
NetworkConfigWidget* m_networkConfigWidget = nullptr;
// 工件参数编辑器(动态创建在独立 Tab 页中)
QLineEdit* m_editWpLength = nullptr;
QLineEdit* m_editWpWidth = nullptr;
QLineEdit* m_editWpThickness = nullptr;
};
#endif // DIALOGALGOARG_H