From c453db6248b576a0ecf47b3725edad07cee0cf8e Mon Sep 17 00:00:00 2001 From: keyeslll Date: Mon, 13 Mar 2023 16:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEM_ASSESS.sln | 22 ++ DEM_ASSESS/DEM_ASSESS.cpp | 386 ++++++++++++++++++++++++++ DEM_ASSESS/DEM_ASSESS.h | 79 ++++++ DEM_ASSESS/DEM_ASSESS.qrc | 6 + DEM_ASSESS/DEM_ASSESS.qss | 68 +++++ DEM_ASSESS/DEM_ASSESS.ui | 317 +++++++++++++++++++++ DEM_ASSESS/DEM_ASSESS.vcxproj | 80 ++++++ DEM_ASSESS/DEM_ASSESS.vcxproj.filters | 59 ++++ DEM_ASSESS/SrsMainPluginInterFace.h | 58 ++++ DEM_ASSESS/main.cpp | 16 ++ DEM_ASSESS/resources/assessment.svg | 2 + 11 files changed, 1093 insertions(+) create mode 100644 DEM_ASSESS.sln create mode 100644 DEM_ASSESS/DEM_ASSESS.cpp create mode 100644 DEM_ASSESS/DEM_ASSESS.h create mode 100644 DEM_ASSESS/DEM_ASSESS.qrc create mode 100644 DEM_ASSESS/DEM_ASSESS.qss create mode 100644 DEM_ASSESS/DEM_ASSESS.ui create mode 100644 DEM_ASSESS/DEM_ASSESS.vcxproj create mode 100644 DEM_ASSESS/DEM_ASSESS.vcxproj.filters create mode 100644 DEM_ASSESS/SrsMainPluginInterFace.h create mode 100644 DEM_ASSESS/main.cpp create mode 100644 DEM_ASSESS/resources/assessment.svg diff --git a/DEM_ASSESS.sln b/DEM_ASSESS.sln new file mode 100644 index 0000000..67bc174 --- /dev/null +++ b/DEM_ASSESS.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32126.315 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DEM_ASSESS", "DEM_ASSESS\DEM_ASSESS.vcxproj", "{E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}.Release|x64.ActiveCfg = Release|x64 + {E901DBCF-219B-4AA9-A34F-BBDDFC06FE11}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1945C514-1E36-458A-841E-E9B4B69F86D4} + EndGlobalSection +EndGlobal diff --git a/DEM_ASSESS/DEM_ASSESS.cpp b/DEM_ASSESS/DEM_ASSESS.cpp new file mode 100644 index 0000000..bdec8b8 --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.cpp @@ -0,0 +1,386 @@ +#include "DEM_ASSESS.h" + +#include + +void WorkThreadObject::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()); + 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); +} + +ModelAssessment::~ModelAssessment() +{ + +} + +QString ModelAssessment::PannelName() +{ + return QString::fromLocal8Bit(""); +} + +QString ModelAssessment::CategoryName() +{ + return QString::fromLocal8Bit("DEMģ"); +} + +QString ModelAssessment::EnglishName() +{ + return QString::fromLocal8Bit("DEM_Module"); +} + +QString ModelAssessment::ChineseName() +{ + return QString::fromLocal8Bit(""); +} + +QString ModelAssessment::Information() +{ + return ""; +} + +QString ModelAssessment::IconPath() +{ + return ":/DEM_ASSESS/resources/assessment.svg"; +} + +QWidget* ModelAssessment::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(":/DEM_ASSESS/resources/assessment.svg")); + myWidget->setAttribute(Qt::WA_QuitOnClose, false); + + myWidget->setAttribute(Qt::WA_DeleteOnClose); + connect(myWidget, &QDialog::destroyed, this, [=] { + qDebug() << "----DEM assess window close----"; + + QDir pluginsDir = QDir(qApp->applicationDirPath()); + if (pluginsDir.cd("srsplugins\\DemModel")) + { + QString strConfigPath = pluginsDir.absoluteFilePath("dem_config.ini"); + QFile f(strConfigPath); + if (f.exists()) + { + WriteConfigPaths(strConfigPath); + f.close(); + } + } + + if (mWorkThread != nullptr) + { + //mWorkThread->quit(); + //mWorkThread->wait();//waitȵfinishedźŶӦIJۺִɺ + //mWorkThread = nullptr;//mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLaterҪdelete + //mWorker = nullptr;//mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater + mWorkThread->requestInterruption();//߳ж + mWorkThread->quit(); + mWorkThread->wait();//waitȵfinishedźŶӦIJۺִɺ + 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.pbtInPredict, &QPushButton::pressed, this, &ModelAssessment::choosePredictPath); + connect(ui.pbtInLabel, &QPushButton::pressed, this, &ModelAssessment::chooseLabelPath); + connect(ui.pbtIndex, &QPushButton::pressed, this, &ModelAssessment::chooseAssessFile); + connect(ui.pbtModel, &QPushButton::pressed, this, &ModelAssessment::chooseModelFile); + connect(ui.pbtOutResult, &QPushButton::pressed, this, &ModelAssessment::chooseResultPath); + + connect(ui.pushButton_ok, &QPushButton::pressed, this, &ModelAssessment::readAndStart); + connect(ui.pushButton_cancel, &QPushButton::pressed, this, &ModelAssessment::pbCancel); + + ui.progressBar->setTextVisible(true); + ui.progressBar->setRange(0, 100); + + QFile qssFile(":/DEM_ASSESS/DEM_ASSESS.qss"); + qssFile.open(QFile::ReadOnly); //ֻʽ + if (qssFile.isOpen()) + { + QString qss = QLatin1String(qssFile.readAll()); + myWidget->setStyleSheet(qss); + qssFile.close(); + } + else + qDebug() << "޷ļ"; + + QDir pluginsDir = QDir(qApp->applicationDirPath()); + if (pluginsDir.cd("srsplugins\\DemModel")) + { + QString strConfigPath = pluginsDir.absoluteFilePath("dem_config.ini"); + QFile f(strConfigPath); + if (f.exists()) + { + ReadConfigHistoryPaths(strConfigPath); + f.close(); + } + } + + if (showWin) + myWidget->show(); + + return myWidget; +} + +void ModelAssessment::startWorkThread() +{ + if (mWorker != nullptr) + { + return; + } + mWorkThread = new QThread(); + mWorker = new WorkThreadObject(); + mWorker->moveToThread(mWorkThread); + connect(mWorkThread, &QThread::finished, mWorkThread, &QObject::deleteLater); + connect(mWorkThread, &QThread::finished, mWorker, &QObject::deleteLater); + connect(mWorker, &WorkThreadObject::process, myWidget, [=](int value) { + ui.progressBar->setValue(value); + if (value == 100) + { + QString txtDir = ui.lineOutResult->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("F1f1_score")); + outLines = outLines + line; + } + } + file.close(); + } + + QMessageBox mess(QMessageBox::Information, + QString::fromLocal8Bit(""), + QString::fromLocal8Bit("۽:\n") + txtDir + "\n" + + outLines); + mess.setWindowFlags(Qt::Drawer); + mess.setTextInteractionFlags(Qt::TextSelectableByMouse); + mess.setStandardButtons(QMessageBox::Yes); + mess.button(QMessageBox::StandardButton::Yes)->setText(QString::fromLocal8Bit("ȷ")); + //mess.setTextInteractionFlags(Qt::TextSelectableByMouse); + int result = mess.exec(); + pbCancel(); + } + }); + connect(this, &ModelAssessment::startPreAssessment, mWorker, &WorkThreadObject::runAssessWork); + + mWorkThread->start(); +} + +void ModelAssessment::chooseModelFile() +{ + 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); + + //򿪱Ϊ[DemTrain] 飬ȡDemTrainTrainResultֶ + configIni.beginGroup("DemTrain"); + + 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.lineInPredict->setText(srcDir.absolutePath()); + //Labels + srcDir = QDir(strDemTrainResult); + if (srcDir.cd("Labels")) + ui.lineInLabel->setText(srcDir.absolutePath()); + + configIni.endGroup();//ر + + //򿪱Ϊ[DemAssess] 飬ȡAssessResultֶ + configIni.beginGroup("DemAssess"); + //۽ + ui.lineOutResult->setText(configIni.value("AssessResult").toString()); + + configIni.endGroup();//ر +} + +void ModelAssessment::WriteConfigPaths(QString strPath) +{ + QSettings configIni(strPath, QSettings::IniFormat); + configIni.setIniCodec("utf-8"); + //򿪱Ϊ[DemAssess] + configIni.beginGroup("DemAssess"); + + //ģ· + QString temp = ui.lineOutResult->text(); + if (temp != "") + configIni.setValue("AssessResult", temp); + + configIni.endGroup();//ر +} + +void ModelAssessment::readAndStart() +{ + QString dirModel = ui.lineModel->text(); + QString dirIndex = ui.lineIndex->text(); + QString dirLabel = ui.lineInLabel->text(); + QString dirPredict = ui.lineInPredict->text(); + QString dirResult = ui.lineOutResult->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 ModelAssessment::pbCancel() +{ + delete myWidget;//&QDialog::destroyed +} diff --git a/DEM_ASSESS/DEM_ASSESS.h b/DEM_ASSESS/DEM_ASSESS.h new file mode 100644 index 0000000..7c4ef38 --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.h @@ -0,0 +1,79 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include "ui_DEM_ASSESS.h" +#include "SrsMainPluginInterFace.h" + +class WorkThreadObject :public QObject +{ + Q_OBJECT + +public: + void on_cancel(); + +signals: + void process(int value); + +public slots: + void runAssessWork(QString model, QString PRE, QString label, QString index, QString result); + void writeAssessTxt(); + +private: + QProcess* mProces = nullptr; + QString assess_txt_path; +}; + +class ModelAssessment : public SrsMainInterface +{ + Q_OBJECT + Q_INTERFACES(SrsMainInterface) + Q_PLUGIN_METADATA(IID MainInterface_iid) + +public: + ModelAssessment(); + ~ModelAssessment(); + + 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; + + //jsonļȡʷ洢· + void ReadConfigHistoryPaths(QString strPath); + //汾δ򿪵·jsonļ + void WriteConfigPaths(QString strPath); + + void startWorkThread(); + +signals: + void startPreAssessment(QString model, QString PRE, QString label, QString index, QString result); + +public slots: + //pushbutton_OK + void readAndStart(); + void pbCancel(); + + void choosePredictPath(); + void chooseLabelPath(); + void chooseAssessFile(); + void chooseModelFile(); + void chooseResultPath(); + +private: + Ui::DEM_ASSESSClass ui; + + QDialog* myWidget = nullptr; + + WorkThreadObject* mWorker = nullptr; + QThread* mWorkThread = nullptr; + +}; diff --git a/DEM_ASSESS/DEM_ASSESS.qrc b/DEM_ASSESS/DEM_ASSESS.qrc new file mode 100644 index 0000000..14515c6 --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.qrc @@ -0,0 +1,6 @@ + + + DEM_ASSESS.qss + resources/assessment.svg + + diff --git a/DEM_ASSESS/DEM_ASSESS.qss b/DEM_ASSESS/DEM_ASSESS.qss new file mode 100644 index 0000000..1eed851 --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.qss @@ -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, #pbtInPredict, #pbtInLabel, #pbtModel, #pbtIndex,#pbtOutResult{ + 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, #pbtInPredict:hover, #pbtInLabel:hover, #pbtModel:hover, #pbtIndex:hover,#pbtOutResult:hover{ + background-color: #ecf5ff; + color: #409eff; +} +#pushButton_ok:pressed, #pushButton_cancel:pressed, #pbtInPredict:pressed, #pbtInLabel:pressed, #pbtModel:pressed, #pbtIndex:pressed,#pbtOutResult:pressed{ + border: 1px solid #3a8ee6; + color: #409eff; +} +#pushButton_ok:checked, #pushButton_cancel:checked, #pbtInPredict:checked, #pbtInLabel:checked, #pbtModel:checked, #pbtIndex:checked,#pbtOutResult:checked{ + border: 1px solid #3a8ee6; + color: #409eff; +} +#pushButton_ok:focus, #pushButton_cancel:focus, #pbtInPredict:focus, #pbtInLabel:focus, #pbtModel:focus, #pbtIndex:focus,#pbtOutResult:focus{ + border: 1px solid #3a8ee6; + color: #409eff; + outline: none; +} + +/*----QLineEditʽ*/ +#lineInPredict, #lineInLabel, #lineModel, #lineIndex, #lineOutResult{ + border:0px; + border-bottom: 1px solid #B3B3B3; + font-family:'Microsoft YaHei'; + font-size:12px; + background-color:transparent; +} +#lineInPredict:hover, #lineInLabel:hover, #lineModel:hover, #lineIndex:hover, #lineOutResult:hover{ + border-bottom: 2px solid #66A3FF; +} +#lineInPredict:focus, #lineInLabel:focus, #lineModel:focus, #lineIndex:focus, #lineOutResult:focus{ + border-bottom: 2px solid #7666FF; +} diff --git a/DEM_ASSESS/DEM_ASSESS.ui b/DEM_ASSESS/DEM_ASSESS.ui new file mode 100644 index 0000000..0b6d254 --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.ui @@ -0,0 +1,317 @@ + + + DEM_ASSESSClass + + + + 0 + 0 + 500 + 300 + + + + + 500 + 300 + + + + + 500 + 300 + + + + DEM_ASSESS + + + + resources/assessment.svgresources/assessment.svg + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 输入验证文件路径 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 输入标签文件路径 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 输入模型文件路径 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 选择文件 + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + 选择文件夹 + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 输入验证文件索引 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 选择文件 + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + 选择文件夹 + + + + + + + + 0 + 0 + + + + 评估结果输出路径 + + + + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + 选择文件夹 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + 确定 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + 取消 + + + + + + + + + 0 + + + + + + + + + + + diff --git a/DEM_ASSESS/DEM_ASSESS.vcxproj b/DEM_ASSESS/DEM_ASSESS.vcxproj new file mode 100644 index 0000000..a28b1d0 --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.vcxproj @@ -0,0 +1,80 @@ + + + + + Release + x64 + + + + {E901DBCF-219B-4AA9-A34F-BBDDFC06FE11} + QtVS_v304 + 10.0.19041.0 + $(MSBuildProjectDirectory)\QtMsBuild + + + + Application + v142 + + + + + + + QtQgis + core;gui;widgets + release + + + + + + + + + + + + + dem2-$(ProjectName) + + + + true + true + EditAndContinue + Disabled + MultiThreadedDLL + Use + stdafx.h + + + Console + true + + + %(PrependInclude) + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DEM_ASSESS/DEM_ASSESS.vcxproj.filters b/DEM_ASSESS/DEM_ASSESS.vcxproj.filters new file mode 100644 index 0000000..87b8c5d --- /dev/null +++ b/DEM_ASSESS/DEM_ASSESS.vcxproj.filters @@ -0,0 +1,59 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} + ts + + + + + Resource Files + + + Form Files + + + Header Files + + + Source Files + + + + + Source Files + + + + + Form Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/DEM_ASSESS/SrsMainPluginInterFace.h b/DEM_ASSESS/SrsMainPluginInterFace.h new file mode 100644 index 0000000..9130479 --- /dev/null +++ b/DEM_ASSESS/SrsMainPluginInterFace.h @@ -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 +#include +#include +#include + +struct SPluginMetaData +{ + QVector qvsReturnFilePaths; + QVector qvsSendFilePaths; + bool isAdd2Map; + +}; +class SrsMainInterface : public QObject +{ + Q_OBJECT +public: + virtual ~SrsMainInterface() {} + + /// + /// pannel + /// + virtual QString PannelName() = 0; + + /// + /// Category + /// + /// + virtual QString CategoryName() = 0; + + /// + /// زӢ + /// + /// + virtual QString EnglishName() = 0; + /// + /// ز + /// + /// + 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) diff --git a/DEM_ASSESS/main.cpp b/DEM_ASSESS/main.cpp new file mode 100644 index 0000000..322086f --- /dev/null +++ b/DEM_ASSESS/main.cpp @@ -0,0 +1,16 @@ +#include "DEM_ASSESS.h" +#include + +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(); +} diff --git a/DEM_ASSESS/resources/assessment.svg b/DEM_ASSESS/resources/assessment.svg new file mode 100644 index 0000000..a445d43 --- /dev/null +++ b/DEM_ASSESS/resources/assessment.svg @@ -0,0 +1,2 @@ + \ No newline at end of file