\( \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
track.h
1 #pragma once
2 #include "stdlib.h"
3 #include "stdio.h"
4 #include "DataTyps.h"
5 #include "MathExt.h"
6 
8 
14 class Track
15 {
16 public:
17  Track(trackpoint* tpl,int tc, KOOlist* kl, int kc);
19  Track(Neighbour** narray, int nc);
21  Track(double** KOOarray, int count);
23  Track(double *d,double *h,double *lat,double *lon,int count);
24  Track(Track* tracktocopy);
25  Track();
26  ~Track(void);
27  void add(trackpoint* tpl,int tc, KOOlist* kl, int kc);
28  void add(Track* t2); //t2 kopieren und anfuegen
29  void get_data_ref(trackpoint** tpl,int* tc, KOOlist** kl, int* kc);
30  double** get_d_h_array();
31  double** get_d_h_array_copy();
32  double** get_KOOa();
33  double** get_KOOa_copy();
34  long int get_array_length();
35  long int get_KOOa_length();
36  float get_height_meters();
37  float get_height_meters(float dmin, float dmax);
40 
43  float get_bend();
44  KOO* get_last_KOO();
45  double get_length();
46  short notNULL();
47  void to_gpx(char* filename);
48  void to_binary_KOO(char* filename);
49  void delete_cross(int nr);
50  void delete_to_cross(KOO* k);
51  void delete_complete();
52  short extract_KOO(KOO* k, double d);
55  short extract_h(double d, double* h);
57  short extract_azimtut(double d, double* azimut);
59 
63  short next_d(double lat, double lon, double* d);
65  short next_cross(double clickedlat, double clickedlon,
66  KOO** kdot, float maxd);
68  short near_check(double lat, double lon, double limit);
70  void adapt_brect(double* latmin, double* latmax,
71  double* lonmin, double* lonmax);
73  void get_brect(double* latmin, double* latmax,
74  double* lonmin, double* lonmax);
75  int owns(KOO* k);
76  void get_anchors(float d, KOO** kfrom, KOO** kto);
77  short found_anchors(double clickedlat, double clickedlon,
78  float maxd, KOO** kfrom, KOO** kto);
79  KOO get_firstKOO();
80  KOO get_lastKOO();
81  /*Track veraendern*/
82  void invert();
83  void trim_left(float d);
84  void trim_right(float d);
85  void trim_left(KOO* k);
86  void trim_right(KOO* k);
88  short toggle_marker(KOO* k);
89 
90 
91 private:
95 
98  int kc;
99  int tc;
100  short keep_lists;
102  double** d_h_array;
103  double** KOOa;
104  void refresh_d_h_array();
105  void refresh_KOOa();
106  KOO* add_to_KOOpool(double lat, double lon);
107  void free_KOOpool(KOO* k);
108  void reset_markers();
109  void trim_left(int kci, int tci);
110  void trim_right(int kci, int tci);
111 };
112 
void reset_markers()
set markers to zero
Definition: track.cpp:711
trackpoint * tpl
Definition: track.h:94
KOOlist * kl
KOO data array.
Definition: track.h:97
container struct to hold data of a coordinate
Definition: DataTyps.h:82
void refresh_KOOa()
refreshs KOOa
Definition: track.cpp:245
short next_d(double lat, double lon, double *d)
searches for closest point on track to point (lat,lon)
Definition: track.cpp:423
double ** get_d_h_array()
returns reference
Definition: track.cpp:204
short notNULL()
is track empty or not
Definition: track.cpp:513
void delete_complete()
Definition: track.cpp:501
float get_height_meters()
Definition: track.cpp:273
short extract_KOO(KOO *k, double d)
creates KOO refering distance point d
Definition: track.cpp:358
void get_brect(double *latmin, double *latmax, double *lonmin, double *lonmax)
return bounding rect of Track
Definition: track.cpp:697
double ** get_d_h_array_copy()
returns deep copy
Definition: track.cpp:208
short next_cross(double clickedlat, double clickedlon, KOO **kdot, float maxd)
stores cross in kdot which is closest to (clickedlat,clickedlon)
Definition: track.cpp:794
void delete_cross(int nr)
deletes last nr cross of Track
Definition: track.cpp:462
routing container struct, connects cross via Way with each other
Definition: DataTyps.h:47
int kc
array length if kl
Definition: track.h:98
short extract_h(double d, double *h)
creates double for height refering distance point d
Definition: track.cpp:379
void delete_to_cross(KOO *k)
deletes cross after k
Definition: track.cpp:475
double ** get_KOOa()
returns reference
Definition: track.cpp:215
double ** d_h_array
distance height output, d:0, h:1
Definition: track.h:102
int tc
Definition: track.h:99
official representation of Track in BTP3
Definition: track.h:14
void to_gpx(char *filename)
save to gpx file
Definition: track.cpp:860
double get_length()
returns Track length [km]
Definition: track.cpp:320
double ** KOOa
coordinate output, lat:0, lon:1
Definition: track.h:103
short near_check(double lat, double lon, double limit)
check if point (lat,lon) is closer to track then limit
Definition: track.cpp:519
void to_binary_KOO(char *filename)
save binary KOOa to file (website)
Definition: track.cpp:848
short toggle_marker(KOO *k)
a KOO of the track can be marked or not, used for drag&drop routing
Definition: track.cpp:718
void adapt_brect(double *latmin, double *latmax, double *lonmin, double *lonmax)
increases rect to contain track, if necessary
Definition: track.cpp:687
KOO * KOOpool
stores dynamically allocated KOO if public a function requires that
Definition: track.h:93
void refresh_d_h_array()
refreshs d_h_array
Definition: track.cpp:225
short keep_lists
destructor instruction, kl might be used outside this class
Definition: track.h:101
float get_bend()
return serpentine index
Definition: track.cpp:819
container struct for Track to hold distance and height data
Definition: DataTyps.h:33
double ** get_KOOa_copy()
returns deep copy
Definition: track.cpp:219
main container for Track, WayHeight and ClimbAnalyse
Definition: DataTyps.h:172
short extract_azimtut(double d, double *azimut)
extract way direction at distance point d
Definition: track.cpp:400
void get_anchors(float d, KOO **kfrom, KOO **kto)
check if k is an element of Track
Definition: track.cpp:736