You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4bc16c3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(StateMachine): replace isRunning() with queued-start-aware inProgress()
QStateMachine::start() is queued, so isRunning() stays false until the
event loop processes the start. QGCStateMachine::active() returned
isRunning(), so Vehicle::isInitialConnectComplete(), which is !active(),
reported a newly created vehicle as complete before AUTOPILOT_VERSION had
been requested. On loaded macOS CI runners the 20 ms active-vehicle timer
can fire ahead of the queued start, so VehicleTest::waitForInitialConnect()
returned immediately and tests such as OnboardLogFtpDownloadTest failed on
capabilitiesKnown(). This regressed in #13981: the old StateMachine set its
active flag synchronously in start().
Having both active() and isRunning() with subtly different meanings is
what allowed the regression, so QGCStateMachine now has a single notion:
- inProgress() (property, inProgressChanged) is set in start() and cleared
at the top of the stopped/finished handlers, so later handlers already
see the machine as no longer in progress.
- active(), the running property and runningChanged are removed.
- isRunning() and setRunning() are deleted on QGCStateMachine, so using
them fails to compile.
- start() logs qCCritical and returns when already in progress or when
there is no initial state, rather than relying on Qt's refusal rules.
- Starting without QGCStateMachine::start(), e.g. through a QStateMachine*
or setRunning(), is logged with qCCritical.
Vehicle, ComponentInformationManager, SubMachineState and the
QGCStateMachine lifecycle helpers use inProgress().
ComponentInformationManager's first progress update no longer reports
100% while its start is queued. StateMachineTest::startAndWaitForFinished()
now starts QGCStateMachines through QGCStateMachine::start().
0 commit comments