diff --git a/src/Client/CasualtySightPlus.pro b/src/Client/CasualtySightPlus.pro
new file mode 100644
index 0000000..85ecb53
--- /dev/null
+++ b/src/Client/CasualtySightPlus.pro
@@ -0,0 +1,44 @@
+QT += core gui
+QT += core gui quickwidgets positioning location
+QT += multimedia
+QT += multimediawidgets
+QT += webenginewidgets webchannel
+QT += sql
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++17
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+ DogDatabase.cpp \
+ InjuryAnalysisUI.cpp \
+ InjuryDatabase.cpp \
+ UAVDatabase.cpp \
+ injurydisiplayui.cpp \
+ main.cpp \
+ guidingui.cpp
+
+HEADERS += \
+ DogDatabase.h \
+ InjuryAnalysisUI.h \
+ InjuryDatabase.h \
+ UAVDatabase.h \
+ guidingui.h \
+ injurydisiplayui.h
+
+FORMS += \
+ InjuryAnalysisUI.ui \
+ guidingui.ui \
+ injurydisiplayui.ui
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+RESOURCES += \
+ res.qrc
diff --git a/src/Client/CasualtySightPlus.pro.user b/src/Client/CasualtySightPlus.pro.user
new file mode 100644
index 0000000..301a142
--- /dev/null
+++ b/src/Client/CasualtySightPlus.pro.user
@@ -0,0 +1,268 @@
+
+
+
+
+
+ EnvironmentId
+ {c17bc554-7aa8-48e6-9607-c4ecd694950b}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ 0
+ false
+ true
+ false
+ 2
+ true
+ true
+ 0
+ 8
+ true
+ false
+ 1
+ true
+ true
+ true
+ *.md, *.MD, Makefile
+ false
+ true
+ true
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+ true
+ false
+ true
+ true
+ true
+ true
+
+
+ 0
+ true
+
+ true
+ true
+ Builtin.DefaultTidyAndClazy
+ 6
+ true
+
+
+
+ true
+
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop
+ Desktop Qt 6.7.0 MSVC2019 64bit
+ Desktop Qt 6.7.0 MSVC2019 64bit
+ qt.qt6.670.win64_msvc2019_64_kit
+ 1
+ 0
+ 0
+
+ 0
+ D:\PROJECT\QT\CasualtySightPlus\build\Desktop_Qt_6_7_0_MSVC2019_64bit-Debug
+ D:/PROJECT/QT/CasualtySightPlus/build/Desktop_Qt_6_7_0_MSVC2019_64bit-Debug
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ 构建
+ 构建
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ 清除
+ 清除
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Debug
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+
+
+ D:\PROJECT\QT\CasualtySightPlus\build\Desktop_Qt_6_7_0_MSVC2019_64bit-Release
+ D:/PROJECT/QT/CasualtySightPlus/build/Desktop_Qt_6_7_0_MSVC2019_64bit-Release
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ 构建
+ 构建
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ 清除
+ 清除
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Release
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ 0
+
+
+ 0
+ D:\PROJECT\QT\CasualtySightPlus\build\Desktop_Qt_6_7_0_MSVC2019_64bit-Profile
+ D:/PROJECT/QT/CasualtySightPlus/build/Desktop_Qt_6_7_0_MSVC2019_64bit-Profile
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ 2
+ 构建
+ 构建
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+ clean
+
+ 1
+ 清除
+ 清除
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ false
+
+ Profile
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ 0
+ 0
+
+ 3
+
+
+ 0
+ 部署
+ 部署
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+
+ false
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+ true
+ true
+ 0
+ true
+
+ 2
+
+ false
+ -e cpu-cycles --call-graph "dwarf,4096" -F 250
+
+ Qt4ProjectManager.Qt4RunConfiguration:D:/PROJECT/QT/CasualtySightPlus/CasualtySightPlus.pro
+ D:/PROJECT/QT/CasualtySightPlus/CasualtySightPlus.pro
+ false
+ true
+ true
+ true
+ D:/PROJECT/QT/CasualtySightPlus/build/Desktop_Qt_6_7_0_MSVC2019_64bit-Release
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 22
+
+
+ Version
+ 22
+
+
diff --git a/src/Client/DogDatabase.cpp b/src/Client/DogDatabase.cpp
new file mode 100644
index 0000000..070966b
--- /dev/null
+++ b/src/Client/DogDatabase.cpp
@@ -0,0 +1,212 @@
+#include "DogDatabase.h"
+
+DogDatabase *DogDatabase::getInstance()
+{
+ static DogDatabase db;
+ return &db;
+}
+
+DogDatabase::~DogDatabase()
+{
+ close();
+}
+
+DogDatabase::DogDatabase()
+{
+ m_sqlDb = QSqlDatabase::addDatabase("QMYSQL");
+}
+
+//添加记录
+bool DogDatabase::add(const Dog &data)
+{
+<<<<<<< HEAD:src/Client2/fly_land/DogDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/DogDatabase.cpp
+ {
+ beginAddFiled("dogdatabase");
+ addFiled("id");
+ addFiled("state");
+ addFiled("ip");
+ addFiled("port");
+ addFiled("lon");
+ addFiled("lat");
+ endAddFiled();
+
+ beginAddRow();
+ addValue(data.id);
+ addValue(data.state);
+ addValue(data.ip);
+ addValue(data.port);
+ addValue(data.lon);
+ addValue(data.lat);
+ endAddRow();
+
+ m_valueSql = m_valueSql.left(m_valueSql.length()-1);
+ QString sql;
+ sql = m_headerSql + m_valueSql;
+ return exec(sql);
+ }
+ close();
+}
+
+//查询位置信息的记录
+Point DogDatabase::ReturnUAVPosition(QString id)
+{
+<<<<<<< HEAD:src/Client2/fly_land/DogDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/DogDatabase.cpp
+ {
+ QSqlQuery query(m_sqlDb);
+
+ QString strQuery;
+ strQuery = "SELECT lon, lat FROM ";
+ strQuery += "dogdatabase";
+ strQuery += " WHERE id = ";
+ strQuery += id;
+
+ qDebug()<>>>>>> master:src/Client/DogDatabase.cpp
+ {
+ QSqlQuery query(m_sqlDb);
+
+ QString strQuery;
+ strQuery = "SELECT state FROM ";
+ strQuery += "dogdatabase";
+ strQuery += " WHERE id = ";
+ strQuery += id;
+
+ qDebug()<>>>>>> master:src/Client/DogDatabase.cpp
+
+ return isSuccess;
+}
+
diff --git a/src/Client/DogDatabase.h b/src/Client/DogDatabase.h
new file mode 100644
index 0000000..3a407a9
--- /dev/null
+++ b/src/Client/DogDatabase.h
@@ -0,0 +1,104 @@
+#ifndef DOGDATABASE_H
+#define DOGDATABASE_H
+
+#include
+<<<<<<< HEAD:src/Client2/fly_land/DogDatabase.h
+#include
+#include
+#include
+=======
+#include
+#include
+#include
+>>>>>>> master:src/Client/DogDatabase.h
+#include
+#include
+#include
+#include "UAVDatabase.h"
+
+using namespace std;
+
+
+struct Dog
+{
+ QString id;
+ int state;
+ QString ip;
+ int port;
+ double lon;
+ double lat;
+};
+
+
+class DogDatabase
+{
+ // Q_OBJECT宏用于提供Qt信号槽和元对象系统服务
+ // 它必须限定为私有访问权限
+ //Q_OBJECT
+
+public:
+ static DogDatabase *getInstance();
+ DogDatabase();
+ ~DogDatabase();
+
+ Dog data;
+
+ //返回状态信息
+ int giveInfo(QString id);
+ //添加数据记录
+ bool add(const Dog &data);
+ //查询位置信息数据
+ Point ReturnUAVPosition( QString id);
+
+
+
+private:
+ //打开
+ bool open(const QString &dbName,const QString &userName = QString(),const QString &passwd = QString());
+ //关闭
+ void close();
+ //开始添加字段
+ 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 // DOGDATABASE_H
diff --git a/src/Client/InjuryAnalysisUI.cpp b/src/Client/InjuryAnalysisUI.cpp
new file mode 100644
index 0000000..836c5ee
--- /dev/null
+++ b/src/Client/InjuryAnalysisUI.cpp
@@ -0,0 +1,116 @@
+#include "InjuryAnalysisUI.h"
+#include "InjuryDatabase.h"
+#include "ui_InjuryAnalysisUI.h"
+#include
+#include
+
+InjuryAnalysisUI::InjuryAnalysisUI(QWidget* parent):
+ QWidget(parent),
+ ui(new Ui::InjuryAnalysisUI)
+{
+ ui->setupUi(this);
+ setWindowTitle("伤情态势分析界面");
+ //resize(600,400);
+
+ InjuryDatabase injurydatabase;
+ QList resultNow;
+ injurydatabase.select_all(resultNow);//获取所有伤员数据
+ result = resultNow;
+
+ //添加一个scrollArea来将信息显示出来
+ ui->scrollArea->setWidgetResizable(false);//可以拖动滚动条
+ //竖滚动条和横滚动条都可以一直显示
+ ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+ ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ //设置主界面的实际界面
+ ui->scrollArea->setWidget(ui->scrollAreaWidgetContents);
+ ui->scrollAreaWidgetContents->setGeometry(0, 0, 381, result.length()*20);//实际界面参数
+
+ QLabel *label0=new QLabel(ui->scrollAreaWidgetContents);
+ label0->setText("伤员编号");
+ label0->move(0,0);
+ QLabel *label1=new QLabel(ui->scrollAreaWidgetContents);
+ label1->setText("伤情等级");
+ label1->move(100,0);
+ QLabel *label2=new QLabel(ui->scrollAreaWidgetContents);
+ label2->setText("位置精度");
+ label2->move(200,0);
+ QLabel *label3=new QLabel(ui->scrollAreaWidgetContents);
+ label3->setText("位置维度");
+ label3->move(300,0);
+ for(int i = 0; iscrollAreaWidgetContents);
+ labelID->setText(result[i].id);
+ labelID->move(0,15*(i+2));
+ QLabel *labelRank=new QLabel(ui->scrollAreaWidgetContents);
+ labelRank->setText(QString::number(result[i].rank));
+ labelRank->move(100,15*(i+2));
+ QLabel *labelLon=new QLabel(ui->scrollAreaWidgetContents);
+ labelLon->setText(QString::number(result[i].lon));
+ labelLon->move(200,15*(i+2));
+ QLabel *labelLat=new QLabel(ui->scrollAreaWidgetContents);
+ labelLat->setText(QString::number(result[i].lat));
+ labelLat->move(300,15*(i+2));
+ }
+
+
+ //对信息进行分类统计分析
+ int sum = result.length();
+ ui->sumLabel->setText(QString::number(sum));
+ int rank0Sum = 0;
+ int rank1Sum = 0;
+ int rank2Sum = 0;
+ for(int i = 0; irank0Label->setText(QString::number(rank0Sum));
+ ui->rank1Label->setText(QString::number(rank1Sum));
+ ui->rank2Label->setText(QString::number(rank2Sum));
+
+
+
+}
+
+InjuryAnalysisUI::~InjuryAnalysisUI()
+{
+ delete ui;
+}
+
+void InjuryAnalysisUI::on_searchButton_clicked()
+{
+ QString userInput = ui->searchInput->text();
+ int searchIndex = -1;
+ if(!userInput.isEmpty())
+ {
+ for(int i = 0; i
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class InjuryAnalysisUI; //声明ui命名空间下的类
+}
+QT_END_NAMESPACE
+
+class InjuryAnalysisUI : public QWidget
+{
+ // Q_OBJECT宏用于提供Qt信号槽和元对象系统服务
+ // 它必须限定为私有访问权限
+ Q_OBJECT
+
+public:
+ InjuryAnalysisUI(QWidget *parent = nullptr);
+ ~InjuryAnalysisUI();
+ QList result;
+
+
+private slots:
+
+
+ void on_searchButton_clicked();
+
+
+private:
+ // 创建Ui::InjuryAnalysisUI类型的指针,用于操作ui界面及其控件
+ Ui::InjuryAnalysisUI *ui;
+};
+
+#endif // INJURYANALYSISUI_H
diff --git a/src/Client/InjuryAnalysisUI.ui b/src/Client/InjuryAnalysisUI.ui
new file mode 100644
index 0000000..a45c26a
--- /dev/null
+++ b/src/Client/InjuryAnalysisUI.ui
@@ -0,0 +1,236 @@
+
+
+ InjuryAnalysisUI
+
+
+
+ 0
+ 0
+ 679
+ 410
+
+
+
+ Form
+
+
+ background-color: rgb(245, 245, 245);
+font: 11pt "Microsoft YaHei UI";
+
+
+
+
+ 10
+ 0
+ 215
+ 82
+
+
+
+ -
+
+
+
+ 0
+ 100
+
+
+
+
+ 80
+ 80
+
+
+
+
+ 100
+ 100
+
+
+
+ border-image: url(:/image/res/image/logo_backgroundless.png);
+
+
+
+
+
+
+ -
+
+
+ 伤情结果统计:
+
+
+
+
+
+
+
+
+ 10
+ 80
+ 631
+ 291
+
+
+
+ QPushButton {
+background-color: rgba(15, 28, 34, 0);
+ color: rgb(0, 0, 0);
+
+border: none;
+
+padding: 10px 20px; /* 设置内边距 */
+
+border-radius: 5px; /* 设置按钮圆角 */
+
+font-size: 14px; /* 设置文字大小 */
+
+text-align: right; /* 设置字体向右对齐 */
+
+}
+
+QPushButton:hover {
+
+background-color: #0364FF; /* 设置鼠标悬停时按钮背景色 */
+
+}
+
+QPushButton:pressed {
+
+background-color: #398439; /* 设置按钮被按下时背景色 */
+
+}
+
+
+ -
+
+
-
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 365
+ 229
+
+
+
+
+
+ -
+
+
-
+
+
-
+
+
+ 伤员总数:
+
+
+
+ -
+
+
+ TextLabel
+
+
+
+
+
+ -
+
+
-
+
+
+ 伤情轻微的伤员数:
+
+
+
+ -
+
+
+ TextLabel
+
+
+
+
+
+ -
+
+
-
+
+
+ 伤情一般的伤员数:
+
+
+
+ -
+
+
+ TextLabel
+
+
+
+
+
+ -
+
+
-
+
+
+ 伤情严重的伤员数:
+
+
+
+ -
+
+
+ TextLabel
+
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 输入伤员编号查询伤员信息
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ font: 14pt "Consolas";
+
+
+ 查询
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Client/InjuryDatabase.cpp b/src/Client/InjuryDatabase.cpp
new file mode 100644
index 0000000..22f6ad0
--- /dev/null
+++ b/src/Client/InjuryDatabase.cpp
@@ -0,0 +1,232 @@
+#include "InjuryDatabase.h"
+
+InjuryDatabase *InjuryDatabase::getInstance()
+{
+ static InjuryDatabase db;
+ return &db;
+}
+
+InjuryDatabase::~InjuryDatabase()
+{
+ close();
+}
+
+InjuryDatabase::InjuryDatabase()
+{
+ m_sqlDb = QSqlDatabase::addDatabase("QMYSQL");
+}
+
+//添加记录
+bool InjuryDatabase::add(const Injury &data)
+{
+<<<<<<< HEAD:src/Client2/fly_land/InjuryDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/InjuryDatabase.cpp
+ {
+ beginAddFiled("injurydatabase");
+ addFiled("id");
+ addFiled("injuryrank");
+ addFiled("lon");
+ addFiled("lat");
+ addFiled("flag");
+ endAddFiled();
+
+ beginAddRow();
+ addValue(data.id);
+ addValue(data.rank);
+ addValue(data.lon);
+ addValue(data.lat);
+ addValue(data.flag);
+ endAddRow();
+
+ m_valueSql = m_valueSql.left(m_valueSql.length()-1);
+ QString sql;
+ sql = m_headerSql + m_valueSql;
+ return exec(sql);
+ }
+ close();
+
+}
+
+
+//查询所有记录
+bool InjuryDatabase::select_all(QList &result)
+{
+<<<<<<< HEAD:src/Client2/fly_land/InjuryDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/InjuryDatabase.cpp
+ {
+ QSqlQuery query(m_sqlDb);
+
+ QString strQuery;
+ strQuery = "SELECT * FROM ";
+ strQuery += "injurydatabase";
+
+ query.prepare(strQuery);
+
+ bool isSuccess = query.exec();
+ if(isSuccess)
+ {
+ while(query.next())
+ {
+ QString id = query.value(0).toString();
+ int rank = query.value(1).toInt();
+ double lon = query.value(2).toDouble();
+ double lat = query.value(3).toDouble();
+ int flag = query.value(4).toInt();
+
+ Injury data;
+ data.id = id;
+ data.rank = rank;
+ data.lon = lon;
+ data.lat = lat;
+ data.flag = flag;
+ result.append(data);
+ }
+ }
+
+ return isSuccess;
+ }
+ close();
+}
+
+
+//返回有效伤员的信息
+void InjuryDatabase::ReturnInfo(QList result)
+{
+<<<<<<< HEAD:src/Client2/fly_land/InjuryDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/InjuryDatabase.cpp
+ {
+ select_valid("injurydatabase", result);
+ for(int i = 0; i &result)
+{
+ QSqlQuery query(m_sqlDb);
+
+ QString strQuery;
+ strQuery = "SELECT id, injuryrank, lon, lat FROM ";
+ strQuery += tableName;
+ strQuery += " WHERE flag = 1";
+
+ //qDebug()<
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+using namespace std;
+
+
+struct Injury
+{
+ QString id;
+ int rank;
+ double lon;
+ double lat;
+ 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 Injury &data);
+ //查询所有数据
+ bool select_all(QList &result);
+
+ Injury data;
+ //返回有效信息
+ void ReturnInfo(QList data);
+
+
+private:
+ //查询有效数据
+ bool select_valid(const QString &tableName,QList &result);
+ //关闭
+ void close();
+ //开始添加字段
+ 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
diff --git a/src/Client/UAVDatabase.cpp b/src/Client/UAVDatabase.cpp
new file mode 100644
index 0000000..15b0d7b
--- /dev/null
+++ b/src/Client/UAVDatabase.cpp
@@ -0,0 +1,212 @@
+#include "UAVDatabase.h"
+
+UAVDatabase *UAVDatabase::getInstance()
+{
+ static UAVDatabase db;
+ return &db;
+}
+
+UAVDatabase::~UAVDatabase()
+{
+ close();
+}
+
+UAVDatabase::UAVDatabase()
+{
+ m_sqlDb = QSqlDatabase::addDatabase("QMYSQL");
+}
+
+//添加记录
+bool UAVDatabase::add(const UAV &data)
+{
+<<<<<<< HEAD:src/Client2/fly_land/UAVDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/UAVDatabase.cpp
+ {
+ beginAddFiled("uavdatabase");
+ addFiled("id");
+ addFiled("state");
+ addFiled("ip");
+ addFiled("port");
+ addFiled("lon");
+ addFiled("lat");
+ endAddFiled();
+
+ beginAddRow();
+ addValue(data.id);
+ addValue(data.state);
+ addValue(data.ip);
+ addValue(data.port);
+ addValue(data.lon);
+ addValue(data.lat);
+ endAddRow();
+
+ m_valueSql = m_valueSql.left(m_valueSql.length()-1);
+ QString sql;
+ sql = m_headerSql + m_valueSql;
+ return exec(sql);
+ }
+ close();
+}
+
+//查询位置信息的记录
+Point UAVDatabase::ReturnUAVPosition(QString id)
+{
+<<<<<<< HEAD:src/Client2/fly_land/UAVDatabase.cpp
+ if(open("fly_land_database","root","684542"))
+=======
+ if(open("fly_land_database","root","MYSQLqwer35257"))
+>>>>>>> master:src/Client/UAVDatabase.cpp
+ {
+ QSqlQuery query(m_sqlDb);
+
+ QString strQuery;
+ strQuery = "SELECT lon, lat FROM ";
+ strQuery += "uavdatabase";
+ strQuery += " WHERE id = ";
+ strQuery += id;
+
+ qDebug()<>>>>>> master:src/Client/UAVDatabase.cpp
+ {
+ QSqlQuery query(m_sqlDb);
+
+ QString strQuery;
+ strQuery = "SELECT state FROM ";
+ strQuery += "uavdatabase";
+ strQuery += " WHERE id = ";
+ strQuery += id;
+
+ qDebug()<>>>>>> master:src/Client/UAVDatabase.cpp
+
+ return isSuccess;
+}
+
diff --git a/src/Client/UAVDatabase.h b/src/Client/UAVDatabase.h
new file mode 100644
index 0000000..b2f7071
--- /dev/null
+++ b/src/Client/UAVDatabase.h
@@ -0,0 +1,110 @@
+#ifndef UAVDATABASE_H
+#define UAVDATABASE_H
+
+<<<<<<< HEAD:src/Client2/fly_land/UAVDatabase.h
+#include
+#include
+#include
+=======
+#include
+#include
+#include
+>>>>>>> master:src/Client/UAVDatabase.h
+#include
+#include
+#include
+#include
+
+
+using namespace std;
+
+
+struct UAV
+{
+ QString id;
+ int state;
+ QString ip;
+ int port;
+ double lon;
+ double lat;
+};
+
+//存储经纬度信息
+struct Point
+{
+ double lon;
+ double lat;
+};
+
+class UAVDatabase
+{
+ // Q_OBJECT宏用于提供Qt信号槽和元对象系统服务
+ // 它必须限定为私有访问权限
+ //Q_OBJECT
+
+public:
+ static UAVDatabase *getInstance();
+ UAVDatabase();
+ ~UAVDatabase();
+
+ UAV data;
+
+ //返回状态信息
+ int giveInfo(QString id);
+ //添加数据记录
+ bool add(const UAV &data);
+ //查询位置信息数据
+ Point ReturnUAVPosition( QString id);
+
+
+
+private:
+ //打开
+ bool open(const QString &dbName,const QString &userName = QString(),const QString &passwd = QString());
+ //关闭
+ void close();
+ //开始添加字段
+ 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 // UAVDATABASE_H
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/DogDatabase.cpp.9C248469BABED4FE.idx b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/DogDatabase.cpp.9C248469BABED4FE.idx
new file mode 100644
index 0000000..ea05439
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/DogDatabase.cpp.9C248469BABED4FE.idx differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/DogDatabase.h.697AD127290AAE98.idx b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/DogDatabase.h.697AD127290AAE98.idx
new file mode 100644
index 0000000..a346150
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/DogDatabase.h.697AD127290AAE98.idx differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/QScrollArea.BE202BFE73F61A75.idx b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/QScrollArea.BE202BFE73F61A75.idx
new file mode 100644
index 0000000..475df3d
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/QScrollArea.BE202BFE73F61A75.idx differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/UAVDatabase.cpp.ACFF5085AE65CCEE.idx b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/UAVDatabase.cpp.ACFF5085AE65CCEE.idx
new file mode 100644
index 0000000..0ad1cc2
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/UAVDatabase.cpp.ACFF5085AE65CCEE.idx differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/UAVDatabase.h.388C4D121CCA039E.idx b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/UAVDatabase.h.388C4D121CCA039E.idx
new file mode 100644
index 0000000..37e45c4
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/UAVDatabase.h.388C4D121CCA039E.idx differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/qscrollarea.h.F2655CAC28E08B21.idx b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/qscrollarea.h.F2655CAC28E08B21.idx
new file mode 100644
index 0000000..f6a6135
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/.qtc_clangd/.cache/clangd/index/qscrollarea.h.F2655CAC28E08B21.idx differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/debug/DogDatabase.o b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/debug/DogDatabase.o
new file mode 100644
index 0000000..f925b9b
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/debug/DogDatabase.o differ
diff --git a/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/debug/UAVDatabase.o b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/debug/UAVDatabase.o
new file mode 100644
index 0000000..774c79b
Binary files /dev/null and b/src/Client/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug/debug/UAVDatabase.o differ
diff --git a/src/Client/guidingui.cpp b/src/Client/guidingui.cpp
new file mode 100644
index 0000000..fa95cc4
--- /dev/null
+++ b/src/Client/guidingui.cpp
@@ -0,0 +1,265 @@
+#include "guidingui.h"
+#include "ui_guidingui.h"
+#include "InjuryAnalysisUI.h"
+#include "InjuryDatabase.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+GuidingUI::GuidingUI(QWidget *parent)
+ : QMainWindow(parent)
+ , ui(new Ui::GuidingUI)
+{
+ ui->setupUi(this);
+ /* 控制地图显示 */
+ MapDisplayControl(ui->mapbutton,ui->MapDisplayer,ui->gridLayout_3);
+ /* 控制添加机器人 */
+ AddRobotControl(ui->addrobot);
+ /* 控制机器人列表 */
+ RobotsInfosControl(ui->robottab);
+}
+
+GuidingUI::~GuidingUI()
+{
+ delete ui;
+}
+
+void GuidingUI::MapDisplayControl(QPushButton *btnCtr,QWidget*Tar,QGridLayout*layout)
+{
+ // 创建堆栈部件
+ QStackedWidget* stackedWidget = new QStackedWidget(this);
+
+ // 创建背景板部件
+ QWidget* backgroundWidget = new QWidget(this);
+ QPixmap backgroundPixmap(":/image/res/image/MapBackGround.png");
+ QLabel *backgroundLabel = new QLabel(backgroundWidget);
+ backgroundLabel->setPixmap(backgroundPixmap);
+
+ // 设置堆栈部件的组成
+ backgroundLabel->setMaximumSize(1500,900); // 背景板的最大尺寸
+ backgroundLabel->setMinimumSize(500,300); // 背景板的最小尺寸
+ // 设置QLabel的缩放模式为拉伸填充
+ backgroundLabel->setScaledContents(true);
+
+
+ // 设置地图部件的尺寸
+ Tar->setMaximumSize(1500,900); // 地图部件的最大尺寸
+ Tar->setMinimumSize(500,300); // 地图部件的最小尺寸
+
+ stackedWidget->addWidget(Tar);
+ stackedWidget->addWidget(backgroundLabel);
+ stackedWidget->setCurrentIndex(1);
+
+ connect(btnCtr,&QPushButton::clicked,this,[=](){
+ if(stackedWidget->currentIndex() == 0)
+ stackedWidget->setCurrentIndex(1);
+ else
+ stackedWidget->setCurrentIndex(0);
+ });
+
+ // 将堆栈部件添加到布局当中
+ layout->addWidget(stackedWidget);
+ QWebEngineView *view = new QWebEngineView(ui->MapDisplayer);
+
+ // 设置HTML文件的路径,这里使用资源文件系统
+ QUrl url = QUrl("qrc:/html/res/html/map.html");
+ view->load(url);
+
+ // 连接loadFinished信号来确认页面是否加载成功,并在加载成功后调用addMarker函数
+ connect(view, &QWebEngineView::loadFinished, [view]() {
+ // 假设我们要添加的坐标和等级
+ QList result;
+ InjuryDatabase injuryinfo;
+ injuryinfo.select_all(result);
+ for(int i=0;ipage()->runJavaScript(QString("addMarker(%1, %2, %3)").arg(latitude).arg(longitude).arg(level), [](const QVariant &result) {
+ // 这里可以处理JavaScript函数执行后的结果
+ });
+ }
+ });
+
+ // 由于 MapDisplayer 已经在 UI 布局中,我们不需要创建新的布局
+ // 直接将 QWebEngineView 添加到 MapDisplayer 中
+ QVBoxLayout *layout1 = qobject_cast(ui->MapDisplayer->layout());
+ if (layout1) {
+ layout1->addWidget(view);
+ } else {
+ // 如果 MapDisplayer 没有布局,则创建一个并添加 QWebEngineView
+ QVBoxLayout *newLayout = new QVBoxLayout(ui->MapDisplayer);
+ newLayout->addWidget(view);
+ ui->MapDisplayer->setLayout(newLayout);
+ }
+}
+
+void GuidingUI::on_addrobot_clicked()
+{
+ QDialog *dialog = new QDialog(this);
+ QVBoxLayout *layout = new QVBoxLayout;
+
+ QHBoxLayout *nameLayout = new QHBoxLayout;
+ QLabel *nameLabel = new QLabel("名称(customized):", dialog);
+ QLineEdit *nameEdit = new QLineEdit(dialog);
+ nameLayout->addWidget(nameLabel);
+ nameLayout->addWidget(nameEdit);
+ layout->addLayout(nameLayout);
+
+ QHBoxLayout *ipLayout = new QHBoxLayout;
+ QLabel *ipLabel = new QLabel("IP地址:", dialog);
+ QLineEdit *ipEdit = new QLineEdit(dialog);
+ ipLayout->addWidget(ipLabel);
+ ipLayout->addWidget(ipEdit);
+ layout->addLayout(ipLayout);
+
+ QPushButton *okButton = new QPushButton("确定", dialog);
+ layout->addWidget(okButton);
+
+ connect(okButton, &QPushButton::clicked, dialog, &QDialog::accept);
+ connect(dialog, &QDialog::accepted, [=]() {
+ QString name = nameEdit->text();
+ QString ip = ipEdit->text();
+ // listWidget->addItem(name + " - " + ip);
+ });
+
+ dialog->setLayout(layout);
+ dialog->exec();
+}
+
+void GuidingUI::AddRobotControl(QPushButton* btnCtr)
+{
+ connect(btnCtr,&QPushButton::clicked,this,&GuidingUI::on_addrobot_clicked);
+}
+
+
+void on_specifiedrobottab_clicked()
+{
+
+}
+
+
+void GuidingUI::on_robottab_clicked()
+{
+ char robot_one[100] = "alice,192.168.0.1";
+ char robot_two[100] = "bob,192.168.0.2";
+ QDialog *dialog = new QDialog(this);
+ QVBoxLayout *layout = new QVBoxLayout;
+ QHBoxLayout *titleLayout = new QHBoxLayout;
+ QLabel *titleLabel = new QLabel("机器人列表", dialog);
+ // 新布局当中添加标题
+ /**
+ * @bug 这里用layout添加和直接添加有什么区别
+ */
+ titleLayout->addWidget(titleLabel);
+ layout->addLayout(titleLayout);
+
+ // 新布局当中添加列表
+ QTableWidget *tableWidget = new QTableWidget(dialog);
+ QVBoxLayout *robotListLayout = new QVBoxLayout;
+ robotListLayout->addWidget(tableWidget);
+ layout->addLayout(robotListLayout);
+
+ // 读取机器人的数据格式
+ /**
+ * @bug 这里显示列表行数是定值
+ */
+ tableWidget->setRowCount(10);
+ tableWidget->setColumnCount(2);
+ tableWidget->setHorizontalHeaderLabels(QStringList() << "名称" << "IP地址");
+ QTableWidgetItem *nameItem = new QTableWidgetItem("ALice");
+ QTableWidgetItem *ipAddressItem = new QTableWidgetItem("192.168.0.1");
+ tableWidget->setItem(0, 0, nameItem);
+ tableWidget->setItem(0, 1, ipAddressItem);
+
+ QTableWidgetItem *nameItem2 = new QTableWidgetItem("Bob");
+ QTableWidgetItem *ipAddressItem2 = new QTableWidgetItem("192.168.0.2");
+ tableWidget->setItem(1, 0, nameItem2);
+ tableWidget->setItem(1, 1, ipAddressItem2);
+
+ /* 跳转按钮 */
+ QPushButton *specified_robot_btn = new QPushButton(dialog); // 新的按钮跟dialog是子属关系
+ QHBoxLayout *specified_robot_btnLayout = new QHBoxLayout(); // 按钮的布局
+ specified_robot_btnLayout->addWidget(specified_robot_btn); // 添加按钮到按钮布局当中
+ layout->addLayout(specified_robot_btnLayout); // 添加按钮布局到对话框布局当中
+ // connect(specified_robot_btn,&QPushButton::clicked,this,&GuidingUI::on_specifiedrobottab_clicked); // 联系槽函数
+
+ dialog->setLayout(layout);
+ dialog->exec();
+}
+
+void GuidingUI::RobotsInfosControl(QPushButton* btnCtr)
+{
+ connect(btnCtr,&QPushButton::clicked,this,&GuidingUI::on_robottab_clicked);
+}
+
+
+
+void GuidingUI::on_addCasualty_clicked()
+{
+ // QDialog dialog(this);
+ // dialog.setWindowTitle("添加伤员信息");
+
+ // QFormLayout formLayout(&dialog);
+
+ // QLineEdit latitudeLineEdit;
+ // QLineEdit longitudeLineEdit;
+ // QLineEdit levelLineEdit;
+
+ // formLayout.addRow("经度:", &latitudeLineEdit);
+ // formLayout.addRow("纬度:", &longitudeLineEdit);
+ // formLayout.addRow("伤情等级:", &levelLineEdit);
+
+ // QPushButton addButton("添加", &dialog);
+ // formLayout.addRow(&addButton);
+
+ // // 连接按钮的点击信号到槽函数
+ // QObject::connect(&addButton, &QPushButton::clicked, [&]() {
+ // bool ok;
+ // double latitude = latitudeLineEdit.text().toDouble(&ok);
+ // if (!ok) {
+ // qDebug() << "Invalid latitude";
+ // return;
+ // }
+
+ // double longitude = longitudeLineEdit.text().toDouble(&ok);
+ // if (!ok) {
+ // qDebug() << "Invalid longitude";
+ // return;
+ // }
+
+ // int level = levelLineEdit.text().toInt(&ok);
+ // if (!ok || level < 1 || level > 3) {
+ // qDebug() << "Invalid level";
+ // return;
+ // }
+
+ // // 获取 QML 根对象
+ // QQuickItem *root = ui->MapDisplayer->rootObject();
+ // auto labelqml = root->findChild("labelcpp");
+
+ // // 调用 QML 中的 addInfo 函数
+ // QVariant ret;
+ // QMetaObject::invokeMethod(labelqml, "addInfo", Q_ARG(QVariant, latitude), Q_ARG(QVariant, longitude), Q_ARG(QVariant, level));
+
+ // qDebug() << "Added casualty at latitude:" << latitude << " longitude:" << longitude << " level:" << level;
+
+ // dialog.accept();
+ // });
+
+ // if (dialog.exec() == QDialog::Accepted) {
+ // // 如果对话框被接受,则在这里处理添加操作
+ // }
+}
+
+void GuidingUI::on_showInjuryInfo_clicked()
+{
+ InjuryAnalysisUI* InjuryAnalysisDialog = new InjuryAnalysisUI;
+ InjuryAnalysisDialog->show();
+}
+
diff --git a/src/Client/guidingui.h b/src/Client/guidingui.h
new file mode 100644
index 0000000..4a9aa27
--- /dev/null
+++ b/src/Client/guidingui.h
@@ -0,0 +1,50 @@
+#ifndef GUIDINGUI_H
+#define GUIDINGUI_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class GuidingUI;
+}
+QT_END_NAMESPACE
+
+class GuidingUI : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ GuidingUI(QWidget *parent = nullptr);
+ ~GuidingUI();
+ // 功能界面地图显示控制
+ void MapDisplayControl(QPushButton*,QWidget*,QGridLayout*);
+ // 添加机器人按钮槽函数
+ void on_addrobot_clicked();
+ // 功能界面添加机器人按钮控制
+ void AddRobotControl(QPushButton*);
+ // 机器人列表显示按钮槽函数
+ void on_robottab_clicked();
+ // 功能界面显示已配置机器人列表按钮控制
+ void RobotsInfosControl(QPushButton*);
+ // 机器人列表当中的切换到指定机器人页面槽函数
+ void on_specifiedrobottab_clicked();
+
+private slots:
+ void on_addCasualty_clicked();
+
+ void on_showInjuryInfo_clicked();
+
+private:
+ Ui::GuidingUI *ui;
+};
+#endif // GUIDINGUI_H
diff --git a/src/Client/guidingui.ui b/src/Client/guidingui.ui
new file mode 100644
index 0000000..af751d5
--- /dev/null
+++ b/src/Client/guidingui.ui
@@ -0,0 +1,420 @@
+
+
+ GuidingUI
+
+
+ true
+
+
+
+ 0
+ 0
+ 1000
+ 663
+
+
+
+ 伤情态势感知分析系统
+
+
+ 0
+
+
+ #centralwidget{
+ background-color: rgb(15, 18, 34);
+}
+
+
+
+
+ true
+
+
+
+
+
+ -
+
+
+ QLabel {
+ background-color: rgba(15, 28, 34, 0);
+ color: white; /* 设置字体颜色为白色 */
+
+ border: none;
+
+ padding: 10px 20px; /* 设置内边距 */
+
+ border-radius: 5px; /* 设置按钮圆角 */
+
+ font-size: 30px; /* 设置文字大小 */
+
+ font-weight: bold; /*设置字体加粗*/
+
+ text-align: right; /* 设置字体居左对齐 */
+}
+
+
+
+ ACM
+
+
+
+ -
+
+
+ 20
+
+
+ 30
+
+
+ 20
+
+
+ 20
+
+
+ 50
+
+
-
+
+
+
+
+ -
+
+
+
+ 0
+ 100
+
+
+
+
+ 100
+ 100
+
+
+
+
+ 100
+ 100
+
+
+
+ border-image: url(:/image/res/image/logo_backgroundless.png);
+
+
+
+
+
+
+ -
+
+
+ QPushButton {
+background-color: rgba(15, 28, 34, 0);
+color: rgb(255, 255, 255);
+
+border: none;
+
+padding: 10px 20px; /* 设置内边距 */
+
+border-radius: 5px; /* 设置按钮圆角 */
+
+font-size: 14px; /* 设置文字大小 */
+
+text-align: right; /* 设置字体向右对齐 */
+
+}
+
+QPushButton:hover {
+
+background-color: #0364FF; /* 设置鼠标悬停时按钮背景色 */
+
+}
+
+QPushButton:pressed {
+
+background-color: #398439; /* 设置按钮被按下时背景色 */
+
+}
+
+
+
-
+
+
-
+
+
+ 机器人列表
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/tab.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 机器人位置显示
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/location.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ #QPushButton{
+background-color: rgba(255, 255, 255, 0);
+color: rgb(255, 255, 255);
+border: none;
+}
+
+
+ 添加机器人
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/robotbtn.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 显示地图
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/mapbtn.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 添加无人机
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/UAV.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 无人机列表
+
+
+
+ -
+
+
+ false
+
+
+ border-image: url(:/image/res/image/tab.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 显示伤情
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/health.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 无人机位置显示
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/location.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ #QPushButton{
+background-color: rgba(255, 255, 255, 0);
+color: rgb(255, 255, 255);
+border: none;
+}
+
+
+ 伤员列表
+
+
+
+ -
+
+
+ border-image: url(:/image/res/image/soldier.svg);
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+ 展示信息
+
+
+
+ -
+
+
+
+border-image: url(:/image/res/image/infomation.svg);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加机器人
+
+
+
+
+ 显示机器人
+
+
+ <html><head/><body><p>显示机器人</p></body></html>
+
+
+
+
+ 伤员
+
+
+
+
+ 加载地图
+
+
+
+
+
+
diff --git a/src/Client/injurydisiplayui.cpp b/src/Client/injurydisiplayui.cpp
new file mode 100644
index 0000000..80168f1
--- /dev/null
+++ b/src/Client/injurydisiplayui.cpp
@@ -0,0 +1,55 @@
+#include "injurydisiplayui.h"
+#include "ui_injurydisiplayui.h"
+#include "InjuryDatabase.h"
+#include "guidingui.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+InjuryDisiplayUI::InjuryDisiplayUI(QWidget *parent)
+ : QDialog(parent)
+ , ui(new Ui::InjuryDisiplayUI)
+{
+ ui->setupUi(this);
+
+ // 创建QWebEngineView实例
+ QWebEngineView *view = new QWebEngineView(this);
+
+ // 设置HTML文件的路径,这里使用资源文件系统
+ QUrl url = QUrl("qrc:/html/res/html/map.html");
+ view->load(url);
+
+ // 连接loadFinished信号来确认页面是否加载成功,并在加载成功后调用addMarker函数
+ connect(view, &QWebEngineView::loadFinished, [view]() {
+ // 假设我们要添加的坐标和等级
+ QList result;
+ InjuryDatabase injuryinfo;
+ injuryinfo.select_all(result);
+ for(int i=0;ipage()->runJavaScript(QString("addMarker(%1, %2, %3)").arg(latitude).arg(longitude).arg(level), [](const QVariant &result) {
+ // 这里可以处理JavaScript函数执行后的结果
+ });
+ }
+
+ });
+
+ // 创建布局并添加QWebEngineView
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ layout->addWidget(view);
+
+ // 设置布局
+ setLayout(layout);
+}
+
+InjuryDisiplayUI::~InjuryDisiplayUI()
+{
+ delete ui;
+}
diff --git a/src/Client/injurydisiplayui.h b/src/Client/injurydisiplayui.h
new file mode 100644
index 0000000..e7ecb81
--- /dev/null
+++ b/src/Client/injurydisiplayui.h
@@ -0,0 +1,24 @@
+#ifndef INJURYDISIPLAYUI_H
+#define INJURYDISIPLAYUI_H
+
+#include
+#include
+#include
+
+namespace Ui {
+class InjuryDisiplayUI;
+}
+
+class InjuryDisiplayUI : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit InjuryDisiplayUI(QWidget *parent = nullptr);
+ ~InjuryDisiplayUI();
+
+private:
+ Ui::InjuryDisiplayUI *ui;
+};
+
+#endif // INJURYDISIPLAYUI_H
diff --git a/src/Client/injurydisiplayui.ui b/src/Client/injurydisiplayui.ui
new file mode 100644
index 0000000..d5d9df6
--- /dev/null
+++ b/src/Client/injurydisiplayui.ui
@@ -0,0 +1,19 @@
+
+
+ InjuryDisiplayUI
+
+
+
+ 0
+ 0
+ 1205
+ 710
+
+
+
+ Dialog
+
+
+
+
+
diff --git a/src/Client/main.cpp b/src/Client/main.cpp
new file mode 100644
index 0000000..46ea88b
--- /dev/null
+++ b/src/Client/main.cpp
@@ -0,0 +1,26 @@
+#include "guidingui.h"
+#include "InjuryDatabase.h"
+#include "DogDatabase.h"
+#include "UAVDatabase.h"
+#include
+#include
+#include
+#include
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+
+ //设置窗口图标
+ QIcon icon(":/image/res/image/logo_backgroundless.png");
+ a.setWindowIcon(icon);
+
+ GuidingUI w;
+ w.show();
+ QStringList lis= QSqlDatabase::drivers();
+ for (int i=0;i
+
+ res/image/health.png
+ res/image/health.png.svg
+ res/image/health.svg
+ res/image/info.png
+ res/image/infomation.svg
+ res/image/location.png
+ res/image/location.svg
+ res/image/logo.png
+ res/image/logo_backgroundless.png
+ res/image/map.png
+ res/image/map.svg
+ res/image/MapBackGround.png
+ res/image/mapbtn.svg
+ res/image/robot.png
+ res/image/robotbtn.svg
+ res/image/soldier.png
+ res/image/soldier.svg
+ res/image/tab.png
+ res/image/tab.svg
+ res/image/uav.png
+ res/image/UAV.svg
+
+
+ res/qml/MAP.qml
+ res/qml/MAP2.qml
+
+
+ res/html/map.html
+
+
+ res/icon/green.png
+ res/icon/red.png
+ res/icon/yellow.png
+
+
diff --git a/src/Client/res/html/map.html b/src/Client/res/html/map.html
new file mode 100644
index 0000000..410a78a
--- /dev/null
+++ b/src/Client/res/html/map.html
@@ -0,0 +1,207 @@
+
+
+
+
+
+ 伤情态势展示系统
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Client/res/icon/green.png b/src/Client/res/icon/green.png
new file mode 100644
index 0000000..0347d9a
Binary files /dev/null and b/src/Client/res/icon/green.png differ
diff --git a/src/Client/res/icon/red.png b/src/Client/res/icon/red.png
new file mode 100644
index 0000000..5c2ddf0
Binary files /dev/null and b/src/Client/res/icon/red.png differ
diff --git a/src/Client/res/icon/yellow.png b/src/Client/res/icon/yellow.png
new file mode 100644
index 0000000..b7ecef5
Binary files /dev/null and b/src/Client/res/icon/yellow.png differ
diff --git a/src/Client/res/image/MapBackGround.png b/src/Client/res/image/MapBackGround.png
new file mode 100644
index 0000000..152ac5d
Binary files /dev/null and b/src/Client/res/image/MapBackGround.png differ
diff --git a/src/Client/res/image/UAV.svg b/src/Client/res/image/UAV.svg
new file mode 100644
index 0000000..0d828dc
--- /dev/null
+++ b/src/Client/res/image/UAV.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/health.png b/src/Client/res/image/health.png
new file mode 100644
index 0000000..3490ba6
Binary files /dev/null and b/src/Client/res/image/health.png differ
diff --git a/src/Client/res/image/health.png.svg b/src/Client/res/image/health.png.svg
new file mode 100644
index 0000000..ad21b55
--- /dev/null
+++ b/src/Client/res/image/health.png.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/health.svg b/src/Client/res/image/health.svg
new file mode 100644
index 0000000..ad21b55
--- /dev/null
+++ b/src/Client/res/image/health.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/info.png b/src/Client/res/image/info.png
new file mode 100644
index 0000000..f804244
Binary files /dev/null and b/src/Client/res/image/info.png differ
diff --git a/src/Client/res/image/infomation.svg b/src/Client/res/image/infomation.svg
new file mode 100644
index 0000000..230844c
--- /dev/null
+++ b/src/Client/res/image/infomation.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/location.png b/src/Client/res/image/location.png
new file mode 100644
index 0000000..be4bfc8
Binary files /dev/null and b/src/Client/res/image/location.png differ
diff --git a/src/Client/res/image/location.svg b/src/Client/res/image/location.svg
new file mode 100644
index 0000000..e698bcc
--- /dev/null
+++ b/src/Client/res/image/location.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/logo.png b/src/Client/res/image/logo.png
new file mode 100644
index 0000000..e07e07c
Binary files /dev/null and b/src/Client/res/image/logo.png differ
diff --git a/src/Client/res/image/logo_backgroundless.png b/src/Client/res/image/logo_backgroundless.png
new file mode 100644
index 0000000..5885415
Binary files /dev/null and b/src/Client/res/image/logo_backgroundless.png differ
diff --git a/src/Client/res/image/map.png b/src/Client/res/image/map.png
new file mode 100644
index 0000000..e37c686
Binary files /dev/null and b/src/Client/res/image/map.png differ
diff --git a/src/Client/res/image/map.svg b/src/Client/res/image/map.svg
new file mode 100644
index 0000000..731de6b
--- /dev/null
+++ b/src/Client/res/image/map.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/mapbtn.svg b/src/Client/res/image/mapbtn.svg
new file mode 100644
index 0000000..731de6b
--- /dev/null
+++ b/src/Client/res/image/mapbtn.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/robot.png b/src/Client/res/image/robot.png
new file mode 100644
index 0000000..88ab844
Binary files /dev/null and b/src/Client/res/image/robot.png differ
diff --git a/src/Client/res/image/robotbtn.svg b/src/Client/res/image/robotbtn.svg
new file mode 100644
index 0000000..2fb0c34
--- /dev/null
+++ b/src/Client/res/image/robotbtn.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/soldier.png b/src/Client/res/image/soldier.png
new file mode 100644
index 0000000..a5d1989
Binary files /dev/null and b/src/Client/res/image/soldier.png differ
diff --git a/src/Client/res/image/soldier.svg b/src/Client/res/image/soldier.svg
new file mode 100644
index 0000000..a3f79f6
--- /dev/null
+++ b/src/Client/res/image/soldier.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/tab.png b/src/Client/res/image/tab.png
new file mode 100644
index 0000000..12d2157
Binary files /dev/null and b/src/Client/res/image/tab.png differ
diff --git a/src/Client/res/image/tab.svg b/src/Client/res/image/tab.svg
new file mode 100644
index 0000000..3bae718
--- /dev/null
+++ b/src/Client/res/image/tab.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/Client/res/image/uav.png b/src/Client/res/image/uav.png
new file mode 100644
index 0000000..f1a1b3b
Binary files /dev/null and b/src/Client/res/image/uav.png differ
diff --git a/src/Client/res/qml/MAP.qml b/src/Client/res/qml/MAP.qml
new file mode 100644
index 0000000..eaee9a4
--- /dev/null
+++ b/src/Client/res/qml/MAP.qml
@@ -0,0 +1,154 @@
+import QtQuick
+import QtLocation
+import QtPositioning
+import QtQuick.Controls
+import QtLocation 5.15
+import QtPositioning 5.15
+Rectangle {
+ width: parent
+ height: parent
+ visible: true
+
+ PositionSource {
+ id: positionSource
+ active: true // 启动位置服务
+ preferredPositioningMethods: PositionSource.AllPositioningMethods
+ }
+ Control{
+ id:labelcpp
+ objectName: 'labelcpp'
+ font.pointSize: 40
+ // property real latitudeSave: 28.2312227
+ // property real longitudeSave: 112.9334574
+ //cpp调用这个函数
+ //getText 返回地图的中心坐标和缩放级别,setCoordinate 设置地图的中心坐标。
+ function getText()
+ {
+ return map.center + " zoom " + map.zoomLevel.toFixed(3)
+ + " min " + map.minimumZoomLevel + " max " + map.maximumZoomLevel
+ }
+ function setCoordinate(latitude,longitude)
+ {
+ // latitudeSave = latitude
+ // longitudeSave = longitude
+ map.center.latitude = latitude
+ map.center.longitude = longitude
+ map.update()
+ console.log("latitude="+latitude+" longitude="+longitude);
+ console.log(QtPositioning.position.coordinate);
+ }
+ function addInfo(latitude, longitude, level) {
+ var color = "#00FF00"; // 默认颜色
+ if (level === 2) {
+ color = "#FFFF00";
+ } else if (level === 3) {
+ color = "#FF0000";
+ }
+
+ // 创建新的 MapCircle 对象
+ var newCircle = mapPlugin.createMapItem("MapCircle", {
+ "id":newCircle,
+ "center": QtPositioning.coordinate(latitude, longitude),
+ "radius": 50,
+ "border.width": 5,
+ "color": color
+ });
+
+ // 将新圆圈添加到地图上
+ map.addMapItem(newCircle);
+ }
+ }
+
+ Plugin {
+ id: mapPlugin
+ name: "osm"
+ }
+
+ Map {
+ id: map
+ anchors.fill: parent
+ plugin: mapPlugin
+ center: positionSource.position.coordinate
+ zoomLevel: 15
+ activeMapType: map.supportedMapTypes[1]
+ copyrightsVisible: false
+ // MapType{
+ // id: mapType
+ // style:MapType.SatelliteMapDay
+ // }
+ PositionSource {
+ id: posSource
+ active: true
+ onPositionChanged: {
+ map.center = position.coordinate // 设置地图中心
+ positionSource.active = true // 禁用位置服务
+ }
+ preferredPositioningMethods: PositionSource.AllPositioningMethods
+ }
+
+ PinchHandler {
+ id: pinch
+ target: null
+ onActiveChanged: if (active) {
+ map.startCentroid = map.toCoordinate(pinch.centroid.position, false)
+ }
+ onScaleChanged: (delta) => {
+ map.zoomLevel += Math.log2(delta)
+ map.alignCoordinateToPoint(map.startCentroid, pinch.centroid.position)
+ }
+ onRotationChanged: (delta) => {
+ map.bearing -= delta
+ map.alignCoordinateToPoint(map.startCentroid, pinch.centroid.position)
+ }
+ grabPermissions: PointerHandler.TakeOverForbidden
+ }
+ WheelHandler {
+ id: wheel
+ // workaround for QTBUG-87646 / QTBUG-112394 / QTBUG-112432:
+ // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler
+ // and we don't yet distinguish mice and trackpads on Wayland either
+ acceptedDevices: Qt.platform.pluginName === "cocoa" || Qt.platform.pluginName === "wayland"
+ ? PointerDevice.Mouse | PointerDevice.TouchPad
+ : PointerDevice.Mouse
+ rotationScale: 1/120
+ property: "zoomLevel"
+ }
+ DragHandler {
+ id: drag
+ target: null
+ onTranslationChanged: (delta) => map.pan(-delta.x, -delta.y)
+
+ }
+ //定义了两个快捷键,用于放大和缩小地图
+ Shortcut {
+ enabled: map.zoomLevel < map.maximumZoomLevel
+ sequence: StandardKey.ZoomIn
+ onActivated: map.zoomLevel = Math.round(map.zoomLevel + 1)
+ }
+ Shortcut {
+ enabled: map.zoomLevel > map.minimumZoomLevel
+ sequence: StandardKey.ZoomOut
+ onActivated: map.zoomLevel = Math.round(map.zoomLevel - 1)
+ }
+ Component.onCompleted: {
+ positionSource.active = true
+ map.addMapItem(circle)
+ }
+ }
+ MapCircle {
+ id: circle
+ center: QtPositioning.coordinate(labelcpp.latitudeSave,labelcpp.longitudeSave)
+ radius: 10
+ border.width: 3
+ color:"black"
+
+ //鼠标按住后可移动
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent
+ }
+
+ }
+}
+
+
diff --git a/src/Client/res/qml/MAP2.qml b/src/Client/res/qml/MAP2.qml
new file mode 100644
index 0000000..c12ba81
--- /dev/null
+++ b/src/Client/res/qml/MAP2.qml
@@ -0,0 +1,38 @@
+import QtQuick
+import QtLocation
+import QtPositioning
+import QtQuick.Controls
+import QtLocation 5.15
+import QtPositioning 5.15
+Window {
+ id: root
+ visible: true
+ width: 640
+ height: 480
+ title: qsTr("My Qt Location")
+
+ Map {
+ id: the_map
+ anchors.fill: parent
+ minimumZoomLevel: 3
+ maximumZoomLevel: 16
+ zoomLevel: 10
+ center: QtPositioning.coordinate(30.67, 104.06)
+
+ plugin: Plugin {
+ name: "mymap" //"esri" "mapbox" "osm" "here"
+
+ // 使用parameters属性来设置插件参数
+ parameters: [
+ PluginParameter {
+ name: "mapPath"
+ value: applicationDirPath+"/dianzi_gaode_ArcgisServerTiles/_alllayers"
+ },
+ PluginParameter {
+ name: "format"
+ value: "png"
+ }
+ ]
+ }
+ }
+}
diff --git a/src/Client/res/qml/MAP3.qml b/src/Client/res/qml/MAP3.qml
new file mode 100644
index 0000000..58e3eb5
--- /dev/null
+++ b/src/Client/res/qml/MAP3.qml
@@ -0,0 +1,375 @@
+import QtQuick 2.9
+import QtQuick.Window 2.2
+import QtLocation 5.6
+import QtPositioning 5.6
+import QtQuick.Controls 2.4
+import Qt.labs.settings 1.0
+import Qt.labs.platform 1.0
+import QtQuick
+import QtLocation
+import QtPositioning
+import QtQuick.Controls
+import QtLocation 5.15
+import QtPositioning 5.15
+Window {
+ id: window
+ visible: true
+ width: 820
+ height: 560
+ color: "#ffffff"
+ title: qsTr("覆盖规划")
+
+ Settings{
+ id:settings
+ property var jd : 112.9334574
+ property var wd : 28.2312227
+ }
+
+ Plugin {
+ id: mapPlugin
+ name: "osm" // "mapboxgl", "esri", ...
+ }
+
+ Item {
+ id: itemMenu
+ width: 180
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 0
+ anchors.top: parent.top
+ anchors.topMargin: 0
+ anchors.left: parent.left
+ anchors.leftMargin: 0
+ property var itemList: []
+
+ Row {
+ id: row
+ y: 10
+ height: 40
+ spacing: 10
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+
+ Label {
+ id: label
+ width: 50
+ height: 40
+ text: qsTr("经度:")
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pointSize: 13
+ }
+
+ Rectangle {
+ id: rectangle
+ width: 100
+ height: 40
+ color: "#ffffff"
+ border.color: "#b0b8b4"
+ border.width: 2
+
+ TextInput {
+ id: textInput_JD
+ height: 20
+ text: settings.jd
+ clip: true
+ anchors.rightMargin: 5
+ anchors.leftMargin: 5
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.left: parent.left
+ font.pointSize: 12
+ }
+ }
+ }
+
+ Row {
+ id: row1
+ x: 7
+ y: 60
+ height: 40
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ Label {
+ id: label1
+ width: 50
+ height: 40
+ text: qsTr("纬度:")
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pointSize: 13
+ }
+
+ Rectangle {
+ id: rectangle1
+ width: 100
+ height: 40
+ color: "#ffffff"
+ border.color: "#b0b8b4"
+ TextInput {
+ id: textInput_WD
+ height: 20
+ text: settings.wd
+ cursorVisible: true
+ clip: true
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ font.pointSize: 12
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: 5
+ }
+ border.width: 2
+ }
+ anchors.right: parent.right
+ spacing: 10
+ anchors.rightMargin: 10
+ }
+
+ Row {
+ id: row2
+ y: 110
+ height: 40
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ Label {
+ id: label2
+ width: 50
+ height: 40
+ text: qsTr("半径:")
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pointSize: 13
+ }
+
+ Rectangle {
+ id: rectangle2
+ width: 100
+ height: 40
+ color: "#ffffff"
+ border.color: "#b0b8b4"
+ TextInput {
+ id: textInput_Distance
+ height: 20
+ text: qsTr("")
+ anchors.left: parent.left
+ anchors.leftMargin: 5
+ font.pointSize: 12
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.rightMargin: 5
+ }
+ border.width: 2
+ }
+ anchors.right: parent.right
+ spacing: 10
+ anchors.rightMargin: 10
+ }
+
+ Row {
+ id: row3
+ x: -9
+ y: 160
+ height: 40
+ anchors.left: parent.left
+ anchors.leftMargin: 8
+ Label {
+ id: label3
+ width: 50
+ height: 40
+ text: qsTr("颜色:")
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pointSize: 13
+ }
+
+ Rectangle {
+ id: rectangle_color
+ width: 100
+ height: 40
+ color: "#cc72f462"
+ border.color: "#b0b8b4"
+ border.width: 0
+ MouseArea{
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: colorDialog.open()
+ }
+ }
+ anchors.right: parent.right
+ spacing: 10
+ anchors.rightMargin: 12
+ }
+
+ Button {
+ id: button1
+ x: 40
+ y: 215
+ width: 100
+ text: qsTr("添加覆盖圈")
+ onClicked: {
+ var component = Qt.createComponent("MyCircle.qml")
+ if(component.status === Component.Ready){
+ var circle = component.createObject(myMap)
+ var jd = textInput_JD.text
+ var wd = textInput_WD.text
+ circle.myCoordinate = QtPositioning.coordinate(wd, jd)
+ circle.myColor = rectangle_color.color
+ circle.distance = textInput_Distance.text
+ myMap.addMapItemGroup(circle)
+ itemMenu.itemList.push(circle)
+ }
+ }
+ }
+
+ Button {
+ id: button2
+ x: 40
+ y: 265
+ width: 100
+ text: qsTr("删除")
+ onClicked: {
+ var obj = itemMenu.itemList[itemMenu.itemList.length-1]
+ myMap.removeMapItemGroup(obj)
+ itemMenu.itemList.pop()
+ delete obj
+ }
+ }
+
+ Button {
+ id: button3
+ x: 40
+ y: 315
+ width: 100
+ text: qsTr("清除测距")
+ onClicked: {
+ lineObj.path = []
+ distanceLabel.text = ''
+ }
+ }
+
+ Text {
+ id: text1
+ x: 18
+ y: 427
+ text: qsTr("双击左键获取图上位置坐标")
+ font.pixelSize: 12
+ }
+
+ Text {
+ id: text2
+ x: 18
+ y: 453
+ text: qsTr("点击鼠标右键进行地图测距")
+ font.pixelSize: 12
+ }
+
+ Button {
+ id: button4
+ x: 40
+ y: 369
+ width: 100
+ text: qsTr("保存中心")
+ onClicked: {
+ settings.jd = textInput_JD.text
+ settings.wd = textInput_WD.text
+ text_info.text = "地图中心位置已保存"
+ }
+ }
+
+ Text {
+ id: text_info
+ x: 74
+ y: 482
+ width: 32
+ height: 12
+ color: "#f66060"
+ text: qsTr("")
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 12
+ }
+ }
+
+ Map {
+ id:myMap
+ anchors.leftMargin: 180
+ anchors.fill: parent
+ plugin: mapPlugin
+ center: QtPositioning.coordinate(settings.wd, settings.jd) // Oslo
+ zoomLevel: 11
+ property bool measure: false
+
+ MouseArea {
+ id: mouseArea_measure
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton | Qt.LeftButton
+ hoverEnabled: true
+ onClicked: {
+ if(mouse.button === Qt.RightButton){
+ if(!lineObj.start){
+ myMap.measure = true
+ lineObj.path = []
+ var c = myMap.toCoordinate(Qt.point(mouse.x, mouse.y))
+ lineObj.addCoordinate(c)
+ lineObj.start = true
+ }else{
+ myMap.measure = false
+ var c = myMap.toCoordinate(Qt.point(mouse.x, mouse.y))
+ lineObj.addCoordinate(c)
+ lineObj.start = false
+ }
+ }
+ }
+
+ onPositionChanged:{
+ if(myMap.measure){
+ var c = myMap.toCoordinate(Qt.point(mouse.x, mouse.y))
+ var path = lineObj.path;
+ path[1] = c;
+ lineObj.path = path;
+ distanceLabel.coordinate = c
+ var dis = c.distanceTo(path[0])
+ distanceLabel.text =" 距离:"+Math.round(dis)/1000+"千米"
+ }
+ }
+ onDoubleClicked: {
+ if(mouse.button === Qt.LeftButton){
+ var c = myMap.toCoordinate(Qt.point(mouse.x, mouse.y))
+ textInput_JD.text = c.longitude.toFixed(6)
+ textInput_WD.text = c.latitude.toFixed(6)
+ }
+ }
+ }
+
+ MapPolyline {
+ id:lineObj
+ line.width: 3
+ line.color: 'green'
+ path: []
+
+ property bool start: false
+ }
+
+ MapQuickItem{
+ id:distanceLabel
+ property string text: ''
+ sourceItem:Label{
+ color: "darkturquoise"
+ font.bold: true
+ font.pointSize: 15
+ font.family: "微软雅黑"
+ text: distanceLabel.text
+ }
+ }
+ }
+
+ ColorDialog {
+ id: colorDialog
+ options:ColorDialog.ShowAlphaChannel
+ onAccepted: {
+ rectangle_color.color = colorDialog.currentColor
+ }
+ }
+}
diff --git a/src/Client/res/qml/test.qml b/src/Client/res/qml/test.qml
new file mode 100644
index 0000000..bddeae5
--- /dev/null
+++ b/src/Client/res/qml/test.qml
@@ -0,0 +1,41 @@
+// import QtQuick 2.15
+// import QtPositioning 5.15
+// import QtLocation 5.15
+
+// Rectangle {
+// width: 400
+// height: 300
+
+// PositionSource {
+// id: positionSource
+// updateInterval: 1000
+// preferredPositioningMethods: PositionSource.AllPositioningMethods
+// }
+// Plugin {
+// id: mapPlugin
+// name: "osm"
+// }
+// Map {
+// id: map
+// anchors.fill: parent
+// plugin: Plugin {
+// name: "osm" // 使用OpenStreetMap
+// }
+// center: positionSource.position.coordinate
+// zoomLevel: 13
+
+// Component.onCompleted: {
+// map.addMapItem(markerComponent)
+// }
+// }
+
+// Component {
+// id: markerComponent
+// Rectangle {
+// width: 20
+// height: 20
+// color: "blue"
+// radius: 10
+// }
+// }
+// }