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
4VehicleHygrometerFactGroup::VehicleHygrometerFactGroup(QObject *parent)
5 : FactGroup(1000, QStringLiteral(":/json/Vehicle/HygrometerFact.json"), parent)
6{
7 _addFact(&_hygroTempFact);
8 _addFact(&_hygroHumiFact);
9 _addFact(&_hygroIDFact);
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
16void VehicleHygrometerFactGroup::handleMessage(Vehicle *vehicle, const mavlink_message_t &message)
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:19
void _setTelemetryAvailable(bool telemetryAvailable)
Definition FactGroup.cc:172
void _handleHygrometerSensor(const mavlink_message_t &message)