Browse Source

Fix terrain ready signalling (#9286)

QGC4.4
Don Gagne 4 years ago committed by GitHub
parent
commit
dacd28b669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/MissionManager/TransectStyleComplexItem.cc

10
src/MissionManager/TransectStyleComplexItem.cc

@ -576,11 +576,10 @@ void TransectStyleComplexItem::_polyPathTerrainData(bool success, const QList<Te @@ -576,11 +576,10 @@ void TransectStyleComplexItem::_polyPathTerrainData(bool success, const QList<Te
emit readyForSaveStateChanged();
if (success) {
_rgPathHeightInfo = rgPathHeightInfo;
emit readyForSaveStateChanged();
// Now that we have terrain data we can adjust
_rgPathHeightInfo = rgPathHeightInfo;
_adjustTransectsForTerrain();
emit readyForSaveStateChanged();
}
@ -603,11 +602,10 @@ TransectStyleComplexItem::ReadyForSaveState TransectStyleComplexItem::readyForSa @@ -603,11 +602,10 @@ TransectStyleComplexItem::ReadyForSaveState TransectStyleComplexItem::readyForSa
terrainReady = _rgPathHeightInfo.count();
}
} else {
// Now following terrain so always ready on terrain
// Not following terrain so always ready on terrain
terrainReady = true;
}
bool polygonNotReady = !_surveyAreaPolygon.isValid();
//qDebug() << polygonNotReady << _wizardMode << terrainReady;
return (polygonNotReady || _wizardMode) ?
NotReadyForSaveData :
(terrainReady ? ReadyForSave : NotReadyForSaveTerrain);
@ -616,7 +614,7 @@ TransectStyleComplexItem::ReadyForSaveState TransectStyleComplexItem::readyForSa @@ -616,7 +614,7 @@ TransectStyleComplexItem::ReadyForSaveState TransectStyleComplexItem::readyForSa
void TransectStyleComplexItem::_adjustTransectsForTerrain(void)
{
if (_followTerrain) {
if (readyForSaveState() != ReadyForSave) {
if (_rgPathHeightInfo.count() == 0) {
qCWarning(TransectStyleComplexItemLog) << "_adjustTransectPointsForTerrain called when terrain data not ready";
qgcApp()->showAppMessage(tr("INTERNAL ERROR: TransectStyleComplexItem::_adjustTransectPointsForTerrain called when terrain data not ready. Plan will be incorrect."));
return;

Loading…
Cancel
Save