\( \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
1 #pragma once
2 #include <QColor>
6 typedef struct PowerAnalysisSetting{
7  double ws,wd;
8  double m;
9  double cr;
10  double T;
11  double p0;
12  double Pvd,Pmax,PT;
13  double cwAvd, cwAmax,cwAmin,cwAT;
15  int fightwind;
16  double abrake;
17  double aradial;
20 /*OSM*/
21 enum branch {l,r,lefttop,leftbottom};
22 enum readdirection {fw,bw};
23 enum inputstate {routeshort, routeflat, routemountain,routeclimb,
24  routeSTRONG,editdata,selectlayer, routetwitch};
25 enum climbstate {increasing, decreasing, outofuse, climbstart, climbend, failure};
26 enum dotstate {crossdot, waydot, nonedot, crossdotmarked};
27 struct STRONG;
28 struct KOO;
29 struct Way;
33 typedef struct trackpoint{
34  float h,d;
35 }trackpoint;
47 typedef struct Neighbour{
52  readdirection rd;
53  Way *way;
54  KOO *nb;
57  float hm;
58  float d;
59  int nodec;
60  int tpc;
61  KOO** node;
64 }Neighbour;
73 typedef struct crossdata{
75  STRONG *s;
76 }crossdata;
82 typedef struct KOO {
83  qint64 id;
84  char balance;
85  KOO *l,*r,*prev;
86  double lon,lat;
100  char status;
101  crossdata* cd;
102 } KOO;
122 typedef struct Way {
123  qint64 id;
124  int nodec;
125  KOO** node;
126  float minlat,minlon,maxlat,maxlon;
127  Way *l,*r,*prev;
128  short balance;
129  char type;
130  char* name;
131 } Way;
132 typedef struct OSM_Data{
133  KOO** nodes;
134  Way** waysavl;
135 } OSM_Data;
137 typedef struct points{
138  KOO* k;
139  float index;
140  char* name;
141  points* next, *prev;}points;
143 typedef struct lines{
144  Way* way;
145  lines* next;
146  char* name;
147 }lines;
149 typedef struct relation{
150  Way** members;
151  int memberscount;
152  char type;
153  relation* next;
154 }relation;
162 typedef struct trackpointlist{
163  trackpoint t;
164  trackpointlist *prev,*next;
172 typedef struct KOOlist{
173  KOO* k;
174  KOOlist *prev,*next;
176  float d;
178  short marked;
180  int tpi;
181 }KOOlist;
183 /*MAP*/
185 typedef struct SunSetting{
186  float azimut,elevation;
187  float I;
188  float sphi;
189  float cphi;
190  float stheta;
191  float ctheta;
192 }SunSetting;
194 /*Profil*/
196 typedef struct ProfilSettings{
197  QRgb bgcolor,fontcolor,latticecolor;
198  bool drawybarlabel,drawxbarlabel,drawtitle,
199  drawxlattice,drawylattice;
200  int fsnormal, fstitle; //Schriftgroessen;
201  char font[100];
202  double xmax,xmin,ymax,ymin;
203  int margin;
204  int width, height;
205  bool autoscale;
206  bool singlecolor;
207  QRgb fillcolor;
208  bool showline;
209  QRgb linecolor;
214 /*Profil*/
215 typedef struct MapSettings{
216  double minlat,minlon,maxlat,maxlon;
217  QRgb roadcolor[6];
218  float roadwidth[6];
219  QRgb summitcolor;
220  float summitsize;
221  float pointsize[6];
222  QRgb pointcolor[6];
223  bool drawcontour;
224  bool drawsummit;
225  bool drawpoints;
226  bool drawwood;
227  bool drawstreetcontour;
228  QRgb woodcolor;
229  bool drawater;
230  QRgb watercolor;
231  bool drawscale;
232  bool drawstreetlabel;
233  QRgb heightcolor[5];
234  double heights[5];
235  double climblayershading;
237 }MapSettings;
239 /*Routing*/
255 typedef struct STRONG{
257  void* from;
259 }STRONG;
261 class STRONGfib{
262 public:
263  float d;
264  float hm;
266  KOO* k;
268 };
270 class STRONGPlusfib : public STRONGfib{
271 public:
273  float hmup;
277  float hmdown;
278 };
281 public:
282  float Psum, dP;
283 };
284 typedef struct STRONGsetting{
290  double rfac, rabs;
292  int hmstep;
293  int hmmax;
294  double hmperkm;
295  short dhmin;
296  float downtoupmax;
297  float minP;
302 typedef struct ClimbAnalyseSettings{
303  double minP;
304  double minS;
305  double maxdwnHM;
306  double minHM;
307  bool html;
308  bool map;
309  bool list;
310  char ProjectFolder[260];
311  char ProjectName[260];
312  double mapsize;
313  bool Climblayer;
316 typedef struct ExtMapSettings{
317  double minlat,minlon,maxlat,maxlon;
318  double mapsize;
319  bool drawCL;
320  bool drawSL;
321  bool drawct;
324 typedef struct config {
325  MapSettings MS;
326  char mintype,maxtype;
330  char SRTM3folder[260];
331  char start_btp[260];
332  inputstate input;
334  int drawRoute;
337  ProfilSettings PS;
339  int plotspeed;
340  int plotpower;
342 }config;
344 typedef struct STRONGlayerele{
345  Neighbour* n;
346  float index;
349 typedef struct STRONGlayer{
350  STRONGlayerele* data;
351  int ncount;
353  STRONGlayer* next;
354 }STRONGlayer;
356 /*WayHeight*/
357 typedef struct PortionInstruction{
358  double cos;
359  trackpoint *dest;
361 typedef struct PortionInstructionCol{
362  Neighbour* nb;
363  PortionInstruction* PI;
364  double SumCos;
365  int Pcount;
366  trackpoint *src;
367  PortionInstructionCol* next;
370 /*ClimbAnalyse*/
371 typedef struct nbpoolele{
372  int mintp;
373  Neighbour* nb;
374 }nbpoolele;
375 typedef struct crosspoolele{
376  float h;
377  KOO* k;
378 }crosspoolele;
380 typedef struct climb{
381  climbstate state;
382  short branches;
387  float P, Pmax, Prec, d, hend, hstart, hmdown,hmup;
391  climb * next,*prev;
395 }climb;
396 typedef struct CAfib{
397  float h; //Distanz der KOO
398  climb* c;
399 }CAfib;
400 class Cfib : public STRONGfib{
401 public:
402  float hmup,hmdown,P;
403 }; //Hilfstruktur fuer ClimbDijkstra
405 typedef struct climblayerelement{
406  double **dharray;
407  int dhcount;
408  double **KOOarray;
409  int KOOcount;
410  char* name;
415  double midlat,midlon;
417 typedef struct climblayer{
419  long climbcount;
420  climblayer* prev;
421  climblayer* next;
422 }climblayer;
423 typedef struct templatepoint{
424  int x,y;
425  int dx,dy;
426  short rprev;
427  short rnext;
double hmperkm
Definition: DataTyps.h:294
bool showreduceddata
average data over multiple screen pixels to sensfully show fill color
Definition: DataTyps.h:211
float d
Definition: DataTyps.h:389
KOO * home
cross, climb refers to
Definition: DataTyps.h:383
double heights[5]
heights of 5 step color scale
Definition: DataTyps.h:234
Neighbour * via
connection to reach this STRONG
Definition: DataTyps.h:258
bool html
climb analyse dialog
Definition: DataTyps.h:307
double minP
climb analyse dialog
Definition: DataTyps.h:303
double mapsize
picturesize in megapixel
Definition: DataTyps.h:318
bool ClimbInsteadHm
maximizes difficulty instead Hm
Definition: DataTyps.h:299
double T
Temperature at sea level [°C].
Definition: DataTyps.h:10
char start_btp[260]
osm data to load at beginning
Definition: DataTyps.h:331
float index
connection to be drawn
Definition: DataTyps.h:346
STRONGsetting sconfig
STRONGAlgo setting, detail mode.
Definition: DataTyps.h:328
char balance
AVL tree balance.
Definition: DataTyps.h:84
float stheta
precalculated sin
Definition: DataTyps.h:190
Definition: DataTyps.h:400
Way * way
Neighbour lives uses this Way.
Definition: DataTyps.h:53
float Prec
Definition: DataTyps.h:389
float sphi
precalculated sin
Definition: DataTyps.h:188
double abrake
maximum brake accelartion [m/s²]
Definition: DataTyps.h:16
FibunacciHeap element to store STRONG data with climb restrictions.
Definition: DataTyps.h:270
int hmmax
finalization criterium absolute
Definition: DataTyps.h:293
STRONGlayer * prev
count of indexed road sections
Definition: DataTyps.h:352
float maxlon
bounding rect, for rendering
Definition: DataTyps.h:126
float minP
defines climb: min. difficulty
Definition: DataTyps.h:297
float index
for summit ranking
Definition: DataTyps.h:139
list elements to handle multiple STRONGlayers
Definition: DataTyps.h:349
container struct to hold data of a coordinate
Definition: DataTyps.h:82
bool Climblayer
climb analyse dialog
Definition: DataTyps.h:313
STRONG * from
pointer to related STRONG struct
Definition: DataTyps.h:265
QRgb roadcolor[6]
color for all different road types
Definition: DataTyps.h:217
float hmup
Definition: DataTyps.h:389
KOO ** node
reference to KOO (of way)
Definition: DataTyps.h:61
char status
state of the KOO when used by different classes
Definition: DataTyps.h:100
double lat
Definition: DataTyps.h:86
QRgb heightcolor[5]
5 step color scale
Definition: DataTyps.h:233
climb * cst
start point as climb struct
Definition: DataTyps.h:392
KOO * nb
Definition: DataTyps.h:54
short branches
count of branching chilf climbs
Definition: DataTyps.h:382
float downtoupmax
defines climb: allowed down Hm
Definition: DataTyps.h:296
int tpi
index of related element in synchronized trackpoint array
Definition: DataTyps.h:180
FibunacciHeap element to store STRONG data.
Definition: DataTyps.h:261
routing container struct, connects cross via Way with each other
Definition: DataTyps.h:47
int hmstep
Additional criteria for STRONGPlus defining climb.
Definition: DataTyps.h:292
setting for poweranalysis
Definition: DataTyps.h:6
Neighbour * next
next Neighbour, set to NULL if last
Definition: DataTyps.h:63
container struct for ClimbAnalyse
Definition: DataTyps.h:380
base information to draw road section in STRONGlayers
Definition: DataTyps.h:344
main container list climbanalyse
Definition: DataTyps.h:162
FibunacciHeap element to store STRONG data with climb analysis.
Definition: DataTyps.h:280
int nodec
count of used KOO in way
Definition: DataTyps.h:59
KOO * k
reference to KOO
Definition: DataTyps.h:138
bool drawct
draw current track
Definition: DataTyps.h:321
bool noSTRONGPlus
dont apply climb restrictions
Definition: DataTyps.h:298
bool list
climb analyse dialog
Definition: DataTyps.h:309
double maxlon
Definition: DataTyps.h:216
float hmup
Hm ascenting since last big descent section.
Definition: DataTyps.h:273
memory for routing algorithms
Definition: DataTyps.h:75
qint64 id
OSM way id
Definition: DataTyps.h:123
char SRTM3folder[260]
SRTM3 data folder.
Definition: DataTyps.h:330
qint64 id
id inherited from OSM data
Definition: DataTyps.h:83
char maxtype
way restrictions
Definition: DataTyps.h:326
float Pmax
Definition: DataTyps.h:389
trackpointlist * t
track profil so far, to trace back
Definition: DataTyps.h:384
char * name
OSM name of point
Definition: DataTyps.h:140
short balance
AVL tree balance.
Definition: DataTyps.h:128
setting for 2D plot
Definition: DataTyps.h:196
trackpointlist * tst
start point in track profil
Definition: DataTyps.h:385
readdirection rd
Definition: DataTyps.h:52
char type
Definition: DataTyps.h:129
double aradial
maximum radial accelaration [m/s²]
Definition: DataTyps.h:17
climb * root
root of the whole climb tree
Definition: DataTyps.h:393
float d
current distance at STRONG
Definition: DataTyps.h:263
container for line geodata
Definition: DataTyps.h:122
float hend
Definition: DataTyps.h:389
double rfac
Area restricitions of STRONG routing.
Definition: DataTyps.h:290
Neighbour * via
connection to STRONG
Definition: DataTyps.h:267
SunSetting sun
lighting of relief
Definition: DataTyps.h:236
void * from
&lt; pointer to STRONG or FibunacciHeap
Definition: DataTyps.h:257
int drawSTRONGlayer
create mapdialog setting
Definition: DataTyps.h:333
QRgb pointcolor[6]
fontcolor of town, village, ...
Definition: DataTyps.h:222
osm data container list for relation data (multiple lakes and forrests)
Definition: DataTyps.h:149
float P
Definition: DataTyps.h:389
float hmdown
Hm descenting since last big descenting section.
Definition: DataTyps.h:277
KOO * k
current KOO
Definition: DataTyps.h:266
float I
Definition: DataTyps.h:187
float hmdown
Definition: DataTyps.h:389
double minHM
climb analyse dialog
Definition: DataTyps.h:306
inputstate input
current routing mode
Definition: DataTyps.h:332
KOO ** node
array KOO pointers
Definition: DataTyps.h:125
bool drawSL
draw stronglayer
Definition: DataTyps.h:320
climbstate state
current state at ClimbAnalyse
Definition: DataTyps.h:381
char ProjectName[260]
climb analyse dialog
Definition: DataTyps.h:311
double mapsize
climb analyse dialog
Definition: DataTyps.h:312
bool drawCL
draw climblayer
Definition: DataTyps.h:319
STRONGsetting cconfig
STRONGAlgo setting, climb mode.
Definition: DataTyps.h:329
float d
Definition: DataTyps.h:58
double cwAT
Fermi CwA function parameter[,,km/h,].
Definition: DataTyps.h:13
trackpointlist * tend
Definition: DataTyps.h:386
bool map
climb analyse dialog
Definition: DataTyps.h:308
int plotpower
Plotting power calc results.
Definition: DataTyps.h:340
char * name
OSM name of line
Definition: DataTyps.h:146
double cr
rolling resistance
Definition: DataTyps.h:9
int tpc
count of trackpoint
Definition: DataTyps.h:60
Neighbour * neighbours
neigbours to link to other cross
Definition: DataTyps.h:74
float d
current distance, synchronized to trackpoint array
Definition: DataTyps.h:176
double minS
climb analyse dialog
Definition: DataTyps.h:304
int drawClimblayer
create mapdialog setting
Definition: DataTyps.h:335
float pointsize[6]
fontsize of town, village, ...
Definition: DataTyps.h:221
float hm
current Hm at STRONG
Definition: DataTyps.h:264
double maxlon
Definition: DataTyps.h:317
char ProjectFolder[260]
climb analyse dialog
Definition: DataTyps.h:310
Way * prev
AVL tree struct.
Definition: DataTyps.h:127
KOO * k
reference to KOO data
Definition: DataTyps.h:173
float hstart
Definition: DataTyps.h:389
int plotspeed
Plotting power calc results.
Definition: DataTyps.h:339
Neighbour * via
last used link
Definition: DataTyps.h:394
double PT
Fermi Power function parameter [km/h,W,km/h].
Definition: DataTyps.h:12
container struct to hold data of a cross
Definition: DataTyps.h:73
double m
system weigth [kg]
Definition: DataTyps.h:8
double wd
Wind strenght ws [bft] and direction wd [°].
Definition: DataTyps.h:7
container struct for Track to hold distance and height data
Definition: DataTyps.h:33
float hm
total height meter, for routing
Definition: DataTyps.h:57
KOO * prev
AVL tree pointers.
Definition: DataTyps.h:85
short dhmin
defines climb: min. Hm
Definition: DataTyps.h:295
short marked
labels elements for drag-drop-routing:
Definition: DataTyps.h:178
trackpoint * tp
heighdata of this Neighbour
Definition: DataTyps.h:62
char * name
name ref owned by lines
Definition: DataTyps.h:130
main container for Track, WayHeight and ClimbAnalyse
Definition: DataTyps.h:172
double maxdwnHM
climb analyse dialog
Definition: DataTyps.h:305
main user setting container
Definition: DataTyps.h:324
osm data container list for line like data (roads, rivers)
Definition: DataTyps.h:143
float roadwidth[6]
width for all different road types
Definition: DataTyps.h:218
float ctheta
precalculated cos
Definition: DataTyps.h:191
osm data container list for point like data (summits, towns, ...)
Definition: DataTyps.h:137
setting of the light to render the DEM
Definition: DataTyps.h:185
container for user settings to run ClimbAnalyse
Definition: DataTyps.h:302
int nodec
count of KOO
Definition: DataTyps.h:124
int drawRoute
create mapdialog setting
Definition: DataTyps.h:334
float cphi
precalculated cos
Definition: DataTyps.h:189
Way * way
reference element of this list
Definition: DataTyps.h:144
STRONGsetting mconfig
STRONGAlgo setting, fast mode.
Definition: DataTyps.h:327
double p0
air pressure at sea level [hPa]
Definition: DataTyps.h:11
Neighbour * brthr
related Neighbour with opposite read direction supposed to store brthr
Definition: DataTyps.h:56
container for user settings to manually generate map
Definition: DataTyps.h:316
main struct for routing purpose
Definition: DataTyps.h:255