From: Toni Jussila Date: Mon, 22 Mar 2010 12:28:52 +0000 (+0200) Subject: Merge branch 'development/GPS' X-Git-Tag: v0.1~14 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=db5f8d85fd299de8e55129ef7e7c0ea5fa5d4790;p=speedfreak Merge branch 'development/GPS' --- db5f8d85fd299de8e55129ef7e7c0ea5fa5d4790 diff --cc Client/carmainwindow.cpp index 55faff9,2216ca0..4272b3a --- a/Client/carmainwindow.cpp +++ b/Client/carmainwindow.cpp @@@ -705,33 -779,17 +706,46 @@@ void CarMainWindow::gpsStatus( ui->labelRouteTabGPSStatus->setText("Waiting for GPS"); } } + ui->labelRouteTabSpeed->setText(QString::number(location->getSpeed())); + } + + void CarMainWindow::on_startRecPushButton_clicked() + { + ui->labelRouteTabRecStatus->setText("Recording started"); + gpsData->startRouteRecording(ui->labelRouteTabGPSTime->text()); + } + + void CarMainWindow::on_stopRecPushButton_clicked() + { + ui->labelRouteTabRecStatus->setText("Recording stopped"); + gpsData->stopRouteRecording(ui->labelRouteTabGPSTime->text()); } + +/** + *Sets time axis right way in result dialog and shows target speed result. + *@param double pTime is the target speed result time which is shown to the user. + */ +void CarMainWindow::setTimeAxisGapAndShowResult(double pTime) +{ + ui->pushButtonShowResultDialog->setEnabled(true); + ui->pushButtonSendResult->setEnabled(true); + QString timeInteger; + timeInteger.setNum(pTime); + ui->labelMeasureTabResult->show(); + ui->labelMeasureTabResult->setText(timeInteger); + + if (floor(pTime) <= 5) + { + result->setDiagramGapHorizontal(80); + } + + else if (floor(pTime) <= 10) + { + result->setDiagramGapHorizontal(40); + } + + else + { + result->setDiagramGapHorizontal(20); + } +}