QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SubMachineState.h
Go to the documentation of this file.
1#pragma once
2
3#include "QGCState.h"
4
5#include <functional>
6
8
15{
16 Q_OBJECT
17 Q_DISABLE_COPY(SubMachineState)
18
19public:
23 using MachineFactory = std::function<QGCStateMachine*(SubMachineState* parent)>;
24
29 SubMachineState(const QString& stateName, QState* parent, MachineFactory factory);
30
32 QGCStateMachine* childMachine() const { return _childMachine; }
33
34signals:
36 void childError();
37
38protected:
39 void onEntry(QEvent* event) override;
40 void onExit(QEvent* event) override;
41
42private slots:
43 void _onChildFinished();
44 void _onChildError();
45
46private:
47 MachineFactory _factory;
48 QGCStateMachine* _childMachine = nullptr;
49};
QString stateName() const
bool event(QEvent *event) override
QGroundControl specific state machine with enhanced error handling.
Full-featured base class for QGroundControl state machine states.
Definition QGCState.h:23
State that invokes a child state machine.
void childError()
Emitted when the child machine encounters an error.
void onEntry(QEvent *event) override
void onExit(QEvent *event) override
QGCStateMachine * childMachine() const
Get the currently running child machine (nullptr if not running)
std::function< QGCStateMachine *(SubMachineState *parent)> MachineFactory