\( \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
plot2D.h
1 #ifndef PLOT2D_H
2 #define PLOT2D_H
3 #include <math.h>
4 #include "DataTyps.h"
5 #include <QPixmap>
6 #include <QPainter>
7 #include <QRect>
8 #include <QBrush>
9 #include <QMouseEvent>
10 #include <QString>
11 #include <QFontMetricsF>
12 #include <QClipboard>
13 #include <QtWidgets/QMessageBox>
14 
16 
20 class plot2D : public QWidget{
21  Q_OBJECT
22 public:
23  plot2D(QWidget *parent = 0);
24  plot2D(plot2D *src);
25  ~plot2D();
27  void set_data(double** dataxy, int count);
29  void set_data(double** data1xy, int count1,
30  double** data2xy, int count2,
31  double** data3xy, int count3);
32  void set_labels(QString title, QString xbarlabel, QString ybarlabel);
33  QSize sizeHint() const;
34  QSize minimumSizeHint() const;
35  void autoset_axis();
36  void set_marker(double x);
37  double get_xmin();
38  void set_size(int w,int h);
39  void save_to_png(QString filename);
40  void settings(ProfilSettings* s);
41  void refresh_pixmap();
42 public slots:
43  void zoom_in();
44  void zoom_out();
45 private:
46  double *xdata, *ydata;
47  double *xdata1, *ydata1;
48  double *xdata2, *ydata2;
49  int count, count1, count2;
50  QPixmap pm;
53  int xsteps, ysteps, showzoombox, xold, yold;
54  double xstep, ystep, xstep0, ystep0;//Achsskalen
55  double xprecission, yprecission;
56  double linewidth;
57  double marker;
58  float textheight, titleheight;
59  QPoint mouseposition;
60  QString title, xbarlabel, ybarlabel;
61  QRect dataarea;
62  QRect zoombox;
63  double xtoxdata(int x);
64  double ytoydata(int y);
65  double xdatatox(double x);
66  double ydatatoy(double y);
67  void add_axis_labels(QPainter* p);
68  void add_grid(QPainter* p);
69  void add_data(QPainter* p);
70  QColor slopetocolor(double x);
71  void init_s0();
72 signals:
73  void keypressed(QKeyEvent *event);
74  void mousex(double x);
75  void call_zoom_repaint(double xmin, double xmax);
77  void call_fullview();
78  void clicked(double x);
79 protected:
80  void paintEvent(QPaintEvent *);
81  void resizeEvent(QResizeEvent *);
82  void mousePressEvent(QMouseEvent *event);
83  void mouseMoveEvent(QMouseEvent *event);
84  void mouseReleaseEvent(QMouseEvent *event);
85  void keyPressEvent(QKeyEvent *event);
86 
87 };
88 
89 #endif // GRAPH_H
void call_zoom_repaint(double xmin, double xmax)
indicate wish to be repainted
void add_data(QPainter *p)
rendering subfunction
Definition: plot2D.cpp:357
double xdatatox(double x)
transform data value to pic-px
Definition: plot2D.cpp:230
ProfilSettings s0
intrinsic settings
Definition: plot2D.h:51
QRect dataarea
coordinates of plot inset
Definition: plot2D.h:61
void autoset_axis()
autoscale plot to full data view
Definition: plot2D.cpp:546
double ytoydata(int y)
transform pic-px to data value
Definition: plot2D.cpp:227
double * ydata2
linedata blue
Definition: plot2D.h:48
void add_axis_labels(QPainter *p)
rendering subfunction
Definition: plot2D.cpp:236
void call_fullview()
indicate wish to be rescaled
QRect zoombox
rect to be drawn green when zoomed
Definition: plot2D.h:62
void set_marker(double x)
draws vertical black line at x pos
Definition: plot2D.cpp:565
double yprecission
axis label precission
Definition: plot2D.h:55
QColor slopetocolor(double x)
calc fill color of profil data
Definition: plot2D.cpp:538
setting for 2D plot
Definition: DataTyps.h:196
void mousex(double x)
int count2
data point count
Definition: plot2D.h:49
double xtoxdata(int x)
transform pic-px to data value
Definition: plot2D.cpp:224
plotting 2D-Data sets as the height profile of a track or poweranalysis data
Definition: plot2D.h:20
QPixmap pm
plot pixel data
Definition: plot2D.h:50
float titleheight
text size
Definition: plot2D.h:58
ProfilSettings * s
assigned settings to be used
Definition: plot2D.h:52
void refresh_pixmap()
repaints the plot&#39;s pixmap
Definition: plot2D.cpp:214
double * ydata
profile data
Definition: plot2D.h:46
void set_data(double **dataxy, int count)
setting one dataset and repaint plot
Definition: plot2D.cpp:475
void init_s0()
initialize intrinsic settings
Definition: plot2D.cpp:73
double ydatatoy(double y)
transform data value to pic-px
Definition: plot2D.cpp:233
double * ydata1
linedata red
Definition: plot2D.h:47
void settings(ProfilSettings *s)
asign settings to plot
Definition: plot2D.cpp:582
void add_grid(QPainter *p)
rendering subfunction
Definition: plot2D.cpp:343