TaurusForms with fast motors

The user can collect a few TaurusForm in one TaurusGui windows

Figure 7.40: taurusform: fast motors
\includegraphics[width=12.98cm]{dcmtaurusform.ps}

by running the following python script

from taurus.qt.qtgui.taurusgui.utils import PanelDescription,\
    ExternalApp, ToolBarDescription, AppletDescription

GUI_NAME = 'dcmform'
ORGANIZATION = 'DESY'

dcm_motor_control = PanelDescription('DCM motor positions',
                       classname = 'TaurusForm',
                       model = [
                           'tango://haso228k:10000/p09/motor/exp.29/position',
                           'tango://haso228k:10000/p09/motor/exp.30/position'])

und_motor_control = PanelDescription('PETRA beam',
                       classname = 'TaurusForm',
                       model = [
                           'tango://haso228k:10000/petra/globals/keyword/Energy',
                           'tango://haso228k:10000/petra/globals/keyword/BeamCurrent'])

dcm_motor_setup = PanelDescription('DCM motor setup',
                       classname = 'TaurusForm',
                       model = [
                           'tango://haso228k:10000/p09/motor/exp.29',
                           'tango://haso228k:10000/p09/motor/exp.30'])

if __name__ == '__main__':
    from taurus.qt.qtgui.application import TaurusApplication
    from taurus.qt.qtgui.taurusgui import TaurusGui
    from taurus.external.qt import Qt
    app = TaurusApplication()
    gui = TaurusGui(confname=__file__)

    #: heartbeat period in ms
    period = 1000
    #: panels with fast motors
    panelnames = ['DCM motor positions', 'PETRA beam']
    for name in panelnames:
        fastpanel = gui.getPanel(name)
        taurusform = fastpanel.widget()
        for taurusvalue in taurusform:
            taurusvalue.setEventBufferPeriod(period)

    gui.show()
    app.exec_()

For TaurusForms containing frequently changing motor positions it is recommended to use the heartbeat mechanism. This mechanism protect against GUI freezing which can be caused by evaluating of too many events coming from moving motors.

In the above example these settings are done just before the gui.show() command. The panelnames list contains names of PanelDesciptions with fast motors.



2019-11-13