QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
EventHandler.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QString>
5
6#include <cstdint>
7#include <functional>
8#include <memory>
9
10#include "QGCMAVLinkTypes.h"
11
12namespace events {
13class HealthAndArmingChecks;
14namespace parser {
15class ParsedEvent;
16} // namespace parser
17} // namespace events
18
21class EventHandler : public QObject
22{
23 Q_OBJECT
24
25public:
27 std::function<void(const mavlink_request_event_t& msg, uint32_t targetSystemId)>;
28 using handle_event_f = std::function<void(std::unique_ptr<events::parser::ParsedEvent>)>;
29
30 EventHandler(QObject* parent, const QString& profile, handle_event_f handleEventCB,
31 send_request_event_message_f sendRequestCB, quint32 ourSystemId, uint8_t ourComponentId,
32 quint32 systemId, uint8_t componentId);
33 ~EventHandler() override;
34
35 void handleEvents(const mavlink_message_t &message);
36 void setMetadata(const QString &metadataJsonFileName);
37
38 const events::HealthAndArmingChecks *healthAndArmingChecks() const;
40
41 int getModeGroup(int32_t customMode) const;
43
44signals:
46
47private:
48 struct Impl;
49 std::unique_ptr<Impl> _impl;
50};
struct __mavlink_message mavlink_message_t
struct __mavlink_request_event_t mavlink_request_event_t
EventHandler(QObject *parent, const QString &profile, handle_event_f handleEventCB, send_request_event_message_f sendRequestCB, quint32 ourSystemId, uint8_t ourComponentId, quint32 systemId, uint8_t componentId)
void handleEvents(const mavlink_message_t &message)
void healthAndArmingChecksUpdated()
void setMetadata(const QString &metadataJsonFileName)
const events::HealthAndArmingChecks * healthAndArmingChecks() const
std::function< void(const mavlink_request_event_t &msg, uint32_t targetSystemId)> send_request_event_message_f
std::function< void(std::unique_ptr< events::parser::ParsedEvent >)> handle_event_f
int getModeGroup(int32_t customMode) const
bool healthAndArmingChecksSupported() const
bool healthAndArmingCheckResultsValid() const
~EventHandler() override