95 lines
1.8 KiB
C
95 lines
1.8 KiB
C
|
#pragma once
|
|||
|
|
|||
|
#include <QtWidgets/QDialog>
|
|||
|
#include "ui_LandslidePredict.h"
|
|||
|
|
|||
|
#include <QProcess>
|
|||
|
#include <QThread>
|
|||
|
#include <QFile>
|
|||
|
#include <QIcon>
|
|||
|
#include <QDebug>
|
|||
|
#include <QMessageBox>
|
|||
|
#include <QFileDialog>
|
|||
|
#include <QStringList>
|
|||
|
#include <QIntValidator>
|
|||
|
|
|||
|
#include "SrsMainPluginInterFace.h"
|
|||
|
|
|||
|
#include <string>
|
|||
|
#include <iostream>
|
|||
|
|
|||
|
#include "im2shp.h"
|
|||
|
|
|||
|
using namespace std;
|
|||
|
|
|||
|
class WorkObject :public QObject
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
|
|||
|
public slots:
|
|||
|
void runPredictWork(QString inModel, QString inDataset, QString outPre);
|
|||
|
void on_read();
|
|||
|
void on_cancel();
|
|||
|
void runFormatConvert(QString pre, QString dataset);
|
|||
|
|
|||
|
signals:
|
|||
|
void progress(int value);
|
|||
|
void preFinished();
|
|||
|
void addShpDataToMap(QStringList list);
|
|||
|
|
|||
|
private:
|
|||
|
QProcess* mProcess = nullptr;
|
|||
|
|
|||
|
};
|
|||
|
|
|||
|
class LandslidePredict : public SrsMainInterface
|
|||
|
{
|
|||
|
Q_OBJECT
|
|||
|
Q_INTERFACES(SrsMainInterface)
|
|||
|
Q_PLUGIN_METADATA(IID MainInterface_iid)
|
|||
|
|
|||
|
public:
|
|||
|
LandslidePredict();
|
|||
|
|
|||
|
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);
|
|||
|
|
|||
|
void openResultData(QStringList string_list);
|
|||
|
|
|||
|
public slots:
|
|||
|
void readAndStart();
|
|||
|
void pbCancel();
|
|||
|
|
|||
|
void chooseInModel();
|
|||
|
void chooseInDataset();
|
|||
|
void chooseResultPath();
|
|||
|
|
|||
|
void finished();
|
|||
|
|
|||
|
signals:
|
|||
|
void start(QString inModel, QString inDataset, QString outPre);
|
|||
|
void startTiffToShp(QString pre, QString dataset);
|
|||
|
|
|||
|
private:
|
|||
|
Ui::LandslidePredictClass ui;
|
|||
|
|
|||
|
QDialog* myWidget = nullptr;
|
|||
|
|
|||
|
QThread* mWorkThread = nullptr;
|
|||
|
WorkObject* mWorkObject = nullptr;
|
|||
|
|
|||
|
};
|