23#include "GlobalObject.h"
24#include "units/Distance.h"
25#include "units/Pressure.h"
26#include "units/Temperature.h"
30#if defined(Q_OS_ANDROID) or defined(Q_OS_IOS)
31#include <QAmbientTemperatureSensor>
32#include <QPressureSensor>
57 explicit Sensors(QObject* parent =
nullptr);
69 static Sensors* create(QQmlEngine* , QJSEngine* )
145 [[nodiscard]] QString
statusString()
const {
return m_statusString.value(); }
155 void updateSensorReadings();
158 void updateStatusString();
163#if defined(Q_OS_ANDROID) or defined(Q_OS_IOS)
165 QAmbientTemperatureSensor m_temperatureSensor;
168 QPressureSensor m_pressureSensor;
171 QProperty<Units::Pressure> m_ambientPressure;
172 QProperty<Units::Distance> m_pressureAltitude;
173 QProperty<Units::Temperature> m_ambientTemperature;
174 QProperty<QString> m_statusString;
static Q_INVOKABLE Sensors * sensors()
Pointer to appplication-wide static Navigation::Clock instance.
GlobalObject(QObject *parent=nullptr)
Standard constructor.
void deferredInitialization() override
Non-constructor initialization.
QBindable< QString > bindableStatusString()
Getter function for the property with the same name.
QString statusString() const
Getter function for the property with the same name.
QBindable< Units::Temperature > bindableAmbientTemperature()
Getter function for the property with the same name.
QBindable< Units::Distance > bindablePressureAltitude()
Getter function for the property with the same name.
QBindable< Units::Pressure > bindableAmbientPressure()
Getter function for the property with the same name.
~Sensors() override=default
Standard destructor.
Units::Temperature ambientTemperature
Ambient temperature.
Units::Pressure ambientPressure
Ambient pressure.
Units::Temperature ambientTemperature() const
Getter function for the property with the same name.
QString statusString
Status string.
Units::Distance pressureAltitude() const
Getter function for the property with the same name.
Sensors(QObject *parent=nullptr)
Standard constructor.
Units::Distance pressureAltitude
Pressure altitude.
Convenience class for distance computations.
Convenience class for pressure computations.
Convenience class for temperature computations.
Conversion between units used in aviation.