Browse Source

Merge pull request #5183 from DonLakeFlyer/MissionNaNFixes

Plan load: Fixes for NaNs in param 5/6/7
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
aa6f066a99
  1. 11
      src/JsonHelper.cc

11
src/JsonHelper.cc

@ -63,20 +63,15 @@ bool JsonHelper::loadGeoCoordinate(const QJsonValue& jsonValue, @@ -63,20 +63,15 @@ bool JsonHelper::loadGeoCoordinate(const QJsonValue& jsonValue,
}
foreach(const QJsonValue& jsonValue, coordinateArray) {
if (jsonValue.type() != QJsonValue::Double) {
if (jsonValue.type() != QJsonValue::Double && jsonValue.type() != QJsonValue::Null) {
errorString = QObject::tr("Coordinate array may only contain double values, found: %1").arg(jsonValue.type());
return false;
}
}
coordinate = QGeoCoordinate(coordinateArray[0].toDouble(), coordinateArray[1].toDouble());
coordinate = QGeoCoordinate(possibleNaNJsonValue(coordinateArray[0]), possibleNaNJsonValue(coordinateArray[1]));
if (altitudeRequired) {
coordinate.setAltitude(coordinateArray[2].toDouble());
}
if (!coordinate.isValid()) {
errorString = QObject::tr("Coordinate is invalid: %1").arg(coordinate.toString());
return false;
coordinate.setAltitude(possibleNaNJsonValue(coordinateArray[2]));
}
return true;

Loading…
Cancel
Save