Skip to content
Permalink
Browse files

[Processing] fixed handling of hardcoded params in SAGA

  • Loading branch information
volaya committed Oct 24, 2015
1 parent dacba06 commit 5575d04a8014199e245f32a339fb0057c0437fad
@@ -87,7 +87,7 @@ def defineCharacteristicsFromFile(self):
line = lines.readline().strip('\n').strip()
while line != '':
if line.startswith('Hardcoded'):
self.hardcodedStrings.append(line[len('Harcoded|') + 1:])
self.hardcodedStrings.append(line[len('Hardcoded|'):])
elif line.startswith('Parameter'):
self.addParameter(getParameterFromString(line))
elif line.startswith('AllowUnmatching'):
@@ -168,9 +168,7 @@ def processAlgorithm(self, progress):

# 2: Set parameters and outputs
command = self.undecoratedGroup + ' "' + self.cmdname + '"'
if self.hardcodedStrings:
for s in self.hardcodedStrings:
command += ' ' + s
command += ' ' + ' '.join(self.hardcodedStrings)

for param in self.parameters:
if param.value is None:
@@ -197,8 +195,7 @@ def processAlgorithm(self, progress):
f.write('\t'.join([col for col in param.cols]) + '\n')
values = param.value.split(',')
for i in range(0, len(values), 3):
s = values[i] + '\t' + values[i + 1] + '\t' + values[i
+ 2] + '\n'
s = values[i] + '\t' + values[i + 1] + '\t' + values[i+ 2] + '\n'
f.write(s)
f.close()
command += ' -' + param.name + ' "' + tempTableFile + '"'
@@ -229,8 +226,7 @@ def processAlgorithm(self, progress):
filename2 = filename + '.sgrd'
if self.cmdname == 'RGB Composite':
commands.append('io_grid_image 0 -IS_RGB -GRID:"' + filename2
+ '" -FILE:"' + filename
+ '"')
+ '" -FILE:"' + filename + '"')

# 3: Run SAGA
commands = self.editCommands(commands)
@@ -115,9 +115,7 @@ def processAlgorithm(self, progress):

# 2: Set parameters and outputs
command = self.undecoratedGroup + ' "' + self.cmdname + '"'
if self.hardcodedStrings:
for s in self.hardcodedStrings:
command += ' ' + s
command += ' ' + ' '.join(self.hardcodedStrings)

for param in self.parameters:
if param.value is None:

0 comments on commit 5575d04

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