252e7ff1e2899c3dee4a51f853bebbdc7ef0f9c2
[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     void setSendServerButtonEnabled();
31
32 signals:
33     void sendresult(double);
34
35 protected:
36     void changeEvent(QEvent *e);
37     void paintEvent(QPaintEvent *);
38
39 private:
40     QPoint changeMeasuresToDiagramPoint(int aSpeed, qreal aTime);
41     void setTimesIntoLabels();
42     void setTimeAxelLength(int pChoice);
43     void setHeaders();
44     void showOrHideLabels();
45     int getTargetChoice();
46
47 private:
48     Ui::ResultDialog *ui;
49     qreal timeArray[11];
50     double diagramGapStem;
51     double diagramGapHorizontal;
52     QStringList speedList;
53     QStringList timeList;
54     int timeAxelLength;
55     QString resultString;
56
57 private slots:
58     void on_pushButtonNew_clicked();
59     void on_pushButtonSend_clicked();
60 };
61
62 #endif // RESULTDIALOG_H