X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FSelection.java;h=6125eacad76e7b0390daef85fa11e14bd65573fb;hp=f5c41ffd91f6015d8d4762e546fe8385c5dadc8e;hb=7f5ed2be62905bd37717376dc22d09e5ea7edb4d;hpb=b361869e590bbca32664c16ac24d6296926594a5 diff --git a/tim/prune/data/Selection.java b/tim/prune/data/Selection.java index f5c41ff..6125eac 100644 --- a/tim/prune/data/Selection.java +++ b/tim/prune/data/Selection.java @@ -19,7 +19,6 @@ public class Selection private AltitudeRange _altitudeRange = null; private long _totalSeconds = 0L, _movingSeconds = 0L; private double _angDistance = -1.0, _angMovingDistance = -1.0; - private int _numSegments = 0; /** @@ -64,7 +63,6 @@ public class Selection */ private void recalculate() { - _numSegments = 0; final int numPoints = _track.getNumPoints(); // Recheck if the number of points has changed if (numPoints != _prevNumPoints) { @@ -109,16 +107,11 @@ public class Selection { double radians = DataPoint.calculateRadiansBetween(lastPoint, currPoint); _angDistance += radians; - if (currPoint.getSegmentStart()) { - _numSegments++; - } - else { + if (!currPoint.getSegmentStart()) { _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) { @@ -192,14 +185,6 @@ public class Selection return Distance.convertRadiansToDistance(_angMovingDistance); } - /** - * @return number of segments in selection - */ - public int getNumSegments() - { - return _numSegments; - } - /** * Clear selected point, range, photo and audio */