Browse Source

Merge pull request #5395 from DonLakeFlyer/FlyView

Fly view fixes
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
e836e961b7
  1. 19
      src/MissionManager/PlanMasterController.cc
  2. 1
      src/Vehicle/Vehicle.cc
  3. 4
      src/Vehicle/Vehicle.h

19
src/MissionManager/PlanMasterController.cc

@ -89,6 +89,16 @@ void PlanMasterController::_activeVehicleChanged(Vehicle* activeVehicle) @@ -89,6 +89,16 @@ void PlanMasterController::_activeVehicleChanged(Vehicle* activeVehicle)
qCDebug(PlanMasterControllerLog) << "_activeVehicleChanged" << activeVehicle;
if (_managerVehicle) {
// Disconnect old vehicle
disconnect(_managerVehicle->missionManager(), &MissionManager::newMissionItemsAvailable, this, &PlanMasterController::_loadMissionComplete);
disconnect(_managerVehicle->geoFenceManager(), &GeoFenceManager::loadComplete, this, &PlanMasterController::_loadGeoFenceComplete);
disconnect(_managerVehicle->rallyPointManager(), &RallyPointManager::loadComplete, this, &PlanMasterController::_loadRallyPointsComplete);
disconnect(_managerVehicle->missionManager(), &MissionManager::sendComplete, this, &PlanMasterController::_sendMissionComplete);
disconnect(_managerVehicle->geoFenceManager(), &GeoFenceManager::sendComplete, this, &PlanMasterController::_sendGeoFenceComplete);
disconnect(_managerVehicle->rallyPointManager(), &RallyPointManager::sendComplete, this, &PlanMasterController::_sendRallyPointsComplete);
}
bool newOffline = false;
if (activeVehicle == NULL) {
// Since there is no longer an active vehicle we use the offline controller vehicle as the manager vehicle
@ -353,6 +363,7 @@ void PlanMasterController::removeAllFromVehicle(void) @@ -353,6 +363,7 @@ void PlanMasterController::removeAllFromVehicle(void)
_missionController.removeAllFromVehicle();
_geoFenceController.removeAllFromVehicle();
_rallyPointController.removeAllFromVehicle();
setDirty(false);
} else {
qWarning() << "PlanMasterController::removeAllFromVehicle called while offline";
}
@ -410,6 +421,14 @@ void PlanMasterController::sendPlanToVehicle(Vehicle* vehicle, const QString& fi @@ -410,6 +421,14 @@ void PlanMasterController::sendPlanToVehicle(Vehicle* vehicle, const QString& fi
void PlanMasterController::_showPlanFromManagerVehicle(void)
{
if (!_managerVehicle->initialPlanRequestComplete() &&
!_missionController.syncInProgress() &&
!_geoFenceController.syncInProgress() &&
!_rallyPointController.syncInProgress()) {
// Something went wrong with initial load. All controllers are idle, so just force it off
_managerVehicle->forceInitialPlanRequestComplete();
}
// The crazy if structure is to handle the load propogating by itself through the system
if (!_missionController.showPlanFromManagerVehicle()) {
if (!_geoFenceController.showPlanFromManagerVehicle()) {

1
src/Vehicle/Vehicle.cc

@ -716,6 +716,7 @@ void Vehicle::_setCapabilities(uint64_t capabilityBits) @@ -716,6 +716,7 @@ void Vehicle::_setCapabilities(uint64_t capabilityBits)
_supportsMissionItemInt = true;
}
_vehicleCapabilitiesKnown = true;
emit capabilitiesKnownChanged(true);
qCDebug(VehicleLog) << QString("Vehicle %1 MISSION_ITEM_INT").arg(_supportsMissionItemInt ? QStringLiteral("supports") : QStringLiteral("does not support"));
}

4
src/Vehicle/Vehicle.h

@ -673,6 +673,7 @@ public: @@ -673,6 +673,7 @@ public:
const QVariantList& toolBarIndicators ();
const QVariantList& cameraList (void) const;
bool capabilitiesKnown(void) const { return _vehicleCapabilitiesKnown; }
bool supportsMissionItemInt(void) const { return _supportsMissionItemInt; }
/// @true: When flying a mission the vehicle is always facing towards the next waypoint
@ -682,6 +683,8 @@ public: @@ -682,6 +683,8 @@ public:
/// @return: true: initial request is complete, false: initial request is still in progress;
bool initialPlanRequestComplete(void) const { return _initialPlanRequestComplete; }
void forceInitialPlanRequestComplete(void) { _initialPlanRequestComplete = true; }
void _setFlying(bool flying);
void _setLanding(bool landing);
void _setHomePosition(QGeoCoordinate& homeCoord);
@ -712,6 +715,7 @@ signals: @@ -712,6 +715,7 @@ signals:
void defaultHoverSpeedChanged(double hoverSpeed);
void firmwareTypeChanged(void);
void vehicleTypeChanged(void);
void capabilitiesKnownChanged(bool capabilitiesKnown);
void messagesReceivedChanged ();
void messagesSentChanged ();

Loading…
Cancel
Save