decades
frog.hardware.plugins.sensors.decades
¤
This module provides an interface to the DECADES API.
This is used to query the DECADES server for aircraft sensor data.
Attributes¤
Classes¤
Decades(host=DECADES_HOST, poll_interval=DECADES_POLL_INTERVAL, params=','.join(DEFAULT_DECADES_PARAMETERS), timeout=DEFAULT_HTTP_TIMEOUT)
¤
Bases: HTTPDevice
, SensorsBase
A class for monitoring a DECADES sensor server.
Create a new Decades instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host
|
str
|
The IP address or hostname of the DECADES server |
DECADES_HOST
|
poll_interval
|
float
|
How often to poll the sensors (seconds) |
DECADES_POLL_INTERVAL
|
params
|
str
|
Comma-separated list of parameters to request from the DECADES server (leave empty for all) |
join(DEFAULT_DECADES_PARAMETERS)
|
timeout
|
float
|
The maximum time in seconds to wait for a response from the server |
DEFAULT_HTTP_TIMEOUT
|
Source code in frog/hardware/plugins/sensors/decades.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
Functions¤
handle_response(response)
¤
Process received sensor readings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response
|
str
|
The response from the server |
required |
Source code in frog/hardware/plugins/sensors/decades.py
171 172 173 174 175 176 177 178 179 |
|
obtain_parameter_list(params)
¤
Request the parameter list from the DECADES server and wait for response.
Source code in frog/hardware/plugins/sensors/decades.py
132 133 134 135 136 137 |
|
request_readings()
¤
Request the sensor data from the DECADES server.
The HTTP request is made on a background thread.
Source code in frog/hardware/plugins/sensors/decades.py
139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
DecadesError
¤
Bases: Exception
Indicates that an error occurred while querying the DECADES server.
DecadesParameter(name, readable_name, unit)
dataclass
¤
Represents a parameter returned from the DECADES server.
Attributes¤
name
instance-attribute
¤
Short name for the parameter.
readable_name
instance-attribute
¤
Human-readable name.
unit
instance-attribute
¤
Unit for the value.
Functions¤
from_dict(d)
classmethod
¤
Create a DecadesParameter from a dict.
Source code in frog/hardware/plugins/sensors/decades.py
82 83 84 85 |
|
get_sensor_reading(value)
¤
Get a SensorReading object with specified value for this parameter.
Source code in frog/hardware/plugins/sensors/decades.py
78 79 80 |
|