vent.common package

Submodules

vent.common.message module

Classes

Alarm(alarm_name, is_active, severity, …)

param alarm_name

AlarmSeverity(value)

An enumeration.

ControlSetting(name, value, min_value, …)

TODO: if enum is hard to use, we may just use a predefined set, e.g.

Error(errnum, err_str, timestamp)

SensorValueNew(name, value, timestamp, …)

SensorValues([timestamp, loop_counter])

param **kwargs

sensor readings, must be in vent.values.SENSOR.keys

class vent.common.message.SensorValueNew(name, value, timestamp, loop_counter)[source]

Bases: object

class vent.common.message.SensorValues(timestamp=None, loop_counter=None, **kwargs)[source]

Bases: object

Parameters

**kwargs – sensor readings, must be in vent.values.SENSOR.keys

Methods

__init__([timestamp, loop_counter])

param **kwargs

sensor readings, must be in vent.values.SENSOR.keys

to_dict()

__init__(timestamp=None, loop_counter=None, **kwargs)[source]
Parameters

**kwargs – sensor readings, must be in vent.values.SENSOR.keys

to_dict()[source]
class vent.common.message.ControlSetting(name, value, min_value, max_value, timestamp)[source]

Bases: object

TODO: if enum is hard to use, we may just use a predefined set, e.g. {‘PIP’, ‘PEEP’, …} :param name: enum belong to ValueName :param value: :param min_value: :param max_value: :param timestamp:

Methods

__init__(name, value, min_value, max_value, …)

TODO: if enum is hard to use, we may just use a predefined set, e.g.

__init__(name, value, min_value, max_value, timestamp)[source]

TODO: if enum is hard to use, we may just use a predefined set, e.g. {‘PIP’, ‘PEEP’, …} :param name: enum belong to ValueName :param value: :param min_value: :param max_value: :param timestamp:

class vent.common.message.AlarmSeverity(value)[source]

Bases: enum.Enum

An enumeration.

Attributes

RED

int([x]) -> integer

ORANGE

int([x]) -> integer

YELLOW

int([x]) -> integer

OFF

int([x]) -> integer

RED = 3
ORANGE = 2
YELLOW = 1
OFF = 0
class vent.common.message.Alarm(alarm_name, is_active, severity, alarm_start_time, alarm_end_time, value=None, message=None)[source]

Bases: object

Parameters
  • alarm_name

  • is_active

  • severity

  • alarm_start_time

  • alarm_end_time

  • value (int, float) – optional - numerical value that generated the alarm

  • message (str) – optional - override default text generated by AlarmManager

Methods

__init__(alarm_name, is_active, severity, …)

param alarm_name

Attributes

id_counter

itertools.count: used to generate unique IDs for each alarm

id_counter = count(0)

used to generate unique IDs for each alarm

Type

itertools.count

__init__(alarm_name, is_active, severity, alarm_start_time, alarm_end_time, value=None, message=None)[source]
Parameters
  • alarm_name

  • is_active

  • severity

  • alarm_start_time

  • alarm_end_time

  • value (int, float) – optional - numerical value that generated the alarm

  • message (str) – optional - override default text generated by AlarmManager

class vent.common.message.Error(errnum, err_str, timestamp)[source]

Bases: object

Module contents