There is a new feature in the config file parser.
It can evaluate integer expressions now.
If it finds curly braces, it will evaluate the expression inside and replace the complete string (including the curly braces) with the result of that expression. It supports common operator priority ('^' binds more than '*' or '/' which bind more than '+' and '-') and parentheses '(' and ')'.
Example:
"{2+2*3}" -> "8"
"{(2+2)*3}" -> "12"
It is in particular meant to be used in for loops, for example:
processor even_channels UTILS.SingleArray
for $i in [0:15]
array[$i] <- AdcCrate.adc[{2*$i}]
end
end
processor odd_channels UTILS.SingleArray
for $i in [0:15]
array[$i] <- AdcCrate.adc[{2*$i+1}]
end
end
[Updated on: Tue, 02 August 2016 18:27]
Report message to a moderator