Skip to content
Permalink
Browse files

Allow double typed values in algorithm

Also homogenize the output name
  • Loading branch information
DelazJ authored and nyalldawson committed Oct 27, 2017
1 parent 99b1c74 commit 30aa5f5f96217a4ad4bea0a7f53b6a8e15edc118
@@ -70,9 +70,11 @@ def initAlgorithm(self, config=None):
self.tr('Input layer')))

self.addParameter(QgsProcessingParameterNumber(self.DISTANCE,
self.tr('Distance'), defaultValue=10.0))
self.tr('Distance'), type=QgsProcessingParameterNumber.Double,
defaultValue=10.0))
self.addParameter(QgsProcessingParameterNumber(self.SEGMENTS,
self.tr('Segments'), type=QgsProcessingParameterNumber.Integer, minValue=1, defaultValue=5))
self.tr('Segments'), type=QgsProcessingParameterNumber.Integer,
minValue=1, defaultValue=5))
self.addParameter(QgsProcessingParameterBoolean(self.DISSOLVE,
self.tr('Dissolve result'), defaultValue=False))
self.end_cap_styles = [self.tr('Round'),
@@ -90,7 +92,8 @@ def initAlgorithm(self, config=None):
self.tr('Join style'),
options=self.join_styles, defaultValue=0))
self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT,
self.tr('Miter limit'), minValue=0, defaultValue=2))
self.tr('Miter limit'), type=QgsProcessingParameterNumber.Double,
minValue=0, defaultValue=2))

self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Buffer'), QgsProcessing.TypeVectorPolygon))

@@ -60,7 +60,8 @@ def __init__(self):

def initParameters(self, config=None):
self.addParameter(QgsProcessingParameterNumber(self.DISTANCE,
self.tr('Distance'), defaultValue=10.0))
self.tr('Distance'), QgsProcessingParameterNumber.Double,
defaultValue=10.0))
self.addParameter(QgsProcessingParameterEnum(
self.SIDE,
self.tr('Side'),
@@ -75,7 +76,8 @@ def initParameters(self, config=None):
self.tr('Join style'),
options=self.join_styles))
self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT,
self.tr('Miter limit'), minValue=1, defaultValue=2))
self.tr('Miter limit'), QgsProcessingParameterNumber.Double,
minValue=1, defaultValue=2))

def name(self):
return 'singlesidedbuffer'
@@ -84,7 +86,7 @@ def displayName(self):
return self.tr('Single sided buffer')

def outputName(self):
return self.tr('Buffers')
return self.tr('Buffer')

def inputLayerTypes(self):
return [QgsProcessing.TypeVectorLine]
@@ -90,7 +90,8 @@ def initAlgorithm(self, config=None):
self.tr('Join style'),
options=self.join_styles, defaultValue=0))
self.addParameter(QgsProcessingParameterNumber(self.MITER_LIMIT,
self.tr('Miter limit'), minValue=0, defaultValue=2))
self.tr('Miter limit'), type=QgsProcessingParameterNumber.Double,
minValue=0, defaultValue=2))

self.addParameter(
QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Buffer'), QgsProcessing.TypeVectorPolygon))

0 comments on commit 30aa5f5

Please sign in to comment.
You can’t perform that action at this time.