]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/gui/profile/ProfileData.java
Version 14, October 2012
[GpsPrune.git] / tim / prune / gui / profile / ProfileData.java
index b72c43a03b7afd3b5cbb42e4519fd9239471a111..0716b9332282164f28a8eb99ae43170dd8ec1a65 100644 (file)
@@ -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