Skip to content

Commit

Permalink
Use 'value' parameter instead of 'val'
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Aug 9, 2020
1 parent 43a20fe commit 57b620c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resources/function_help/json/scale_exp
Expand Up @@ -4,7 +4,7 @@
"groups": ["Math"],
"description": "Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out of the specified output range.",
"arguments": [
{"arg":"val","description":"A value in the input domain. The function will return a corresponding scaled value in the output range."},
{"arg":"value","description":"A value in the input domain. The function will return a corresponding scaled value in the output range."},
{"arg":"domain_min","description":"Specifies the minimum value in the input domain, the smallest value the input value should take."},
{"arg":"domain_max","description":"Specifies the maximum value in the input domain, the largest value the input value should take."},
{"arg":"range_min","description":"Specifies the minimum value in the output range, the smallest value which should be output by the function."},
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/scale_linear
Expand Up @@ -4,7 +4,7 @@
"groups": ["Math"],
"description": "Transforms a given value from an input domain to an output range using linear interpolation.",
"arguments": [
{"arg":"val", "description":"A value in the input domain. The function will return a corresponding scaled value in the output range."},
{"arg":"value", "description":"A value in the input domain. The function will return a corresponding scaled value in the output range."},
{"arg":"domain_min", "description":"Specifies the minimum value in the input domain, the smallest value the input value should take."},
{"arg":"domain_max", "description":"Specifies the maximum value in the input domain, the largest value the input value should take."},
{"arg":"range_min", "description":"Specifies the minimum value in the output range, the smallest value which should be output by the function."},
Expand Down
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -5735,8 +5735,8 @@ const QList<QgsExpressionFunction *> &QgsExpression::Functions()
<< new QgsStaticExpressionFunction( QStringLiteral( "max" ), -1, fcnMax, QStringLiteral( "Math" ), QString(), false, QSet<QString>(), false, QStringList(), /* handlesNull = */ true )
<< new QgsStaticExpressionFunction( QStringLiteral( "min" ), -1, fcnMin, QStringLiteral( "Math" ), QString(), false, QSet<QString>(), false, QStringList(), /* handlesNull = */ true )
<< new QgsStaticExpressionFunction( QStringLiteral( "clamp" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "max" ) ), fcnClamp, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "scale_linear" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "val" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_max" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_max" ) ), fcnLinearScale, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "scale_exp" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "val" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_max" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_max" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "exponent" ) ), fcnExpScale, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "scale_linear" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_max" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_max" ) ), fcnLinearScale, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "scale_exp" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "domain_max" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_min" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "range_max" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "exponent" ) ), fcnExpScale, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "floor" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ), fcnFloor, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "ceil" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ), fcnCeil, QStringLiteral( "Math" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "pi" ), 0, fcnPi, QStringLiteral( "Math" ), QString(), false, QSet<QString>(), false, QStringList() << QStringLiteral( "$pi" ) )
Expand Down
2 changes: 2 additions & 0 deletions src/core/expression/qgsexpressionnodeimpl.cpp
Expand Up @@ -89,6 +89,8 @@ QString QgsExpressionNode::NodeList::cleanNamedNodeName( const QString &name )
// upgrade older argument names to standard versions
if ( cleaned == QLatin1String( "geom" ) )
cleaned = QStringLiteral( "geometry" );
else if ( cleaned == QLatin1String( "val" ) )
cleaned = QStringLiteral( "value" );

return cleaned;
}
Expand Down

0 comments on commit 57b620c

Please sign in to comment.