Unverified Commit e680d17e authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Flagged many GUI parameters as 'advanced' to hide them by default.

parent 60d33599
Pipeline #23842 failed with stage
in 1 minute and 9 seconds
......@@ -39,7 +39,8 @@ from qgis.core import \
QgsProcessingParameterNumber,
QgsProcessingParameterFolderDestination,
QgsProcessingParameterBoolean,
QgsProcessingParameterString
QgsProcessingParameterString,
QgsProcessingParameterDefinition
)
from .version import __version__
......@@ -115,6 +116,21 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
return '%s__%s' % (outdir_nocounter, counter)
def addParameter(self, param, *args, advanced=False, **kwargs):
"""Add a parameter to the QgsProcessingAlgorithm.
This overrides the parent method to make it accept an 'advanced' parameter.
:param param: the parameter to be added
:param args: arguments to be passed to the parent method
:param advanced: whether the parameter should be flagged as 'advanced'
:param kwargs: keyword arguments to be passed to the parent method
"""
if advanced:
param.setFlags(param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
super(_EnPTBaseAlgorithm, self).addParameter(param, *args, **kwargs)
def initAlgorithm(self, configuration=None):
self.addParameter(QgsProcessingParameterFile(
name=self.P_json_config, description='Configuration JSON template file',
......@@ -127,7 +143,8 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
description='Number of CPU cores to be used for processing',
type=QgsProcessingParameterNumber.Integer,
defaultValue=cpu_count(), minValue=0, maxValue=cpu_count(),
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterFile(
name=self.P_path_l1b_enmap_image,
......@@ -136,7 +153,8 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
self.addParameter(QgsProcessingParameterFile(
name=self.P_path_l1b_enmap_image_gapfill,
description='Adjacent EnMAP L1B image to be used for gap-filling (zip-archive or root directory)',
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterFile(
name=self.P_path_dem,
......@@ -151,7 +169,8 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
'(may be provided if no DEM is available and ignored if DEM is given)',
type=QgsProcessingParameterNumber.Integer,
defaultValue=0,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterFolderDestination(
name=self.P_output_dir,
......@@ -171,32 +190,37 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
description='Number of lines to be added to the main image [if not given, use the whole imgap]',
type=QgsProcessingParameterNumber.Integer,
defaultValue=None,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterBoolean(
name=self.P_disable_progress_bars,
description='Disable all progress bars during processing',
defaultValue=True,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterFile(
name=self.P_path_earthSunDist,
description='Input path of the earth sun distance model',
defaultValue=None,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterFile(
name=self.P_path_solar_irr,
description='Input path of the solar irradiance model',
defaultValue=None,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterNumber(
name=self.P_scale_factor_toa_ref,
description='Scale factor to be applied to TOA reflectance result',
type=QgsProcessingParameterNumber.Integer,
defaultValue=10000,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterBoolean(
name=self.P_enable_keystone_correction,
......@@ -226,26 +250,30 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
name=self.P_auto_download_ecmwf,
description='Automatically download ECMWF data for atmospheric correction',
defaultValue=False,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterBoolean(
name=self.P_enable_ice_retrieval,
description='Enable ice retrieval (increases accuracy of water vapour retrieval)',
defaultValue=True,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterBoolean(
name=self.P_enable_cloud_screening,
description='Cloud screening during atmospheric correction',
defaultValue=False,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterNumber(
name=self.P_scale_factor_boa_ref,
description='Scale factor to be applied to BOA reflectance result',
type=QgsProcessingParameterNumber.Integer,
defaultValue=10000,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterBoolean(
name=self.P_run_smile_P,
......@@ -264,7 +292,8 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
description="Algorithm for dead pixel correction ('spectral' or 'spatial')",
defaultValue='spectral',
multiLine=False,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterString(
name=self.P_deadpix_P_interp_spectral,
......@@ -272,7 +301,8 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
"('linear', 'bilinear', 'cubic', 'spline')",
defaultValue='linear',
multiLine=False,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterString(
name=self.P_deadpix_P_interp_spatial,
......@@ -280,14 +310,16 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
"('linear', 'bilinear', 'cubic', 'spline')",
defaultValue='linear',
multiLine=False,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterString(
name=self.P_ortho_resampAlg,
description="Ortho-rectification resampling algorithm ('nearest', 'bilinear', 'gauss')",
defaultValue='bilinear',
multiLine=False,
optional=True))
optional=True),
advanced=True)
self.addParameter(QgsProcessingParameterString(
name=self.P_vswir_overlap_algorithm,
......@@ -295,7 +327,8 @@ class _EnPTBaseAlgorithm(QgsProcessingAlgorithm):
"region ('order_by_wvl', 'average', 'vnir_only', 'swir_only')",
defaultValue='swir_only',
multiLine=False,
optional=True))
optional=True),
advanced=True)
@staticmethod
def shortHelpString(*args, **kwargs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment