#ifndef DIALOGALGOARG_H #define DIALOGALGOARG_H #include #include class QCheckBox; class QLineEdit; class QWidget; class ParkingSpaceGuidePresenter; namespace Ui { class DialogAlgoArg; } class DialogAlgoArg : public QDialog { Q_OBJECT public: enum class ConfigPage { Detection = 0, Camera = 1, Lidar = 2, Multicast = 3 }; explicit DialogAlgoArg(QWidget* parent = nullptr); ~DialogAlgoArg(); void SetPresenter(ParkingSpaceGuidePresenter* presenter); void SetCurrentPage(ConfigPage page); private slots: void on_btnOK_clicked(); void on_btnCancel_clicked(); void on_btnApply_clicked(); void on_btnReset_clicked(); private: void BuildUi(); void ApplyUiFont(); void ShowTabGroup(ConfigPage page); void UpdateTitle(ConfigPage page); void LoadParams(); bool SaveParams(); void ResetParams(); QLineEdit* AddDoubleEditor(QWidget* parent, const QString& label, int row, double min, double max); QLineEdit* AddIntEditor(QWidget* parent, const QString& label, int row, int min, int max); QLineEdit* AddTextEditor(QWidget* parent, const QString& label, int row, bool password = false); QCheckBox* AddCheckBox(QWidget* parent, const QString& label, int row); void SetDouble(QLineEdit* edit, double value); void SetInt(QLineEdit* edit, int value); bool GetDouble(QLineEdit* edit, const QString& label, double& value); bool GetFloat(QLineEdit* edit, const QString& label, float& value); bool GetInt(QLineEdit* edit, const QString& label, int& value); private: Ui::DialogAlgoArg* ui = nullptr; ParkingSpaceGuidePresenter* m_presenter = nullptr; QVector m_visiblePages; QWidget* m_detectionTab = nullptr; QWidget* m_cameraTab = nullptr; QWidget* m_lidarTab = nullptr; QWidget* m_multicastTab = nullptr; QLineEdit* m_minGuideDistance = nullptr; QLineEdit* m_maxGuideDistance = nullptr; QLineEdit* m_targetStopOffset = nullptr; QLineEdit* m_lateralTolerance = nullptr; QLineEdit* m_angleTolerance = nullptr; QLineEdit* m_confidenceThreshold = nullptr; QLineEdit* m_mvsSerialNumber = nullptr; QLineEdit* m_mvsDeviceIndex = nullptr; QCheckBox* m_mvsEnabled = nullptr; QLineEdit* m_lidarType = nullptr; QLineEdit* m_lidarHost = nullptr; QLineEdit* m_lidarMsopPort = nullptr; QLineEdit* m_lidarDifopPort = nullptr; QLineEdit* m_lidarMinDistance = nullptr; QLineEdit* m_lidarMaxDistance = nullptr; QLineEdit* m_lidarStartAngle = nullptr; QLineEdit* m_lidarEndAngle = nullptr; QLineEdit* m_udpAddress = nullptr; QLineEdit* m_udpPort = nullptr; QLineEdit* m_udpTargetId = nullptr; QLineEdit* m_udpParkId = nullptr; QCheckBox* m_udpEnabled = nullptr; }; #endif // DIALOGALGOARG_H