def initParameters(self, configuration): #pylint: disable=unused-argument,missing-docstring

        param_length = QgsProcessingParameterDistance(
            self.LENGTH,
            self.tr('Length of Transect'),
            parentParameterName='INPUT',
            defaultValue=10.0)
        param_length.setIsDynamic(True)
        param_length.setDynamicLayerParameterName('INPUT')
        param_length.setDynamicPropertyDefinition(
            QgsPropertyDefinition(
                self.LENGTH,
                self.tr('Length of Transect'),
                QgsPropertyDefinition.Double))
        self.addParameter(param_length)

        param_distance = QgsProcessingParameterDistance(
            self.INTERVAL,
            self.tr('Distance Between Transects'),
            parentParameterName='INPUT',
            defaultValue=20.0)
        param_distance.setIsDynamic(True)
        param_distance.setDynamicLayerParameterName('INPUT')
        param_distance.setDynamicPropertyDefinition(
            QgsPropertyDefinition(
                self.INTERVAL,
                self.tr('Distance Between Transects'),
                QgsPropertyDefinition.Double))
        self.addParameter(param_distance)
Ejemplo n.º 2
0
    def initParameters(self, configuration):  #pylint: disable=unused-argument,missing-docstring

        self.addParameter(
            QgsProcessingParameterFeatureSource(
                self.LINES, self.tr('Lines'), [QgsProcessing.TypeVectorLine]))

        param_length = QgsProcessingParameterDistance(
            self.LENGTH,
            self.tr('Length of Transect'),
            parentParameterName='INPUT',
            defaultValue=10.0)
        param_length.setIsDynamic(True)
        param_length.setDynamicLayerParameterName('INPUT')
        param_length.setDynamicPropertyDefinition(
            QgsPropertyDefinition(self.LENGTH, self.tr('Length of Transect'),
                                  QgsPropertyDefinition.Double))
        self.addParameter(param_length)

        self.addParameter(
            QgsProcessingParameterDistance(self.SEARCH_DISTANCE,
                                           self.tr('Search Distance'),
                                           parentParameterName='INPUT',
                                           defaultValue=50.0))