QGIS API Documentation 4.3.0-Master (52aa6503bed)
Loading...
Searching...
No Matches
qgsprocessingbatchalgorithmdialogbase.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingalgorithmdialogbase.h
3 ----------------------------------
4 Date : November 2017
5 Copyright : (C) 2017 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
17#define QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
22
23#include <QElapsedTimer>
24
27
29
30
37class GUI_EXPORT QgsProcessingBatchAlgorithmDialogBase : public QgsProcessingAlgorithmWidgetBase
38{
39 Q_OBJECT
40
41 public:
45 QgsProcessingBatchAlgorithmDialogBase( QMainWindow *parentWindow SIP_TRANSFERTHIS );
46 ~QgsProcessingBatchAlgorithmDialogBase() override;
47
48 void resetAdditionalGui() override;
49 void blockAdditionalControlsWhileRunning() override;
50
51 public slots:
52
56 virtual void runAsSingle() = 0; // cppcheck-suppress pureVirtualCall
57
58 protected slots:
59
60 void algExecuted( bool successful, const QVariantMap &results ) override;
61
62 protected:
63 bool isFinalized() override;
64
69 void execute( const QList<QVariantMap> &parameters );
70
76 virtual QgsProcessingContext *createContext( QgsProcessingFeedback *feedback ) = 0 SIP_FACTORY;
77
81 virtual void loadHtmlResults( const QVariantMap &results, int index ) = 0;
82
86 virtual void createSummaryTable( const QList<QVariantMap> &results, const QList<QVariantMap> &errors ) = 0;
87
88 private slots:
89
90 void onTaskComplete( bool ok, const QVariantMap &results );
91 void taskTriggered( QgsTask *task );
92
93 private:
94 void executeNext();
95 void allTasksComplete( bool canceled );
96
97 QPushButton *mButtonRunSingle = nullptr;
98
99 int mCurrentStep = 0;
100 int mTotalSteps = 0;
101 QList<QVariantMap> mQueuedParameters;
102 QVariantMap mCurrentParameters;
103 QPointer<QgsProxyProgressTask> mProxyTask;
104 std::unique_ptr<QgsProcessingFeedback> mFeedback;
105 std::unique_ptr<QgsProcessingBatchFeedback> mBatchFeedback;
106 std::unique_ptr<QgsProcessingContext> mTaskContext;
107 QList<QVariantMap> mResults;
108 QList<QVariantMap> mErrors;
109 QElapsedTimer mTotalTimer;
110 QElapsedTimer mCurrentStepTimer;
111};
112
114
115#endif // QGSPROCESSINGBATCHALGORITHMDIALOGBASE_H
Processing feedback subclass for use when batch processing.
A QgsTask shell which proxies progress reports.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_FACTORY
Definition qgis_sip.h:83