forked from donaloconnor/automon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
accelerationtestwidget.h
82 lines (66 loc) · 2.95 KB
/
accelerationtestwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef ACCELERATIONTESTWIDGET_H
#define ACCELERATIONTESTWIDGET_H
/*
==================================================================================================
| accelerationtestwidget.h |
| Part of the Automon application. |
| |
| Final Year Project - "An Embedded Automotive Monitoring Device" |
| |
| By Donal O' Connor for completion of B.Sc (Hons) Software Development and Computer Networking |
| Email: [email protected] |
| Website/Blog: http://automon.killarneyonline.eu |
| |
| Cork Institute of Technology, Cork, Ireland - http://www.cit.ie/ |
| |
| Copyright © 2009 Donal O'Connor <[email protected]> |
==================================================================================================
The Acceleration Test widget is part of the main GUI of Automon.
It is one of the menu items on top. It's purpose is to provide a GUI interface
and also provide the logic to do an acceleration test.
The implementation file includes the detail of what occurs.
AccelerationTest is a class derived from widget.
It also includes a signal, changeStatus in which the main GUI widget connects to, to receieve
messages from this Widget and display them on the screen
*/
#include <QWidget>
#include "automon.h"
class QLabel;
class QVBoxLayout;
class QHBoxLayout;
class QLCDNumber;
class QPushButton;
class QSpinBox;
class QTime;
using namespace AutomonKernel;
class AccelerationTestWidget : public QWidget
{
Q_OBJECT
public:
AccelerationTestWidget(Automon * kernel, QWidget * parent = 0);
~AccelerationTestWidget();
public slots:
void startTest();
void display(double speed);
signals:
void changeStatus(const QString & status);
private:
void setUpSensor();
void removeSensor();
QLabel * m_header;
QHBoxLayout * m_mainLayout;
QVBoxLayout * m_verticalLayout;
QLCDNumber * m_speed;
QLCDNumber * m_accelerationTimeDisplay;
Automon * m_kernel;
QPushButton * m_startTest;
QSpinBox * m_destinationSpeed;
QTime * m_time;
bool m_carMoving;
int m_accelerationTime;
bool m_testFinished;
int m_parkThreshold;
bool m_testStarted;
bool m_startButtonClicked;
};
#endif // ACCELERATIONTESTWIDGET_H