Control Panel¶
The Control Panel starts and stops ventilation and controls runtime options
Classes:
|
Representation of alarm status and parameters |
|
An enumeration. |
|
The control panel starts and stops ventilation and controls runtime settings |
|
Track state of connection with Controller |
|
Button to lock and unlock controls |
|
Simple extension of toggle button with styling for clearer ‘ON’ vs ‘OFF’ |
|
with respct to https://stackoverflow.com/a/51057516 |
|
Button to start and stop Ventilation, created by |
|
Simple widget to display ventilation time! |
|
alias of |
Functions:
|
Retreive the currently running instance of the GUI |
|
module function to return a |
-
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:
Button to start and stop ventilation
- Type
Button used to lock controls
- Type
Methods:
_pressure_units_changed
(button)Emit the str of the current pressure units
init_ui
()Initialize all graphical elements and buttons!
Attributes:
cycle_autoset_changed
(*args, **kwargs)pressure_units_changed
(*args, **kwargs)staticMetaObject
-
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
Methods:
load_pixmaps
()Load pixmaps to
Start_Button.pixmaps
set_state
(state)Set state of button
Attributes:
states
staticMetaObject
-
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
Methods:
load_pixmaps
()Load pixmaps used to display lock state to
Lock_Button.pixmaps
set_state
(state)Set lock state of button
Attributes:
states
staticMetaObject
-
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
Methods:
_heartbeat
()Called every (update_interval) milliseconds to set the check the status of the heartbeat.
beatheart
(heartbeat_time)Slot that receives timestamps of last contact with controller
init_ui
()Initialize labels and status indicator
set_indicator
([state])Set visual indicator
set_state
(state)Set running state
start_timer
([update_interval])Start
HeartBeat.timer
to check for contact with controllerstop_timer
()Stop timer and clear text
Attributes:
heartbeat
(*args, **kwargs)staticMetaObject
timeout
(*args, **kwargs)-
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!
_update_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
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>¶