Values¶
Parameterization of variables and values used in PVP.
Value
objects define the existence and behavior of values, including
creating Display
and Plot
widgets in the GUI, and the contents of
SensorValues
and ControlSetting
s used between the GUI and controller.
Classes:
|
Canonical names of all values used in PVP. |
|
Class to parameterize how a value is used in PVP. |
Data:
Declaration of all values used by PVP |
|
Sensor values |
|
Values to control but not monitor. |
|
Those sensor values that should also have a widget created in the GUI |
|
Control values that should also have a widget created in the GUI |
|
Values that can be plotted |
- class pvp.common.values.ValueName(value)[source]¶
Bases:
enum.Enum
Canonical names of all values used in PVP.
Attributes:
- PIP = 1¶
- PIP_TIME = 2¶
- PEEP = 3¶
- PEEP_TIME = 4¶
- BREATHS_PER_MINUTE = 5¶
- INSPIRATION_TIME_SEC = 6¶
- IE_RATIO = 7¶
- FIO2 = 8¶
- VTE = 9¶
- PRESSURE = 10¶
- FLOWOUT = 11¶
- class pvp.common.values.Value(name: str, units: str, abs_range: tuple, safe_range: tuple, decimals: int, control: bool, sensor: bool, display: bool, plot: bool = False, plot_limits: Union[None, Tuple[pvp.common.values.ValueName]] = None, control_type: Union[None, str] = None, group: Union[None, dict] = None, default: (<class 'int'>, <class 'float'>) = None)[source]¶
Bases:
object
Class to parameterize how a value is used in PVP.
Sets whether a value is a sensor value, a control value, whether it should be plotted, and other details for the rest of the system to determine how to use it.
Values should only be declared in this file so that they are kept consistent with
ValueName
and to not leak stray values anywhere else in the program.- Parameters
name (str) – Human-readable name of the value
units (str) – Human-readable description of units
abs_range (tuple) – tuple of ints or floats setting the logical limit of the value, eg. a percent between 0 and 100, (0, 100)
safe_range (tuple) –
tuple of ints or floats setting the safe ranges of the value,
note:
this is not the same thing as the user-set alarm values, though the user-set alarm values are initialized as ``safe_range``.
decimals (int) – the number of decimals of precision used when displaying the value
control (bool) – Whether or not the value is used to control ventilation
sensor (bool) – Whether or not the value is a measured sensor value
display (bool) – whether the value should be created as a
gui.widgets.Display
widget.plot (bool) – whether or not the value is plottable in the center plot window
plot_limits (None, tuple(ValueName)) – If plottable, and the plotted value has some alarm limits for another value, plot those limits as horizontal lines in the plot. eg. the PIP alarm range limits should be plotted on the Pressure plot
control_type (None, "slider", "record") – If a control sets whether the control should use a slider or be set by recording recent sensor values.
group (None, str) – Unused currently, but to be used to create subgroups of control & display widgets
default (None, int, float) – Default value, if any. (Not automatically set in the GUI.)
Methods:
__init__
(name, units, abs_range, safe_range, ...)- param name
Human-readable name of the value
to_dict
()Gather up all attributes and return as a dict!
Attributes:
Human readable name of value
tuple of ints or floats setting the logical limit of the value, eg.
tuple of ints or floats setting the safe ranges of the value,
The number of decimals of precision used when displaying the value
Default value, if any.
Whether or not the value is used to control ventilation
Whether or not the value is a measured sensor value
Whether the value should be created as a
gui.widgets.Display
widget.If a control sets whether the control should use a slider or be set by recording recent sensor values.
Unused currently, but to be used to create subgroups of control & display widgets
whether or not the value is plottable in the center plot window
If plottable, and the plotted value has some alarm limits for another value, plot those limits as horizontal lines in the plot.
- __init__(name: str, units: str, abs_range: tuple, safe_range: tuple, decimals: int, control: bool, sensor: bool, display: bool, plot: bool = False, plot_limits: Union[None, Tuple[pvp.common.values.ValueName]] = None, control_type: Union[None, str] = None, group: Union[None, dict] = None, default: (<class 'int'>, <class 'float'>) = None)[source]¶
- Parameters
name (str) – Human-readable name of the value
units (str) – Human-readable description of units
abs_range (tuple) – tuple of ints or floats setting the logical limit of the value, eg. a percent between 0 and 100, (0, 100)
safe_range (tuple) –
tuple of ints or floats setting the safe ranges of the value,
note:
this is not the same thing as the user-set alarm values, though the user-set alarm values are initialized as ``safe_range``.
decimals (int) – the number of decimals of precision used when displaying the value
control (bool) – Whether or not the value is used to control ventilation
sensor (bool) – Whether or not the value is a measured sensor value
display (bool) – whether the value should be created as a
gui.widgets.Display
widget.plot (bool) – whether or not the value is plottable in the center plot window
plot_limits (None, tuple(ValueName)) – If plottable, and the plotted value has some alarm limits for another value, plot those limits as horizontal lines in the plot. eg. the PIP alarm range limits should be plotted on the Pressure plot
control_type (None, "slider", "record") – If a control sets whether the control should use a slider or be set by recording recent sensor values.
group (None, str) – Unused currently, but to be used to create subgroups of control & display widgets
default (None, int, float) – Default value, if any. (Not automatically set in the GUI.)
- property abs_range: tuple¶
tuple of ints or floats setting the logical limit of the value, eg. a percent between 0 and 100, (0, 100)
- Returns
tuple
- property safe_range: tuple¶
tuple of ints or floats setting the safe ranges of the value,
note:
this is not the same thing as the user-set alarm values, though the user-set alarm values are initialized as ``safe_range``.
- Returns
tuple
- property decimals: int¶
The number of decimals of precision used when displaying the value
- Returns
int
- property default¶
Default value, if any. (Not automatically set in the GUI.)
- property display¶
Whether the value should be created as a
gui.widgets.Display
widget.- Returns
bool
- property control_type¶
If a control sets whether the control should use a slider or be set by recording recent sensor values.
- Returns
None, “slider”, “record”
- property group¶
Unused currently, but to be used to create subgroups of control & display widgets
- Returns
None, str
- property plot¶
whether or not the value is plottable in the center plot window
- Returns
bool
- property plot_limits¶
If plottable, and the plotted value has some alarm limits for another value, plot those limits as horizontal lines in the plot. eg. the PIP alarm range limits should be plotted on the Pressure plot
- Returns
None, typing.Tuple[ValueName]
- pvp.common.values.VALUES = OrderedDict([(<ValueName.PIP: 1>, <pvp.common.values.Value object>), (<ValueName.PEEP: 3>, <pvp.common.values.Value object>), (<ValueName.BREATHS_PER_MINUTE: 5>, <pvp.common.values.Value object>), (<ValueName.INSPIRATION_TIME_SEC: 6>, <pvp.common.values.Value object>), (<ValueName.IE_RATIO: 7>, <pvp.common.values.Value object>), (<ValueName.PIP_TIME: 2>, <pvp.common.values.Value object>), (<ValueName.PEEP_TIME: 4>, <pvp.common.values.Value object>), (<ValueName.PRESSURE: 10>, <pvp.common.values.Value object>), (<ValueName.VTE: 9>, <pvp.common.values.Value object>), (<ValueName.FLOWOUT: 11>, <pvp.common.values.Value object>), (<ValueName.FIO2: 8>, <pvp.common.values.Value object>)])¶
Declaration of all values used by PVP
- pvp.common.values.SENSOR = OrderedDict([(<ValueName.PIP: 1>, <pvp.common.values.Value object>), (<ValueName.PEEP: 3>, <pvp.common.values.Value object>), (<ValueName.BREATHS_PER_MINUTE: 5>, <pvp.common.values.Value object>), (<ValueName.INSPIRATION_TIME_SEC: 6>, <pvp.common.values.Value object>), (<ValueName.PRESSURE: 10>, <pvp.common.values.Value object>), (<ValueName.VTE: 9>, <pvp.common.values.Value object>), (<ValueName.FLOWOUT: 11>, <pvp.common.values.Value object>), (<ValueName.FIO2: 8>, <pvp.common.values.Value object>)])¶
Sensor values
Automatically generated as all
Value
objects inVALUES
wheresensor == True
- pvp.common.values.CONTROL = OrderedDict([(<ValueName.PIP: 1>, <pvp.common.values.Value object>), (<ValueName.PEEP: 3>, <pvp.common.values.Value object>), (<ValueName.BREATHS_PER_MINUTE: 5>, <pvp.common.values.Value object>), (<ValueName.INSPIRATION_TIME_SEC: 6>, <pvp.common.values.Value object>), (<ValueName.IE_RATIO: 7>, <pvp.common.values.Value object>), (<ValueName.PIP_TIME: 2>, <pvp.common.values.Value object>), (<ValueName.PEEP_TIME: 4>, <pvp.common.values.Value object>)])¶
Values to control but not monitor.
Automatically generated as all
Value
objects inVALUES
wherecontrol == True
- pvp.common.values.DISPLAY_MONITOR = OrderedDict([(<ValueName.PIP: 1>, <pvp.common.values.Value object>), (<ValueName.PEEP: 3>, <pvp.common.values.Value object>), (<ValueName.BREATHS_PER_MINUTE: 5>, <pvp.common.values.Value object>), (<ValueName.INSPIRATION_TIME_SEC: 6>, <pvp.common.values.Value object>), (<ValueName.PRESSURE: 10>, <pvp.common.values.Value object>), (<ValueName.VTE: 9>, <pvp.common.values.Value object>), (<ValueName.FLOWOUT: 11>, <pvp.common.values.Value object>), (<ValueName.FIO2: 8>, <pvp.common.values.Value object>)])¶
Those sensor values that should also have a widget created in the GUI
Automatically generated as all
Value
objects inVALUES
wheresensor == True
anddisplay == True
- pvp.common.values.DISPLAY_CONTROL = OrderedDict([(<ValueName.PIP: 1>, <pvp.common.values.Value object>), (<ValueName.PEEP: 3>, <pvp.common.values.Value object>), (<ValueName.BREATHS_PER_MINUTE: 5>, <pvp.common.values.Value object>), (<ValueName.INSPIRATION_TIME_SEC: 6>, <pvp.common.values.Value object>), (<ValueName.IE_RATIO: 7>, <pvp.common.values.Value object>), (<ValueName.PIP_TIME: 2>, <pvp.common.values.Value object>)])¶
Control values that should also have a widget created in the GUI
Automatically generated as all
Value
objects inVALUES
wherecontrol == True
anddisplay == True
- pvp.common.values.PLOTS = OrderedDict([(<ValueName.PRESSURE: 10>, <pvp.common.values.Value object>), (<ValueName.FLOWOUT: 11>, <pvp.common.values.Value object>), (<ValueName.FIO2: 8>, <pvp.common.values.Value object>)])¶
Values that can be plotted
Automatically generated as all
Value
objects inVALUES
whereplot == True