- altValue = altitude.getValue(_altitudeFormat);
- if (_altitudeFormat == Altitude.Format.NO_FORMAT)
- _altitudeFormat = altitude.getFormat();
- _altitudeRange.addValue(altValue);
- if (foundAlt)
- {
- if (altValue > lastAltValue)
- _climb += (altValue - lastAltValue);
- else
- _descent += (lastAltValue - altValue);
- }
- lastAltValue = altValue;
- foundAlt = true;