09c4174a8a303fd590ff8a49b247afffbcec03f0
[speedfreak] / Client / resultdialog.h
1 /*
2  * CarMainWindow main class
3  *
4  * @author     Janne Änäkkälä   <janne.anakkala@fudeco.com>
5  * @author      Toni Jussila    <toni.jussila@fudeco.com>
6  * @copyright  (c) 2010 Speed Freak team
7  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
8  */
9
10 #ifndef RESULTDIALOG_H
11 #define RESULTDIALOG_H
12
13 #include <QDialog>
14
15
16 namespace Ui {
17     class ResultDialog;
18 }
19
20 class ResultDialog : public QDialog {
21     Q_OBJECT
22 public:
23     ResultDialog(QWidget *parent = 0);
24     ~ResultDialog();
25
26     void setEnd(int pValue);
27     void setValue(int pSpeed, double pTime);
28     void setLabelInfoToUser(QString infoText);
29     double getResult();
30
31 signals:
32     void sendresult(double);
33
34 protected:
35     void changeEvent(QEvent *e);
36     void paintEvent(QPaintEvent *);
37
38 private:
39     QPoint changeMeasuresToDiagramPoint(int aSpeed, qreal aTime);
40     void setTimesIntoLabels();
41     void setTimeAxelLength(int pChoice);
42     void setHeaders();
43     void showOrHideLabels();
44     int getTargetChoice();
45
46 private:
47     Ui::ResultDialog *ui;
48     qreal timeArray[11];
49     double diagramGapStem;
50     double diagramGapHorizontal;
51     QStringList speedList;
52     QStringList timeList;
53     int timeAxelLength;
54     QString resultString;
55
56 private slots:
57     void on_pushButtonNew_clicked();
58     void on_pushButtonSend_clicked();
59 };
60
61 #endif // RESULTDIALOG_H