\( \def\bold#1{\bf #1} \newcommand{\d}{\mathrm{d}} \) BTP: Manual and Source Code Documentation

Power Uphill

bike mass [kg]
body mass [kg]
altitude gain [m]
climb length [km]
gradient [%]
time [s]
speed [km/h]
power [W]
power/mass [W/kg]
climbrate [m/min]

average power on climb stage

BTP  3.0
Routing/ClimbAnalysis/PowerCalculation
UndoRedo.cpp
1 #include "UndoRedo.h"
2 
3 UndoRedo::UndoRedo(){
4  l = new undoredolist;
5  l->next = NULL;
6  l->prev = l;
7  l->element = new Track();
8  c = l;
9  keepbeforeundo = 1;
10 }
11 UndoRedo::~UndoRedo(){
12  del_list(l);
13 }
14 void UndoRedo::add(Track* element){
15  if(element->notNULL()){
16  del_list(c->next);
17  c->next = new undoredolist;
18  c->next->prev = c;
19  c = c->next;
20  c->next = NULL;
21  c->element = new Track(element);
22  l->prev = c;
23  keepbeforeundo = 1;
24  }
25 }
26 Track* UndoRedo::undo(Track* element){
27  if(keepbeforeundo){
28  /*bevor etwas rueckgaengig gemacht wird sollte der aktuellste Zustand
29  eventuell gesichert werden*/
30  add(element);
31  keepbeforeundo = 0;
32  }
33  else
34  /*oder eben geloescht*/
35  element->~Track();
36  if(c != l){
37  c = c->prev;
38  return new Track(c->element);
39  }
40  else
41  return new Track(l->element);
42 }
43 Track* UndoRedo::redo(){
44  if(c->next != NULL){
45  c = c->next;
46  return new Track(c->element);
47  }
48  else
49  return new Track(c->element);
50 }
51 void UndoRedo::del_list(undoredolist* t){
52  undoredolist* tt;
53  while(t != NULL){
54  tt = t;
55  t = t->next;
56  tt->element->~Track();
57  delete tt;
58  }
59 }
UndoRedo container list element, stores Track.
Definition: UndoRedo.h:4
short notNULL()
is track empty or not
Definition: track.cpp:513
official representation of Track in BTP3
Definition: track.h:14