Browse Source

Fix multiple vehicle check

QGC4.4
Don Gagne 10 years ago
parent
commit
34ec7b080c
  1. 12
      src/AutoPilotPlugins/PX4/AirframeComponentController.cc

12
src/AutoPilotPlugins/PX4/AirframeComponentController.cc

@ -92,17 +92,7 @@ AirframeComponentController::~AirframeComponentController()
void AirframeComponentController::changeAutostart(void) void AirframeComponentController::changeAutostart(void)
{ {
LinkManager* linkManager = LinkManager::instance(); if (UASManager::instance()->getUASList().count() > 1) {
// This shouldn't theoretically be needed since a disconnected link should be deleted. But
// for some reason multiple links are coming up.
int connectedLinkCount = 0;
foreach (LinkInterface* link, linkManager->getLinks()) {
if (link->isConnected()) {
connectedLinkCount++;
}
}
if (connectedLinkCount > 1) {
QGCMessageBox::warning("Airframe Config", "You cannot change airframe configuration while connected to multiple vehicles."); QGCMessageBox::warning("Airframe Config", "You cannot change airframe configuration while connected to multiple vehicles.");
return; return;
} }

Loading…
Cancel
Save