feat: 新增交互界面
@ -0,0 +1,21 @@
|
||||
# 根据构建类型设置不同的库
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# Debug 模式链接调试库
|
||||
target_link_libraries(VideoClient
|
||||
PRIVATE
|
||||
Qt::Core
|
||||
Qt::Widgets
|
||||
${CMAKE_CURRENT_LIST_DIR}/QNotify/lib/QNotifyd.lib)
|
||||
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
# Release 模式链接发布库
|
||||
target_link_libraries(VideoClient
|
||||
PRIVATE
|
||||
Qt::Core
|
||||
Qt::Widgets
|
||||
${CMAKE_CURRENT_LIST_DIR}/QNotify/lib/QNotify.lib)
|
||||
endif()
|
||||
|
||||
target_include_directories(VideoClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/QNotify/include
|
||||
)
|
@ -0,0 +1,74 @@
|
||||
#include "commandwidget.h"
|
||||
|
||||
#include "ui_commandwidget.h"
|
||||
|
||||
CommandWidget::CommandWidget(QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::CommandWidget) {
|
||||
ui->setupUi(this);
|
||||
ui->stopConnectionToolBtn->setDisabled(true);
|
||||
|
||||
udpSocket = new QUdpSocket(this);
|
||||
connect(&settingDlg, &CommunicationSettingDlg::sendErrorMessage, this,
|
||||
&CommandWidget::receiveMessageSlots);
|
||||
}
|
||||
|
||||
CommandWidget::~CommandWidget() {
|
||||
delete ui;
|
||||
if (udpSocket) udpSocket->deleteLater();
|
||||
}
|
||||
|
||||
void CommandWidget::on_settingToolBtn_clicked() {
|
||||
settingDlg.exec();
|
||||
}
|
||||
|
||||
// 连接
|
||||
void CommandWidget::on_startConnectionToolBtn_clicked() {
|
||||
ui->startConnectionToolBtn->setDisabled(true);
|
||||
if (!g_networkSettingInfo) return;
|
||||
int dataSourceType = g_networkSettingInfo->value("DataSource").toInt();
|
||||
QString groupName = "";
|
||||
switch (dataSourceType) {
|
||||
case 0:
|
||||
groupName = "LLink";
|
||||
break;
|
||||
case 1:
|
||||
groupName = "SATCOM1";
|
||||
break;
|
||||
case 2:
|
||||
groupName = "SATCOM2";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
m_remoteIP =
|
||||
g_networkSettingInfo->value(groupName + "/remoteIP").toString();
|
||||
m_remotePort =
|
||||
g_networkSettingInfo->value(groupName + "/remotePort").toInt();
|
||||
int localPort =
|
||||
g_networkSettingInfo->value(groupName + "/localPort").toInt();
|
||||
QString localIP =
|
||||
g_networkSettingInfo->value(groupName + "/localIP").toString();
|
||||
|
||||
if (dataSourceType == 0) { // 组播
|
||||
emit startConnectionSignal(m_remoteIP, m_remotePort);
|
||||
} else { // 单播
|
||||
emit startConnectionSignal(localIP, localPort);
|
||||
}
|
||||
|
||||
ui->stopConnectionToolBtn->setDisabled(false);
|
||||
}
|
||||
|
||||
// 断开
|
||||
void CommandWidget::on_stopConnectionToolBtn_clicked() {
|
||||
ui->stopConnectionToolBtn->setDisabled(true);
|
||||
|
||||
emit stopConnectionSignal();
|
||||
|
||||
// ui->stopConnectionToolBtn->setDisabled(false);
|
||||
ui->startConnectionToolBtn->setDisabled(false);
|
||||
}
|
||||
|
||||
void CommandWidget::receiveMessageSlots(QString message, int type) {
|
||||
emit sendErrorMessage(message, type);
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
#ifndef COMMANDWIDGET_H
|
||||
#define COMMANDWIDGET_H
|
||||
|
||||
#include <QUdpSocket>
|
||||
#include <QWidget>
|
||||
|
||||
#include "communicationsettingdlg.h"
|
||||
|
||||
namespace Ui {
|
||||
class CommandWidget;
|
||||
}
|
||||
|
||||
class CommandWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommandWidget(QWidget *parent = nullptr);
|
||||
~CommandWidget();
|
||||
|
||||
QUdpSocket *udpSocket = nullptr;
|
||||
signals:
|
||||
void startConnectionSignal(QString ip, int port);
|
||||
void stopConnectionSignal();
|
||||
void sendErrorMessage(QString message, int type);
|
||||
private slots:
|
||||
void on_settingToolBtn_clicked();
|
||||
|
||||
void on_startConnectionToolBtn_clicked();
|
||||
|
||||
void on_stopConnectionToolBtn_clicked();
|
||||
|
||||
void receiveMessageSlots(QString message, int type);
|
||||
|
||||
private:
|
||||
Ui::CommandWidget *ui;
|
||||
|
||||
CommunicationSettingDlg settingDlg;
|
||||
QString m_remoteIP;
|
||||
int m_remotePort;
|
||||
};
|
||||
|
||||
#endif // COMMANDWIDGET_H
|
@ -0,0 +1,240 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CommandWidget</class>
|
||||
<widget class="QWidget" name="CommandWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>897</width>
|
||||
<height>105</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="settingToolBtn">
|
||||
<property name="text">
|
||||
<string>通信设置</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>res/settings.png</normaloff>res/settings.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="startConnectionToolBtn">
|
||||
<property name="text">
|
||||
<string>连接</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="stopConnectionToolBtn">
|
||||
<property name="text">
|
||||
<string>断开</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="1" column="7">
|
||||
<widget class="QPushButton" name="pushButton_15">
|
||||
<property name="text">
|
||||
<string>4-6图拼接</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="pushButton_8">
|
||||
<property name="text">
|
||||
<string>画中画开</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushButton_7">
|
||||
<property name="text">
|
||||
<string>画中画关</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QPushButton" name="pushButton_16">
|
||||
<property name="text">
|
||||
<string>0-3图拼接</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="text">
|
||||
<string>俯仰+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>方位-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>方位+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QPushButton" name="pushButton_14">
|
||||
<property name="text">
|
||||
<string>扫描</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="pushButton_10">
|
||||
<property name="text">
|
||||
<string>红外小</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QPushButton" name="pushButton_11">
|
||||
<property name="text">
|
||||
<string>锁定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<widget class="QPushButton" name="pushButton_13">
|
||||
<property name="text">
|
||||
<string>吊舱</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QPushButton" name="pushButton_12">
|
||||
<property name="text">
|
||||
<string>复位</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="text">
|
||||
<string>变焦推远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="text">
|
||||
<string>变焦拉近</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="pushButton_9">
|
||||
<property name="text">
|
||||
<string>红外大</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>俯仰-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QPushButton" name="pushButton_17">
|
||||
<property name="text">
|
||||
<string>图像切换</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,41 @@
|
||||
#ifndef COMMUNICATIONSETTINGDLG_H
|
||||
#define COMMUNICATIONSETTINGDLG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QSettings>
|
||||
#include <QUdpSocket>
|
||||
|
||||
#include "global.h"
|
||||
|
||||
namespace Ui {
|
||||
class CommunicationSettingDlg;
|
||||
}
|
||||
|
||||
class CommunicationSettingDlg : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommunicationSettingDlg(QWidget *parent = nullptr);
|
||||
~CommunicationSettingDlg();
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event);
|
||||
|
||||
signals:
|
||||
void sendErrorMessage(QString message, int type);
|
||||
private slots:
|
||||
|
||||
void on_saveSettingBtn_clicked();
|
||||
|
||||
private:
|
||||
void initCombobox();
|
||||
|
||||
void initNetworkSetting();
|
||||
|
||||
void setSaveSettingParms();
|
||||
|
||||
private:
|
||||
Ui::CommunicationSettingDlg *ui;
|
||||
};
|
||||
|
||||
#endif // COMMUNICATIONSETTINGDLG_H
|
@ -1,23 +1,35 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QDebug>
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "NotifyManager.h"
|
||||
#include "commandwidget.h"
|
||||
#include "global.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
void initSignalConnection();
|
||||
void initNotifyMessageConnection();
|
||||
void initNotifyManager();
|
||||
|
||||
void showMessageSlots(QString message, int type);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
NotifyManager *m_notifyManager = nullptr;
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 122 KiB |
After Width: | Height: | Size: 9.9 MiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,8 @@
|
||||
/*hover样式*/
|
||||
QPushButton:hover{
|
||||
background-color: rgb(95,107,117);
|
||||
}
|
||||
/*pressed样式*/
|
||||
QPushButton:pressed{
|
||||
background-color: rgb(54,54,54);
|
||||
}
|
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 858 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 863 B |
After Width: | Height: | Size: 872 B |
After Width: | Height: | Size: 817 B |
After Width: | Height: | Size: 837 B |
After Width: | Height: | Size: 838 B |
After Width: | Height: | Size: 863 B |
After Width: | Height: | Size: 854 B |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 863 B |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0"/>
|
||||
/*************************MainWindow*****************/
|
||||
#MainWindow
|
||||
{
|
||||
background-color: rgba(131,175,155 100%);
|
||||
}
|
||||
|
||||
#pushButton:hover { color: red } //
|
||||
#pushButton_9:enabled { color: blue } //
|
||||
|
||||
#pushButton_10:enabled { color: red } //
|
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE RCC>
|
||||
<RCC version="1.0"/>
|
||||
QPushButton_9 {
|
||||
font: 15px;
|
||||
min-width:2em;
|
||||
font-family:黑体;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
QPushButton_9:hover {
|
||||
background-color: #2E3648;
|
||||
color: #2E3648;
|
||||
}
|
||||
QPushButton_9:pressed, QPushButton:checked {
|
||||
border: 1px solid #2E3648;
|
||||
color: #2E3648;
|
||||
}
|
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 465 B |
After Width: | Height: | Size: 464 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 328 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 951 B |
After Width: | Height: | Size: 2.9 KiB |