2025-08-20 23:06:28 +08:00
|
|
|
|
#ifndef P10_INTELLIGENTPAGE_H
|
|
|
|
|
|
#define P10_INTELLIGENTPAGE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
2025-09-15 22:28:43 +08:00
|
|
|
|
#include <QPixmap>
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
#include <QEvent>
|
|
|
|
|
|
#include <QMouseEvent>
|
2025-09-28 17:14:34 +08:00
|
|
|
|
#if CONFIG_EN_RTSP //开启 RTSP 读取
|
2025-09-15 22:28:43 +08:00
|
|
|
|
#include <PublicFunctions/RtspPlayer.h> // 引入RTSP播放器头文件
|
|
|
|
|
|
#include <GlobalDefinitions/Variable.h>
|
2025-09-28 17:14:34 +08:00
|
|
|
|
#endif
|
2025-08-20 23:06:28 +08:00
|
|
|
|
namespace Ui {
|
|
|
|
|
|
class P10_IntelligentPage;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class P10_IntelligentPage : public QWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit P10_IntelligentPage(QWidget *parent = nullptr);
|
|
|
|
|
|
~P10_IntelligentPage();
|
2025-09-28 17:14:34 +08:00
|
|
|
|
#if CONFIG_EN_RTSP //开启 RTSP 读取
|
2025-09-15 22:28:43 +08:00
|
|
|
|
void setRtspUrl(const QString &url); // 设置RTSP地址接口
|
|
|
|
|
|
void WinInit(); // 初始化界面与逻辑
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void onFrameReady(const QImage &frame); // 接收新视频帧并显示
|
|
|
|
|
|
void onErrorOccurred(const QString &msg); // 接收错误信息并提示
|
|
|
|
|
|
|
|
|
|
|
|
// 按钮点击事件(UI自动关联,需确保.ui文件中按钮对象名一致)
|
|
|
|
|
|
void on_But_Atlas_1_clicked(); // 切换摄像头1
|
|
|
|
|
|
void on_But_Atlas_2_clicked(); // 切换摄像头2
|
|
|
|
|
|
void on_But_Atlas_3_clicked(); // 暂停/继续播放
|
|
|
|
|
|
void on_But_Magnify_clicked(); // 图像放大
|
|
|
|
|
|
void on_But_Reduce_clicked(); // 图像缩小
|
2025-08-20 23:06:28 +08:00
|
|
|
|
|
|
|
|
|
|
private:
|
2025-09-28 17:14:34 +08:00
|
|
|
|
#endif
|
2025-08-20 23:06:28 +08:00
|
|
|
|
Ui::P10_IntelligentPage *ui;
|
2025-09-28 17:14:34 +08:00
|
|
|
|
#if CONFIG_EN_RTSP //开启 RTSP 读取
|
2025-09-15 22:28:43 +08:00
|
|
|
|
// 事件过滤器(处理鼠标拖拽平移)
|
|
|
|
|
|
bool eventFilter(QObject *obj, QEvent *ev) override;
|
|
|
|
|
|
|
|
|
|
|
|
/* 图像尺寸与缩放参数 */
|
|
|
|
|
|
uint32_t Img_W = 0; // 图像原始宽度
|
|
|
|
|
|
uint32_t Img_H = 0; // 图像原始高度
|
|
|
|
|
|
float Img_Zoom = 1.0f; // 缩放比例(默认100%)
|
|
|
|
|
|
|
|
|
|
|
|
/* 鼠标拖拽参数 */
|
|
|
|
|
|
QPoint dragStart; // 拖拽起始点
|
|
|
|
|
|
bool dragging = false; // 拖拽状态标记
|
|
|
|
|
|
|
|
|
|
|
|
/* RTSP播放相关 */
|
|
|
|
|
|
RtspPlayer *m_rtspPlayer; // RTSP播放器实例
|
|
|
|
|
|
QString m_rtspUrl; // 当前使用的RTSP地址
|
2025-09-28 17:14:34 +08:00
|
|
|
|
#endif
|
2025-08-20 23:06:28 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // P10_INTELLIGENTPAGE_H
|