53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
#ifndef DRONESCREWCTRL_DIALOG_CAMERASETTING_H
|
|
#define DRONESCREWCTRL_DIALOG_CAMERASETTING_H
|
|
|
|
#include <QDialog>
|
|
#include <QString>
|
|
#include "IVrConfig.h"
|
|
|
|
namespace Ui { class DialogCameraSetting; }
|
|
|
|
/**
|
|
* @brief 相机设置对话框
|
|
*
|
|
* 纯编辑器:编辑 Server IP + 曝光时间(μs) + 增益。
|
|
* - 「确定」关闭对话框,由上层读取 GetServerIp()/GetCameraParams() 完成存盘与下发。
|
|
* - 「应用」不关闭对话框,发出 applyRequested 信号供上层实时下发(便于一边看实时图一边调曝光)。
|
|
*/
|
|
class DialogCameraSetting : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DialogCameraSetting(QWidget* parent = nullptr);
|
|
~DialogCameraSetting() override;
|
|
|
|
void SetParams(const QString& serverIp, const DroneScrewCameraParams& cam);
|
|
QString GetServerIp() const;
|
|
DroneScrewCameraParams GetCameraParams() const;
|
|
|
|
signals:
|
|
//「应用」按钮:实时下发但不关闭对话框
|
|
void applyRequested(const QString& serverIp, const DroneScrewCameraParams& cam);
|
|
|
|
private slots:
|
|
void on_btn_ok_clicked();
|
|
void on_btn_cancel_clicked();
|
|
void on_btn_apply_clicked();
|
|
void on_btn_reset_clicked();
|
|
|
|
private:
|
|
bool eventFilter(QObject* watched, QEvent* event) override;
|
|
void loadToUi(const QString& serverIp, const DroneScrewCameraParams& cam);
|
|
void collectFromUi(); // 把界面值写回 m_serverIp / m_camera
|
|
|
|
void setupInputKeyboard();
|
|
|
|
private:
|
|
Ui::DialogCameraSetting* ui{nullptr};
|
|
QString m_serverIp;
|
|
DroneScrewCameraParams m_camera;
|
|
};
|
|
|
|
#endif // DRONESCREWCTRL_DIALOG_CAMERASETTING_H
|