添加项目文件。
This commit is contained in:
parent
302df1cf7a
commit
4925216b83
22
LandslideAssess.sln
Normal file
22
LandslideAssess.sln
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.32630.194
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LandslideAssess", "LandslideAssess\LandslideAssess.vcxproj", "{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}.Release|x64.Build.0 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {B31E7462-C1A4-4BA3-97F3-704180A5CDB6}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
378
LandslideAssess/LandslideAssess.cpp
Normal file
378
LandslideAssess/LandslideAssess.cpp
Normal file
@ -0,0 +1,378 @@
|
|||||||
|
#include "LandslideAssess.h"
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
LandslideAssess::LandslideAssess()
|
||||||
|
{
|
||||||
|
//ui.setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LandslideAssess::PannelName()
|
||||||
|
{
|
||||||
|
return QString::fromLocal8Bit("地质模块");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LandslideAssess::CategoryName()
|
||||||
|
{
|
||||||
|
return QString::fromLocal8Bit("地质模块");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LandslideAssess::EnglishName()
|
||||||
|
{
|
||||||
|
return QString::fromLocal8Bit("LandslideAssess");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LandslideAssess::ChineseName()
|
||||||
|
{
|
||||||
|
return QString::fromLocal8Bit("结果评估");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LandslideAssess::Information()
|
||||||
|
{
|
||||||
|
return QString::fromLocal8Bit("结果评估");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString LandslideAssess::IconPath()
|
||||||
|
{
|
||||||
|
return QString(":/LandslideAssess/resources/assessment.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget* LandslideAssess::CenterWidget()
|
||||||
|
{
|
||||||
|
QString gdal_path = qApp->applicationDirPath().toLocal8Bit() + "/share/gdal";
|
||||||
|
QString pro_lib_path = qApp->applicationDirPath().toLocal8Bit() + "/share/proj";
|
||||||
|
qputenv("GDAL_DATA", gdal_path.toLocal8Bit());
|
||||||
|
qputenv("PROJ_LIB", pro_lib_path.toLocal8Bit());
|
||||||
|
|
||||||
|
bool showWin = false;
|
||||||
|
if (myWidget == nullptr)
|
||||||
|
{
|
||||||
|
myWidget = new QDialog();
|
||||||
|
showWin = true;
|
||||||
|
qDebug() << "new QDialog()";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qDebug() << "already have myWidget";
|
||||||
|
//激活窗口并提升至顶层
|
||||||
|
myWidget->activateWindow();
|
||||||
|
myWidget->raise();
|
||||||
|
return myWidget;
|
||||||
|
}
|
||||||
|
ui.setupUi(myWidget);
|
||||||
|
|
||||||
|
myWidget->setWindowTitle(QString::fromLocal8Bit("结果评估"));
|
||||||
|
myWidget->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
|
||||||
|
myWidget->setWindowIcon(QIcon(":/LandslideAssess/resources/assessment.svg"));
|
||||||
|
myWidget->setAttribute(Qt::WA_QuitOnClose, false);
|
||||||
|
|
||||||
|
myWidget->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
connect(myWidget, &QDialog::destroyed, this, [=] {
|
||||||
|
qDebug() << "----Landslide assess window close----";
|
||||||
|
|
||||||
|
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
||||||
|
if (pluginsDir.cd("srsplugins\\SldModel"))
|
||||||
|
{
|
||||||
|
QString strConfigPath = pluginsDir.absoluteFilePath("sld_config.ini");
|
||||||
|
QFile f(strConfigPath);
|
||||||
|
if (f.exists())
|
||||||
|
{
|
||||||
|
WriteConfigPaths(strConfigPath);
|
||||||
|
f.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mWorkThread != nullptr)
|
||||||
|
{
|
||||||
|
mWorkThread->requestInterruption();//请求线程中断
|
||||||
|
mWorkThread->quit();
|
||||||
|
mWorkThread->wait();//调用wait后先调用finished信号对应的槽函数,执行完成后再往下走
|
||||||
|
mWorker->on_cancel();
|
||||||
|
mWorkThread = nullptr;//mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater,不需要delete
|
||||||
|
mWorker = nullptr;//mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater
|
||||||
|
}
|
||||||
|
//qDebug() << "--destroyed";
|
||||||
|
myWidget->close();
|
||||||
|
myWidget = nullptr;
|
||||||
|
});
|
||||||
|
connect(ui.pbtInDataset, &QPushButton::clicked, this, &LandslideAssess::choosePredictPath);
|
||||||
|
connect(ui.pbtInLabel, &QPushButton::clicked, this, &LandslideAssess::chooseLabelPath);
|
||||||
|
connect(ui.pbtIndex, &QPushButton::clicked, this, &LandslideAssess::chooseAssessFile);
|
||||||
|
connect(ui.pbtInModel, &QPushButton::clicked, this, &LandslideAssess::chooseModelFile);
|
||||||
|
connect(ui.pbtResult, &QPushButton::clicked, this, &LandslideAssess::chooseResultPath);
|
||||||
|
|
||||||
|
connect(ui.pushButton_ok, &QPushButton::clicked, this, &LandslideAssess::readAndStart);
|
||||||
|
connect(ui.pushButton_cancel, &QPushButton::clicked, this, &LandslideAssess::pbCancel);
|
||||||
|
|
||||||
|
ui.progressBar->setTextVisible(true);
|
||||||
|
ui.progressBar->setRange(0, 100);
|
||||||
|
|
||||||
|
ui.pbtInModel->setFocus();
|
||||||
|
|
||||||
|
QFile qssFile(":/LandslideAssess/LandslideAssess.qss");
|
||||||
|
qssFile.open(QFile::ReadOnly); //以只读方式打开
|
||||||
|
if (qssFile.isOpen())
|
||||||
|
{
|
||||||
|
QString qss = QLatin1String(qssFile.readAll());
|
||||||
|
myWidget->setStyleSheet(qss);
|
||||||
|
qssFile.close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
qDebug() << "no qssFile";
|
||||||
|
|
||||||
|
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
||||||
|
if (pluginsDir.cd("srsplugins\\SldModel"))
|
||||||
|
{
|
||||||
|
QString strConfigPath = pluginsDir.absoluteFilePath("sld_config.ini");
|
||||||
|
QFile f(strConfigPath);
|
||||||
|
if (f.exists())
|
||||||
|
{
|
||||||
|
ReadConfigHistoryPaths(strConfigPath);
|
||||||
|
f.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showWin)
|
||||||
|
myWidget->show();
|
||||||
|
|
||||||
|
return myWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::startWorkThread()
|
||||||
|
{
|
||||||
|
if (mWorker != nullptr)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mWorkThread = new QThread();
|
||||||
|
mWorker = new WorkObject();
|
||||||
|
mWorker->moveToThread(mWorkThread);
|
||||||
|
connect(mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater);
|
||||||
|
connect(mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater);
|
||||||
|
connect(mWorker, &WorkObject::progress, myWidget, [=](int value) {
|
||||||
|
ui.progressBar->setValue(value);
|
||||||
|
if (value == 100)
|
||||||
|
{
|
||||||
|
QString txtDir = ui.lineResult->text() + "/assessment.txt";
|
||||||
|
QFile file(txtDir);
|
||||||
|
QString outLines = "";
|
||||||
|
if (file.open(QIODevice::ReadOnly))
|
||||||
|
{
|
||||||
|
QTextStream stream(&file);
|
||||||
|
// recall 召回率
|
||||||
|
// precision 精确率
|
||||||
|
// mIoU 平均交并比
|
||||||
|
// mAP 平均精度均值
|
||||||
|
// f1_score
|
||||||
|
while (!stream.atEnd())
|
||||||
|
{
|
||||||
|
QString line = stream.readLine();
|
||||||
|
//strs.push_back(line);
|
||||||
|
if (line.contains("===>mIoU"))
|
||||||
|
{
|
||||||
|
//===>mIoU:68.45; mAP: 74.92
|
||||||
|
line.remove("===>");
|
||||||
|
line.replace(QStringLiteral("mAP"), QStringLiteral("平均精度均值mAP"));
|
||||||
|
line.replace(QStringLiteral("mIoU"), QStringLiteral("平均交并比mIoU"));
|
||||||
|
outLines = outLines + line + "\n";
|
||||||
|
}
|
||||||
|
else if (line.contains("===>recall"))
|
||||||
|
{
|
||||||
|
//===>recall:66.62; precision: 51.2
|
||||||
|
line.remove("===>");
|
||||||
|
line.replace(QStringLiteral("recall"), QStringLiteral("召回率recall"));
|
||||||
|
line.replace(QStringLiteral("precision"), QStringLiteral("精确率precision"));
|
||||||
|
outLines = outLines + line + "\n";
|
||||||
|
}
|
||||||
|
else if (line.contains("===>f1_score"))
|
||||||
|
{
|
||||||
|
//===>f1_score:57.9
|
||||||
|
line.remove("===>");
|
||||||
|
line.replace(QStringLiteral("f1_score"), QStringLiteral("F1分数f1_score"));
|
||||||
|
outLines = outLines + line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
QMessageBox mess(QMessageBox::Information,
|
||||||
|
QString::fromLocal8Bit("评估结束"),
|
||||||
|
QString::fromLocal8Bit("评价结果:\n") + txtDir + "\n"
|
||||||
|
+ outLines);
|
||||||
|
mess.setWindowFlags(Qt::Drawer);
|
||||||
|
mess.setStandardButtons(QMessageBox::Yes);
|
||||||
|
mess.button(QMessageBox::StandardButton::Yes)->setText(QString::fromLocal8Bit("确认"));
|
||||||
|
int result = mess.exec();
|
||||||
|
pbCancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
connect(this, &LandslideAssess::startPreAssessment, mWorker, &WorkObject::runAssessWork);
|
||||||
|
|
||||||
|
mWorkThread->start();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::ReadConfigHistoryPaths(QString strPath)
|
||||||
|
{
|
||||||
|
QSettings configIni(strPath, QSettings::IniFormat);
|
||||||
|
|
||||||
|
//打开标题为:[DemTrain] 的组,读取DemTrain输出结果TrainResult字段
|
||||||
|
configIni.beginGroup("SldTrain");
|
||||||
|
|
||||||
|
QString strDemTrainResult = configIni.value("TrainResult").toString();
|
||||||
|
QDir srcDir = QDir(strDemTrainResult);
|
||||||
|
//更新评价文件列表
|
||||||
|
if (srcDir.absoluteFilePath("val_list.txt") != "")
|
||||||
|
ui.lineIndex->setText(srcDir.absoluteFilePath("val_list.txt"));
|
||||||
|
//更新输入Images
|
||||||
|
srcDir = QDir(strDemTrainResult);
|
||||||
|
if (srcDir.cd("Images"))
|
||||||
|
ui.lineInDataset->setText(srcDir.absolutePath());
|
||||||
|
//更新输入Labels
|
||||||
|
srcDir = QDir(strDemTrainResult);
|
||||||
|
if (srcDir.cd("Labels"))
|
||||||
|
ui.lineInLabel->setText(srcDir.absolutePath());
|
||||||
|
|
||||||
|
configIni.endGroup();//关闭组
|
||||||
|
|
||||||
|
//打开标题为:[DemAssess] 的组,读取AssessResult字段
|
||||||
|
configIni.beginGroup("SldAssess");
|
||||||
|
//更新评价结果输出
|
||||||
|
ui.lineResult->setText(configIni.value("AssessResult").toString());
|
||||||
|
|
||||||
|
configIni.endGroup();//关闭组
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::WriteConfigPaths(QString strPath)
|
||||||
|
{
|
||||||
|
QSettings configIni(strPath, QSettings::IniFormat);
|
||||||
|
configIni.setIniCodec("utf-8");
|
||||||
|
//打开标题为:[DemAssess] 的组
|
||||||
|
configIni.beginGroup("SldAssess");
|
||||||
|
|
||||||
|
//更新输入模型路径
|
||||||
|
QString temp = ui.lineResult->text();
|
||||||
|
if (temp != "")
|
||||||
|
configIni.setValue("AssessResult", temp);
|
||||||
|
|
||||||
|
configIni.endGroup();//关闭组
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::readAndStart()
|
||||||
|
{
|
||||||
|
QString dirModel = ui.lineInModel->text();
|
||||||
|
QString dirIndex = ui.lineIndex->text();
|
||||||
|
QString dirLabel = ui.lineInLabel->text();
|
||||||
|
QString dirPredict = ui.lineInDataset->text();
|
||||||
|
QString dirResult = ui.lineResult->text();
|
||||||
|
|
||||||
|
ui.progressBar->setValue(0);
|
||||||
|
|
||||||
|
if (dirLabel == "" || dirPredict == "" || dirIndex == "" || dirModel == "" || dirResult == "")
|
||||||
|
{
|
||||||
|
QMessageBox mess(QMessageBox::NoIcon, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("请检查输入路径"));
|
||||||
|
mess.setWindowFlags(Qt::Drawer);
|
||||||
|
int result = mess.exec();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mWorkThread == nullptr)
|
||||||
|
{
|
||||||
|
qDebug() << "--startThread";
|
||||||
|
startWorkThread();
|
||||||
|
}
|
||||||
|
emit startPreAssessment(dirModel, dirPredict, dirLabel, dirIndex, dirResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::pbCancel()
|
||||||
|
{
|
||||||
|
qDebug() << "--pbtCancel";
|
||||||
|
delete myWidget;//调起&QDialog::destroyed
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::choosePredictPath()
|
||||||
|
{
|
||||||
|
QString dirInDataset = QFileDialog::getExistingDirectory(ui.pbtInDataset, QString::fromLocal8Bit("选择输入评价文件路径"), "");
|
||||||
|
if (dirInDataset != "")
|
||||||
|
ui.lineInDataset->setText(dirInDataset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::chooseLabelPath()
|
||||||
|
{
|
||||||
|
QString dirDom = QFileDialog::getExistingDirectory(ui.pbtInLabel, QString::fromLocal8Bit("选择输入标签文件路径"), "");
|
||||||
|
if (dirDom != "")
|
||||||
|
ui.lineInLabel->setText(dirDom);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::chooseAssessFile()
|
||||||
|
{
|
||||||
|
QString dirDom = QFileDialog::getOpenFileName(ui.pbtIndex, QString::fromLocal8Bit("选择输入评估文件索引"), "", "*.txt");
|
||||||
|
if (dirDom != "")
|
||||||
|
ui.lineIndex->setText(dirDom);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::chooseModelFile()
|
||||||
|
{
|
||||||
|
QString fileModel = QFileDialog::getOpenFileName(ui.pbtInModel, QString::fromLocal8Bit("选择输入模型文件"), "", "*.pth");
|
||||||
|
if (fileModel != "")
|
||||||
|
ui.lineInModel->setText(fileModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LandslideAssess::chooseResultPath()
|
||||||
|
{
|
||||||
|
QString dirResult = QFileDialog::getExistingDirectory(ui.pbtResult, QString::fromLocal8Bit("选择评估结果输出路径"), "");
|
||||||
|
if (dirResult != "")
|
||||||
|
ui.lineResult->setText(dirResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkObject::runAssessWork(QString model, QString PRE, QString label, QString index, QString result)
|
||||||
|
{
|
||||||
|
qDebug() << "start work:" << "\npredict: " << PRE << "\nLabel:" << label;
|
||||||
|
QFileInfo file(index);
|
||||||
|
file.absolutePath();
|
||||||
|
assess_txt_path = file.absolutePath() + "/assessment.txt";
|
||||||
|
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
||||||
|
qDebug() << "----" << pluginsDir.currentPath();
|
||||||
|
if (!pluginsDir.cd("models\\envs"))
|
||||||
|
{
|
||||||
|
qDebug() << "no folder models\\envs";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QString exeDirName = pluginsDir.absoluteFilePath("miou_landslide.exe");
|
||||||
|
QString model_dir = " --model_dir " + model;
|
||||||
|
QString img_data_dir = " --img_data_dir " + PRE + "/";
|
||||||
|
QString label_dir = " --label_dir " + label + "/";
|
||||||
|
QString val_list = " --val_list " + index;
|
||||||
|
QString out_result = " --result_file " + result + "/";
|
||||||
|
QString ss = exeDirName + model_dir + img_data_dir + label_dir + val_list + out_result;
|
||||||
|
qDebug() << ss;
|
||||||
|
QProcess* pProces = new QProcess(this);
|
||||||
|
connect(pProces, SIGNAL(readyReadStandardOutput()), this, SLOT(writeAssessTxt()));
|
||||||
|
pProces->start(ss);
|
||||||
|
|
||||||
|
emit progress(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkObject::writeAssessTxt()
|
||||||
|
{
|
||||||
|
mProcess = (QProcess*)sender();
|
||||||
|
QString output = QString::fromLocal8Bit(mProcess->readAllStandardOutput());
|
||||||
|
output.chop(2);
|
||||||
|
if (output.toFloat() != 0)
|
||||||
|
{
|
||||||
|
qDebug() << "process:" << output.toFloat();
|
||||||
|
emit progress(output.toFloat());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
qDebug() << "unsolved exe out:" << output;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorkObject::on_cancel()
|
||||||
|
{
|
||||||
|
if (mProcess == nullptr)
|
||||||
|
qDebug() << "--mProces null";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString KillStr = "taskkill /f /im miou_landslide.exe";
|
||||||
|
mProcess->startDetached(KillStr);
|
||||||
|
qDebug() << "--kill Proces";
|
||||||
|
}
|
||||||
|
}
|
84
LandslideAssess/LandslideAssess.h
Normal file
84
LandslideAssess/LandslideAssess.h
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QtWidgets/QDialog>
|
||||||
|
#include "ui_LandslideAssess.h"
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
#include "SrsMainPluginInterFace.h"
|
||||||
|
|
||||||
|
|
||||||
|
class WorkObject :public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
void on_cancel();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void progress(int value);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void runAssessWork(QString model, QString PRE, QString label, QString index, QString result);
|
||||||
|
void writeAssessTxt();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QProcess* mProcess = nullptr;
|
||||||
|
QString assess_txt_path;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LandslideAssess : public SrsMainInterface
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES(SrsMainInterface)
|
||||||
|
Q_PLUGIN_METADATA(IID MainInterface_iid)
|
||||||
|
|
||||||
|
public:
|
||||||
|
LandslideAssess();
|
||||||
|
|
||||||
|
virtual QString PannelName() override;
|
||||||
|
virtual QString CategoryName() override;
|
||||||
|
|
||||||
|
virtual QString EnglishName() override;
|
||||||
|
virtual QString ChineseName() override;
|
||||||
|
virtual QString Information() override;
|
||||||
|
virtual QString IconPath() override;
|
||||||
|
virtual QWidget* CenterWidget() override;
|
||||||
|
|
||||||
|
void startWorkThread();
|
||||||
|
|
||||||
|
//读json文件,获取历史存储的路径
|
||||||
|
void ReadConfigHistoryPaths(QString strPath);
|
||||||
|
//保存本次打开的路径到json文件
|
||||||
|
void WriteConfigPaths(QString strPath);
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void startPreAssessment(QString model, QString prefile, QString label, QString index, QString result);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void readAndStart();
|
||||||
|
void pbCancel();
|
||||||
|
|
||||||
|
void choosePredictPath();
|
||||||
|
void chooseLabelPath();
|
||||||
|
void chooseAssessFile();
|
||||||
|
void chooseModelFile();
|
||||||
|
void chooseResultPath();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::LandslideAssessClass ui;
|
||||||
|
|
||||||
|
QDialog* myWidget = nullptr;
|
||||||
|
|
||||||
|
WorkObject* mWorker = nullptr;
|
||||||
|
QThread* mWorkThread = nullptr;
|
||||||
|
|
||||||
|
};
|
6
LandslideAssess/LandslideAssess.qrc
Normal file
6
LandslideAssess/LandslideAssess.qrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/LandslideAssess">
|
||||||
|
<file>resources/assessment.svg</file>
|
||||||
|
<file>LandslideAssess.qss</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
68
LandslideAssess/LandslideAssess.qss
Normal file
68
LandslideAssess/LandslideAssess.qss
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
QProgressBar#progressBar {
|
||||||
|
border:0px solid white;
|
||||||
|
text-align:center;
|
||||||
|
color:black;
|
||||||
|
}
|
||||||
|
QProgressBar#progressBar:chunk {
|
||||||
|
background-color:#3FABBA;
|
||||||
|
width:20px;
|
||||||
|
}
|
||||||
|
QProgressBar#progressBar QLineEdit {
|
||||||
|
border:none;
|
||||||
|
color:black;
|
||||||
|
padding-left:5px;
|
||||||
|
font-size:16px;
|
||||||
|
background-color:transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLabel{
|
||||||
|
color:black;
|
||||||
|
font-family:'Microsoft YaHei';
|
||||||
|
font-size:12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----QPushButtonÑùʽ±í*/
|
||||||
|
#pushButton_ok, #pushButton_cancel, #pbtInDataset, #pbtInLabel, #pbtInModel, #pbtIndex,#pbtResult{
|
||||||
|
font-family:'Microsoft YaHei';
|
||||||
|
font-size:12px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
padding: 2px;
|
||||||
|
border-radius: 5px;
|
||||||
|
max-height:20px;
|
||||||
|
}
|
||||||
|
#pushButton_ok, #pushButton_cancel{
|
||||||
|
min-width:36px;
|
||||||
|
}
|
||||||
|
#pushButton_ok:hover, #pushButton_cancel:hover, #pbtInDataset:hover, #pbtInLabel:hover, #pbtInModel:hover, #pbtIndex:hover,#pbtResult:hover{
|
||||||
|
background-color: #ecf5ff;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
#pushButton_ok:pressed, #pushButton_cancel:pressed, #pbtInDataset:pressed, #pbtInLabel:pressed, #pbtInModel:pressed, #pbtIndex:pressed,#pbtResult:pressed{
|
||||||
|
border: 1px solid #3a8ee6;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
#pushButton_ok:checked, #pushButton_cancel:checked, #pbtInDataset:checked, #pbtInLabel:checked, #pbtInModel:checked, #pbtIndex:checked,#pbtResult:checked{
|
||||||
|
border: 1px solid #3a8ee6;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
#pushButton_ok:focus, #pushButton_cancel:focus, #pbtInDataset:focus, #pbtInLabel:focus, #pbtInModel:focus, #pbtIndex:focus,#pbtResult:focus{
|
||||||
|
border: 1px solid #3a8ee6;
|
||||||
|
color: #409eff;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----QLineEditÑùʽ*/
|
||||||
|
#lineInDataset, #lineInLabel, #lineInModel, #lineIndex, #lineResult{
|
||||||
|
border:0px;
|
||||||
|
border-bottom: 1px solid #B3B3B3;
|
||||||
|
font-family:'Microsoft YaHei';
|
||||||
|
font-size:12px;
|
||||||
|
background-color:transparent;
|
||||||
|
}
|
||||||
|
#lineInDataset:hover, #lineInLabel:hover, #lineInModel:hover, #lineIndex:hover, #lineResult:hover{
|
||||||
|
border-bottom: 2px solid #66A3FF;
|
||||||
|
}
|
||||||
|
#lineInDataset:focus, #lineInLabel:focus, #lineInModel:focus, #lineIndex:focus, #lineResult:focus{
|
||||||
|
border-bottom: 2px solid #7666FF;
|
||||||
|
}
|
271
LandslideAssess/LandslideAssess.ui
Normal file
271
LandslideAssess/LandslideAssess.ui
Normal file
@ -0,0 +1,271 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>LandslideAssessClass</class>
|
||||||
|
<widget class="QDialog" name="LandslideAssessClass">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>500</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>LandslideAssess</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>输入模型文件路径</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineInModel"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="pbtInModel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择文件</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>输入验证文件索引</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineIndex"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QPushButton" name="pbtIndex">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择文件</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>输入验证文件路径</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineInDataset"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QPushButton" name="pbtInDataset">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择文件夹</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>输入标签文件路径</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineInLabel"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QPushButton" name="pbtInLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择文件夹</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>评估结果输出路径</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineResult"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QPushButton" name="pbtResult">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>75</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>选择文件夹</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>133</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_ok">
|
||||||
|
<property name="text">
|
||||||
|
<string>确认</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>10</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_cancel">
|
||||||
|
<property name="text">
|
||||||
|
<string>取消</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QProgressBar" name="progressBar">
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>lineInModel</tabstop>
|
||||||
|
<tabstop>pbtInModel</tabstop>
|
||||||
|
<tabstop>lineIndex</tabstop>
|
||||||
|
<tabstop>pbtIndex</tabstop>
|
||||||
|
<tabstop>lineInDataset</tabstop>
|
||||||
|
<tabstop>pbtInDataset</tabstop>
|
||||||
|
<tabstop>lineInLabel</tabstop>
|
||||||
|
<tabstop>pbtInLabel</tabstop>
|
||||||
|
<tabstop>lineResult</tabstop>
|
||||||
|
<tabstop>pbtResult</tabstop>
|
||||||
|
<tabstop>pushButton_ok</tabstop>
|
||||||
|
<tabstop>pushButton_cancel</tabstop>
|
||||||
|
</tabstops>
|
||||||
|
<resources>
|
||||||
|
<include location="LandslideAssess.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
79
LandslideAssess/LandslideAssess.vcxproj
Normal file
79
LandslideAssess/LandslideAssess.vcxproj
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>QtQgis</QtInstall>
|
||||||
|
<QtModules>core;gui;widgets</QtModules>
|
||||||
|
<QtBuildConfig>release</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||||
|
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||||
|
</Target>
|
||||||
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
|
<ImportGroup Label="Shared" />
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<TargetName>landslide2_assess</TargetName>
|
||||||
|
<IncludePath>D:\qgis\osgeo4w\include;D:\qgis\osgeo4w\apps\Qt5\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>D:\qgis\osgeo4w\lib;D:\qgis\osgeo4w\apps\Qt5\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="LandslideAssess.qrc" />
|
||||||
|
<QtUic Include="LandslideAssess.ui" />
|
||||||
|
<QtMoc Include="LandslideAssess.h" />
|
||||||
|
<ClCompile Include="LandslideAssess.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="SrsMainPluginInterFace.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="x64\Release\uic\ui_LandslideAssess.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="LandslideAssess.qss" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
59
LandslideAssess/LandslideAssess.vcxproj.filters
Normal file
59
LandslideAssess/LandslideAssess.vcxproj.filters
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Form Files">
|
||||||
|
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||||
|
<Extensions>ui</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Translation Files">
|
||||||
|
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||||
|
<Extensions>ts</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="LandslideAssess.qrc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</QtRcc>
|
||||||
|
<QtUic Include="LandslideAssess.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
|
<QtMoc Include="LandslideAssess.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<ClCompile Include="LandslideAssess.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="SrsMainPluginInterFace.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="x64\Release\uic\ui_LandslideAssess.h">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="LandslideAssess.qss">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
58
LandslideAssess/SrsMainPluginInterFace.h
Normal file
58
LandslideAssess/SrsMainPluginInterFace.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#pragma once
|
||||||
|
//#if _MSC_VER >=1600 // MSVC2015>1899, msvc_ver=14.0
|
||||||
|
//#pragma execution_character_set("utf-8")
|
||||||
|
//#endif
|
||||||
|
//#include "qtclasslibrary1_global.h"
|
||||||
|
#include <qstring.h>
|
||||||
|
#include <QtPlugin>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
struct SPluginMetaData
|
||||||
|
{
|
||||||
|
QVector<QString> qvsReturnFilePaths;
|
||||||
|
QVector<QString> qvsSendFilePaths;
|
||||||
|
bool isAdd2Map;
|
||||||
|
|
||||||
|
};
|
||||||
|
class SrsMainInterface : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
virtual ~SrsMainInterface() {}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回pannel的名字
|
||||||
|
/// </summary>
|
||||||
|
virtual QString PannelName() = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回Category名字
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
virtual QString CategoryName() = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 返回插件的英文名字
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
virtual QString EnglishName() = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// 返回插件的中文名字
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
virtual QString ChineseName() = 0;
|
||||||
|
virtual QString Information() = 0;
|
||||||
|
virtual QString IconPath() = 0;
|
||||||
|
virtual QWidget* CenterWidget() = 0;
|
||||||
|
//
|
||||||
|
//public slots:
|
||||||
|
// virtual void test(QWidget* parent) = 0;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void AddDataToMap(QStringList string_list);
|
||||||
|
//void addDataToCanvas(QStringList string_list);
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MainInterface_iid "com.Srs.MainInterface"
|
||||||
|
Q_DECLARE_INTERFACE(SrsMainInterface, MainInterface_iid)
|
10
LandslideAssess/main.cpp
Normal file
10
LandslideAssess/main.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include "LandslideAssess.h"
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
LandslideAssess w;
|
||||||
|
w.CenterWidget()->show();
|
||||||
|
return a.exec();
|
||||||
|
}
|
2
LandslideAssess/resources/assessment.svg
Normal file
2
LandslideAssess/resources/assessment.svg
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1652932649746" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2186" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
|
||||||
|
</style></defs><path d="M802.3 649c-13.3 0-24 10.7-24 24v163.9c0 17.7-14.4 32.1-32.1 32.1H222.6c-17.7 0-32.1-14.4-32.1-32.1v-656c0-17.7 14.4-32.1 32.1-32.1h523.7c17.7 0 32 14.4 32 32V235c0 13.3 10.7 24 24 24s24-10.7 24-24v-54.2c0-44.1-35.9-80-80-80H222.6c-44.2 0-80.1 35.9-80.1 80.1v656c0 44.2 35.9 80.1 80.1 80.1h523.6c44.2 0 80.1-35.9 80.1-80.1V673c0-13.3-10.7-24-24-24z" fill="#2c2c2c" p-id="2187"></path><path d="M856.6 332.2L827 315.1c-15.2-9.3-31.5-11.1-47-5.2-12.7 4.8-24.3 14.8-33.8 29l-16.4 25.2c-0.8 0.8-1.5 1.7-2.1 2.6-0.7 1-1.2 2.1-1.7 3.2L563 620.5c-8.8 13.2-13.2 29.2-12.6 45.1l-2.2 90.4c-0.1 5.7 5.4 9.7 10.8 7.9l100.8-35.2c15.6-4.6 28.6-14.8 36.8-28.9L866 411.2l0.1-0.1c5.3-9.1 11.7-23.2 12.1-38 0.5-17.5-7.2-32-21.6-40.9z m-50.3 17.1l29.6 17.1c1.4 0.9 2.4 1.7 2.3 5.4-0.1 5-2.6 12-6.7 19.1l-8.5 14.5-50.6-33.3 7.3-11.2c13.1-19.8 22.6-14 26.6-11.6zM662.1 679.5l-0.1 0.1c-3 5.2-8 9-13.8 10.7l-0.5 0.1-51.7 18c-3.2 1.1-6.6-1.3-6.5-4.7l1-38.7v-0.8c-0.4-7.6 1.7-15.4 5.9-21.7l154.2-236.9 52.2 34.3-140.7 239.6zM702.6 256.9c-7.8-7.8-20.5-7.9-28.3-0.1L467.8 462.4l-93.9-98.6c-7-7.4-18.5-8.3-26.6-2.1l-113.1 86.6c-8.8 6.7-10.4 19.3-3.7 28 6.7 8.8 19.3 10.4 28 3.7l98.8-75.7 95.6 100.4c3.7 3.9 8.8 6.1 14.2 6.2h0.3c5.3 0 10.4-2.1 14.1-5.8l221.1-220c7.8-7.7 7.8-20.4 0-28.2zM266.3 647h186.2c11 0 20-9 20-20s-9-20-20-20H266.3c-11 0-20 9-20 20s9 20 20 20zM266.3 775h232.2c11 0 20-9 20-20s-9-20-20-20H266.3c-11 0-20 9-20 20s9 20 20 20z" fill="#2c2c2c" p-id="2188"></path></svg>
|
After Width: | Height: | Size: 2.1 KiB |
Loading…
Reference in New Issue
Block a user