85 lines
1.6 KiB
C
85 lines
1.6 KiB
C
|
#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();
|
|||
|
|
|||
|
//<2F><>json<6F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ʷ<EFBFBD>洢<EFBFBD><E6B4A2>·<EFBFBD><C2B7>
|
|||
|
void ReadConfigHistoryPaths(QString strPath);
|
|||
|
//<2F><><EFBFBD>汾<EFBFBD>δ<CEB4>·<EFBFBD><C2B7><EFBFBD><EFBFBD>json<6F>ļ<EFBFBD>
|
|||
|
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;
|
|||
|
|
|||
|
};
|