X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fgui%2Fprofile%2FSpeedData.java;fp=tim%2Fprune%2Fgui%2Fprofile%2FSpeedData.java;h=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hp=4b0f350c58309a6a4b480de766942cc046b8ac78;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465;p=GpsPrune.git diff --git a/tim/prune/gui/profile/SpeedData.java b/tim/prune/gui/profile/SpeedData.java deleted file mode 100644 index 4b0f350..0000000 --- a/tim/prune/gui/profile/SpeedData.java +++ /dev/null @@ -1,66 +0,0 @@ -package tim.prune.gui.profile; - -import tim.prune.I18nManager; -import tim.prune.data.SpeedCalculator; -import tim.prune.data.SpeedValue; -import tim.prune.data.Track; -import tim.prune.data.UnitSet; - -/** - * Class to provide a source of speed data for the profile chart - */ -public class SpeedData extends ProfileData -{ - /** - * Constructor - * @param inTrack track object - */ - public SpeedData(Track inTrack) { - super(inTrack); - } - - /** - * Get the data and populate the instance arrays - */ - public void init(UnitSet inUnitSet) - { - setUnitSet(inUnitSet); - initArrays(); - _hasData = false; - _minValue = _maxValue = 0.0; - SpeedValue speed = new SpeedValue(); - if (_track != null) - { - for (int i=0; i<_track.getNumPoints(); i++) - { - // Get the speed either from the speed value or from the distances and timestamps - SpeedCalculator.calculateSpeed(_track, i, speed); - if (speed.isValid()) - { - double speedValue = speed.getValue(); - _pointValues[i] = speedValue; - if (speedValue < _minValue || !_hasData) {_minValue = speedValue;} - if (speedValue > _maxValue || !_hasData) {_maxValue = speedValue;} - _hasData = true; - } - _pointHasData[i] = speed.isValid(); - } - } - } - - /** - * @return text description including units - */ - public String getLabel() - { - return I18nManager.getText("fieldname.speed") + " (" - + I18nManager.getText(_unitSet.getSpeedUnit().getShortnameKey()) + ")"; - } - - /** - * @return key for message when no speeds present - */ - public String getNoDataKey() { - return "display.notimestamps"; - } -}