|
QGroundControl
Ground Control Station for MAVLink Drones
|
Functions | |
| FunctionState * | logAndContinue (QGCStateMachine *machine, const QString &stateName, QAbstractState *nextState, const QString &message) |
| FunctionState * | logAndStop (QGCStateMachine *machine, const QString &stateName, const QString &message) |
| std::function< int(int)> | exponentialBackoff (int initialDelayMsecs, double multiplier, int maxDelayMsecs) |
| std::function< int(int)> | linearBackoff (int initialDelayMsecs, int incrementMsecs, int maxDelayMsecs) |
| std::function< int(int)> | constantDelay (int delayMsecs) |
| std::function< int(int)> | jitteredExponentialBackoff (int initialDelayMsecs, double multiplier, int maxDelayMsecs, double jitterFraction) |
Pre-built error handling utilities.
Provides common error handling patterns as ready-to-use functions and states.
Example usage:
| std::function< int(int)> ErrorHandlers::constantDelay | ( | int | delayMsecs | ) |
Create a constant delay calculator (same delay for all attempts)
| delayMsecs | Constant delay in milliseconds |
Definition at line 67 of file ErrorHandlers.cc.
| std::function< int(int)> ErrorHandlers::exponentialBackoff | ( | int | initialDelayMsecs, |
| double | multiplier = 2.0, |
||
| int | maxDelayMsecs = 60000 |
||
| ) |
Create an exponential backoff delay calculator
| initialDelayMsecs | Initial delay in milliseconds |
| multiplier | Multiplier for each subsequent attempt (default 2.0) |
| maxDelayMsecs | Maximum delay cap |
Definition at line 44 of file ErrorHandlers.cc.
| std::function< int(int)> ErrorHandlers::jitteredExponentialBackoff | ( | int | initialDelayMsecs, |
| double | multiplier = 2.0, |
||
| int | maxDelayMsecs = 60000, |
||
| double | jitterFraction = 0.25 |
||
| ) |
Create a jittered exponential backoff (adds randomness to prevent thundering herd)
| initialDelayMsecs | Initial delay in milliseconds |
| multiplier | Multiplier for each subsequent attempt |
| maxDelayMsecs | Maximum delay cap |
| jitterFraction | Fraction of delay to add as random jitter (0.0-1.0) |
Definition at line 74 of file ErrorHandlers.cc.
| std::function< int(int)> ErrorHandlers::linearBackoff | ( | int | initialDelayMsecs, |
| int | incrementMsecs, | ||
| int | maxDelayMsecs = 60000 |
||
| ) |
Create a linear backoff delay calculator
| initialDelayMsecs | Initial delay in milliseconds |
| incrementMsecs | Amount to add for each subsequent attempt |
| maxDelayMsecs | Maximum delay cap |
Definition at line 57 of file ErrorHandlers.cc.
| FunctionState * ErrorHandlers::logAndContinue | ( | QGCStateMachine * | machine, |
| const QString & | stateName, | ||
| QAbstractState * | nextState, | ||
| const QString & | message = QString() |
||
| ) |
Create a state that logs the error and transitions to the next state
| machine | Parent state machine |
| stateName | Name for the error logging state |
| nextState | State to transition to after logging |
| message | Optional custom message to log |
Definition at line 10 of file ErrorHandlers.cc.
References QGCAbstractState::advance().
| FunctionState * ErrorHandlers::logAndStop | ( | QGCStateMachine * | machine, |
| const QString & | stateName, | ||
| const QString & | message = QString() |
||
| ) |
Create a state that logs the error and stops the machine
| machine | Parent state machine |
| stateName | Name for the error state |
| message | Optional custom message to log |
Definition at line 28 of file ErrorHandlers.cc.