private Altitude.Format _altitudeFormat = Altitude.Format.NO_FORMAT;
private long _totalSeconds = 0L, _movingSeconds = 0L;
private double _angDistance = -1.0, _angMovingDistance = -1.0;
- private boolean _multipleSegments = false;
+ private int _numSegments = 0;
/**
private void recalculate()
{
_altitudeFormat = Altitude.Format.NO_FORMAT;
- _multipleSegments = false;
+ _numSegments = 0;
if (_track.getNumPoints() > 0 && hasRangeSelected())
{
_altitudeRange = new IntegerRange();
double radians = DataPoint.calculateRadiansBetween(lastPoint, currPoint);
_angDistance += radians;
if (currPoint.getSegmentStart()) {
- _multipleSegments = true;
+ _numSegments++;
}
else {
_angMovingDistance += radians;
}
}
lastPoint = currPoint;
+ // If it's a track point then there must be at least one segment
+ if (_numSegments == 0) {_numSegments = 1;}
}
}
if (endTime != null) {
}
/**
- * @return true if track has multiple segments
+ * @return number of segments in selection
*/
- public boolean getHasMultipleSegments()
+ public int getNumSegments()
{
- return _multipleSegments;
+ return _numSegments;
}
/**
/**
- * Deselect range
+ * Select range from start to end
* @param inStartIndex index of start of range
* @param inEndIndex index of end of range
*/