X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fgui%2Fprofile%2FProfileData.java;h=0716b9332282164f28a8eb99ae43170dd8ec1a65;hb=0a2480df5845e2d7190dfdec9b2653b1609e853d;hp=8b036a914856d9cad42de3a041d3ef147e8e9fe5;hpb=c0387c124840c9407e040600fda88f3c3e8f6aa6;p=GpsPrune.git diff --git a/tim/prune/gui/profile/ProfileData.java b/tim/prune/gui/profile/ProfileData.java index 8b036a9..0716b93 100644 --- a/tim/prune/gui/profile/ProfileData.java +++ b/tim/prune/gui/profile/ProfileData.java @@ -1,6 +1,7 @@ package tim.prune.gui.profile; import tim.prune.data.Track; +import tim.prune.data.UnitSet; /** * Abstract class for all sources of profile data, @@ -10,6 +11,8 @@ public abstract class ProfileData { /** Track object */ protected final Track _track; + /** Unit set to use */ + protected UnitSet _unitSet = null; /** Flag for availability of any data */ protected boolean _hasData = false; /** Array of booleans for data per point */ @@ -74,7 +77,15 @@ public abstract class ProfileData /** * Get the data from the track and populate the value arrays */ - public abstract void init(); + public abstract void init(UnitSet inUnitSet); + + /** + * Set the UnitSet to use for the calculations + * @param inUnitSet unit set + */ + protected void setUnitSet(UnitSet inUnitSet) { + _unitSet = inUnitSet; + } /** * @return text for label including units @@ -87,7 +98,7 @@ public abstract class ProfileData public abstract String getNoDataKey(); /** - * Initialise the data arrays + * Initialise the data arrays to the correct size */ protected void initArrays() {