display counter feature

pyspMonitor has the displayCounter feature, PySpectra version > 1.77. The user may define one or more counters which are displayed during the scan but they not stored in a file. However, the data remain available for cursor operations and so until the next scan is started. This feature has been implemented to avoid multiple hardware accesses, e.g. through VcExecutors.

Here is an example:

# to enable the feature
p09/door/haso107tk.01 [62]: senv useDisplayCounters True
useDisplayCounters = True
# to define the display counter vfc_ratio from spock
p09/door/haso107tk.01 [63]: senv displayCounters "{ 'vfc_ratio': 'DataDict[ \'pips\']/DataDict[ \'ioni\']'}"
displayCounters = {'vfc_ratio': "DataDict[ 'pips']/DataDict[ 'ioni']"}
# the same definition from python
p09/door/haso107tk.01 [74]: import HasyUtils
p09/door/haso107tk.01 [75]: hsh = { 'vfc_ratio': "DataDict[ 'pips']/DataDict[ 'ioni']"}
p09/door/haso107tk.01 [76]: HasyUtils.setEnv( "displayCounters", hsh)

The program automatically fills DataDict with counter readings. It can be referenced by an expression like in line 75 above.

The y-value of the display counter is calculated by such an expression:

    cmd = "yValue = %s" % self.displayCounterHsh[ 'vfc_ratio']
    exec cmd
    yValue = 0