Unverified Commit 81d60947 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6614 from DonLakeFlyer/TerrainWarn

Warn if sending MAV_FRAME_GLOBAL_TERRAIN_ALT
parents cbe81ce1 3b5f8ae7
...@@ -212,6 +212,17 @@ void MissionController::loadFromVehicle(void) ...@@ -212,6 +212,17 @@ void MissionController::loadFromVehicle(void)
} }
} }
void MissionController::_warnIfTerrainFrameUsed(void)
{
for (int i=1; i<_visualItems->count(); i++) {
SimpleMissionItem* simpleItem = qobject_cast<SimpleMissionItem*>(_visualItems->get(i));
if (simpleItem && simpleItem->altitudeMode() == SimpleMissionItem::AltitudeTerrainFrame) {
qgcApp()->showMessage(tr("Warning: You are using MAV_FRAME_GLOBAL_TERRAIN_ALT in a mission. %1 does not support sending terrain tiles to vehicle.").arg(qgcApp()->applicationName()));
break;
}
}
}
void MissionController::sendToVehicle(void) void MissionController::sendToVehicle(void)
{ {
if (_masterController->offline()) { if (_masterController->offline()) {
...@@ -220,6 +231,7 @@ void MissionController::sendToVehicle(void) ...@@ -220,6 +231,7 @@ void MissionController::sendToVehicle(void)
qCWarning(MissionControllerLog) << "MissionControllerLog::sendToVehicle called while syncInProgress"; qCWarning(MissionControllerLog) << "MissionControllerLog::sendToVehicle called while syncInProgress";
} else { } else {
qCDebug(MissionControllerLog) << "MissionControllerLog::sendToVehicle"; qCDebug(MissionControllerLog) << "MissionControllerLog::sendToVehicle";
_warnIfTerrainFrameUsed();
if (_visualItems->count() == 1) { if (_visualItems->count() == 1) {
// This prevents us from sending a possibly bogus home position to the vehicle // This prevents us from sending a possibly bogus home position to the vehicle
QmlObjectListModel emptyModel; QmlObjectListModel emptyModel;
......
...@@ -257,6 +257,7 @@ private: ...@@ -257,6 +257,7 @@ private:
void _addCommandTimeDelay(SimpleMissionItem* simpleItem, bool vtolInHover); void _addCommandTimeDelay(SimpleMissionItem* simpleItem, bool vtolInHover);
void _addTimeDistance(bool vtolInHover, double hoverTime, double cruiseTime, double extraTime, double distance, int seqNum); void _addTimeDistance(bool vtolInHover, double hoverTime, double cruiseTime, double extraTime, double distance, int seqNum);
int _insertComplexMissionItemWorker(ComplexMissionItem* complexItem, int i); int _insertComplexMissionItemWorker(ComplexMissionItem* complexItem, int i);
void _warnIfTerrainFrameUsed(void);
private: private:
MissionManager* _missionManager; MissionManager* _missionManager;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment