commit
7850da49de
@ -0,0 +1,34 @@
|
||||
#include "CommunicationUI.h"
|
||||
#include "ui_CommunicationUI.h"
|
||||
#include <QMediaPlayer>
|
||||
#include <QVideoWidget>
|
||||
|
||||
CommunicationUI::CommunicationUI(QWidget* parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::CommunicationUI)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("远程交互救助服务");
|
||||
resize(600,400);
|
||||
|
||||
// 创建视频播放器
|
||||
QMediaPlayer* player = new QMediaPlayer(this);
|
||||
|
||||
// 创建视频播放窗口
|
||||
QVideoWidget* videoWidget = new QVideoWidget(this);
|
||||
videoWidget->setGeometry(50, 50, 500, 300); // 设置视频播放窗口的位置和大小
|
||||
|
||||
// 设置视频播放器的输出窗口
|
||||
player->setVideoOutput(videoWidget);
|
||||
|
||||
// 加载视频文件
|
||||
player->setSource(QUrl::fromLocalFile("C:\\Users\\86185\\Desktop\\WeChat_20240428194941.mp4"));
|
||||
|
||||
// 播放视频
|
||||
player->play();
|
||||
}
|
||||
|
||||
CommunicationUI::~CommunicationUI()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CommunicationUI</class>
|
||||
<widget class="QWidget" name="CommunicationUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,34 @@
|
||||
#include "DogControlUI.h"
|
||||
#include "ui_DogControlUI.h"
|
||||
#include <QMediaPlayer>
|
||||
#include <QVideoWidget>
|
||||
|
||||
DogControlUI::DogControlUI(QWidget* parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::DogControlUI)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("控制机器狗");
|
||||
resize(600,400);
|
||||
|
||||
// 创建视频播放器
|
||||
QMediaPlayer* player = new QMediaPlayer(this);
|
||||
|
||||
// 创建视频播放窗口
|
||||
QVideoWidget* videoWidget = new QVideoWidget(this);
|
||||
videoWidget->setGeometry(50, 50, 500, 300); // 设置视频播放窗口的位置和大小
|
||||
|
||||
// 设置视频播放器的输出窗口
|
||||
player->setVideoOutput(videoWidget);
|
||||
|
||||
// 加载视频文件
|
||||
player->setSource(QUrl::fromLocalFile("C:\\Users\\86185\\Desktop\\WeChat_20240428194941.mp4"));
|
||||
|
||||
// 播放视频
|
||||
player->play();
|
||||
}
|
||||
|
||||
DogControlUI::~DogControlUI()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DogControlUI</class>
|
||||
<widget class="QWidget" name="DogControlUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,56 @@
|
||||
#include "GuidingUI.h"
|
||||
#include "ui_GuidingUI.h"
|
||||
#include <DogControlUI.h>
|
||||
#include <UAVControlUI.h>
|
||||
#include <CommunicationUI.h>
|
||||
#include <InjuryDisplayUI.h>
|
||||
#include <QMessageBox>
|
||||
|
||||
GuidingUI::GuidingUI(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::GuidingUI)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("空地协同伤情态势感知分析系统");
|
||||
resize(600,400);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
GuidingUI::~GuidingUI()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GuidingUI::on_Communication_clicked()
|
||||
{
|
||||
//QMessageBox::information(this,"远程交互界面","视频 语音");
|
||||
CommunicationUI* communication = new CommunicationUI;
|
||||
communication->show();
|
||||
}
|
||||
|
||||
void GuidingUI::on_ControlDog_clicked()
|
||||
{
|
||||
//QMessageBox::information(this,"控制机器狗","输入正确的指令");
|
||||
DogControlUI* dogUI = new DogControlUI;
|
||||
dogUI->show();
|
||||
|
||||
}
|
||||
|
||||
void GuidingUI::on_ControlUAV_clicked()
|
||||
{
|
||||
//QMessageBox::information(this,"控制无人机","输入正确的指令");
|
||||
UAVControlUI* uavUI = new UAVControlUI;
|
||||
uavUI->show();
|
||||
}
|
||||
|
||||
void GuidingUI::on_InjuryDisplay_clicked()
|
||||
{
|
||||
//QMessageBox::information(this,"伤情总览","呈现伤情");
|
||||
InjuryDisplayUI* injuryDisplay = new InjuryDisplayUI;
|
||||
injuryDisplay->show();
|
||||
}
|
||||
|
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GuidingUI</class>
|
||||
<widget class="QWidget" name="GuidingUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>609</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Widget</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>30</y>
|
||||
<width>301</width>
|
||||
<height>361</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Communication">
|
||||
<property name="text">
|
||||
<string>远程交互救助</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ControlUAV">
|
||||
<property name="text">
|
||||
<string>控制无人机</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ControlDog">
|
||||
<property name="text">
|
||||
<string>控制机器狗</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="InjuryDisplay">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>伤情态势显示</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>12</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,16 @@
|
||||
#include "InjuryAnalysisUI.h"
|
||||
#include "ui_InjuryAnalysisUI.h"
|
||||
|
||||
InjuryAnalysisUI::InjuryAnalysisUI(QWidget* parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::InjuryAnalysisUI)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("伤情态势分析界面");
|
||||
resize(600,400);
|
||||
}
|
||||
|
||||
InjuryAnalysisUI::~InjuryAnalysisUI()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InjuryAnalysisUI</class>
|
||||
<widget class="QWidget" name="InjuryAnalysisUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>50</y>
|
||||
<width>91</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>目前伤亡情况:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,96 @@
|
||||
#ifndef INJURYDATABASE_H
|
||||
#define INJURYDATABASE_H
|
||||
|
||||
#include <QtSql>
|
||||
#include <QWidget>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlDatabase>
|
||||
#include <QString>
|
||||
#include <QSqlRecord>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
struct Injury
|
||||
{
|
||||
QString id;
|
||||
int rank;
|
||||
QString position;
|
||||
int flag;
|
||||
};
|
||||
|
||||
class InjuryDatabase
|
||||
{
|
||||
// Q_OBJECT宏用于提供Qt信号槽和元对象系统服务
|
||||
// 它必须限定为私有访问权限
|
||||
//Q_OBJECT
|
||||
|
||||
public:
|
||||
static InjuryDatabase *getInstance();
|
||||
InjuryDatabase();
|
||||
~InjuryDatabase();
|
||||
|
||||
//打开
|
||||
bool open(const QString &dbName,const QString &userName = QString(),const QString &passwd = QString());
|
||||
//添加数据记录
|
||||
bool add(const QString &tableName,const Injury &data);
|
||||
//查询所有数据
|
||||
bool select(const QString &tableName,QList<Injury> &result);
|
||||
//关闭
|
||||
void close();
|
||||
|
||||
public:
|
||||
Injury data;
|
||||
|
||||
void ReturnInfo(Injury data);
|
||||
|
||||
|
||||
private:
|
||||
//开始添加字段
|
||||
void beginAddFiled(const QString &tableName);
|
||||
|
||||
//添加字段
|
||||
void addFiled(const QString &filedName);
|
||||
|
||||
//结束添加字段
|
||||
void endAddFiled();
|
||||
|
||||
//开始添加行
|
||||
void beginAddRow();
|
||||
|
||||
//添加字段值
|
||||
void addValue(const QVariant &value);
|
||||
|
||||
//结束添加行
|
||||
void endAddRow();
|
||||
|
||||
//执行
|
||||
bool exec(const QString &sql);
|
||||
|
||||
|
||||
private:
|
||||
//数据库
|
||||
QSqlDatabase m_sqlDb;
|
||||
|
||||
//表名
|
||||
QString m_tableName;
|
||||
|
||||
//字段名
|
||||
QStringList m_fieldName;
|
||||
|
||||
//头sql
|
||||
QString m_headerSql;
|
||||
|
||||
//值sql
|
||||
QString m_valueSql;
|
||||
|
||||
//已添加row数
|
||||
int m_fieldAdd = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // INJURYDATABASE_H
|
@ -0,0 +1,35 @@
|
||||
#include "InjuryDisplayUI.h"
|
||||
#include "ui_InjuryDisplayUI.h"
|
||||
#include "InjuryAnalysisUI.h"
|
||||
#include <QQuickItem>
|
||||
|
||||
InjuryDisplayUI::InjuryDisplayUI(QWidget* parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::InjuryDisplayUI)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("伤情态势展示界面");
|
||||
}
|
||||
|
||||
InjuryDisplayUI::~InjuryDisplayUI()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void InjuryDisplayUI::on_InjuryAnaysis_clicked()
|
||||
{
|
||||
InjuryAnalysisUI* injuryAnalysis = new InjuryAnalysisUI;
|
||||
injuryAnalysis->show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void InjuryDisplayUI::on_MapButton_clicked()
|
||||
{
|
||||
QQuickItem *root = ui->quickWidget->rootObject();//拿到所有对象的列表
|
||||
auto labelqml = root->findChild<QObject*>("labelcpp");//名字要与main.qml中的 objectName: 'labelcpp' 相同
|
||||
QVariant ret;
|
||||
QMetaObject::invokeMethod(labelqml, "setCoordinate", Q_ARG(QVariant, 22.65599), Q_ARG(QVariant, 113.92576));
|
||||
qDebug() << ret.toString();
|
||||
}
|
||||
|
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>InjuryDisplayUI</class>
|
||||
<widget class="QWidget" name="InjuryDisplayUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>370</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="InjuryAnaysis">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>10</y>
|
||||
<width>81</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>分析当前伤情</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="MapButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>330</y>
|
||||
<width>161</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>打印经纬度</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Widget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>581</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QQuickWidget" name="quickWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>571</width>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>QQuickWidget::SizeRootObjectToView</enum>
|
||||
</property>
|
||||
<property name="source">
|
||||
<url>
|
||||
<string>qrc:/map.qml</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QQuickWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">QtQuickWidgets/QQuickWidget</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>map.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -0,0 +1,35 @@
|
||||
#include "UAVControlUI.h"
|
||||
#include "ui_UAVControlUI.h"
|
||||
#include <QMediaPlayer>
|
||||
#include <QVideoWidget>
|
||||
|
||||
UAVControlUI::UAVControlUI(QWidget* parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::UAVControlUI)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle("控制无人机");
|
||||
resize(600,400);
|
||||
|
||||
// 创建视频播放器
|
||||
QMediaPlayer* player = new QMediaPlayer(this);
|
||||
|
||||
// 创建视频播放窗口
|
||||
QVideoWidget* videoWidget = new QVideoWidget(this);
|
||||
videoWidget->setGeometry(50, 50, 500, 300); // 设置视频播放窗口的位置和大小
|
||||
|
||||
// 设置视频播放器的输出窗口
|
||||
player->setVideoOutput(videoWidget);
|
||||
|
||||
// 加载视频文件
|
||||
player->setSource(QUrl::fromLocalFile("C:\\Users\\86185\\Desktop\\WeChat_20240428194941.mp4"));
|
||||
|
||||
// 播放视频
|
||||
player->play();
|
||||
|
||||
}
|
||||
|
||||
UAVControlUI::~UAVControlUI()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UAVControlUI</class>
|
||||
<widget class="QWidget" name="UAVControlUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,21 @@
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 201703L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 11
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2
|
||||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_GCC_MAJOR_VERSION \
|
||||
QMAKE_GCC_MINOR_VERSION \
|
||||
QMAKE_GCC_PATCH_VERSION
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++ \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/x86_64-w64-mingw32 \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/backward \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed \
|
||||
D:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0 \
|
||||
D:/Qt/Tools/mingw1120_64/lib/gcc \
|
||||
D:/Qt/Tools/mingw1120_64/x86_64-w64-mingw32/lib \
|
||||
D:/Qt/Tools/mingw1120_64/lib
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue