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:

ValueName(value)

Canonical names of all values used in PVP.

Value(name, units, abs_range, safe_range, ...)

Class to parameterize how a value is used in PVP.

Data:

VALUES

Declaration of all values used by PVP

SENSOR

Sensor values

CONTROL

Values to control but not monitor.

DISPLAY_MONITOR

Those sensor values that should also have a widget created in the GUI

DISPLAY_CONTROL

Control values that should also have a widget created in the GUI

PLOTS

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

PIP_TIME

PEEP

PEEP_TIME

BREATHS_PER_MINUTE

INSPIRATION_TIME_SEC

IE_RATIO

FIO2

VTE

PRESSURE

FLOWOUT

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: typing.Union[None, typing.Tuple[pvp.common.values.ValueName]] = None, control_type: typing.Union[None, str] = None, group: typing.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:

name

Human readable name of value

abs_range

tuple of ints or floats setting the logical limit of the value, eg.

safe_range

tuple of ints or floats setting the safe ranges of the value,

decimals

The number of decimals of precision used when displaying the value

default

Default value, if any.

control

Whether or not the value is used to control ventilation

sensor

Whether or not the value is a measured sensor value

display

Whether the value should be created as a gui.widgets.Display widget.

control_type

If a control sets whether the control should use a slider or be set by recording recent sensor values.

group

Unused currently, but to be used to create subgroups of control & display widgets

plot

whether or not the value is plottable in the center plot window

plot_limits

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: typing.Union[None, typing.Tuple[pvp.common.values.ValueName]] = None, control_type: typing.Union[None, str] = None, group: typing.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 name: str

Human readable name of value

Returns

str

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 control: bool

Whether or not the value is used to control ventilation

Returns

bool

property sensor: bool

Whether or not the value is a measured sensor value

Returns

bool

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]

to_dict() dict[source]

Gather up all attributes and return as a dict!

Returns

dict

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 in VALUES where sensor == 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 in VALUES where control == 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 in VALUES where sensor == True and display == 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 in VALUES where control == True and display == 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 in VALUES where plot == True