Connecting client-server communication to new GUI.
[speedfreak] / Client / accrealtimedialog.h
1 #ifndef ACCREALTIMEDIALOG_H
2 #define ACCREALTIMEDIALOG_H
3
4 #include <QDialog>
5 #include <QTimer>
6 #include "accelerometer.h"
7 #include "movingaverage.h"
8
9 namespace Ui {
10     class AccRealTimeDialog;
11 }
12
13 class AccRealTimeDialog : public QDialog {
14     Q_OBJECT
15 public:
16     AccRealTimeDialog(QWidget *parent = 0);
17     ~AccRealTimeDialog();
18     void Calibrate();
19     void startAccelerationMeasure();
20     void SetStopMeasureSpeed(double speed);
21
22 protected:
23     void changeEvent(QEvent *e);
24
25 private slots:
26     void on_buttonAbort_clicked();
27     void readAccelerometerData();
28
29 private:
30     Ui::AccRealTimeDialog *ui;
31     void resetAccelerometerMeasurements();
32
33     QTimer *accelerometerTimer;
34     QTime elapsedTime;
35     Accelerometer* accelerometer;
36     Calculate *calculate;
37     MovingAverage* movingAverageZ;
38
39     int updateScreenCounter;
40     double accelerationStartThreshold;
41     double currentAcceleration;
42     double currentTime;
43     double previousTime;
44     double time;
45     double speed;
46     double stopMeasureSpeed;
47     bool vehicleStartedMoving;
48     bool isNewRun;
49
50     QString currentSpeed;
51     QString totalTime;
52 };
53
54 #endif // ACCREALTIMEDIALOG_H