You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
233 lines
4.6 KiB
233 lines
4.6 KiB
/**
|
|
* @file DroneControlDialog.h
|
|
* @brief 无人机控制对话框定义
|
|
* @author Qt UI Optimizer
|
|
* @date 2024-07-04
|
|
* @version 1.0
|
|
*
|
|
* 无人机专用控制界面,包含:
|
|
* - 飞行控制(起飞、降落、悬停)
|
|
* - 航线规划和导航
|
|
* - 实时视频传输
|
|
* - 照片拍摄和传输
|
|
* - 人物识别功能
|
|
* - 设备状态监控
|
|
*
|
|
* @note 依赖Qt GUI模块和ModernStyleManager
|
|
* @since 1.0
|
|
*/
|
|
|
|
#ifndef DRONECONTROLDIALOG_H
|
|
#define DRONECONTROLDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include <QGridLayout>
|
|
#include <QGroupBox>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QSlider>
|
|
#include <QSpinBox>
|
|
#include <QProgressBar>
|
|
#include <QTextEdit>
|
|
#include <QComboBox>
|
|
#include <QCheckBox>
|
|
#include <QTimer>
|
|
#include <QFrame>
|
|
|
|
/**
|
|
* @class DroneControlDialog
|
|
* @brief 无人机控制对话框
|
|
*
|
|
* 提供完整的无人机控制功能界面,采用模块化设计
|
|
*/
|
|
class DroneControlDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/**
|
|
* @brief 构造函数
|
|
* @param parent 父窗口指针
|
|
*/
|
|
explicit DroneControlDialog(QWidget *parent = nullptr);
|
|
|
|
/**
|
|
* @brief 析构函数
|
|
*/
|
|
~DroneControlDialog();
|
|
|
|
signals:
|
|
/**
|
|
* @brief 开始自主建图信号
|
|
*/
|
|
void startMapping();
|
|
|
|
/**
|
|
* @brief 停止自主建图信号
|
|
*/
|
|
void stopMapping();
|
|
|
|
/**
|
|
* @brief 开始导航避障信号
|
|
*/
|
|
void startNavigation();
|
|
|
|
/**
|
|
* @brief 停止导航避障信号
|
|
*/
|
|
void stopNavigation();
|
|
|
|
/**
|
|
* @brief 开始照片传输信号
|
|
*/
|
|
void startPhotoTransmission();
|
|
|
|
/**
|
|
* @brief 停止照片传输信号
|
|
*/
|
|
void stopPhotoTransmission();
|
|
|
|
/**
|
|
* @brief 开始人物识别信号
|
|
*/
|
|
void startPersonRecognition();
|
|
|
|
/**
|
|
* @brief 停止人物识别信号
|
|
*/
|
|
void stopPersonRecognition();
|
|
|
|
public slots:
|
|
/**
|
|
* @brief 更新无人机状态
|
|
* @param battery 电池电量
|
|
* @param altitude 飞行高度
|
|
* @param speed 飞行速度
|
|
*/
|
|
void updateDroneStatus(int battery, double altitude, double speed);
|
|
|
|
private slots:
|
|
/**
|
|
* @brief 起飞按钮点击槽函数
|
|
*/
|
|
void onTakeoffClicked();
|
|
|
|
/**
|
|
* @brief 降落按钮点击槽函数
|
|
*/
|
|
void onLandClicked();
|
|
|
|
/**
|
|
* @brief 悬停按钮点击槽函数
|
|
*/
|
|
void onHoverClicked();
|
|
|
|
/**
|
|
* @brief 返航按钮点击槽函数
|
|
*/
|
|
void onReturnHomeClicked();
|
|
|
|
/**
|
|
* @brief 建图开关槽函数
|
|
*/
|
|
void onMappingToggle();
|
|
|
|
/**
|
|
* @brief 导航开关槽函数
|
|
*/
|
|
void onNavigationToggle();
|
|
|
|
/**
|
|
* @brief 照片传输开关槽函数
|
|
*/
|
|
void onPhotoTransmissionToggle();
|
|
|
|
/**
|
|
* @brief 人物识别开关槽函数
|
|
*/
|
|
void onPersonRecognitionToggle();
|
|
|
|
/**
|
|
* @brief 紧急停止槽函数
|
|
*/
|
|
void onEmergencyStop();
|
|
|
|
private:
|
|
/**
|
|
* @brief 设置UI界面
|
|
*/
|
|
void setupUI();
|
|
|
|
/**
|
|
* @brief 设置飞行控制模块
|
|
*/
|
|
void setupFlightControlModule();
|
|
|
|
/**
|
|
* @brief 设置任务控制模块
|
|
*/
|
|
void setupMissionControlModule();
|
|
|
|
/**
|
|
* @brief 设置状态监控模块
|
|
*/
|
|
void setupStatusMonitorModule();
|
|
|
|
/**
|
|
* @brief 应用样式表
|
|
*/
|
|
void applyStyles();
|
|
|
|
/**
|
|
* @brief 连接信号槽
|
|
*/
|
|
void connectSignals();
|
|
|
|
private:
|
|
// 主布局
|
|
QVBoxLayout *m_mainLayout;
|
|
QHBoxLayout *m_contentLayout;
|
|
|
|
// 飞行控制模块
|
|
QGroupBox *m_flightControlGroup;
|
|
QPushButton *m_takeoffBtn;
|
|
QPushButton *m_landBtn;
|
|
QPushButton *m_hoverBtn;
|
|
QPushButton *m_returnHomeBtn;
|
|
QPushButton *m_emergencyStopBtn;
|
|
QSlider *m_altitudeSlider;
|
|
QSlider *m_speedSlider;
|
|
|
|
// 任务控制模块
|
|
QGroupBox *m_missionControlGroup;
|
|
QPushButton *m_mappingBtn;
|
|
QPushButton *m_navigationBtn;
|
|
QPushButton *m_photoBtn;
|
|
QPushButton *m_recognitionBtn;
|
|
QComboBox *m_missionModeCombo;
|
|
|
|
// 状态监控模块
|
|
QGroupBox *m_statusGroup;
|
|
QLabel *m_batteryLabel;
|
|
QProgressBar *m_batteryProgress;
|
|
QLabel *m_altitudeLabel;
|
|
QLabel *m_speedLabel;
|
|
QLabel *m_gpsLabel;
|
|
QLabel *m_connectionLabel;
|
|
QTextEdit *m_logTextEdit;
|
|
|
|
// 状态变量
|
|
bool m_isMappingActive;
|
|
bool m_isNavigationActive;
|
|
bool m_isPhotoTransmissionActive;
|
|
bool m_isPersonRecognitionActive;
|
|
bool m_isFlying;
|
|
|
|
// 定时器
|
|
QTimer *m_statusUpdateTimer;
|
|
};
|
|
|
|
#endif // DRONECONTROLDIALOG_H
|