![]() |
RumPi 1.0
A self-assembling C++ sensor & actuator library for the Raspberry Pi 5
|
A point-in-time copy of the SELECTED sensor readings the Home dashboard surfaces - a deliberately curated subset, not a generic per-sensor reading. More...
#include <SelectedSensorReadings.h>
Public Member Functions | |
| SelectedSensorReadings () | |
| Builds a SelectedSensorReadings with every numeric field defaulted to NaN ("no reading / sensor not present") and the level fields defaulted to their lowest category. More... | |
| virtual | ~SelectedSensorReadings ()=default |
| Defaulted destructor. More... | |
| float | GetTemperatureCelsius () const |
| Gets the temperature, in Celsius. More... | |
| float | GetHumidityPercent () const |
| Gets the relative humidity, as a percent. More... | |
| float | GetPmTwoPointFive () const |
| Gets the PM2.5 particulate reading. More... | |
| const std::string & | GetAirQuality () const |
| Gets the air-quality description. More... | |
| float | GetTVOC () const |
| Gets the total volatile organic compounds (TVOC) reading. More... | |
| float | GetFormaldehyde () const |
| Gets the formaldehyde reading. More... | |
| float | GetCO2 () const |
| Gets the CO2 reading. More... | |
| bool | GetIsMotionDetected () const |
| Gets whether motion was detected. More... | |
| float | GetWindSpeed () const |
| Gets the wind speed reading. More... | |
| float | GetLightLux () const |
| Gets the light level, in lux. More... | |
| const std::string & | GetLightCategory () const |
| Gets the human-readable light category. More... | |
| E_LightLevel | GetLightLevel () const |
| Gets the categorized light level. More... | |
| E_AirQualityLevel | GetAirQualityLevel () const |
| Gets the categorized air-quality level. More... | |
| void | SetTemperatureCelsius (const float temperatureCelsius) |
| Sets the temperature, in Celsius. More... | |
| void | SetHumidityPercent (const float humidityPercent) |
| Sets the relative humidity, as a percent. More... | |
| void | SetPmTwoPointFive (const float pmTwoPointFive) |
| Sets the PM2.5 particulate reading. More... | |
| void | SetAirQuality (const std::string &airQuality) |
| Sets the air-quality description. More... | |
| void | SetTVOC (const float tvoc) |
| Sets the total volatile organic compounds (TVOC) reading. More... | |
| void | SetFormaldehyde (const float formaldehyde) |
| Sets the formaldehyde reading. More... | |
| void | SetCO2 (const float co2) |
| Sets the CO2 reading. More... | |
| void | SetIsMotionDetected (const bool isMotionDetected) |
| Sets whether motion was detected. More... | |
| void | SetWindSpeed (const float windSpeed) |
| Sets the wind speed reading. More... | |
| void | SetLightLux (const float lightLux) |
| Sets the light level, in lux. More... | |
| void | SetLightCategory (const std::string &lightCategory) |
| Sets the human-readable light category. More... | |
| void | SetLightLevel (const E_LightLevel lightLevel) |
| Sets the categorized light level. More... | |
| void | SetAirQualityLevel (const E_AirQualityLevel airQualityLevel) |
| Sets the categorized air-quality level. More... | |
Protected Attributes | |
| float | myTemperatureCelsius |
| Temperature, in Celsius (NaN if not present). More... | |
| float | myHumidityPercent |
| Relative humidity, as a percent (NaN if not present). More... | |
| float | myPmTwoPointFive |
| PM2.5 particulate reading (NaN if not present). More... | |
| std::string | myAirQuality |
| Air-quality description (empty if not present). More... | |
| float | myTVOC |
| Total volatile organic compounds reading (NaN if not present). More... | |
| float | myFormaldehyde |
| Formaldehyde reading (NaN if not present). More... | |
| float | myCO2 |
| CO2 reading (NaN if not present). More... | |
| bool | myIsMotionDetected |
| True if motion was detected. More... | |
| float | myWindSpeed |
| Wind speed reading (NaN if not present). More... | |
| float | myLightLux |
| Light level, in lux (NaN if not present). More... | |
| std::string | myLightCategory |
| Human-readable light category (empty if not present). More... | |
| E_LightLevel | myLightLevel |
| Categorized light level. More... | |
| E_AirQualityLevel | myAirQualityLevel |
| Categorized air-quality level. More... | |
A point-in-time copy of the SELECTED sensor readings the Home dashboard surfaces - a deliberately curated subset, not a generic per-sensor reading.
ComponentManager::GetSelectedSensorReadings() fills this on the worker thread and hands it to the UI as an immutable value, so the UI never reads a live component. Numeric fields default to NaN to mean "no reading / sensor not present" (matching the sensor getters' own convention), so a dashboard tile can show a placeholder instead of a bogus value.
| RumPi::SelectedSensorReadings::SelectedSensorReadings | ( | ) |
Builds a SelectedSensorReadings with every numeric field defaulted to NaN ("no reading / sensor not present") and the level fields defaulted to their lowest category.
|
virtualdefault |
Defaulted destructor.
| const std::string & RumPi::SelectedSensorReadings::GetAirQuality | ( | ) | const |
Gets the air-quality description.
| E_AirQualityLevel RumPi::SelectedSensorReadings::GetAirQualityLevel | ( | ) | const |
Gets the categorized air-quality level.
| float RumPi::SelectedSensorReadings::GetCO2 | ( | ) | const |
Gets the CO2 reading.
| float RumPi::SelectedSensorReadings::GetFormaldehyde | ( | ) | const |
Gets the formaldehyde reading.
| float RumPi::SelectedSensorReadings::GetHumidityPercent | ( | ) | const |
Gets the relative humidity, as a percent.
| bool RumPi::SelectedSensorReadings::GetIsMotionDetected | ( | ) | const |
Gets whether motion was detected.
| const std::string & RumPi::SelectedSensorReadings::GetLightCategory | ( | ) | const |
Gets the human-readable light category.
| E_LightLevel RumPi::SelectedSensorReadings::GetLightLevel | ( | ) | const |
Gets the categorized light level.
| float RumPi::SelectedSensorReadings::GetLightLux | ( | ) | const |
Gets the light level, in lux.
| float RumPi::SelectedSensorReadings::GetPmTwoPointFive | ( | ) | const |
Gets the PM2.5 particulate reading.
| float RumPi::SelectedSensorReadings::GetTemperatureCelsius | ( | ) | const |
Gets the temperature, in Celsius.
| float RumPi::SelectedSensorReadings::GetTVOC | ( | ) | const |
Gets the total volatile organic compounds (TVOC) reading.
| float RumPi::SelectedSensorReadings::GetWindSpeed | ( | ) | const |
Gets the wind speed reading.
| void RumPi::SelectedSensorReadings::SetAirQuality | ( | const std::string & | airQuality | ) |
Sets the air-quality description.
| [in] | airQuality | The air-quality description to set. |
| void RumPi::SelectedSensorReadings::SetAirQualityLevel | ( | const E_AirQualityLevel | airQualityLevel | ) |
Sets the categorized air-quality level.
| [in] | airQualityLevel | The categorized air-quality level to set. |
| void RumPi::SelectedSensorReadings::SetCO2 | ( | const float | co2 | ) |
Sets the CO2 reading.
| [in] | co2 | The CO2 reading to set. |
| void RumPi::SelectedSensorReadings::SetFormaldehyde | ( | const float | formaldehyde | ) |
Sets the formaldehyde reading.
| [in] | formaldehyde | The formaldehyde reading to set. |
| void RumPi::SelectedSensorReadings::SetHumidityPercent | ( | const float | humidityPercent | ) |
Sets the relative humidity, as a percent.
| [in] | humidityPercent | The relative humidity to set, as a percent. |
| void RumPi::SelectedSensorReadings::SetIsMotionDetected | ( | const bool | isMotionDetected | ) |
Sets whether motion was detected.
| [in] | isMotionDetected | True if motion was detected. |
| void RumPi::SelectedSensorReadings::SetLightCategory | ( | const std::string & | lightCategory | ) |
Sets the human-readable light category.
| [in] | lightCategory | The light category to set. |
| void RumPi::SelectedSensorReadings::SetLightLevel | ( | const E_LightLevel | lightLevel | ) |
Sets the categorized light level.
| [in] | lightLevel | The categorized light level to set. |
| void RumPi::SelectedSensorReadings::SetLightLux | ( | const float | lightLux | ) |
Sets the light level, in lux.
| [in] | lightLux | The light level to set, in lux. |
| void RumPi::SelectedSensorReadings::SetPmTwoPointFive | ( | const float | pmTwoPointFive | ) |
Sets the PM2.5 particulate reading.
| [in] | pmTwoPointFive | The PM2.5 reading to set. |
| void RumPi::SelectedSensorReadings::SetTemperatureCelsius | ( | const float | temperatureCelsius | ) |
Sets the temperature, in Celsius.
| [in] | temperatureCelsius | The temperature to set, in Celsius. |
| void RumPi::SelectedSensorReadings::SetTVOC | ( | const float | tvoc | ) |
Sets the total volatile organic compounds (TVOC) reading.
| [in] | tvoc | The TVOC reading to set. |
| void RumPi::SelectedSensorReadings::SetWindSpeed | ( | const float | windSpeed | ) |
Sets the wind speed reading.
| [in] | windSpeed | The wind speed reading to set. |
|
protected |
Air-quality description (empty if not present).
|
protected |
Categorized air-quality level.
|
protected |
CO2 reading (NaN if not present).
|
protected |
Formaldehyde reading (NaN if not present).
|
protected |
Relative humidity, as a percent (NaN if not present).
|
protected |
True if motion was detected.
|
protected |
Human-readable light category (empty if not present).
|
protected |
Categorized light level.
|
protected |
Light level, in lux (NaN if not present).
|
protected |
PM2.5 particulate reading (NaN if not present).
|
protected |
Temperature, in Celsius (NaN if not present).
|
protected |
Total volatile organic compounds reading (NaN if not present).
|
protected |
Wind speed reading (NaN if not present).