5#include <QtCore/QTimer>
20 using Action = std::function<bool()>;
31 int retryDelayMsecs = 1000,
57 void _executeAction();
62 int _retryDelayMsecs = 1000;
65 int _currentAttempt = 0;
66 bool _wasSkipped =
false;
QString stateName() const
Full-featured base class for QGroundControl state machine states.
A state that retries an action and chooses behavior when retries are exhausted.
int currentAttempt() const
void succeeded()
Emitted when the action eventually succeeds.
int totalAttempts() const
std::function< bool()> Action
void skipped()
Emitted when retries are exhausted and behavior is EmitAdvance.
void onEnter() override
Override to perform actions on state entry.
void exhausted()
Emitted when all retries are exhausted (both behaviors).
@ EmitAdvance
Emit advance() after retries exhausted (skip/continue).
@ EmitError
Emit error() after retries exhausted.
ExhaustedBehavior exhaustedBehavior() const
void retrying(int attempt, int maxAttempts)
Emitted before each retry attempt.