GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » NUSTAR » NUSTAR PRESPEC » prespec git updates (Post here if you pushed your changes to the agatagsi@lx-pool.gsi.de:git/prespec repository and you want to make everybody aware of the new features you added)
Re: prespec git updates [message #19401 is a reply to message #17158] Mon, 01 August 2016 13:35 Go to previous message
Michael Reese is currently offline  Michael Reese
Messages: 9
Registered: August 2016
occasional visitor
From: 140.181.14*
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multihit TDCs in the PreSPEC setup (CAENv1290)
Next Topic: LYCCA ToF scintillators
Goto Forum:
  


Current Time: Tue Oct 22 17:10:21 CEST 2019

Total time taken to generate the page: 0.02223 seconds