QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VehicleHygrometerFactGroup.cc
Go to the documentation of this file.
2
3#include "MAVLinkLib.h"
4#include "Vehicle.h"
5
7 : FactGroup(1000, QStringLiteral(":/json/Vehicle/HygrometerFact.json"), parent)
8{
12
13 _hygroTempFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
14 _hygroHumiFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
15 _hygroIDFact.setRawValue(std::numeric_limits<unsigned int>::quiet_NaN());
16}
17
19{
20 Q_UNUSED(vehicle);
21
22 switch (message.msgid) {
23 case MAVLINK_MSG_ID_HYGROMETER_SENSOR:
25 break;
26 default:
27 break;
28 }
29}
30
32{
33 mavlink_hygrometer_sensor_t hygrometer{};
34 mavlink_msg_hygrometer_sensor_decode(&message, &hygrometer);
35
36 _hygroTempFact.setRawValue(hygrometer.temperature / 100.f);
37 _hygroHumiFact.setRawValue(hygrometer.humidity);
38 _hygroIDFact.setRawValue(hygrometer.id);
39
41}
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:135
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.