QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
DelayState.cc
Go to the documentation of this file.
1#include "DelayState.h"
2
3DelayState::DelayState(QState* parentState, int delayMsecs)
4 : QGCState("DelayState", parentState)
5{
6 _delayTimer.setSingleShot(true);
7 _delayTimer.setInterval(delayMsecs);
8
9 connect(&_delayTimer, &QTimer::timeout, this, &DelayState::delayComplete);
10 connect(&_delayTimer, &QTimer::timeout, this, &DelayState::advance);
11
12 connect(this, &QState::entered, this, [this, delayMsecs] ()
13 {
14 qCDebug(QGCStateMachineLog) << stateName() << QStringLiteral("Starting delay for %1 secs").arg(delayMsecs / 1000.0) << " - " << Q_FUNC_INFO;
15 _delayTimer.start();
16 });
17
18 connect(this, &QGCState::exited, this, [this] ()
19 {
20 _delayTimer.stop();
21 });
22}
DelayState(QState *parentState, int delayMsecs)
Definition DelayState.cc:3
void delayComplete()
QString stateName() const