diff --git a/src/FirmwarePlugin/FirmwarePlugin.h b/src/FirmwarePlugin/FirmwarePlugin.h index d549fdd65286d90fc9bdeeaf29e4bd70ef440e14..353b4c79b271d1d33808c30ae1f57d80563aa833 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.h +++ b/src/FirmwarePlugin/FirmwarePlugin.h @@ -257,6 +257,7 @@ public: virtual QString vehicleImageCompass(const Vehicle* vehicle) const; /// Allows the core plugin to override the toolbar indicators + /// signals toolbarIndicatorsChanged /// @return A list of QUrl with the indicators (see MainToolBarIndicators.qml) virtual const QVariantList& toolBarIndicators(const Vehicle* vehicle); @@ -298,6 +299,9 @@ public: // FIXME: Hack workaround for non pluginize FollowMe support static const QString px4FollowMeFlightMode; +signals: + void toolbarIndicatorsChanged(void); + protected: // Arms the vehicle with validation and retries // @return: true - vehicle armed, false - vehicle failed to arm diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 99b8ba000166ca52cc3cd746410f57b8f64476f2..549811204d256cb982736fd780e8b1eb5988f04a 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -357,6 +357,8 @@ void Vehicle::_commonInit(void) { _firmwarePlugin = _firmwarePluginManager->firmwarePluginForAutopilot(_firmwareType, _vehicleType); + connect(_firmwarePlugin, &FirmwarePlugin::toolbarIndicatorsChanged, this, &Vehicle::toolBarIndicatorsChanged); + connect(this, &Vehicle::coordinateChanged, this, &Vehicle::_updateDistanceToHome); connect(this, &Vehicle::homePositionChanged, this, &Vehicle::_updateDistanceToHome); connect(this, &Vehicle::hobbsMeterChanged, this, &Vehicle::_updateHobbsMeter); diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index e1ff02c722ecce1dd86430fa5df11bb9dad67cae..0a8d762b43be3c54ebc0d7ef79bd9253903a22db 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -314,7 +314,7 @@ public: Q_PROPERTY(unsigned int telemetryTXBuffer READ telemetryTXBuffer NOTIFY telemetryTXBufferChanged) Q_PROPERTY(int telemetryLNoise READ telemetryLNoise NOTIFY telemetryLNoiseChanged) Q_PROPERTY(int telemetryRNoise READ telemetryRNoise NOTIFY telemetryRNoiseChanged) - Q_PROPERTY(QVariantList toolBarIndicators READ toolBarIndicators CONSTANT) + Q_PROPERTY(QVariantList toolBarIndicators READ toolBarIndicators NOTIFY toolBarIndicatorsChanged) Q_PROPERTY(QmlObjectListModel* adsbVehicles READ adsbVehicles CONSTANT) Q_PROPERTY(bool initialPlanRequestComplete READ initialPlanRequestComplete NOTIFY initialPlanRequestCompleteChanged) Q_PROPERTY(QVariantList staticCameraList READ staticCameraList CONSTANT) @@ -745,6 +745,7 @@ signals: void capabilitiesKnownChanged(bool capabilitiesKnown); void initialPlanRequestCompleteChanged(bool initialPlanRequestComplete); void capabilityBitsChanged(uint64_t capabilityBits); + void toolBarIndicatorsChanged(void); void messagesReceivedChanged (); void messagesSentChanged ();