common
Base classes for OM's graphical interfaces.
This module contains common base classes and functions used by all of OM's graphical user interfaces and viewers.
OmGuiBase
Bases: QtWidgets.QMainWindow
See documentation of the __init__
function.
__init__(*, url, tag)
Base class for OM's graphical user interfaces.
This class implements elements that are common to all of OM's graphical interfaces. When initialized, this class creates a listening thread that receives data from an OnDA Monitor (filtered according to a provided tag). It additionally lays out the basic widget structure of the interface. Finally, it makes sure that a function that updates the graphical elements of the interface is called at regular intervals.
The class has methods to start and stop the listening thread, effectively attaching and detaching the graphical interface from the OnDA Monitor broadcasting the data
This base class should be subclassed to create specific graphical interfaces. Each derived class should always call the constructor of this class during initialization, and must additionally provide its own specific implementation of the abstract update_gui function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
The URL at which the GUI will connect and listen for data. This must be a string in the format used by the ZeroMQ protocol. |
required |
tag |
str
|
A string used to filter the data received from an OnDA Monitor. The GUI only receives data whose tag matches this argument. |
required |
start_listening()
Connects to an OnDA Monitor and starts listening for broadcast data.
This function instructs the listening thread to connect to an OnDA Monitor and start receiving data.
stop_listening()
Disconnects from an OnDA Monitor and stops listening for data.
This function instructs the listening thread to disconnect from an OnDA Monitor and stop receiving data.
update_gui()
Updates GUI elements.
This function is called at regular intervals by this class. It updates plots and other elements of the graphical interface.
This function is an abstract method of this base class: each derived graphical interface class must provide its own implementation.