Skip to content

Commit

Permalink
Prevent double request of mission items (mavlink#3692)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer authored Jul 1, 2016
1 parent 2e9d112 commit f78ed77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/MissionManager/MissionController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "SimpleMissionItem.h"
#include "ComplexMissionItem.h"
#include "JsonHelper.h"
#include "ParameterLoader.h"

#ifndef __mobile__
#include "QGCFileDialog.h"
Expand Down Expand Up @@ -963,8 +964,9 @@ void MissionController::_activeVehicleChanged(Vehicle* activeVehicle)
connect(_activeVehicle, &Vehicle::homePositionAvailableChanged, this, &MissionController::_activeVehicleHomePositionAvailableChanged);
connect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionController::_activeVehicleHomePositionChanged);

if (!syncInProgress()) {
// We have to manually ask for the items from the Vehicle
if (_activeVehicle->getParameterLoader()->parametersAreReady() && !syncInProgress()) {
// We are switching between two previously existing vehicles. We have to manually ask for the items from the Vehicle.
// We don't request mission items for new vehicles since that will happen autamatically.
getMissionItems();
}

Expand Down

0 comments on commit f78ed77

Please sign in to comment.