QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCState.h
Go to the documentation of this file.
1#pragma once
2
3#include "QGCAbstractState.h"
4
5#include <QtCore/QLoggingCategory>
6
7Q_DECLARE_LOGGING_CATEGORY(QGCStateMachineLog)
8
10class Vehicle;
11
22{
23 Q_OBJECT
24 Q_DISABLE_COPY(QGCState)
25
26public:
27 QGCState(const QString& stateName, QState* parentState);
28
30 template <typename PointerToMemberFunction> QSignalTransition *addThisTransition(PointerToMemberFunction signal, QAbstractState *target)
31 { return QState::addTransition(this, signal, target); };
32
33 // -------------------------------------------------------------------------
34 // Error Handling
35 // -------------------------------------------------------------------------
36
39 void setLocalErrorState(QAbstractState* errorState);
40
42 QAbstractState* localErrorState() const { return _localErrorState; }
43
44 // -------------------------------------------------------------------------
45 // Property Assignment
46 // -------------------------------------------------------------------------
47
53 void setProperty(QObject* object, const char* name, const QVariant& value);
54
56 void setEnabled(QObject* object, bool enabled);
57
59 void setVisible(QObject* object, bool visible);
60
61private:
62 QAbstractState* _localErrorState = nullptr;
63};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
QString stateName() const
QGroundControl specific state machine with enhanced error handling.
QAbstractState * localErrorState() const
Get the per-state error state (nullptr if using global)
Definition QGCState.h:42
void setEnabled(QObject *object, bool enabled)
Convenience overload for setting enabled state on widgets/controls.
Definition QGCState.cc:25
void setVisible(QObject *object, bool visible)
Convenience overload for setting visible state on widgets/controls.
Definition QGCState.cc:30
QSignalTransition * addThisTransition(PointerToMemberFunction signal, QAbstractState *target)
Simpler version of QState::addTransition which assumes the sender is this.
Definition QGCState.h:30
void setProperty(QObject *object, const char *name, const QVariant &value)
Definition QGCState.cc:20
void setLocalErrorState(QAbstractState *errorState)
Definition QGCState.cc:11