2026-08-04 14:23:07 +08:00
|
|
|
|
#ifndef DIALOGALGOARG_H
|
|
|
|
|
|
#define DIALOGALGOARG_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
#include "ConfigManager.h"
|
|
|
|
|
|
|
2026-09-19 09:44:46 +08:00
|
|
|
|
class HandEyeCalibWidget;
|
2026-08-04 14:23:07 +08:00
|
|
|
|
class ToolExtrinsicWidget;
|
|
|
|
|
|
class NetworkConfigWidget;
|
2026-10-01 21:26:34 +08:00
|
|
|
|
class PointCloudFilterWidget;
|
2026-08-04 14:23:07 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
|
class DialogAlgoarg;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class DialogAlgoarg : public QDialog
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit DialogAlgoarg(ConfigManager* configManager, QWidget *parent = nullptr);
|
|
|
|
|
|
~DialogAlgoarg();
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void on_btn_camer_ok_clicked();
|
|
|
|
|
|
void on_btn_camer_cancel_clicked();
|
2026-09-19 09:44:46 +08:00
|
|
|
|
void onCalibMatrixLoaded(int cameraIndex, const double* matrix);
|
|
|
|
|
|
void onSaveCalibRequested(int cameraIndex, const double* matrix);
|
2026-08-04 14:23:07 +08:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
void LoadConfigToUI();
|
|
|
|
|
|
bool SaveConfigFromUI();
|
|
|
|
|
|
|
|
|
|
|
|
void InitToolExtrinsicTab();
|
2026-09-19 09:44:46 +08:00
|
|
|
|
void InitHandEyeCalibTab();
|
2026-08-04 14:23:07 +08:00
|
|
|
|
void InitNetworkConfigTab();
|
2026-10-01 21:26:34 +08:00
|
|
|
|
void initWorkpieceSizesTab();
|
|
|
|
|
|
void addWorkpieceSizeRow(const VrRotorWorkpieceSize& size);
|
|
|
|
|
|
void refreshWorkpieceRows(int defaultRow);
|
|
|
|
|
|
void moveWorkpieceRow(int row, int offset);
|
|
|
|
|
|
void removeWorkpieceRow(int row);
|
|
|
|
|
|
void updateWorkpieceActions();
|
|
|
|
|
|
void loadWorkpieceSizes(const VrRotorCoreParam& rotorParam);
|
|
|
|
|
|
bool saveWorkpieceSizes(VrRotorCoreParam& rotorParam);
|
|
|
|
|
|
void loadPointCloudFilterConfig(const ConfigResult& configResult);
|
|
|
|
|
|
bool savePointCloudFilterConfig(ConfigResult& configResult);
|
|
|
|
|
|
void LoadModelDetectionParamsToUI(const VrAlgorithmParams& algorithmParams);
|
|
|
|
|
|
bool SaveModelDetectionParamsFromUI(VrAlgorithmParams& algorithmParams);
|
|
|
|
|
|
void initModelParamsTab();
|
|
|
|
|
|
void addModelParamRow(const VrWorkpieceModelParam& modelParam);
|
|
|
|
|
|
void refreshModelParamRows();
|
|
|
|
|
|
void moveModelParamRow(int row, int offset);
|
|
|
|
|
|
void removeModelParamRow(int row);
|
|
|
|
|
|
void updateModelParamActions();
|
2026-08-17 14:11:44 +08:00
|
|
|
|
void LoadBinDetectionParamsToUI(const VrBinParam& binParam);
|
|
|
|
|
|
bool SaveBinDetectionParamsFromUI(VrBinParam& binParam);
|
|
|
|
|
|
void LoadRotorCoreParamsToUI(const VrRotorCoreParam& rotorParam);
|
|
|
|
|
|
bool SaveRotorCoreParamsFromUI(VrRotorCoreParam& rotorParam);
|
2026-08-04 14:23:07 +08:00
|
|
|
|
|
|
|
|
|
|
// 网络配置(JSON TCP 端口 + Modbus 寄存器地址)
|
|
|
|
|
|
void LoadPlcRobotServerConfigToUI(const VrPlcRobotServerConfig& config);
|
|
|
|
|
|
bool SavePlcRobotServerConfigFromUI(VrPlcRobotServerConfig& config);
|
|
|
|
|
|
|
2026-09-19 09:44:46 +08:00
|
|
|
|
void LoadHandEyeCalibConfig();
|
2026-08-04 14:23:07 +08:00
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
Ui::DialogAlgoarg *ui;
|
|
|
|
|
|
ConfigManager* m_pConfigManager;
|
|
|
|
|
|
QString m_configFilePath;
|
2026-09-19 09:44:46 +08:00
|
|
|
|
HandEyeCalibWidget* m_handEyeCalibWidget;
|
2026-08-04 14:23:07 +08:00
|
|
|
|
ToolExtrinsicWidget* m_toolExtrinsicWidget;
|
|
|
|
|
|
NetworkConfigWidget* m_networkConfigWidget = nullptr;
|
2026-10-01 21:26:34 +08:00
|
|
|
|
PointCloudFilterWidget* m_pointCloudFilterWidget = nullptr;
|
2026-08-04 14:23:07 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // DIALOGALGOARG_H
|