\( \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
main.cpp
1 #include <QtWidgets/QApplication>
2 #include <QFileInfo>
3 #include <QRegExp>
4 #include <QStringList>
5 #include "mainwindow.h"
6 
7 int main(int argc, char *argv[])
8 {
9  QApplication a(argc, argv);
10  MainWindow w;
11  w.show();
12  //w.read_osm("D:\\ClimbProject\\pbf-Data\\problem5.osm");
13  if(argc > 1){
14  QRegExp rbound("(-b=)(-?\\d+\\.?\\d*)(,)(-?\\d+\\.?\\d*)(,)(-?\\d+\\.?\\d*)(,)(-?\\d+\\.?\\d*)");
15  QRegExp rpngdest("(-m=)(\\d+)(,)(\\d+)(,)(.+)");
16  QRegExp rbtpdest("(-d=)(.+)");
17  QRegExp rosmread("(-r=)(.+)");
18  QRegExp rbtpCA("(-a=)(.+)");
19  double minlat = -90., maxlat = 90., minlon = -180., maxlon = 180.;
20  int FalseCommand;
21  for(int i = 1; i < argc; i++){
22  FalseCommand = 1;
23  if(rosmread.indexIn(argv[i])==0){
24  // reading osm data
25  w.read_osm(rosmread.cap(2));
26  FalseCommand = 0;
27  }
28  if(rbtpdest.indexIn(argv[i])==0){
29  // saving btp data within bounding rect
30  w.save_btp(rbtpdest.cap(2),minlat,maxlat,minlon,maxlon);
31  FalseCommand = 0;
32  }
33  if(rpngdest.indexIn(argv[i])==0){
34  // generating and saving map
35  MAP mt(w.hd,w.osm);
36  mt.settings(&(w.c.MS));
37  mt.resize(rpngdest.cap(2).toInt(),rpngdest.cap(4).toInt());
38  mt.set_borders(minlat,maxlat,minlon,maxlon);
39  mt.calc_borders();
40  mt.draw_map(NULL,NULL,NULL,0);
41  mt.save_to_png(rpngdest.cap(6));
42  FalseCommand = 0;
43  }
44  if(rbtpCA.indexIn(argv[i])==0){
45  ClimbAnalyse CA(w.osm,w.c.mintype,w.c.maxtype,w.c.CA.minP,
46  w.c.CA.minS,w.c.CA.maxdwnHM,w.c.CA.minHM,
47  w.hd);
48  QString projectname = QDir(rbtpCA.cap(2)).dirName();
49  CA.set_brect(minlat,maxlat,minlon,maxlon);
50  CA.create_html(projectname.toLocal8Bit().data(),
51  rbtpCA.cap(2).toLocal8Bit().data());
52  FalseCommand = 0;
53  }
54  if(rbound.indexIn(argv[i])==0){
55  // setting up a bounding rect
56  minlon = rbound.cap(2).toDouble();
57  minlat = rbound.cap(4).toDouble();
58  maxlon = rbound.cap(6).toDouble();
59  maxlat = rbound.cap(8).toDouble();
60  FalseCommand = 0;
61  }
62  if(QString(argv[i])=="close"){
63  w.autosave = 0;
64  return w.close();
65  }
66  if(FalseCommand){
67  if(QFileInfo(QString(argv[i])).suffix()=="btp"){
68  // loading data set
69  w.load_btp(QString(argv[i]));
70  FalseCommand = 0;
71  }
72  if(QFileInfo(QString(argv[i])).suffix()=="gpx"){
73  // loading and analysing gpx file
74  w.analyse_gpx(QString(argv[1]));
75  FalseCommand = 0;
76  }
77  if(QFileInfo(QString(argv[i])).suffix()=="osm"){
78  // reading osm data
79  w.read_osm(argv[1]);
80  FalseCommand = 0;
81  }
82  if(FalseCommand)
83  // still not recognized commend
84  QMessageBox(QMessageBox::NoIcon,"Unknown argument",argv[i]).exec();
85  }
86  }
87  }
88 
89  return a.exec();
90 }
double minP
climb analyse dialog
Definition: DataTyps.h:303
char maxtype
way restrictions
Definition: DataTyps.h:326
extracts climbs from street network and provides climblayer handling
Definition: ClimbAnalyse.h:52
double minHM
climb analyse dialog
Definition: DataTyps.h:306
double minS
climb analyse dialog
Definition: DataTyps.h:304
double maxdwnHM
climb analyse dialog
Definition: DataTyps.h:305
generating maps
Definition: MAP.h:24