QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VehicleHygrometerFactGroup.cc
Go to the documentation of this file.
2#include "Vehicle.h"
3
5 : FactGroup(1000, QStringLiteral(":/json/Vehicle/HygrometerFact.json"), parent)
6{
10
11 _hygroTempFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
12 _hygroHumiFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
13 _hygroIDFact.setRawValue(std::numeric_limits<unsigned int>::quiet_NaN());
14}
15
17{
18 Q_UNUSED(vehicle);
19
20 switch (message.msgid) {
21 case MAVLINK_MSG_ID_HYGROMETER_SENSOR:
23 break;
24 default:
25 break;
26 }
27}
28
30{
31 mavlink_hygrometer_sensor_t hygrometer{};
32 mavlink_msg_hygrometer_sensor_decode(&message, &hygrometer);
33
34 _hygroTempFact.setRawValue(hygrometer.temperature / 100.f);
35 _hygroHumiFact.setRawValue(hygrometer.humidity);
36 _hygroIDFact.setRawValue(hygrometer.id);
37
39}
struct __mavlink_message mavlink_message_t
Used to group Facts together into an object hierarachy.
Definition FactGroup.h:16
void _setTelemetryAvailable(bool telemetryAvailable)
Definition FactGroup.cc:175
void _addFact(Fact *fact, const QString &name)
Definition FactGroup.cc:116
void setRawValue(const QVariant &value)
Definition Fact.cc:128
void _handleHygrometerSensor(const mavlink_message_t &message)
VehicleHygrometerFactGroup(QObject *parent=nullptr)
void handleMessage(Vehicle *vehicle, const mavlink_message_t &message) final
Allows a FactGroup to parse incoming messages and fill in values.