53 Commits

Author SHA1 Message Date
Alexander Bruy
0059b2b692 [processing] remove Python 2 compatibility layer 2017-11-28 12:27:45 +02:00
Nyall Dawson
612f51601a [processing] Remove expression buttons from parameters outside modeler
Since these expressions were only evaluated immediately, it led to
confusing behavior for users who were expecting that the expression
would be applied per-feature.

Given that expressions can be directly entered into spin boxes, we already
have a way of users evaluating simple calculations for numeric
parameters at least.

I don't think there's a strong enough use case for needing to
calculate string results to leave the confusing expression builder
option in place.

This should be re-evaluated when we add UI support for dynamic
parameters (which are already supported in the backend), where
expressions are evaluated per-feature.

Fixes #17267
2017-11-10 10:42:25 +10:00
Nyall Dawson
f49b603443 Split QgsProcessingModelAlgorithm into separate components
The cpp/h file was getting too large, so split off the individual
subcomponents into their own h/cpp files to keep code
maintainable.
2017-07-08 20:49:17 +10:00
Nyall Dawson
3f9cfe0ce7 Fix setting number parameters to expressions 2017-07-07 11:35:31 +10:00
Nyall Dawson
82ef7d2a89 Create specific expression context scope for child algorithms
Contains variables for model parameters, algorithm results for
other child algorithms which are not dependent on the
algorithm.

Allows removal of final pieces of ModelerAlgorithm code
2017-07-07 11:35:31 +10:00
Nyall Dawson
11d35821c0 Fix setting number inputs to algorithms in modeler 2017-06-27 08:33:13 +10:00
Nyall Dawson
d1ed7d158e Steps towards executing models 2017-06-22 06:47:11 +10:00
Nyall Dawson
efe8bba006 Work on resurrecting modeler 2017-06-20 14:45:13 +10:00
Nyall Dawson
28f7a8b7e1 Move expression context generation out of parameters 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
c1d9d57dd2 First working pure c++ algorithms 2017-06-06 07:41:19 +10:00
Nyall Dawson
6987d7b37c Port handling of algorithm names to QgsProcessingAlgorithm 2017-04-03 21:17:45 +10:00
Juergen E. Fischer
5a962e8d4e translation string fixes 2017-03-05 11:37:57 +01:00
Juergen E. Fischer
c77172ed3d fix more flake8 warnings 2017-03-05 10:21:24 +01:00
Juergen E. Fischer
f00a87cb8a update translation strings 2017-03-05 10:21:24 +01:00
Nyall Dawson
a3ae0b28fc [processing] Restore spin box widget for number inputs outside modeller
This commit restores some pre 3.0 processing behaviour for number inputs.
Now, if a number input is required outside of modeller than a spin box
will be shown instead of a free text input.

Clicking the expression builder button results in an expression
which is evaluated immediately to avoid users expecting that
the expression will be evaluated per feature.
2016-11-11 11:02:42 +10:00
Nyall Dawson
d5698be69f Fix some processing breakage 2016-10-31 09:12:39 +10:00
volaya
2207669001 [processing] fixed expressions dialog when not in modeler 2016-10-05 12:39:03 +02:00
arnaud.morvan@camptocamp.com
4184934b9a [processing] Apply 2to3 on changes 2016-10-05 12:39:01 +02:00
Alexander Bruy
3407ced90e fix indentation
Conflicts:
	python/plugins/processing/gui/BatchInputSelectionPanel.py
	python/plugins/processing/gui/wrappers.py
2016-10-05 12:38:50 +02:00
volaya
a4a74b631a [processing] removed commented lines 2016-10-05 12:38:17 +02:00
volaya
bd06316c9d [processing] richer expressions in number parameters 2016-10-05 12:38:16 +02:00
volaya
e08fdaa444 [processing] support for expressions in numerical values in modeler
includes cleanup of modeler, to adapt to latest changes in parameters architecture
2016-10-05 12:38:11 +02:00
volaya
e353d226a8 [processing] evaluate parameters before executing algorithm
This allows a better use of expressions
2016-10-05 12:35:02 +02:00
volaya
b298c76ee4 [processing] implemented parameter widget wrappers
Conflicts:
	python/plugins/processing/core/GeoAlgorithm.py
	python/plugins/processing/gui/ExtentSelectionPanel.py
	python/plugins/processing/modeler/ModelerParametersDialog.py
2016-10-05 12:34:58 +02:00
Juergen E. Fischer
31df84aa6b run 2to3 on source 2016-09-21 23:30:04 +02:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02:00
Alexander Bruy
ab3fef97aa fix import (take 2) 2016-05-13 13:17:48 +03:00
Alexander Bruy
7c122a3a93 [processing] fix import 2016-05-13 11:11:33 +03:00
Alexander Bruy
0c8f6f7fbb fix indentation and typo 2016-05-13 09:32:13 +03:00
Alexander Bruy
730c5806aa Merge branch 'processing_exps' of https://github.com/volaya/QGIS into processing_exps
Conflicts:
	python/plugins/processing/gui/NumberInputPanel.py
	python/plugins/processing/gui/OutputSelectionPanel.py
2016-05-13 09:26:55 +03:00
Matthias Kuhn
abfd7740bd Fix qgis.PyQt compatibility imports 2016-04-29 14:10:41 +02:00
Denis Rouzaud
8071acd064 move PyQt compat folder to python/qgis 2016-04-29 14:10:26 +02:00
volaya
2535c0a9c1 [processing] better expression context building 2016-04-26 08:33:57 +02:00
volaya
7805c64208 [processing] added variables to scope when inputing value of a ParameterNumber 2016-04-25 14:21:15 +02:00
volaya
ac0bff32bf [processing] added support for expressions in some input params and outputs 2016-04-25 14:21:13 +02:00
Juergen E. Fischer
2526d3e3c8 processing: switch to pyqt wrappers, flake8 fixes 2016-03-21 17:00:25 +01:00
Alexander Bruy
908a380241 [processing] fix deprecation warnings 2016-01-20 16:39:13 +02:00
volaya
b2a12735c5 [processing] fixed update of console call in GdalAlgorithmDialog
fixes #14129
2016-01-19 09:03:23 +01:00
rldhont
cc2fb2efda [Processing] Update gui 2015-12-24 15:14:02 +01:00
Nyall Dawson
53aa583da0 [processing] Use QgsDoubleSpinBox instead of QSpinBox
Allows for simple calculations in spin box, adds a reset control
to reset widget to default value
2015-11-18 16:27:04 +11:00
Nyall Dawson
86231d79fa [processing] Guess sensible step sizes for float spin boxes 2015-11-18 16:26:55 +11:00
Nyall Dawson
ffd9707516 [processing] Fix maximum/minimum not respected for float spinboxes 2015-11-18 16:26:48 +11:00
radosuav
0dfb1561c6 [Processing] Fix limits in NumberInputPanel when the limiting value is 0 2015-07-17 14:47:04 +02:00
Alexander Bruy
d8e1cf30af [processing] load UI files dynamically 2015-05-19 15:30:26 +03:00
Juergen E. Fischer
956c155e8f fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
     --exclude="ui_*.py,debian/*,python/ext-libs/*" \
     .
2015-02-01 20:46:47 +01:00
Alexander Bruy
95650c43a5 [processing] rename number selector to keep consistency 2014-11-17 20:03:31 +02:00
Alexander Bruy
1507f0db88 [processing] add new output type - directory 2014-05-16 15:45:21 +03:00
Alexander Bruy
231f4e8444 [processing] homogenize widgets used for ParameterNumber (fix 8807) 2013-10-12 11:51:46 +03:00
Alexander Bruy
498a5d9ab8 [processing] code formatting, make sources more pep8 compliant 2013-10-02 16:24:10 +03:00