Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4925216b83 | |||
| 302df1cf7a |
@@ -1,6 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/DEM_ASSESS">
|
|
||||||
<file>DEM_ASSESS.qss</file>
|
|
||||||
<file>resources/assessment.svg</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#include "DEM_ASSESS.h"
|
|
||||||
#include <QtWidgets/QApplication>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
QApplication a(argc, argv);
|
|
||||||
|
|
||||||
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());
|
|
||||||
|
|
||||||
ModelAssessment w;
|
|
||||||
w.CenterWidget()->show();
|
|
||||||
return a.exec();
|
|
||||||
}
|
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 16.0.32126.315
|
VisualStudioVersion = 16.0.32630.194
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DEM_ASSESS", "DEM_ASSESS\DEM_ASSESS.vcxproj", "{E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LandslideAssess", "LandslideAssess\LandslideAssess.vcxproj", "{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Release|x64 = Release|x64
|
Release|x64 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}.Release|x64.ActiveCfg = Release|x64
|
{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}.Release|x64.ActiveCfg = Release|x64
|
||||||
{E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}.Release|x64.Build.0 = Release|x64
|
{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {1945C514-1E36-458A-841E-E9B4B69F86D4}
|
SolutionGuid = {B31E7462-C1A4-4BA3-97F3-704180A5CDB6}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
@@ -1,106 +1,43 @@
|
|||||||
#include "DEM_ASSESS.h"
|
#include "LandslideAssess.h"
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
void WorkThreadObject::runAssessWork(QString model, QString PRE, QString label, QString index, QString result)
|
LandslideAssess::LandslideAssess()
|
||||||
{
|
|
||||||
qDebug() << "start work:" << "\npredict: " << PRE << "\nLabel:" << label;
|
|
||||||
QFileInfo file(index);
|
|
||||||
file.absolutePath();
|
|
||||||
assess_txt_path = file.absolutePath() + "/assessment.txt";
|
|
||||||
//QDir pluginsDir = QDir(qApp->applicationDirPath());
|
|
||||||
QDir pluginsDir = QDir("D:\\code\\RsSurvey\\RsSurvey_Build\\x64\\Release\\");
|
|
||||||
qDebug() << "----" << pluginsDir.currentPath();
|
|
||||||
if (!pluginsDir.cd("models\\envs"))
|
|
||||||
{
|
|
||||||
qDebug() << "no folder models\\envs";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QString exeDirName = pluginsDir.absoluteFilePath("miou_vegetation.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 process(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WorkThreadObject::writeAssessTxt()
|
|
||||||
{
|
|
||||||
mProces = (QProcess*)sender();
|
|
||||||
QString output = QString::fromLocal8Bit(mProces->readAllStandardOutput());
|
|
||||||
output.chop(2);
|
|
||||||
if (output.toFloat() != 0)
|
|
||||||
{
|
|
||||||
qDebug() << "process:" << output.toFloat();
|
|
||||||
emit process(output.toFloat());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
qDebug() << "unsolved exe out:" << output;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WorkThreadObject::on_cancel()
|
|
||||||
{
|
|
||||||
if (mProces == nullptr)
|
|
||||||
{
|
|
||||||
qDebug() << "--mProces null";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QString KillStr = "taskkill /f /im miou_vegetation.exe";
|
|
||||||
mProces->startDetached(KillStr);
|
|
||||||
qDebug() << "--kill Proces";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
///////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
ModelAssessment::ModelAssessment()
|
|
||||||
{
|
{
|
||||||
//ui.setupUi(this);
|
//ui.setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelAssessment::~ModelAssessment()
|
QString LandslideAssess::PannelName()
|
||||||
{
|
{
|
||||||
|
return QString::fromLocal8Bit("地质模块");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelAssessment::PannelName()
|
QString LandslideAssess::CategoryName()
|
||||||
{
|
{
|
||||||
return QString::fromLocal8Bit("");
|
return QString::fromLocal8Bit("地质模块");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelAssessment::CategoryName()
|
QString LandslideAssess::EnglishName()
|
||||||
{
|
{
|
||||||
return QString::fromLocal8Bit("DEM模块");
|
return QString::fromLocal8Bit("LandslideAssess");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelAssessment::EnglishName()
|
QString LandslideAssess::ChineseName()
|
||||||
{
|
|
||||||
return QString::fromLocal8Bit("DEM_Module");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ModelAssessment::ChineseName()
|
|
||||||
{
|
{
|
||||||
return QString::fromLocal8Bit("结果评估");
|
return QString::fromLocal8Bit("结果评估");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelAssessment::Information()
|
QString LandslideAssess::Information()
|
||||||
{
|
{
|
||||||
return "结果评估";
|
return QString::fromLocal8Bit("结果评估");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelAssessment::IconPath()
|
QString LandslideAssess::IconPath()
|
||||||
{
|
{
|
||||||
return ":/DEM_ASSESS/resources/assessment.svg";
|
return QString(":/LandslideAssess/resources/assessment.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget* ModelAssessment::CenterWidget()
|
QWidget* LandslideAssess::CenterWidget()
|
||||||
{
|
{
|
||||||
QString gdal_path = qApp->applicationDirPath().toLocal8Bit() + "/share/gdal";
|
QString gdal_path = qApp->applicationDirPath().toLocal8Bit() + "/share/gdal";
|
||||||
QString pro_lib_path = qApp->applicationDirPath().toLocal8Bit() + "/share/proj";
|
QString pro_lib_path = qApp->applicationDirPath().toLocal8Bit() + "/share/proj";
|
||||||
@@ -126,17 +63,17 @@ QWidget* ModelAssessment::CenterWidget()
|
|||||||
|
|
||||||
myWidget->setWindowTitle(QString::fromLocal8Bit("结果评估"));
|
myWidget->setWindowTitle(QString::fromLocal8Bit("结果评估"));
|
||||||
myWidget->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
|
myWidget->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
|
||||||
myWidget->setWindowIcon(QIcon(":/DEM_ASSESS/resources/assessment.svg"));
|
myWidget->setWindowIcon(QIcon(":/LandslideAssess/resources/assessment.svg"));
|
||||||
myWidget->setAttribute(Qt::WA_QuitOnClose, false);
|
myWidget->setAttribute(Qt::WA_QuitOnClose, false);
|
||||||
|
|
||||||
myWidget->setAttribute(Qt::WA_DeleteOnClose);
|
myWidget->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
connect(myWidget, &QDialog::destroyed, this, [=] {
|
connect(myWidget, &QDialog::destroyed, this, [=] {
|
||||||
qDebug() << "----DEM assess window close----";
|
qDebug() << "----Landslide assess window close----";
|
||||||
|
|
||||||
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
||||||
if (pluginsDir.cd("srsplugins\\DemModel"))
|
if (pluginsDir.cd("srsplugins\\SldModel"))
|
||||||
{
|
{
|
||||||
QString strConfigPath = pluginsDir.absoluteFilePath("dem_config.ini");
|
QString strConfigPath = pluginsDir.absoluteFilePath("sld_config.ini");
|
||||||
QFile f(strConfigPath);
|
QFile f(strConfigPath);
|
||||||
if (f.exists())
|
if (f.exists())
|
||||||
{
|
{
|
||||||
@@ -147,10 +84,6 @@ QWidget* ModelAssessment::CenterWidget()
|
|||||||
|
|
||||||
if (mWorkThread != nullptr)
|
if (mWorkThread != nullptr)
|
||||||
{
|
{
|
||||||
//mWorkThread->quit();
|
|
||||||
//mWorkThread->wait();//调用wait后先调用finished信号对应的槽函数,执行完成后再往下走
|
|
||||||
//mWorkThread = nullptr;//mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater,不需要delete
|
|
||||||
//mWorker = nullptr;//mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater
|
|
||||||
mWorkThread->requestInterruption();//请求线程中断
|
mWorkThread->requestInterruption();//请求线程中断
|
||||||
mWorkThread->quit();
|
mWorkThread->quit();
|
||||||
mWorkThread->wait();//调用wait后先调用finished信号对应的槽函数,执行完成后再往下走
|
mWorkThread->wait();//调用wait后先调用finished信号对应的槽函数,执行完成后再往下走
|
||||||
@@ -162,19 +95,21 @@ QWidget* ModelAssessment::CenterWidget()
|
|||||||
myWidget->close();
|
myWidget->close();
|
||||||
myWidget = nullptr;
|
myWidget = nullptr;
|
||||||
});
|
});
|
||||||
connect(ui.pbtInPredict, &QPushButton::pressed, this, &ModelAssessment::choosePredictPath);
|
connect(ui.pbtInDataset, &QPushButton::clicked, this, &LandslideAssess::choosePredictPath);
|
||||||
connect(ui.pbtInLabel, &QPushButton::pressed, this, &ModelAssessment::chooseLabelPath);
|
connect(ui.pbtInLabel, &QPushButton::clicked, this, &LandslideAssess::chooseLabelPath);
|
||||||
connect(ui.pbtIndex, &QPushButton::pressed, this, &ModelAssessment::chooseAssessFile);
|
connect(ui.pbtIndex, &QPushButton::clicked, this, &LandslideAssess::chooseAssessFile);
|
||||||
connect(ui.pbtModel, &QPushButton::pressed, this, &ModelAssessment::chooseModelFile);
|
connect(ui.pbtInModel, &QPushButton::clicked, this, &LandslideAssess::chooseModelFile);
|
||||||
connect(ui.pbtOutResult, &QPushButton::pressed, this, &ModelAssessment::chooseResultPath);
|
connect(ui.pbtResult, &QPushButton::clicked, this, &LandslideAssess::chooseResultPath);
|
||||||
|
|
||||||
connect(ui.pushButton_ok, &QPushButton::pressed, this, &ModelAssessment::readAndStart);
|
connect(ui.pushButton_ok, &QPushButton::clicked, this, &LandslideAssess::readAndStart);
|
||||||
connect(ui.pushButton_cancel, &QPushButton::pressed, this, &ModelAssessment::pbCancel);
|
connect(ui.pushButton_cancel, &QPushButton::clicked, this, &LandslideAssess::pbCancel);
|
||||||
|
|
||||||
ui.progressBar->setTextVisible(true);
|
ui.progressBar->setTextVisible(true);
|
||||||
ui.progressBar->setRange(0, 100);
|
ui.progressBar->setRange(0, 100);
|
||||||
|
|
||||||
QFile qssFile(":/DEM_ASSESS/DEM_ASSESS.qss");
|
ui.pbtInModel->setFocus();
|
||||||
|
|
||||||
|
QFile qssFile(":/LandslideAssess/LandslideAssess.qss");
|
||||||
qssFile.open(QFile::ReadOnly); //以只读方式打开
|
qssFile.open(QFile::ReadOnly); //以只读方式打开
|
||||||
if (qssFile.isOpen())
|
if (qssFile.isOpen())
|
||||||
{
|
{
|
||||||
@@ -183,12 +118,12 @@ QWidget* ModelAssessment::CenterWidget()
|
|||||||
qssFile.close();
|
qssFile.close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qDebug() << "无法打开文件";
|
qDebug() << "no qssFile";
|
||||||
|
|
||||||
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
QDir pluginsDir = QDir(qApp->applicationDirPath());
|
||||||
if (pluginsDir.cd("srsplugins\\DemModel"))
|
if (pluginsDir.cd("srsplugins\\SldModel"))
|
||||||
{
|
{
|
||||||
QString strConfigPath = pluginsDir.absoluteFilePath("dem_config.ini");
|
QString strConfigPath = pluginsDir.absoluteFilePath("sld_config.ini");
|
||||||
QFile f(strConfigPath);
|
QFile f(strConfigPath);
|
||||||
if (f.exists())
|
if (f.exists())
|
||||||
{
|
{
|
||||||
@@ -203,22 +138,22 @@ QWidget* ModelAssessment::CenterWidget()
|
|||||||
return myWidget;
|
return myWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelAssessment::startWorkThread()
|
void LandslideAssess::startWorkThread()
|
||||||
{
|
{
|
||||||
if (mWorker != nullptr)
|
if (mWorker != nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mWorkThread = new QThread();
|
mWorkThread = new QThread();
|
||||||
mWorker = new WorkThreadObject();
|
mWorker = new WorkObject();
|
||||||
mWorker->moveToThread(mWorkThread);
|
mWorker->moveToThread(mWorkThread);
|
||||||
connect(mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater);
|
connect(mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater);
|
||||||
connect(mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater);
|
connect(mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater);
|
||||||
connect(mWorker, &WorkThreadObject::process, myWidget, [=](int value) {
|
connect(mWorker, &WorkObject::progress, myWidget, [=](int value) {
|
||||||
ui.progressBar->setValue(value);
|
ui.progressBar->setValue(value);
|
||||||
if (value == 100)
|
if (value == 100)
|
||||||
{
|
{
|
||||||
QString txtDir = ui.lineOutResult->text() + "/assessment.txt";
|
QString txtDir = ui.lineResult->text() + "/assessment.txt";
|
||||||
QFile file(txtDir);
|
QFile file(txtDir);
|
||||||
QString outLines = "";
|
QString outLines = "";
|
||||||
if (file.open(QIODevice::ReadOnly))
|
if (file.open(QIODevice::ReadOnly))
|
||||||
@@ -265,56 +200,23 @@ void ModelAssessment::startWorkThread()
|
|||||||
QString::fromLocal8Bit("评价结果:\n") + txtDir + "\n"
|
QString::fromLocal8Bit("评价结果:\n") + txtDir + "\n"
|
||||||
+ outLines);
|
+ outLines);
|
||||||
mess.setWindowFlags(Qt::Drawer);
|
mess.setWindowFlags(Qt::Drawer);
|
||||||
mess.setTextInteractionFlags(Qt::TextSelectableByMouse);
|
|
||||||
mess.setStandardButtons(QMessageBox::Yes);
|
mess.setStandardButtons(QMessageBox::Yes);
|
||||||
mess.button(QMessageBox::StandardButton::Yes)->setText(QString::fromLocal8Bit("确认"));
|
mess.button(QMessageBox::StandardButton::Yes)->setText(QString::fromLocal8Bit("确认"));
|
||||||
//mess.setTextInteractionFlags(Qt::TextSelectableByMouse);
|
|
||||||
int result = mess.exec();
|
int result = mess.exec();
|
||||||
pbCancel();
|
pbCancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(this, &ModelAssessment::startPreAssessment, mWorker, &WorkThreadObject::runAssessWork);
|
connect(this, &LandslideAssess::startPreAssessment, mWorker, &WorkObject::runAssessWork);
|
||||||
|
|
||||||
mWorkThread->start();
|
mWorkThread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelAssessment::chooseModelFile()
|
void LandslideAssess::ReadConfigHistoryPaths(QString strPath)
|
||||||
{
|
|
||||||
QString fileModel = QFileDialog::getOpenFileName(ui.pbtModel, QString::fromLocal8Bit("选择输入模型文件"), "", "*.pth");
|
|
||||||
if (fileModel != "")
|
|
||||||
ui.lineModel->setText(fileModel);
|
|
||||||
}
|
|
||||||
void ModelAssessment::choosePredictPath()
|
|
||||||
{
|
|
||||||
QString dirDom = QFileDialog::getExistingDirectory(ui.pbtInPredict, QString::fromLocal8Bit("选择输入评价文件路径"), "");
|
|
||||||
if (dirDom != "")
|
|
||||||
ui.lineInPredict->setText(dirDom);
|
|
||||||
}
|
|
||||||
void ModelAssessment::chooseLabelPath()
|
|
||||||
{
|
|
||||||
QString dirDom = QFileDialog::getExistingDirectory(ui.pbtInLabel, QString::fromLocal8Bit("选择输入Label文件路径"), "");
|
|
||||||
if (dirDom != "")
|
|
||||||
ui.lineInLabel->setText(dirDom);
|
|
||||||
}
|
|
||||||
void ModelAssessment::chooseAssessFile()
|
|
||||||
{
|
|
||||||
QString dirDom = QFileDialog::getOpenFileName(ui.pbtIndex, QString::fromLocal8Bit("选择输入评估文件索引"), "", "*.txt");
|
|
||||||
if (dirDom != "")
|
|
||||||
ui.lineIndex->setText(dirDom);
|
|
||||||
}
|
|
||||||
void ModelAssessment::chooseResultPath()
|
|
||||||
{
|
|
||||||
QString dirResult = QFileDialog::getExistingDirectory(ui.pbtOutResult, QString::fromLocal8Bit("选择评估结果输出路径"), "");
|
|
||||||
if (dirResult != "")
|
|
||||||
ui.lineOutResult->setText(dirResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ModelAssessment::ReadConfigHistoryPaths(QString strPath)
|
|
||||||
{
|
{
|
||||||
QSettings configIni(strPath, QSettings::IniFormat);
|
QSettings configIni(strPath, QSettings::IniFormat);
|
||||||
|
|
||||||
//打开标题为:[DemTrain] 的组,读取DemTrain输出结果TrainResult字段
|
//打开标题为:[DemTrain] 的组,读取DemTrain输出结果TrainResult字段
|
||||||
configIni.beginGroup("DemTrain");
|
configIni.beginGroup("SldTrain");
|
||||||
|
|
||||||
QString strDemTrainResult = configIni.value("TrainResult").toString();
|
QString strDemTrainResult = configIni.value("TrainResult").toString();
|
||||||
QDir srcDir = QDir(strDemTrainResult);
|
QDir srcDir = QDir(strDemTrainResult);
|
||||||
@@ -324,7 +226,7 @@ void ModelAssessment::ReadConfigHistoryPaths(QString strPath)
|
|||||||
//更新输入Images
|
//更新输入Images
|
||||||
srcDir = QDir(strDemTrainResult);
|
srcDir = QDir(strDemTrainResult);
|
||||||
if (srcDir.cd("Images"))
|
if (srcDir.cd("Images"))
|
||||||
ui.lineInPredict->setText(srcDir.absolutePath());
|
ui.lineInDataset->setText(srcDir.absolutePath());
|
||||||
//更新输入Labels
|
//更新输入Labels
|
||||||
srcDir = QDir(strDemTrainResult);
|
srcDir = QDir(strDemTrainResult);
|
||||||
if (srcDir.cd("Labels"))
|
if (srcDir.cd("Labels"))
|
||||||
@@ -333,35 +235,35 @@ void ModelAssessment::ReadConfigHistoryPaths(QString strPath)
|
|||||||
configIni.endGroup();//关闭组
|
configIni.endGroup();//关闭组
|
||||||
|
|
||||||
//打开标题为:[DemAssess] 的组,读取AssessResult字段
|
//打开标题为:[DemAssess] 的组,读取AssessResult字段
|
||||||
configIni.beginGroup("DemAssess");
|
configIni.beginGroup("SldAssess");
|
||||||
//更新评价结果输出
|
//更新评价结果输出
|
||||||
ui.lineOutResult->setText(configIni.value("AssessResult").toString());
|
ui.lineResult->setText(configIni.value("AssessResult").toString());
|
||||||
|
|
||||||
configIni.endGroup();//关闭组
|
configIni.endGroup();//关闭组
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelAssessment::WriteConfigPaths(QString strPath)
|
void LandslideAssess::WriteConfigPaths(QString strPath)
|
||||||
{
|
{
|
||||||
QSettings configIni(strPath, QSettings::IniFormat);
|
QSettings configIni(strPath, QSettings::IniFormat);
|
||||||
configIni.setIniCodec("utf-8");
|
configIni.setIniCodec("utf-8");
|
||||||
//打开标题为:[DemAssess] 的组
|
//打开标题为:[DemAssess] 的组
|
||||||
configIni.beginGroup("DemAssess");
|
configIni.beginGroup("SldAssess");
|
||||||
|
|
||||||
//更新输入模型路径
|
//更新输入模型路径
|
||||||
QString temp = ui.lineOutResult->text();
|
QString temp = ui.lineResult->text();
|
||||||
if (temp != "")
|
if (temp != "")
|
||||||
configIni.setValue("AssessResult", temp);
|
configIni.setValue("AssessResult", temp);
|
||||||
|
|
||||||
configIni.endGroup();//关闭组
|
configIni.endGroup();//关闭组
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelAssessment::readAndStart()
|
void LandslideAssess::readAndStart()
|
||||||
{
|
{
|
||||||
QString dirModel = ui.lineModel->text();
|
QString dirModel = ui.lineInModel->text();
|
||||||
QString dirIndex = ui.lineIndex->text();
|
QString dirIndex = ui.lineIndex->text();
|
||||||
QString dirLabel = ui.lineInLabel->text();
|
QString dirLabel = ui.lineInLabel->text();
|
||||||
QString dirPredict = ui.lineInPredict->text();
|
QString dirPredict = ui.lineInDataset->text();
|
||||||
QString dirResult = ui.lineOutResult->text();
|
QString dirResult = ui.lineResult->text();
|
||||||
|
|
||||||
ui.progressBar->setValue(0);
|
ui.progressBar->setValue(0);
|
||||||
|
|
||||||
@@ -380,7 +282,97 @@ void ModelAssessment::readAndStart()
|
|||||||
emit startPreAssessment(dirModel, dirPredict, dirLabel, dirIndex, dirResult);
|
emit startPreAssessment(dirModel, dirPredict, dirLabel, dirIndex, dirResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelAssessment::pbCancel()
|
void LandslideAssess::pbCancel()
|
||||||
{
|
{
|
||||||
|
qDebug() << "--pbtCancel";
|
||||||
delete myWidget;//调起&QDialog::destroyed
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,21 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtWidgets>
|
|
||||||
#include <QtWidgets/QDialog>
|
#include <QtWidgets/QDialog>
|
||||||
|
#include "ui_LandslideAssess.h"
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
#include "ui_DEM_ASSESS.h"
|
|
||||||
#include "SrsMainPluginInterFace.h"
|
#include "SrsMainPluginInterFace.h"
|
||||||
|
|
||||||
class WorkThreadObject :public QObject
|
|
||||||
|
class WorkObject :public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -17,26 +23,25 @@ public:
|
|||||||
void on_cancel();
|
void on_cancel();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void process(int value);
|
void progress(int value);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void runAssessWork(QString model, QString PRE, QString label, QString index, QString result);
|
void runAssessWork(QString model, QString PRE, QString label, QString index, QString result);
|
||||||
void writeAssessTxt();
|
void writeAssessTxt();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProcess* mProces = nullptr;
|
QProcess* mProcess = nullptr;
|
||||||
QString assess_txt_path;
|
QString assess_txt_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModelAssessment : public SrsMainInterface
|
class LandslideAssess : public SrsMainInterface
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(SrsMainInterface)
|
Q_INTERFACES(SrsMainInterface)
|
||||||
Q_PLUGIN_METADATA(IID MainInterface_iid)
|
Q_PLUGIN_METADATA(IID MainInterface_iid)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModelAssessment();
|
LandslideAssess();
|
||||||
~ModelAssessment();
|
|
||||||
|
|
||||||
virtual QString PannelName() override;
|
virtual QString PannelName() override;
|
||||||
virtual QString CategoryName() override;
|
virtual QString CategoryName() override;
|
||||||
@@ -47,18 +52,18 @@ public:
|
|||||||
virtual QString IconPath() override;
|
virtual QString IconPath() override;
|
||||||
virtual QWidget* CenterWidget() override;
|
virtual QWidget* CenterWidget() override;
|
||||||
|
|
||||||
|
void startWorkThread();
|
||||||
|
|
||||||
//读json文件,获取历史存储的路径
|
//读json文件,获取历史存储的路径
|
||||||
void ReadConfigHistoryPaths(QString strPath);
|
void ReadConfigHistoryPaths(QString strPath);
|
||||||
//保存本次打开的路径到json文件
|
//保存本次打开的路径到json文件
|
||||||
void WriteConfigPaths(QString strPath);
|
void WriteConfigPaths(QString strPath);
|
||||||
|
|
||||||
void startWorkThread();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void startPreAssessment(QString model, QString PRE, QString label, QString index, QString result);
|
void startPreAssessment(QString model, QString prefile, QString label, QString index, QString result);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//pushbutton_OK
|
|
||||||
void readAndStart();
|
void readAndStart();
|
||||||
void pbCancel();
|
void pbCancel();
|
||||||
|
|
||||||
@@ -69,11 +74,11 @@ public slots:
|
|||||||
void chooseResultPath();
|
void chooseResultPath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DEM_ASSESSClass ui;
|
Ui::LandslideAssessClass ui;
|
||||||
|
|
||||||
QDialog* myWidget = nullptr;
|
QDialog* myWidget = nullptr;
|
||||||
|
|
||||||
WorkThreadObject* mWorker = nullptr;
|
WorkObject* mWorker = nullptr;
|
||||||
QThread* mWorkThread = nullptr;
|
QThread* mWorkThread = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/LandslideAssess">
|
||||||
|
<file>resources/assessment.svg</file>
|
||||||
|
<file>LandslideAssess.qss</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
@@ -22,7 +22,7 @@ QLabel{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*----QPushButtonÑùʽ±í*/
|
/*----QPushButtonÑùʽ±í*/
|
||||||
#pushButton_ok, #pushButton_cancel, #pbtInPredict, #pbtInLabel, #pbtModel, #pbtIndex,#pbtOutResult{
|
#pushButton_ok, #pushButton_cancel, #pbtInDataset, #pbtInLabel, #pbtInModel, #pbtIndex,#pbtResult{
|
||||||
font-family:'Microsoft YaHei';
|
font-family:'Microsoft YaHei';
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
@@ -34,35 +34,35 @@ QLabel{
|
|||||||
#pushButton_ok, #pushButton_cancel{
|
#pushButton_ok, #pushButton_cancel{
|
||||||
min-width:36px;
|
min-width:36px;
|
||||||
}
|
}
|
||||||
#pushButton_ok:hover, #pushButton_cancel:hover, #pbtInPredict:hover, #pbtInLabel:hover, #pbtModel:hover, #pbtIndex:hover,#pbtOutResult:hover{
|
#pushButton_ok:hover, #pushButton_cancel:hover, #pbtInDataset:hover, #pbtInLabel:hover, #pbtInModel:hover, #pbtIndex:hover,#pbtResult:hover{
|
||||||
background-color: #ecf5ff;
|
background-color: #ecf5ff;
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
}
|
}
|
||||||
#pushButton_ok:pressed, #pushButton_cancel:pressed, #pbtInPredict:pressed, #pbtInLabel:pressed, #pbtModel:pressed, #pbtIndex:pressed,#pbtOutResult:pressed{
|
#pushButton_ok:pressed, #pushButton_cancel:pressed, #pbtInDataset:pressed, #pbtInLabel:pressed, #pbtInModel:pressed, #pbtIndex:pressed,#pbtResult:pressed{
|
||||||
border: 1px solid #3a8ee6;
|
border: 1px solid #3a8ee6;
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
}
|
}
|
||||||
#pushButton_ok:checked, #pushButton_cancel:checked, #pbtInPredict:checked, #pbtInLabel:checked, #pbtModel:checked, #pbtIndex:checked,#pbtOutResult:checked{
|
#pushButton_ok:checked, #pushButton_cancel:checked, #pbtInDataset:checked, #pbtInLabel:checked, #pbtInModel:checked, #pbtIndex:checked,#pbtResult:checked{
|
||||||
border: 1px solid #3a8ee6;
|
border: 1px solid #3a8ee6;
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
}
|
}
|
||||||
#pushButton_ok:focus, #pushButton_cancel:focus, #pbtInPredict:focus, #pbtInLabel:focus, #pbtModel:focus, #pbtIndex:focus,#pbtOutResult:focus{
|
#pushButton_ok:focus, #pushButton_cancel:focus, #pbtInDataset:focus, #pbtInLabel:focus, #pbtInModel:focus, #pbtIndex:focus,#pbtResult:focus{
|
||||||
border: 1px solid #3a8ee6;
|
border: 1px solid #3a8ee6;
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----QLineEditÑùʽ*/
|
/*----QLineEditÑùʽ*/
|
||||||
#lineInPredict, #lineInLabel, #lineModel, #lineIndex, #lineOutResult{
|
#lineInDataset, #lineInLabel, #lineInModel, #lineIndex, #lineResult{
|
||||||
border:0px;
|
border:0px;
|
||||||
border-bottom: 1px solid #B3B3B3;
|
border-bottom: 1px solid #B3B3B3;
|
||||||
font-family:'Microsoft YaHei';
|
font-family:'Microsoft YaHei';
|
||||||
font-size:12px;
|
font-size:12px;
|
||||||
background-color:transparent;
|
background-color:transparent;
|
||||||
}
|
}
|
||||||
#lineInPredict:hover, #lineInLabel:hover, #lineModel:hover, #lineIndex:hover, #lineOutResult:hover{
|
#lineInDataset:hover, #lineInLabel:hover, #lineInModel:hover, #lineIndex:hover, #lineResult:hover{
|
||||||
border-bottom: 2px solid #66A3FF;
|
border-bottom: 2px solid #66A3FF;
|
||||||
}
|
}
|
||||||
#lineInPredict:focus, #lineInLabel:focus, #lineModel:focus, #lineIndex:focus, #lineOutResult:focus{
|
#lineInDataset:focus, #lineInLabel:focus, #lineInModel:focus, #lineIndex:focus, #lineResult:focus{
|
||||||
border-bottom: 2px solid #7666FF;
|
border-bottom: 2px solid #7666FF;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>DEM_ASSESSClass</class>
|
<class>LandslideAssessClass</class>
|
||||||
<widget class="QDialog" name="DEM_ASSESSClass">
|
<widget class="QDialog" name="LandslideAssessClass">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -10,131 +10,100 @@
|
|||||||
<height>300</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>500</width>
|
|
||||||
<height>300</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>500</width>
|
|
||||||
<height>300</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>DEM_ASSESS</string>
|
<string>LandslideAssess</string>
|
||||||
</property>
|
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>resources/assessment.svg</normaloff>resources/assessment.svg</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_mask_2">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>输入验证文件路径</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_mask">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>输入标签文件路径</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineModel"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineIndex"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="lineInPredict">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>输入模型文件路径</string>
|
<string>输入模型文件路径</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="pbtIndex">
|
<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">
|
<property name="text">
|
||||||
<string>选择文件</string>
|
<string>选择文件</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="2" column="2">
|
||||||
<widget class="QPushButton" name="pbtInPredict">
|
<widget class="QPushButton" name="pbtInDataset">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>75</width>
|
<width>75</width>
|
||||||
@@ -152,44 +121,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="3" column="1">
|
||||||
<widget class="QLineEdit" name="lineInLabel">
|
<widget class="QLineEdit" name="lineInLabel"/>
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>输入验证文件索引</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QPushButton" name="pbtModel">
|
|
||||||
<property name="text">
|
|
||||||
<string>选择文件</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
<widget class="QPushButton" name="pbtInLabel">
|
<widget class="QPushButton" name="pbtInLabel">
|
||||||
@@ -211,7 +157,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -224,10 +170,10 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QLineEdit" name="lineOutResult"/>
|
<widget class="QLineEdit" name="lineResult"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="4" column="2">
|
||||||
<widget class="QPushButton" name="pbtOutResult">
|
<widget class="QPushButton" name="pbtResult">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>75</width>
|
<width>75</width>
|
||||||
@@ -250,13 +196,13 @@
|
|||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>133</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -264,19 +210,13 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pushButton_ok">
|
<widget class="QPushButton" name="pushButton_ok">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>确定</string>
|
<string>确认</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -285,7 +225,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>13</width>
|
<width>10</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -310,8 +250,22 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<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>
|
<resources>
|
||||||
<include location="DEM_ASSESS.qrc"/>
|
<include location="LandslideAssess.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
@@ -7,14 +7,14 @@
|
|||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}</ProjectGuid>
|
<ProjectGuid>{AEAE6E5B-D14B-46CB-BF18-3375936B7CD2}</ProjectGuid>
|
||||||
<Keyword>QtVS_v304</Keyword>
|
<Keyword>QtVS_v304</Keyword>
|
||||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0.19041.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
@@ -37,7 +37,9 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
<TargetName>dem2-$(ProjectName)</TargetName>
|
<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>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -46,30 +48,27 @@
|
|||||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
<UsePrecompiledHeader>Use</UsePrecompiledHeader>
|
|
||||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
<QtMoc>
|
|
||||||
<PrependInclude>%(PrependInclude)</PrependInclude>
|
|
||||||
</QtMoc>
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtRcc Include="DEM_ASSESS.qrc" />
|
<QtRcc Include="LandslideAssess.qrc" />
|
||||||
<QtUic Include="DEM_ASSESS.ui" />
|
<QtUic Include="LandslideAssess.ui" />
|
||||||
<QtMoc Include="DEM_ASSESS.h" />
|
<QtMoc Include="LandslideAssess.h" />
|
||||||
<ClCompile Include="DEM_ASSESS.cpp" />
|
<ClCompile Include="LandslideAssess.cpp" />
|
||||||
<ClCompile Include="main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtMoc Include="SrsMainPluginInterFace.h" />
|
<QtMoc Include="SrsMainPluginInterFace.h" />
|
||||||
<ClInclude Include="x64\Release\uic\ui_DEM_ASSESS.h" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="DEM_ASSESS.qss" />
|
<ClInclude Include="x64\Release\uic\ui_LandslideAssess.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="LandslideAssess.qss" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
+11
-11
@@ -3,7 +3,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Source Files">
|
<Filter Include="Source Files">
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Header Files">
|
<Filter Include="Header Files">
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
@@ -23,16 +23,16 @@
|
|||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtRcc Include="DEM_ASSESS.qrc">
|
<QtRcc Include="LandslideAssess.qrc">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</QtRcc>
|
</QtRcc>
|
||||||
<QtUic Include="DEM_ASSESS.ui">
|
<QtUic Include="LandslideAssess.ui">
|
||||||
<Filter>Form Files</Filter>
|
<Filter>Form Files</Filter>
|
||||||
</QtUic>
|
</QtUic>
|
||||||
<QtMoc Include="DEM_ASSESS.h">
|
<QtMoc Include="LandslideAssess.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</QtMoc>
|
</QtMoc>
|
||||||
<ClCompile Include="DEM_ASSESS.cpp">
|
<ClCompile Include="LandslideAssess.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -41,18 +41,18 @@
|
|||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="x64\Release\uic\ui_DEM_ASSESS.h">
|
|
||||||
<Filter>Form Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtMoc Include="SrsMainPluginInterFace.h">
|
<QtMoc Include="SrsMainPluginInterFace.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</QtMoc>
|
</QtMoc>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="DEM_ASSESS.qss">
|
<ClInclude Include="x64\Release\uic\ui_LandslideAssess.h">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="LandslideAssess.qss">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Reference in New Issue
Block a user