QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NamedEventTransition.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <QtCore/QString>
7#include <functional>
8
15{
16 Q_OBJECT
17 Q_DISABLE_COPY(NamedEventTransition)
18
19public:
20 using NamedGuard = std::function<bool(const QGCStateMachineEvent*)>;
21
26 NamedEventTransition(const QString& eventName, QAbstractState* target, QState* sourceState = nullptr);
27
33 NamedEventTransition(const QString& eventName, QAbstractState* target, NamedGuard guard, QState* sourceState = nullptr);
34
35 QString eventName() const { return _eventName; }
36
37protected:
38 bool eventTest(QEvent* event) override;
39
40private:
41 QString _eventName;
42 NamedGuard _namedGuard;
43};
Transition that fires when a named QGCStateMachineEvent is posted to the state machine.
std::function< bool(const QGCStateMachineEvent *)> NamedGuard
bool eventTest(QEvent *event) override
Base class for custom transitions that need access to QGCStateMachine and Vehicle.
Custom event for QGCStateMachine delayed/scheduled events.