Figure 7.15.2 shows the main widget of The purpose of this application is to listen to a Sardana door and display the incoming data, like

If the option -n is supplied, data from the Door are ignored. In this case toPyspMonitor() is the only source of data.

Figure 7.43: pyspMonitor, main widget

Figure 7.15.2 show the widget for changing the graphical attributes.

Figure 7.44: pyspMonitor, attributes widget

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. This feature has been implemented to avoid multiple hardware access, 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[ \'eh_vfc01\']/DataDict[ \'eh_vfc02\']'}"
displayCounters = {'vfc_ratio': "DataDict[ 'eh_vfc01']/DataDict[ 'eh_vfc02']"}
# the same definition from python
p09/door/haso107tk.01 [74]: import HasyUtils
p09/door/haso107tk.01 [75]: hsh = { 'vfc_ratio': "DataDict[ 'eh_vfc01']/DataDict[ 'eh_vfc02']"}
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