gui¶
Program Diagram¶
Design Requirements¶
Display Values
Value name, units, absolute range, recommended range, default range
VTE
FiO2
Humidity
Temperature
Plots
Controlled Values
PIP
PEEP
Inspiratory Time
Value Dependencies
UI Notes & Todo¶
Jonny add notes from helpful RT in discord!!!
Top status Bar
Start/stop button
Status indicator - a clock that increments with heartbeats, or some other visual indicator that things are alright
Status bar - most recent alarm or notification w/ means of clearing
Override to give 100% oxygen and silence all alarms
API
Two queues, input and output. Read from socket and put directly into queue.
Input, receive (timestamp, key, value) messages where key and value are names of variables and their values
Output, send same format
Menus
Trigger some testing/calibration routine
Log/alarm viewer
Wizard to set values?
save/load values
Alarms
Multiple levels
Silenced/reset
Logging
Sounds?
General
Reduce space given to waveforms
Clearer grouping & titling for display values & controls
Collapsible range setting
Ability to declare dependencies between values
Limits - one value’s range logically depends on another
Derived - one value is computed from another/others
Monitored values should have defaults, warning range, and absolute range
Two classes of monitored values – ones with limits and ones without. There seem to be lots and lots of observed values, but only some need limits. might want to make larger drawer of smaller displayed values that don’t need controls
Save/load parameters. Autosave, and autorestore if saved <5m ago, otherwise init from defaults.
Implement timed updates to plots to limit resource usage
Make class for setting values
Possible plots
Pressure vs. flow
flow vs volume
volume vs time
Performance
Cache drawText() calls in range selector by drawing to pixmap
Jonny Questions¶
Which alarm sounds to use?
Final final final breakdown on values and ranges plzzz
jonny todo¶
use loop_counter to check on controller advancement
implement single values list with properties ‘controllable’ vs not.
GUI Object Documentation¶
Control¶
Monitor¶
Classes
|
|
-
class
vent.gui.widgets.monitor.
Monitor
(value, update_period=0.5, enum_name=None)[source]¶ - Parameters
value (
Value
) –update_period (float) – update period of monitor in s
Methods
__init__
(value[, update_period, enum_name])- param value
_limits_changed
(val)check_alarm
([value])init_ui
()set_alarm
(alarm)Simple wrapper to set alarm state from a qt signal
toggle_control
(state)update_boxes
(new_values)update_limits
(new_limits)update_value
(new_value)Attributes
-
alarm
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
limits_changed
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
__init__
(value, update_period=0.5, enum_name=None)[source]¶ - Parameters
value (
Value
) –update_period (float) – update period of monitor in s
-
property
alarm_state
¶
-
set_alarm
(alarm)[source]¶ Simple wrapper to set alarm state from a qt signal
- Parameters
alarm (bool) – Whether to set as alarm state or not
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
Plot¶
Data
Update frequency of |
|
A |
Classes
|
When initializing PlotWidget, parent and background are passed to |
-
class
vent.gui.widgets.plot.
Plot
(name, buffer_size=4092, plot_duration=5, abs_range=None, safe_range=None, color=None, units='', **kwargs)[source]¶ When initializing PlotWidget, parent and background are passed to
GraphicsWidget.__init__()
and all others are passed toPlotItem.__init__()
.Methods
_safe_limits_changed
(val)set_duration
(dur)set_safe_limits
(limits)update_value
(new_value)new_value: (timestamp from time.time(), value)
-
limits_changed
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
Status Bar¶
Classes
|
|
|
-
class
vent.gui.widgets.status_bar.
Status_Bar
[source]¶ Start/stop button
- Status indicator - a clock that increments with heartbeats,
or some other visual indicator that things are alright
Status bar - most recent alarm or notification w/ means of clearing
Override to give 100% oxygen and silence all alarms
Methods
init_ui
()-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
class
vent.gui.widgets.status_bar.
Message_Display
[source]¶ Attributes
Methods
draw_state
([state])init_ui
()update_message
(alarm)- param alarm
-
message_cleared
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
level_changed
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
property
alarm_level
¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
class
vent.gui.widgets.status_bar.
HeartBeat
(update_interval=100, timeout_dur=5000)[source]¶ - Parameters
Methods
__init__
([update_interval, timeout_dur])- param update_interval
How often to do the heartbeat, in ms
Called every (update_interval) milliseconds to set the text of the timer.
beatheart
(heartbeat_time)init_ui
()set_indicator
([state])start_timer
([update_interval])- param update_interval
How often (in ms) the timer should be updated.
you can read the sign ya punk
-
timeout
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
heartbeat
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
start_timer
(update_interval=None)[source]¶ - Parameters
update_interval (float) – How often (in ms) the timer should be updated.
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
Components¶
GUI Stylesheets¶
Data
inter-update interval (seconds) for |
Functions
|
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.
GUI Alarm Manager¶
Classes
Functions
-
class
vent.gui.alarm_manager.
AlarmManager
[source]¶ Methods
monitor_alarm
(alarm)Parse a tentative alarm from a monitor – we should have already gotten an alarm from the controller, so this largely serves as a double check.
parse_message
(alarm)If an alarm doesn’t have a
message
attr, make one for it.update_alarms
(alarms)-
new_alarm
(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
-
monitor_alarm
(alarm)[source]¶ Parse a tentative alarm from a monitor – we should have already gotten an alarm from the controller, so this largely serves as a double check.
Doesn’t use the
Alarm
class because creating a new alarm increments the counter.- Parameters
alarm (tuple) – (monitor_name, monitor_value, timestamp)
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-