本文整理汇总了Python中processing.core.parameters.ParameterSelection.isAdvanced方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterSelection.isAdvanced方法的具体用法?Python ParameterSelection.isAdvanced怎么用?Python ParameterSelection.isAdvanced使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.parameters.ParameterSelection
的用法示例。
在下文中一共展示了ParameterSelection.isAdvanced方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: defineCharacteristicsFromFile
# 需要导入模块: from processing.core.parameters import ParameterSelection [as 别名]
# 或者: from processing.core.parameters.ParameterSelection import isAdvanced [as 别名]
def defineCharacteristicsFromFile(self):
with open(self.descriptionFile) as lines:
line = lines.readline().strip('\n').strip()
self.name = line
if '|' in self.name:
tokens = self.name.split('|')
self.name = tokens[0]
#cmdname is the name of the algorithm in SAGA, that is, the name to use to call it in the console
self.cmdname = tokens[1]
else:
self.cmdname = self.name
self.i18n_name = QCoreApplication.translate("SAGAAlgorithm", str(self.name))
#_commandLineName is the name used in processing to call the algorithm
#Most of the time will be equal to the cmdname, but in same cases, several processing algorithms
#call the same SAGA one
self._commandLineName = self.createCommandLineName(self.name)
self.name = decoratedAlgorithmName(self.name)
self.i18n_name = QCoreApplication.translate("SAGAAlgorithm", str(self.name))
line = lines.readline().strip('\n').strip()
self.undecoratedGroup = line
self.group = decoratedGroupName(self.undecoratedGroup)
self.i18n_group = QCoreApplication.translate("SAGAAlgorithm", self.group)
line = lines.readline().strip('\n').strip()
while line != '':
if line.startswith('Hardcoded'):
self.hardcodedStrings.append(line[len('Hardcoded|'):])
elif line.startswith('Parameter'):
self.addParameter(getParameterFromString(line))
elif line.startswith('AllowUnmatching'):
self.allowUnmatchingGridExtents = True
elif line.startswith('NoResamplingChoice'):
self.noResamplingChoice = True
elif line.startswith('Extent'):
# An extent parameter that wraps 4 SAGA numerical parameters
self.extentParamNames = line[6:].strip().split(' ')
self.addParameter(ParameterExtent(self.OUTPUT_EXTENT,
'Output extent'))
else:
self.addOutput(getOutputFromString(line))
line = lines.readline().strip('\n').strip()
hasRaster = False
for param in self.parameters:
if (isinstance(param, ParameterRaster) or
(isinstance(param, ParameterMultipleInput)
and param.datatype == ParameterMultipleInput.TYPE_RASTER)):
hasRaster = True
break
if (not self.noResamplingChoice and hasRaster):
param = ParameterSelection(self.RESAMPLING, "Resampling method", ["Nearest Neighbour", "Bilinear Interpolation", "Bicubic Spline Interpolation", "B-Spline Interpolation"], 3)
param.isAdvanced = True
self.addParameter(param)