vent.gui package

Submodules

vent.gui.defaults module

vent.gui.styles module

Data

MONITOR_UPDATE_INTERVAL

(float): inter-update interval (seconds) for Monitor

Functions

set_dark_palette(app)

Apply Dark Theme to the Qt application instance.

vent.gui.styles.MONITOR_UPDATE_INTERVAL = 0.5

inter-update interval (seconds) for Monitor

Type

(float)

vent.gui.styles.set_dark_palette(app)[source]

Apply Dark Theme to the Qt application instance.

borrowed from https://github.com/gmarull/qtmodern/blob/master/qtmodern/styles.py
Args:

app (QApplication): QApplication instance.

vent.gui.widgets module

Module contents

Data

LIMIT_GUI_INSTANCE

(bool): whether there hsould only be one GUI instance at a time. disabled during testing.

PLOTS

Values to plot.

Functions

get_gui_instance()

Retreive the currently running instance of the GUI

limit_gui([limit])

load_mono_font()

Load the monospaced font and set the module-global _MONO_FONT object.

mono_font()

module function to return a PySide2.QtGui.QFont to use as the mono font.

set_gui_instance(instance)

Store the current instance of the GUI

vent.gui.LIMIT_GUI_INSTANCE = True

whether there hsould only be one GUI instance at a time. disabled during testing.

Type

(bool)

vent.gui.limit_gui(limit=None)[source]
vent.gui.PLOTS = OrderedDict([(<ValueName.PRESSURE: 12>, {'name': 'Pressure', 'units': 'mmH2O', 'abs_range': (0, 70), 'safe_range': (0, 60), 'decimals': 1, 'default': None, 'color': '#FF6319'}), (<ValueName.TEMP: 9>, {'name': 'Temp', 'units': '°C', 'abs_range': (35, 40), 'safe_range': (36, 39), 'decimals': 1, 'default': None, 'color': '#EE352E'}), (<ValueName.HUMIDITY: 10>, {'name': 'Humidity', 'units': '%', 'abs_range': (0, 100), 'safe_range': (70, 100), 'decimals': 1, 'default': None, 'color': '#0039A6'})])

Values to plot.

Should have the same key as some key in SENSOR. If it does, it will be mutually connected to the resulting gui.widgets.Monitor_Value such that the set limit range is updated when the horizontal bars on the plot are updated.:

{
    'name' (str): title of plot,
    'abs_range' (tuple): absolute limit of plot range,
    'safe_range' (tuple): safe range, will be discolored outside of this range,
    'color' (str): hex color of line (like "#FF0000")
}
vent.gui.set_gui_instance(instance)[source]

Store the current instance of the GUI

Parameters

instance (Vent_Gui) –

vent.gui.mono_font()[source]

module function to return a PySide2.QtGui.QFont to use as the mono font.

use this instead of just making because PySide2.QtGui.QFontDatabase can’t be instantiated before the PySide2.QtWidgets.QApplication is instantiated, so we load the font after the app

vent.gui.load_mono_font()[source]

Load the monospaced font and set the module-global _MONO_FONT object.

Note

Must be called after PySide2.QtWidgets.QApplication is instantiated!

vent.gui.get_gui_instance()[source]

Retreive the currently running instance of the GUI

Returns

Vent_Gui