77 lines
2.2 KiB
C
Raw Normal View History

2026-07-03 19:21:24 +08:00
#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