SardanaInfoViewer

The SardanaInfoViewer subscribes to Info events of a door and displays the text in a widget. Any macro may send strings to the info stream:

#!/bin/env python
# 
# file name: /home/pXXuser/sardanaMacros/hello_world.py 
# 
"""this module contains the hello world macro"""

__all__ = ["hello_world"]

from sardana.macroserver.macro import *
from sardana.macroserver.macro import macro
import HasyUtils
import random

class hello_world(Macro):
    """The hello world macro."""
    def run(self):
        self.output( "Hello World!")

        self.output( "dir( self) %s" % str( dir( self)))
        self.info( "info: this is a message from hello_world")
        self.warning( "warning: this is an warning message from hello_world")
        self.error( "error: this is an error message from hello_world")

The InfoViewer server can be launched from a Unix shell or from spock

p10user@haspp10e2:~/temp$ SardanaInfoViewer.py &

p10/door/haspp10e2.01 [2]: ! SardanaInfoViewer.py &

Figure 7.32: The SardanaInfoViewer
\includegraphics[width=14.3cm]{SardanaInfoViewer.ps}



2021-07-09