143 lines
4.7 KiB
C++
143 lines
4.7 KiB
C++
#ifndef DIALOGALGOARG_H
|
|
#define DIALOGALGOARG_H
|
|
|
|
#include <QDialog>
|
|
#include <QVector>
|
|
|
|
class QCheckBox;
|
|
class QLineEdit;
|
|
class QPushButton;
|
|
class QWidget;
|
|
class ParkingSpaceGuidePresenter;
|
|
struct VrGuideLineCalibration;
|
|
|
|
namespace Ui {
|
|
class DialogAlgoArg;
|
|
}
|
|
|
|
class DialogAlgoArg : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum class ConfigPage
|
|
{
|
|
Detection = 0,
|
|
Camera = 1,
|
|
Lidar = 2,
|
|
Multicast = 3,
|
|
Calibration = 4
|
|
};
|
|
|
|
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();
|
|
void onCalibrateCenterLineClicked();
|
|
void onCalibrateStopLineClicked();
|
|
|
|
private:
|
|
void BuildUi();
|
|
void ApplyUiFont();
|
|
void ShowTabGroup(ConfigPage page);
|
|
void UpdateTitle(ConfigPage page);
|
|
void LoadParams();
|
|
bool SaveParams();
|
|
void ResetParams();
|
|
void HideDetachedTabs();
|
|
|
|
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);
|
|
QPushButton* AddActionButton(QWidget* parent, const QString& text, int row);
|
|
|
|
void SetDouble(QLineEdit* edit, double value);
|
|
void SetInt(QLineEdit* edit, int value);
|
|
void SetLineCalibration(QCheckBox* calibrated,
|
|
QLineEdit* startX,
|
|
QLineEdit* startY,
|
|
QLineEdit* endX,
|
|
QLineEdit* endY,
|
|
QLineEdit* time,
|
|
const VrGuideLineCalibration& 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);
|
|
bool GetLineCalibration(QCheckBox* calibrated,
|
|
QLineEdit* startX,
|
|
QLineEdit* startY,
|
|
QLineEdit* endX,
|
|
QLineEdit* endY,
|
|
QLineEdit* time,
|
|
const QString& label,
|
|
VrGuideLineCalibration& value);
|
|
bool ValidateLineCalibration(const VrGuideLineCalibration& value, const QString& label);
|
|
bool SaveCalibrationWithMessage(const QString& message);
|
|
|
|
private:
|
|
Ui::DialogAlgoArg* ui = nullptr;
|
|
ParkingSpaceGuidePresenter* m_presenter = nullptr;
|
|
QVector<ConfigPage> m_visiblePages;
|
|
|
|
QWidget* m_detectionTab = nullptr;
|
|
QWidget* m_cameraTab = nullptr;
|
|
QWidget* m_lidarTab = nullptr;
|
|
QWidget* m_multicastTab = nullptr;
|
|
QWidget* m_centerLineTab = nullptr;
|
|
QWidget* m_stopLineTab = 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;
|
|
|
|
QCheckBox* m_centerLineCalibrated = nullptr;
|
|
QLineEdit* m_centerLineStartX = nullptr;
|
|
QLineEdit* m_centerLineStartY = nullptr;
|
|
QLineEdit* m_centerLineEndX = nullptr;
|
|
QLineEdit* m_centerLineEndY = nullptr;
|
|
QLineEdit* m_centerLineTime = nullptr;
|
|
QPushButton* m_calibrateCenterLine = nullptr;
|
|
|
|
QCheckBox* m_stopLineCalibrated = nullptr;
|
|
QLineEdit* m_stopLineStartX = nullptr;
|
|
QLineEdit* m_stopLineStartY = nullptr;
|
|
QLineEdit* m_stopLineEndX = nullptr;
|
|
QLineEdit* m_stopLineEndY = nullptr;
|
|
QLineEdit* m_stopLineTime = nullptr;
|
|
QLineEdit* m_countdownStartDistance = nullptr;
|
|
QLineEdit* m_modelVerifyDistance = nullptr;
|
|
QPushButton* m_calibrateStopLine = nullptr;
|
|
};
|
|
|
|
#endif // DIALOGALGOARG_H
|