|
QGroundControl
Ground Control Station for MAVLink Drones
|
Transition that fires automatically after a specified delay. More...
#include <TimeoutTransition.h>
Inheritance diagram for TimeoutTransition:
Collaboration diagram for TimeoutTransition:Signals | |
| void | timeout () |
| Emitted when the timeout expires (internal use - triggers transition) | |
Public Member Functions | |
| TimeoutTransition (int timeoutMsecs, QAbstractState *target=nullptr) | |
| void | attachToSourceState (QState *source) |
| int | timeoutMsecs () const |
| Get the timeout duration. | |
| void | setTimeoutMsecs (int msecs) |
| Set the timeout duration (only effective before state is entered) | |
| bool | isTimerActive () const |
| Check if the timer is currently running. | |
Public Member Functions inherited from QGCSignalTransition | |
| QGCSignalTransition (QState *sourceState=nullptr) | |
| QGCSignalTransition (const QObject *sender, const char *signal, QState *sourceState=nullptr) | |
| template<typename Func > | |
| QGCSignalTransition (const typename QtPrivate::FunctionPointer< Func >::Object *sender, Func signalFn, QState *sourceState=nullptr) | |
| QGCStateMachine * | machine () const |
| Get the QGCStateMachine this transition belongs to. | |
| Vehicle * | vehicle () const |
| Get the Vehicle associated with the state machine. | |
Protected Member Functions | |
| bool | event (QEvent *e) override |
| void | onTransition (QEvent *event) override |
Transition that fires automatically after a specified delay.
Useful for adding timeout behavior to any state without requiring WaitStateBase.
The timer starts when the source state is entered and stops when exited. If the timer expires while in the source state, the transition is taken.
Example usage:
Definition at line 20 of file TimeoutTransition.h.
|
explicit |
Create a timeout transition
| timeoutMsecs | Time in milliseconds before transition fires |
| target | Target state to transition to on timeout |
Definition at line 6 of file TimeoutTransition.cc.
References timeout().
| void TimeoutTransition::attachToSourceState | ( | QState * | source | ) |
Bind timeout start/stop hooks to a source state. Safe to call multiple times.
Definition at line 23 of file TimeoutTransition.cc.
|
overrideprotected |
Definition at line 49 of file TimeoutTransition.cc.
Referenced by onTransition().
|
inline |
Check if the timer is currently running.
Definition at line 42 of file TimeoutTransition.h.
|
overrideprotected |
Definition at line 63 of file TimeoutTransition.cc.
References event().
|
inline |
Set the timeout duration (only effective before state is entered)
Definition at line 39 of file TimeoutTransition.h.
|
signal |
Emitted when the timeout expires (internal use - triggers transition)
Referenced by TimeoutTransition().
|
inline |
Get the timeout duration.
Definition at line 36 of file TimeoutTransition.h.