#include <FailureInjection.h>
Signals | |
| void | activityChanged (void) |
Public Member Functions | |
| FailureInjection (QObject *parent=nullptr) | |
| < newest first: [{ time, unitName, typeName, instance, result }] | |
| QVariantList | units (void) const |
| QVariantList | types (void) const |
| QVariantList | activity (void) const |
| Q_INVOKABLE void | logRow (const QString &unitName, const QString &typeName, const QString &instanceLabel, const QString &time) |
| Q_INVOKABLE void | logInjection (const QString &unitName, const QString &typeName, int unitEnum, const QString &instanceLabel, const QString &time) |
| Record one injected failure: adds a log row and remembers the unit so Reset can restore it. | |
| Q_INVOKABLE void | resolveResult (int ackResult, int failureCode=0) |
| Q_INVOKABLE QVariantList | injectedUnits (void) const |
| Distinct FAILURE_UNIT values injected this session, so Reset restores only those. | |
| Q_INVOKABLE void | markUnitReset (int unitEnum) |
| Untrack one FAILURE_UNIT once its reset is accepted, so an interrupted Reset all keeps the rest retryable. | |
| Q_INVOKABLE void | resolvePendingInterrupted (void) |
| Q_INVOKABLE void | notifyActiveVehicle (quint32 vehicleId) |
| Q_INVOKABLE QVariantList | detailParams (int unitEnum, int typeEnum) const |
QML singleton backing the Failure Injection page.
Definition at line 12 of file FailureInjection.h.
|
explicit |
< newest first: [{ time, unitName, typeName, instance, result }]
< [{ name, unit }] [{ name, type }]
Definition at line 67 of file FailureInjection.cc.
|
inline |
Definition at line 29 of file FailureInjection.h.
|
signal |
Referenced by logRow(), notifyActiveVehicle(), resolvePendingInterrupted(), and resolveResult().
| QVariantList FailureInjection::detailParams | ( | int | unitEnum, |
| int | typeEnum ) const |
Vehicle parameters that refine how a (unit, type) failure manifests, e.g. BATTERY+WRONG -> SYS_FAIL_BAT_LVL. Returns [{ param, label }]; empty when the combo has no detail parameters.
Definition at line 189 of file FailureInjection.cc.
| QVariantList FailureInjection::injectedUnits | ( | void | ) | const |
Distinct FAILURE_UNIT values injected this session, so Reset restores only those.
Definition at line 147 of file FailureInjection.cc.
| void FailureInjection::logInjection | ( | const QString & | unitName, |
| const QString & | typeName, | ||
| int | unitEnum, | ||
| const QString & | instanceLabel, | ||
| const QString & | time ) |
Record one injected failure: adds a log row and remembers the unit so Reset can restore it.
Definition at line 89 of file FailureInjection.cc.
References logRow().
| void FailureInjection::logRow | ( | const QString & | unitName, |
| const QString & | typeName, | ||
| const QString & | instanceLabel, | ||
| const QString & | time ) |
Add a log row (prepended, newest first, result "pending") without tracking the unit for Reset. instanceLabel is a display descriptor for the affected instance(s), e.g. "all", "2", "1, 3, 5".
Definition at line 78 of file FailureInjection.cc.
References activityChanged().
Referenced by logInjection().
| void FailureInjection::markUnitReset | ( | int | unitEnum | ) |
Untrack one FAILURE_UNIT once its reset is accepted, so an interrupted Reset all keeps the rest retryable.
Definition at line 156 of file FailureInjection.cc.
| void FailureInjection::notifyActiveVehicle | ( | quint32 | vehicleId | ) |
Note the active vehicle's system id; a switch to a different vehicle clears the session so Reset all can't target the wrong vehicle. Id 0 (no vehicle: transient disconnect/reboot) is ignored.
Definition at line 177 of file FailureInjection.cc.
References activityChanged().
| void FailureInjection::resolvePendingInterrupted | ( | void | ) |
Resolve any still-"pending" rows to "Interrupted"; called on page (re)load to clear stragglers whose ack was lost when the previous page instance was destroyed mid-send.
Definition at line 161 of file FailureInjection.cc.
References activityChanged().
| void FailureInjection::resolveResult | ( | int | ackResult, |
| int | failureCode = 0 ) |
Resolve the oldest still-pending injection with a MAV_RESULT ack code; sets the row result. failureCode (Vehicle::MavCmdResultFailureCode_t) carries the reason when the command never reached the vehicle, which ackResult alone cannot express.
Definition at line 98 of file FailureInjection.cc.
References activityChanged(), and QGCMAVLink::mavResultToString().
|
inline |
Definition at line 27 of file FailureInjection.h.
|
inline |
Definition at line 25 of file FailureInjection.h.