diff --git a/src/Vehicle/MultiVehicleManager.cc b/src/Vehicle/MultiVehicleManager.cc index 7e5cdbfa2406b9b1f19bffed3e22e07494e5fe83..a83db20f8903dd29a48de24ad446bc80edc0f06e 100644 --- a/src/Vehicle/MultiVehicleManager.cc +++ b/src/Vehicle/MultiVehicleManager.cc @@ -109,7 +109,7 @@ void MultiVehicleManager::_deleteVehiclePhase1(Vehicle* vehicle) } vehicle->setActive(false); - vehicle->uas()->clearVehicle(); + vehicle->uas()->shutdownVehicle(); // First we must signal that a vehicle is no longer available. _activeVehicleAvailable = false; diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index caedb6bf7bda7d7c52383c4261a7f4cb93573f42..cff3630079bd5ff9812c8c22b6b3f32d2b9fb05a 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1057,7 +1057,7 @@ void Vehicle::setFlightMode(const QString& flightMode) mavlink_msg_set_mode_pack(_mavlink->getSystemId(), _mavlink->getComponentId(), &msg, id(), newBaseMode, custom_mode); sendMessage(msg); } else { - qCWarning(VehicleLog) << "FirmwarePlugin::setFlightMode failed, flightMode:" << flightMode; + qWarning() << "FirmwarePlugin::setFlightMode failed, flightMode:" << flightMode; } } diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 0dbfbb1469c86073f05bf324e75a815d0ce428b8..7b2c03f1df6f860ce13e1f744c5fcce64302e1c5 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -193,23 +193,6 @@ UAS::UAS(MAVLinkProtocol* protocol, Vehicle* vehicle, FirmwarePluginManager * fi statusTimeout.start(500); } -/** -* Saves the settings of name, airframe, autopilot type and battery specifications -* by calling writeSettings. -*/ -UAS::~UAS() -{ -#ifndef __mobile__ - stopHil(); - if (simulation) { - // wait for the simulator to exit - simulation->wait(); - simulation->disconnectSimulation(); - simulation->deleteLater(); - } -#endif -} - /** * @ return the id of the uas */ @@ -2233,3 +2216,17 @@ void UAS::_say(const QString& text, int severity) if (!qgcApp()->runningUnitTests()) qgcApp()->toolbox()->audioOutput()->say(text, severity); } + +void UAS::shutdownVehicle(void) +{ +#ifndef __mobile__ + stopHil(); + if (simulation) { + // wait for the simulator to exit + simulation->wait(); + simulation->disconnectSimulation(); + simulation->deleteLater(); + } +#endif + _vehicle = NULL; +} diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 80b35954eaf38c7846bf19087f215d7a4c8a3ef8..fe5e957d7206ed427568f42754eb8fbf3587d33d 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -64,7 +64,6 @@ class UAS : public UASInterface Q_OBJECT public: UAS(MAVLinkProtocol* protocol, Vehicle* vehicle, FirmwarePluginManager * firmwarePluginManager); - ~UAS(); float lipoFull; ///< 100% charged voltage float lipoEmpty; ///< Discharged voltage @@ -100,7 +99,8 @@ public: Q_PROPERTY(double satRawVDOP READ getSatRawVDOP NOTIFY satRawVDOPChanged) Q_PROPERTY(double satRawCOG READ getSatRawCOG NOTIFY satRawCOGChanged) - void clearVehicle(void) { _vehicle = NULL; } + /// Vehicle is about to go away + void shutdownVehicle(void); void setGroundSpeed(double val) { diff --git a/src/ui/toolbar/MainToolBarIndicators.qml b/src/ui/toolbar/MainToolBarIndicators.qml index 93370d135fb8e4ff31d6c3180e4b4aca93cf81d8..e41927e489d08032177026886afe14d840f8c92e 100644 --- a/src/ui/toolbar/MainToolBarIndicators.qml +++ b/src/ui/toolbar/MainToolBarIndicators.qml @@ -397,8 +397,6 @@ Row { id: flightModeMenuItemComponent MenuItem { - checkable: true - checked: activeVehicle ? (activeVehicle.flightMode === text) : false onTriggered: { if(activeVehicle) { activeVehicle.flightMode = text