\( \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
147 #ifndef MAINWINDOW_H
148 #define MAINWINDOW_H
149 #pragma once
150 #include <QtWidgets/QMainWindow>
151 #include <QPixmap>
152 #include <QResizeEvent>
153 #include <stdio.h>
154 #include <QtWidgets/QFileDialog>
155 #include <QTime>
156 #include <QtWidgets/QMessageBox>
157 #include "DataTyps.h"
158 #include "HeightData.h"
159 #include "MAP.h"
160 #include "Routing.h"
161 #include "STRONGcalc.h"
162 #include "UndoRedo.h"
163 #include "WayHeight.h"
164 #include "btp3setups.h"
165 #include "ClimbAnalyse.h"
166 #include "poweranalysis.h"
167 #include "gpx.h"
168 #include "webdata.h"
175 namespace Ui {
176 class MainWindow;
177 }
179 class MainWindow : public QMainWindow
180 {
183 public:
184  explicit MainWindow(QWidget *parent = 0);
185  ~MainWindow();
186  void closeEvent(QCloseEvent *);
187  void load_btp(QString filename);
188  void save_btp(QString filename, double minlat, double maxlat,
189  double minlon, double maxlon);
190  void read_osm(QString filename);
191  void analyse_gpx(QString filename);
192  HeightData* hd;
193  OSM* osm;
194  config c;
195  int autosave;
196 private slots:
197  void set_SRTM3_folder();
198  void set_start_btp();
199  void load_btp();
200  void save_btp();
201  void read_osm();
202  void analyse_gpx();
205  void toggle_poweranalysis();
206  void profilinfo(double x);
207  void profil_settings();
208  void map_settings();
209  void STRONG_preview(int i);
210  void STRONG_settings();
212  void route_STRONG_finalize(int succes);
214  void save_profile();
215  void save_gpx();
216  void create_STRONGlayer();
217  void save_STRONGlayer();
218  void load_STRONGlayer();
219  void toggle_STRONGlayer();
220  void load_STRONGcalc();
221  void save_STRONGcalc();
222  void AnalyseClimbs();
223  void load_Climblayer();
224  void toggle_Climblayer();
225  void generate_Map();
229  void normalize_Hm();
234  void invert_Hm();
235  void update_profil();
237  void center_track(double d);
239  void zoom_profil(double dmin, double dmax);
240  void toggle_showpower();
241  void toggle_showspeed();
246  void generate_tiles();
252  void split_europe_pbf();
258  void next_command();
262  void add_Cmd(webdatacmd* w);
266  void correct_hgt();
270  void read_europe();
274  void CA_europe();
278  void STRONG_europe();
280  void zoom14_collection();
281 signals:
282  void stop_STRONG();
283 private:
285  void init();
286  void init_config();
287  void autoload_setting();
288  void autosave_setting();
293  void resizeEvent ( QResizeEvent * event );
295  void keyPressEvent(QKeyEvent *event);
297  void mousePressEvent(QMouseEvent *event);
298  void mouseReleaseEvent(QMouseEvent *event);
299  void mouseDoubleClickEvent(QMouseEvent *event);
300  void mouseMoveEvent(QMouseEvent *event);
301  void wheelEvent(QWheelEvent * event );
302  void MouseToTrack();
304  void zoom(double zoomfactor,double dlonfactor, double dlatfactor);
305  void update_statusbar();
307  void set_routingmode(inputstate ip);
308  void set_mintype(char mt);
309  void set_maxtype(char mt);
310  void delete_to_cross(int cc);
311  void undo();
312  void redo();
313  void enter();
314  void update_map_raw();
315  void update_map_track();
316  void update_map_MovObj(Way* w);
317  void drawRoute(QPainter *p);
318  void drawCross(QPainter *p);
319  void route_short();
320  void route_flat();
321  void route_STRONG();
322  void acceptSTRONG();
323  void selectSTRONG(readdirection rd, short steps);
325  void delete_STRONG_tracks();
326  void toggle_preview();
327  int route_preview(int x, int y);
328  void accept_ct();
329  void reset_track();
331  Ui::MainWindow *ui;
332  MAP* map;
333  Routing* r;
334  PowerAnalysis* PA;
335  QPixmap* cmap;
336  int x,y;
337  int xold,yold;
338  KOO *kold,*knew,*kdot;
339  KOO* anchorfrom, *anchorto;
341  Track* lrt;
343  int sN;
346  dotstate dstate;
347  int ydot,xdot;
348  inputstate oldroutemode;
350  QString status1, status2;
351  short readytotrace;
355  short traceback;
356  int trace_back(KOO* k);
358  void recalc_power();
359  QColor colorgradient(float x);
361  long int SLnbc;
362  int SLN, SLc;
363  STRONGlayer* SL;
366  QLabel * statusLeft;
367  QLabel * statusMiddle;
368  QList<webdatacmd> Cmdl;
371 };
373 #endif // MAINWINDOW_H
void read_europe()
slot to organize multithreating task
int STRONGstate
Definition: mainwindow.h:353
QString status2
Definition: mainwindow.h:350
KOO * anchorto
Definition: mainwindow.h:339
void correct_hgt()
slot to organize multithreating task
void delete_to_cross(int cc)
void reset_track()
Definition: mainwindow.cpp:939
Way * selected_way
Definition: mainwindow.h:349
void update_profil()
Definition: mainwindow.cpp:351
void next_command()
slot to organize multithreating task
void accept_ct()
QPixmap * cmap
Definition: mainwindow.h:335
void toggle_showpower()
int threadscount
Definition: mainwindow.h:370
list elements to handle multiple STRONGlayers
Definition: DataTyps.h:349
KOO * kdot
Definition: mainwindow.h:338
container struct to hold data of a coordinate
Definition: DataTyps.h:82
QLabel * statusLeft
Definition: mainwindow.h:366
void route_short()
Definition: mainwindow.cpp:801
void set_maxtype(char mt)
Track ** STRONGtracks
Definition: mainwindow.h:342
void route_STRONG_finalize(int succes)
Definition: mainwindow.cpp:862
void recalc_power()
void zoom(double zoomfactor, double dlonfactor, double dlatfactor)
handles all map modification (mooving, zooming)
Definition: mainwindow.cpp:207
int trace_back(KOO *k)
Definition: mainwindow.cpp:725
void mousePressEvent(QMouseEvent *event)
handles all mouse inputs
Definition: mainwindow.cpp:412
UndoRedo * UR
Definition: mainwindow.h:345
void toggle_preview()
dotstate dstate
Definition: mainwindow.h:346
void update_map_raw()
Definition: mainwindow.cpp:296
QColor colorgradient(float x)
void set_routingmode(inputstate ip)
sets routing mode and shows hints in statusbar
Definition: mainwindow.cpp:975
undo and redo container class for BTP to save no longer needed tracks
Definition: UndoRedo.h:13
void enter()
holds digital elevation model extracted from SRTM3 data
Definition: HeightData.h:26
official representation of Track in BTP3
Definition: track.h:14
int STRONGindex
Definition: mainwindow.h:344
void keyPressEvent(QKeyEvent *event)
handles keyboard input
Definition: mainwindow.cpp:103
container for line geodata
Definition: DataTyps.h:122
Track * ct
Definition: mainwindow.h:340
short traceback
Definition: mainwindow.h:355
void zoom_profil(double dmin, double dmax)
repaints profil with current dataset, but refreshed titel
void add_Cmd(webdatacmd *w)
slot to organize multithreating task
void drawCross(QPainter *p)
Definition: mainwindow.cpp:386
void STRONG_settings()
short readytotrace
Definition: mainwindow.h:351
void update_map_MovObj(Way *w)
Definition: mainwindow.cpp:327
climblayer * CL
Definition: mainwindow.h:365
void toggle_poweranalysis()
conroles communication from profil to mainwindow
QLabel * statusMiddle
Definition: mainwindow.h:367
void update_map_track()
Definition: mainwindow.cpp:313
void CA_europe()
slot to organize multithreating task
multithreading working command, defines the task to be executed
Definition: webdata.h:16
class to perform routing routines on osm data sets
Definition: Routing.h:18
void STRONG_europe()
slot to organize multithreating task
void resizeEvent(QResizeEvent *event)
change of main window size
Definition: mainwindow.cpp:97
void init()
loads settings, initialized variables
Definition: mainwindow.cpp:235
void invert_Hm()
void STRONG_preview(int i)
void generate_tiles()
creates tiles for map server
power calculation for height-distance datasets
Definition: poweranalysis.h:76
void drawRoute(QPainter *p)
Definition: mainwindow.cpp:398
BTP3 database, created from OpenStreetMap data.
Definition: osm.h:34
void acceptSTRONG()
Definition: mainwindow.cpp:917
void zoom14_collection()
copy high zoom level tiles for desired areas in europe
void set_mintype(char mt)
void route_flat()
Definition: mainwindow.cpp:823
int route_preview(int x, int y)
void center_track(double d)
void route_STRONG()
Definition: mainwindow.cpp:847
main user setting container
Definition: DataTyps.h:324
void selectSTRONG(readdirection rd, short steps)
void toggle_showspeed()
QList< webdatacmd > Cmdl
command list to calculate web content multithreated
Definition: mainwindow.h:369
void normalize_Hm()
generating maps
Definition: MAP.h:24
void split_europe_pbf()
splits europe.pbf $osm data
void generate_Map()