Ticket #48 (new enhancement)

Opened 6 years ago

Last modified 6 years ago

Total Elevation Gain

Reported by: sibion Owned by: 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

comment:1 Changed 6 years ago by sibion

  • Type changed from defect to enhancement
  • Milestone changed from 1.0 to 0.5
Note: See TracTickets for help on using tickets.