Ticket #48 (new enhancement)

Opened 1 year ago

Last modified 1 year ago

Total Elevation Gain

Reported by: sibion Assigned to: saua
Priority: minor Milestone: 0.5
Component: common Version: 0.4.1
Keywords: Cc:

Description

Here is the code used to add Total Elevation Gain. The main code is in Track.java in the UpdateSpeedandElevation? method.

private transient float lastElevation = Float.NaN;

private transient float currentGain = Float.NaN;

private transient float totalGain = Float.NaN;

if (Float.isNaN(totalGain)){

totalGain = 0; lastElevation = elevation;

} if (!Float.isNaN(totalGain)) {

if (elevation > lastElevation){

currentGain = elevation - lastElevation; totalGain += currentGain; lastElevation = elevation;

} else {

lastElevation = elevation;

}

}

I think it goes without saying that you need to add a method in Track.java to getTotalGain and add it to the Summary Tile that I provided which I know needs know explanation as I largely learned from your code how to do this anyway. Hopefully, if you choose to implement the SummaryTile? or something similar that this will help round off the requests for what should be included in that view.

Change History

09/02/07 06:33:05 changed by sibion

  • type changed from defect to enhancement.
  • milestone changed from 1.0 to 0.5.