|
|
#ifndef GDDCDLG_H
|
|
|
#define GDDCDLG_H
|
|
|
|
|
|
#include "Src/GDDC/gddcSet.h"
|
|
|
// #include "Src/Video/cffmpeg_decode.h"
|
|
|
#include "gddcCmdDlg.h" //吊舱控制对话框
|
|
|
#include <QByteArray>
|
|
|
#include <QHeaderView>
|
|
|
#include <QHostAddress>
|
|
|
#include <QMouseEvent>
|
|
|
#include <QNetworkDatagram>
|
|
|
#include <QStandardItemModel>
|
|
|
#include <QTimer>
|
|
|
#include <QUdpSocket>
|
|
|
#include <QWidget>
|
|
|
#include <fstream>
|
|
|
#include <iostream>
|
|
|
#include <string>
|
|
|
#include <vector>
|
|
|
// #include "ui_gddcCmdDlg.h" //吊舱控制对话框ui
|
|
|
#include "gddcStateInfo.h" //吊舱状态信息显示对话框
|
|
|
// #include "ui_gddcStateInfo.h" //吊舱状态信息显示对话框
|
|
|
// #include "ui_gddcSet.h"
|
|
|
#include "QProcess"
|
|
|
#include <QThread>
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
#define cmdLength 44
|
|
|
namespace Ui {
|
|
|
class GDDCdlg;
|
|
|
}
|
|
|
|
|
|
class GDDCdlg : public QWidget {
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
explicit GDDCdlg(QWidget *parent = nullptr);
|
|
|
~GDDCdlg();
|
|
|
|
|
|
private:
|
|
|
Ui::GDDCdlg *ui;
|
|
|
QTimer *GDDCControlTimer;
|
|
|
|
|
|
protected:
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
public:
|
|
|
void initWindow(); // 初始化窗口
|
|
|
void initParam(); // 初始化参数
|
|
|
void initSignalSlot(); // 初始化信号与槽
|
|
|
void resizeUI(); // 重新设置布局
|
|
|
|
|
|
GDDCSet *m_DlgGDDCSet; // 光电吊舱设置对话框
|
|
|
GDDCCmdDlg *m_GDDCCmdDlg; // 光电吊舱控制对话框
|
|
|
GDDCStateInfo *m_GDDCStateDlg; // 光电吊舱状态数据对话框
|
|
|
public:
|
|
|
// socket对象
|
|
|
QUdpSocket *udpSocket;
|
|
|
// QString RemoteIP; //目标IP
|
|
|
// QHostAddress RemoteAddr; //目标地址
|
|
|
// quint16 RemotePort; //目标port
|
|
|
QString localIP; // 本地IP
|
|
|
QHostAddress localAddr; // 本地地址
|
|
|
quint16 localPort; // 本地port
|
|
|
QProcess *process; // 执行CMD
|
|
|
QThread workerThread; // 线程
|
|
|
|
|
|
// bool eventFilter(QObject *,QEvent *); //事件过滤器
|
|
|
void mousePressEvent(QMouseEvent *event); // 事件过滤器
|
|
|
void mouseMoveEvent(QMouseEvent *event); // 事件过滤器
|
|
|
|
|
|
void startConnectURL1();
|
|
|
void stopConnectURL1();
|
|
|
void startConnectURL2();
|
|
|
void stopConnectURL2();
|
|
|
void startConnectSerialCtrl();
|
|
|
void stopConnectSerialCtrl();
|
|
|
void startConnectUDPCtrl();
|
|
|
void stopConnectUDPCtrl();
|
|
|
void startConnectTCPCtrl();
|
|
|
void stopConnectTCPCtrl();
|
|
|
void startPushURL();
|
|
|
void stopPushURL();
|
|
|
|
|
|
public:
|
|
|
bool pointSelectionTracking; // 选点跟踪
|
|
|
bool Is_openVideo; // 视频是否已打开,默认未打开
|
|
|
std::vector<bool> connectFlag; // 0视频流1;1视频流2;2串口通信,3网口通信
|
|
|
bool isCmdPageShow; // 控制页是否显示
|
|
|
bool isStatePageShow; // 状态页是否显示
|
|
|
bool detectionAreaSetting; // 检测区域设置
|
|
|
public slots:
|
|
|
void GDDCControlTimeOut();
|
|
|
void startConnect(int); // 开始连接
|
|
|
void stopConnect(int); // 停止连接
|
|
|
void UDPMessageReceive(); // udp数据接收
|
|
|
void pushButtonSet_clicked();
|
|
|
void pushButShowCmdPage_clicked();
|
|
|
void pushButShowStatePage_clicked();
|
|
|
};
|
|
|
|
|
|
#endif // GDDCDLG_H
|