70 Commits

Author SHA1 Message Date
Nyall Dawson
08e850db38 [processing] In batch mode, don't try to run rows with invalid parameter values
Previously we would show a warning about these, but then go ahead and try
to run the row anyway (using an empty set of parameters), resulting in
the log being filled with confusing error messages.

Instead, keep the existing warning advising about which values are
invalid, but skip the affected row and don't try to run it at all.
2020-03-19 15:42:13 +10:00
gacarrillor
0153dc805e [processing] Disable runAsBatch/runAsSingle buttons during algorithm execution 2020-03-07 17:16:03 -05:00
gacarrillor
237f1f7e2d [processing][needs-docs] Adjust status of controls in algorithm dialog
+ Run button is not shown anymore in the Log tab, therefore, you can only run algorithms from the Parameters tab.
  + While running an algorithm, the Parameters tab is now blocked.
  + When an algorithm execution finishes (either successfully or not), a new button Change Parameters is shown in the Log tab.
  + The Batch Algorithm Dialog is now consistent with the described behavior (before, it blocked the Parameters panel, but not the tab; and it was the only dialog blocking parameters widgets).

These changes were applied to the Algorithm Dialog and Batch Algorithm Dialog, and work on Edit in place dialogs as well.
2020-03-07 14:23:51 -05:00
Nyall Dawson
fe8b7c0c95 [processing] Always clear list of previously encountered errors on
each new algorithm execution

Avoids the situation where errors reported during an algorithm
which was overall successully executed are append to the errors
for later execution steps
2019-08-08 10:07:27 +10:00
Nyall Dawson
e0093e1d11 [processing] Don't abort when an algorithm step fails in batch mode
Instead, record errors and report them all at the end of the batch
process. If we abort the remaining batch steps when encountering any
error, this blocks a useful use of the batch mode and prevents users
from running a batch process over a large number of input files, some
of which may be invalid.
2019-07-15 06:35:14 +10:00
Juergen E. Fischer
72af468228 translation string fixes 2019-06-17 09:40:29 +02:00
Nyall Dawson
e0eedc5fa1 [processing] Make batch processing HTML report more useful
Include the input parameter values in the report, otherwise the
results are just a meaningless list of values which can't be
associated with any particular set of inputs

Also correctly handle boolean and other output types
2019-06-12 07:03:57 +10:00
Juergen E. Fischer
5a54eb7739 processing: add option to select directory to recurse for files (fixes regression with a number of tools that used to have this - eg. buildvrt for instance) 2019-05-31 19:02:48 +02:00
Nyall Dawson
be11896012 Fix exception in BatchAlgorithmDialog 2019-05-31 09:54:30 +10:00
Alexander Bruy
e8a74f4537 [processing][needs-docs] allow to switch from batch dialog to single UI
(fix #16893)
2019-05-24 08:51:34 +10:00
Bas Couwenberg
2628c480c5 Don't include revision in sources.
Prevent changes to files that weren't changed between releases.
This eases review of the changes between releases significantly.
2019-05-17 16:47:47 +02:00
rldhont
943c7d5d90 [Processing] Define boolean output
In processing, if an algorithm has a boolean as an output, it cannot be defined as boolean but as a number.

To be more precise in algorithms description, the commit add QgsProcessingOutputBoolean.
2019-05-17 08:21:57 +10:00
Nyall Dawson
185172a946 Refactor creation of batch dialog row algorithm parameters 2019-04-30 14:43:58 +10:00
Nyall Dawson
e6e39173b2 [FEATURE][processing] In batch mode, allow population of file/layer
input columns by searching for files matching a specified pattern

With optional recursive search!
2019-04-30 14:43:58 +10:00
Nyall Dawson
5edf06a5bc [processing][needs-docs] Move batch execution double-click-to-fill-down
to an explicit widget in the table

The double-click-header action is very hidden, and many users will
not stumble upon this. By moving it to an explicit "Autofill" widget at the
top of the table, we make this important action much more user
discoverable.

It also gives the possibility of other, parameter specific, autofill
actions (e.g. fill by expression, fill by file pattern)
2019-04-30 14:43:58 +10:00
Nyall Dawson
149b35ead2 Indentation 2019-04-27 07:27:54 +10:00
Nyall Dawson
0ff5820573 [processing] Correctly reset progress bar after completing batch execution 2019-04-27 07:27:54 +10:00
Nyall Dawson
66eabdd40c [processing] Fix exception on completion of batch execution of
algorithm which has string or numeric outputs
2019-04-27 07:27:54 +10:00
volaya
eb47288fac [processing] correctly set output styles for models
fixes #20573
2019-01-23 08:02:19 +01:00
Nyall Dawson
d207251251 [processing] Fix run as batch mode doesn't execute
Fixes #20650
2018-11-29 10:57:07 +10:00
Nyall Dawson
6d1a9295f7 Use correct stylesheet for processing dialogs 2018-09-26 04:26:27 +10:00
Nyall Dawson
0ea283190b Better (finer) proxy task progress reporting for batch execution 2018-09-07 12:19:48 +10:00
Nyall Dawson
45bc2a0798 [processing] Use multi-step feedback for batch execution
Gives better indication of total progress vs showing just
current algorithm progress
2018-09-07 12:19:48 +10:00
Nyall Dawson
db1600871a [processing] Use a proxy task for batch processing execution 2018-09-07 12:19:48 +10:00
Nyall Dawson
8082497724 Fix evaluation of Python wrapper values 2018-09-04 19:06:07 +10:00
Nyall Dawson
bd65fc607b [processing][gdal] Don't double quote output paths
Breaks for some drivers, e.g. KML

Fixes #18264
2018-06-01 18:21:41 +10:00
Nyall Dawson
08d30c3b9f [processing] Add method for algorithms to preprocess parameter values
Allows algorithms to pre-processes a set of parameters, allowing the
algorithm to clean their values.

This method is automatically called after users enter parameters, e.g.
via the algorithm dialog. This method should NOT be called manually
by algorithms.
2018-04-03 18:36:39 +10:00
Juergen E. Fischer
6dfedc38e9 translation string fixes and cleanups 2018-02-15 22:31:15 +01:00
Denis Rouzaud
3dc3d9d1b2 unite QgsMessageLog::Level and QgsMessageBar::MessageLevel in Qgis::MessageLevel
make enum items lower case
remove unused QgsMessageLog::None and All
2018-02-06 08:56:40 -04:00
Nyall Dawson
f6e63d7f4c Fixes and cleanups to algorithm dialogs 2017-12-01 18:15:40 +11:00
Nyall Dawson
ce170918c9 Start moving processing algorithm dialog to c++
In an attempt to avoid Python global interpreter locks which
block the UI thread.
2017-12-01 18:15:40 +11:00
Alexander Bruy
0059b2b692 [processing] remove Python 2 compatibility layer 2017-11-28 12:27:45 +02:00
Nyall Dawson
2ed2248827 [processing] Add option whether to load batch output layers on completion
By always trying to load all layers, we severely limit the usefulness
of batch processing. E.g. try clipping 200 layers - and then
get ready to punch something as you wait for all the results to load.
2017-11-10 17:00:24 +10:00
Nyall Dawson
3fc90301a9 [processing] Only load layers when absolutely required
This change avoids holding onto resources and layers from earlier iterations,
and allows batch processing of many more items then is possible
if we hold on to these layers
2017-11-10 17:00:24 +10:00
Nyall Dawson
feacb76300 Fix python error 2017-11-10 13:43:50 +10:00
Nyall Dawson
9bac962a9e Fix batch processing progress bar never hits 100%, also fix fragile
cursor handling
2017-11-10 11:33:58 +10:00
Nyall Dawson
9d04f87249 Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs.
Rename them to QgsProcessingParameterFileDestination, etc... to
make it clearer what they are used for.
2017-07-08 20:49:17 +10:00
Nyall Dawson
4ea85362f4 Transform errors encountered while iterating features in
processing are non-fatal. We report them to users, and treat the
feature as having no geometry, but don't stop execution.
2017-06-23 12:08:54 +10:00
Nyall Dawson
bdc5e224a3 Small cleanups 2017-06-20 14:45:13 +10:00
Nyall Dawson
54124bd0aa Restore batch algorithm mode following new processing API 2017-06-13 12:32:30 +10:00
Nyall Dawson
b40f409de2 Nicer formatting for log in algorithm dialog 2017-06-12 08:31:37 +10:00
Nyall Dawson
bdf051a03a Partially port a trial python alg to new API 2017-06-06 07:41:19 +10:00
Nyall Dawson
189f804714 Adapt more code to c++ API 2017-06-06 07:41:19 +10:00
Nyall Dawson
ef59d0c454 Port parameter checking to c++ 2017-06-06 07:41:19 +10:00
Nyall Dawson
4cb7d18b1c Push parameters into processAlgorithm and related functions 2017-06-06 07:41:19 +10:00
Nyall Dawson
fb811766f8 Add framework for algorithm outputs
This somewhat changes the meaning of outputs from processing 2.x.
In 2.x processing outputs were used both as a method of specifying
inputs to algorithms (file paths to destination layers created
by the algorithm) AND pure outputs (such as statistics calculated
by the algorithm).

This is now split. The old input-type-outputs (destination layers)
are now input parameters (since the parameter value IS an input to the
algorithm). To differentiate them from parameters indicating pure
input layers a new "isDestination()" method was added to
QgsProcessingParameterDefinition.

Output definitions are now purely indications of values CREATED
by the algorithms. Suitable candidates are the existing calculated
stats and actual file path/URI of any layers created by the algorithm.
Moving forward we should ensure all algorithms output as much
useful information as possible - e.g. number of features processed,
number of skipped features, count null geometries encountered, etc...
2017-06-06 07:41:19 +10:00
Nyall Dawson
03e40f7497 [processing] Remove all remaining algorithm copies
Algorithms are no longer copied - just a single const instance
of each algorithm is used
2017-06-06 07:41:19 +10:00
Nyall Dawson
ac84326464 [processing] Fix executing models 2017-05-01 17:29:40 +10:00
Nyall Dawson
fd2c18ee16 Refactor processing writer to use QgsFeatureSink, and to store
temporary output layers in the provided processing context

Should fix loss of intermediate memory layers when running
a multi-step model
2017-04-26 17:38:40 +10:00
Nyall Dawson
dd4f530cfb [processing] Pass context argument to processAlgorithm 2017-04-26 12:53:35 +10:00