Added signal strength indicator to detail screen. Changed speed treshold to change...
[jspeed] / src / detailscreen.h
1 /*
2  * This file is part of jSpeed.
3  *
4  * jSpeed is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * jSpeed is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with jSpeed.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  */
18
19 #ifndef DETAILSCREEN_H
20 #define DETAILSCREEN_H
21
22 #include "graphicsscreen.h"
23
24 class QString;
25 class QGraphicsTextItem;
26 class QGraphicsLineItem;
27 class QGraphicsPixmapItem;
28
29 class DetailScreen : public GraphicsScreen
30 {
31     Q_OBJECT
32
33 public:
34     DetailScreen(QWidget* parent = 0);
35
36 public slots:
37     virtual void update();
38     void reArrange();
39
40 private slots:
41     void updateTime();
42     void updateUnits();
43
44 private:
45     QString formatTime(qulonglong time);
46     QGraphicsTextItem* createItem(QString const& text);
47     QGraphicsLineItem* createLine();
48     QString roundDouble(double number);
49     int getStrength();
50     QGraphicsTextItem* tripLabel_;
51     QGraphicsTextItem* trip_;
52     QGraphicsTextItem* tripUnit_;
53     QGraphicsTextItem* totalLabel_;
54     QGraphicsTextItem* total_;
55     QGraphicsTextItem* totalUnit_;
56     QGraphicsTextItem* speedLabel_;
57     QGraphicsTextItem* speed_;
58     QGraphicsTextItem* speedUnit_;
59     QGraphicsTextItem* avgSpeedLabel_;
60     QGraphicsTextItem* avgSpeed_;
61     QGraphicsTextItem* avgSpeedUnit_;
62     QGraphicsTextItem* maxSpeedLabel_;
63     QGraphicsTextItem* maxSpeed_;
64     QGraphicsTextItem* maxSpeedUnit_;
65     QGraphicsTextItem* tripTimeLabel_;
66     QGraphicsTextItem* tripTime_;
67     QGraphicsTextItem* totalTimeLabel_;
68     QGraphicsTextItem* totalTime_;
69     QGraphicsLineItem* line1_;
70     QGraphicsLineItem* line2_;
71     QGraphicsPixmapItem* strength_;
72     int currentStrength_;
73 };
74
75 #endif