QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RequestMetaDataTypeStateMachine Class Reference

#include <RequestMetaDataTypeStateMachine.h>

+ Inheritance diagram for RequestMetaDataTypeStateMachine:
+ Collaboration diagram for RequestMetaDataTypeStateMachine:

Signals

void requestComplete ()
 
- Signals inherited from QGCStateMachine
void error ()
 
void progressUpdate (float progress)
 
void machineEvent (const QString &eventName)
 
void currentStateNameChanged ()
 Emitted when the current state changes (for QML binding)
 
void runningChanged ()
 Emitted when the running state changes (for QML binding)
 
void stateHistoryChanged ()
 Emitted when the state history changes (for QML binding)
 

Public Member Functions

 RequestMetaDataTypeStateMachine (ComponentInformationManager *compMgr, QObject *parent=nullptr)
 
 ~RequestMetaDataTypeStateMachine () override
 
void request (CompInfo *compInfo)
 
QString typeToString () const
 
CompInfocompInfo () const
 
ComponentInformationManagercompMgr () const
 
- Public Member Functions inherited from QGCStateMachine
 QGCStateMachine (const QString &machineName, Vehicle *vehicle, QObject *parent=nullptr)
 
Vehiclevehicle () const
 
QString machineName () const
 
StateContextcontext ()
 
const StateContextcontext () const
 
bool active () const
 
QString currentStateName () const
 
QStringList stateHistory () const
 
void setStateHistoryLimit (int limit)
 Set the maximum number of state history entries to keep.
 
void setOnEntry (EntryCallback callback)
 Set a callback to be invoked when the machine starts.
 
void setOnExit (ExitCallback callback)
 Set a callback to be invoked when the machine stops.
 
void setCallbacks (EntryCallback onEntry, ExitCallback onExit=nullptr)
 Set both entry and exit callbacks.
 
void setEventHandler (EventHandler handler)
 
void enablePropertyRestore ()
 
bool isPropertyRestoreEnabled () const
 Check if property restoration is enabled.
 
void setGlobalErrorState (QAbstractState *errorState)
 
QAbstractState * globalErrorState () const
 Get the global error state.
 
void registerState (QGCState *state)
 
void registerState (QGCAbstractState *state)
 
FunctionStateaddFunctionState (const QString &stateName, std::function< void()> function)
 
AsyncFunctionStateaddAsyncFunctionState (const QString &stateName, AsyncFunctionState::SetupFunction setupFunction, int timeoutMsecs=0)
 
QGCStateaddErrorRecoveryState (const QString &stateName, ErrorRecoveryBuilder::Action action, int maxRetries=0, int retryDelayMsecs=1000, ErrorRecoveryBuilder::ExhaustedBehavior exhaustedBehavior=ErrorRecoveryBuilder::EmitError, ErrorRecoveryBuilder::Action fallback=nullptr, ErrorRecoveryBuilder::VoidAction rollback=nullptr, int timeoutMsecs=0)
 
DelayStateaddDelayState (int delayMsecs)
 
ParallelStateaddParallelState (const QString &stateName)
 
void postEvent (const QString &eventName, const QVariant &data=QVariant(), EventPriority priority=NormalPriority)
 
int postDelayedEvent (const QString &eventName, int delayMsecs, const QVariant &data=QVariant())
 
bool cancelDelayedEvent (int eventId)
 
void setInitialState (QAbstractState *state, bool autoStart=false)
 
QGCFinalStateaddFinalState (const QString &stateName=QString())
 
ConditionalStateaddConditionalState (const QString &stateName, ConditionalState::Predicate predicate, ConditionalState::Action action=nullptr)
 
template<typename Func >
WaitForSignalStateaddWaitForSignalState (const QString &stateName, const QObject *sender, Func signal, int timeoutMsecs=0)
 
SubMachineStateaddSubMachineState (const QString &stateName, SubMachineState::MachineFactory factory)
 
EventQueuedStateaddEventQueuedState (const QString &stateName, const QString &eventName, int timeoutMsecs=0)
 
QState * createTimedActionState (const QString &stateName, int durationMsecs, std::function< void()> onEntry=nullptr, std::function< void()> onExit=nullptr)
 
bool isStateActive (QAbstractState *state) const
 
QSet< QAbstractState * > activeStates () const
 
QAbstractState * findState (const QString &stateName) const
 
template<typename T >
QList< T * > findStates () const
 Find all states of a specific type.
 
bool isInErrorState () const
 Check if the machine is in an error state.
 
FunctionStateaddLogAndContinueErrorState (const QString &stateName, QAbstractState *nextState, const QString &message=QString())
 Create a logging error handler state that advances to nextState.
 
FunctionStateaddLogAndStopErrorState (const QString &stateName, const QString &message=QString())
 Create a logging error handler state that stops the machine.
 
QString lastError () const
 Get the last error message (from Qt's internal error handling)
 
void clearError (bool restart=false)
 
bool resetToState (QAbstractState *state)
 
bool recoverFromError ()
 
void setRecoveryState (QAbstractState *state)
 
QAbstractState * recoveryState () const
 Get the recovery state.
 
bool attemptRecovery ()
 
void ensureRunning ()
 Start the machine if not already running.
 
void stopMachine (bool deleteOnStop=true)
 
void restart ()
 Restart the machine (stop then start)
 
template<typename Func >
QSignalTransition * addTransition (QState *from, Func signal, QAbstractState *to, QAbstractAnimation *animation=nullptr)
 
template<typename Func >
GuardedTransitionaddGuardedTransition (QState *from, Func signal, QAbstractState *to, GuardedTransition::Guard guard, QAbstractAnimation *animation=nullptr)
 
MachineEventTransitionaddEventTransition (QState *from, const QString &eventName, QAbstractState *to, QAbstractAnimation *animation=nullptr)
 
TimeoutTransitionaddTimeoutTransition (QState *from, int timeoutMsecs, QAbstractState *to, QAbstractAnimation *animation=nullptr)
 
template<typename SenderType , typename Func >
RetryTransitionaddRetryTransition (SenderType *from, Func signal, QAbstractState *to, std::function< void()> retryAction, int maxRetries=1)
 
template<typename SenderType , typename Func >
GuardedTransitionaddConditionalTransition (SenderType *from, Func signal, QAbstractState *to, std::function< bool()> guard)
 
template<typename Sender , typename Signal >
QSignalTransition * addSelfLoopTransition (QState *state, Sender *sender, Signal signal, std::function< void()> action)
 
template<typename Sender , typename Signal >
InternalTransitionaddInternalTransition (QState *state, Sender *sender, Signal signal, std::function< void()> action)
 
QList< QAbstractTransition * > transitionsFrom (QAbstractState *state) const
 
QList< QAbstractTransition * > transitionsTo (QAbstractState *state) const
 
QList< QAbstractState * > reachableFrom (QAbstractState *state) const
 
QList< QAbstractState * > predecessorsOf (QAbstractState *state) const
 
QString dumpCurrentState () const
 
QString dumpConfiguration () const
 
void logCurrentState () const
 Log the current state to debug output.
 
void logConfiguration () const
 Log the full configuration to debug output.
 
void setHistoryRecordingEnabled (bool enabled, int maxEntries=1000)
 Enable/disable structured transition history recording.
 
bool historyRecordingEnabled () const
 
QString dumpRecordedHistory () const
 
QJsonArray recordedHistoryJson () const
 
void setProfilingEnabled (bool enabled)
 Enable/disable state timing profiler.
 
bool profilingEnabled () const
 
QString profilingSummary () const
 
void setStructuredLoggingEnabled (bool enabled)
 Enable/disable structured state-machine logger.
 
bool structuredLoggingEnabled () const
 
QString exportAsDot () const
 
QList< QAbstractState * > unreachableStates () const
 
int maxPathLength () const
 
QList< QAbstractState * > deadEndStates () const
 
void setProgressWeights (const QList< QPair< QAbstractState *, int > > &stateWeights)
 
void setSubProgress (float subProgress)
 
float progress () const
 Get the current overall progress (0.0 to 1.0)
 
void resetProgress ()
 Reset progress tracking (call when restarting the machine)
 
void setTimeoutOverride (const QString &stateName, int timeoutMsecs)
 
void removeTimeoutOverride (const QString &stateName)
 
int timeoutOverride (const QString &stateName) const
 Get the timeout override for a state, or -1 if not set.
 
QHash< QString, int > allTimeoutOverrides () const
 Get all timeout overrides.
 
void clearTimeoutOverrides ()
 Clear all timeout overrides.
 
QHash< QString, int > timeoutStats () const
 Get timeout statistics (how often each state timed out)
 
void recordTimeout (const QString &stateName)
 Record a timeout for statistics.
 
void clearTimeoutStats ()
 Clear timeout statistics.
 

Additional Inherited Members

- Public Types inherited from QGCStateMachine
using EntryCallback = std::function< void()>
 Name of the currently active state (for QML binding)
 
using ExitCallback = std::function< void()>
 
using EventHandler = std::function< bool(QEvent *)>
 
- Public Slots inherited from QGCStateMachine
void start ()
 Start the state machine with debug logging.
 
- Protected Member Functions inherited from QGCStateMachine
virtual void onEnter ()
 Override to perform actions when machine starts.
 
virtual void onLeave ()
 Override to perform actions when machine stops.
 
void onEntry (QEvent *event) override
 
void onExit (QEvent *event) override
 
bool event (QEvent *event) override
 

Detailed Description

Definition at line 17 of file RequestMetaDataTypeStateMachine.h.

Constructor & Destructor Documentation

◆ RequestMetaDataTypeStateMachine()

RequestMetaDataTypeStateMachine::RequestMetaDataTypeStateMachine ( ComponentInformationManager compMgr,
QObject *  parent = nullptr 
)
explicit

Definition at line 22 of file RequestMetaDataTypeStateMachine.cc.

◆ ~RequestMetaDataTypeStateMachine()

RequestMetaDataTypeStateMachine::~RequestMetaDataTypeStateMachine ( )
override

Definition at line 33 of file RequestMetaDataTypeStateMachine.cc.

Member Function Documentation

◆ compInfo()

CompInfo * RequestMetaDataTypeStateMachine::compInfo ( ) const
inline

Definition at line 27 of file RequestMetaDataTypeStateMachine.h.

Referenced by request().

◆ compMgr()

ComponentInformationManager * RequestMetaDataTypeStateMachine::compMgr ( ) const
inline

Definition at line 28 of file RequestMetaDataTypeStateMachine.h.

◆ request()

void RequestMetaDataTypeStateMachine::request ( CompInfo compInfo)

◆ requestComplete

void RequestMetaDataTypeStateMachine::requestComplete ( )
signal

◆ typeToString()

QString RequestMetaDataTypeStateMachine::typeToString ( ) const

Definition at line 186 of file RequestMetaDataTypeStateMachine.cc.

References CompInfo::type.

Referenced by request().


The documentation for this class was generated from the following files: