Control Panel¶
The Control Panel starts and stops ventilation and controls runtime options
Classes:
|
The control panel starts and stops ventilation and controls runtime settings |
|
Button to start and stop Ventilation, created by |
|
Button to lock and unlock controls |
|
Track state of connection with Controller |
|
Simple widget to display ventilation time! |
- class pvp.gui.widgets.control_panel.Control_Panel[source]¶
The control panel starts and stops ventilation and controls runtime settings
It creates:
Start/stop button
- Status indicator - a clock that increments with heartbeats,
or some other visual indicator that things are alright
Version indicator
Buttons to select options like cycle autoset and automatic breath detection
Args:
- start_button¶
Button to start and stop ventilation
- Type
- lock_button¶
Button used to lock controls
- Type
Attributes:
pressure_units_changed
(*args, **kwargs)Signal emitted when pressure units have been changed.
cycle_autoset_changed
(*args, **kwargs)Signal emitted when a different breath cycle control value is set to be autocalculated
staticMetaObject
Methods:
init_ui
()Initialize all graphical elements and buttons!
_pressure_units_changed
(button)Emit the str of the current pressure units
- pressure_units_changed(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
Signal emitted when pressure units have been changed.
Contains str of current pressure units
- cycle_autoset_changed(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
Signal emitted when a different breath cycle control value is set to be autocalculated
- _pressure_units_changed(button)[source]¶
Emit the str of the current pressure units
- Parameters
button (
PySide2.QtWidgets.QPushButton
) – Button that was clicked
- staticMetaObject = <PySide2.QtCore.QMetaObject object>¶
- class pvp.gui.widgets.control_panel.Start_Button(*args, **kwargs)[source]¶
Button to start and stop Ventilation, created by
Control_Panel
Attributes:
states
Possible states of Start_Button
staticMetaObject
Methods:
load_pixmaps
()Load pixmaps to
Start_Button.pixmaps
set_state
(state)Set state of button
- states = ['OFF', 'ON', 'ALARM']¶
Possible states of Start_Button
- load_pixmaps()[source]¶
Load pixmaps to
Start_Button.pixmaps
- set_state(state)[source]¶
Set state of button
Should only be called by other objects (as there are checks to whether it’s ok to start/stop that we shouldn’t be aware of)
- Parameters
state (str) – one of
('OFF', 'ON', 'ALARM')
- staticMetaObject = <PySide2.QtCore.QMetaObject object>¶
- class pvp.gui.widgets.control_panel.Lock_Button(*args, **kwargs)[source]¶
Button to lock and unlock controls
Created by
Control_Panel
Attributes:
states
Possible states of Lock Button
staticMetaObject
Methods:
load_pixmaps
()Load pixmaps used to display lock state to
Lock_Button.pixmaps
set_state
(state)Set lock state of button
- states = ['DISABLED', 'UNLOCKED', 'LOCKED']¶
Possible states of Lock Button
- load_pixmaps()[source]¶
Load pixmaps used to display lock state to
Lock_Button.pixmaps
- set_state(state)[source]¶
Set lock state of button
Should only be called by other objects (as there are checks to whether it’s ok to start/stop that we shouldn’t be aware of)
- Parameters
state (str) –
('OFF', 'ON', 'ALARM')
- staticMetaObject = <PySide2.QtCore.QMetaObject object>¶
- class pvp.gui.widgets.control_panel.HeartBeat(update_interval: int = 100, timeout_dur: int = 5000)[source]¶
Track state of connection with Controller
Check when we last had contact with controller every
HeartBeat.update_interval
ms, if longer thanHeartBeat.timeout_dur
then emit a timeout signal- Parameters
- timer¶
Timer that checks for last contact
- Type
PySide2.QtCore.QTimer
Attributes:
timeout
(*args, **kwargs)Signal that a timeout has occurred -- too long between contact with controller.
heartbeat
(*args, **kwargs)Signal that requests to affirm contact with controller if no message has been received in timeout duration
staticMetaObject
Methods:
init_ui
()Initialize labels and status indicator
set_state
(state)Set running state
set_indicator
([state])Set visual indicator
start_timer
([update_interval])Start
HeartBeat.timer
to check for contact with controllerstop_timer
()Stop timer and clear text
beatheart
(heartbeat_time)Slot that receives timestamps of last contact with controller
_heartbeat
()Called every (update_interval) milliseconds to set the check the status of the heartbeat.
- timeout(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
Signal that a timeout has occurred – too long between contact with controller.
- heartbeat(*args, **kwargs) = <PySide2.QtCore.Signal object>¶
Signal that requests to affirm contact with controller if no message has been received in timeout duration
- set_state(state)[source]¶
Set running state
if just starting reset
HeartBeat._last_heartbeat
- Parameters
state (bool) – Whether we are starting (True) or stopping (False)
- set_indicator(state=None)[source]¶
Set visual indicator
- Parameters
state ('ALARM', 'OFF', 'NORMAL') – Current state of connection with controller
- start_timer(update_interval=None)[source]¶
Start
HeartBeat.timer
to check for contact with controller- Parameters
update_interval (int) – How often (in ms) the timer should be updated. if None, use
self.update_interval
- beatheart(heartbeat_time)[source]¶
Slot that receives timestamps of last contact with controller
- Parameters
heartbeat_time (float) – timestamp of last contact with controller
- _heartbeat()[source]¶
Called every (update_interval) milliseconds to set the check the status of the heartbeat.
- staticMetaObject = <PySide2.QtCore.QMetaObject object>¶
- class pvp.gui.widgets.control_panel.StopWatch(update_interval: float = 100, *args, **kwargs)[source]¶
Simple widget to display ventilation time!
- Parameters
update_interval (float) – update clock every n seconds
*args – passed to
PySide2.QtWidgets.QLabel
**kwargs – passed to
PySide2.QtWidgets.QLabel
Methods:
__init__
([update_interval])Simple widget to display ventilation time!
init_ui
()start_timer
([update_interval])- param update_interval
How often (in ms) the timer should be updated.
stop_timer
()Stop timer and reset label
_update_time
()Attributes:
staticMetaObject
- __init__(update_interval: float = 100, *args, **kwargs)[source]¶
Simple widget to display ventilation time!
- Parameters
update_interval (float) – update clock every n seconds
*args – passed to
PySide2.QtWidgets.QLabel
**kwargs – passed to
PySide2.QtWidgets.QLabel
- staticMetaObject = <PySide2.QtCore.QMetaObject object>¶