* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
+#include "routesavedialog.h"
#include "routedialog.h"
#include "ui_routedialog.h"
#include "usersettings.h"
/**
* Constructor of this class.
*/
-RouteDialog::RouteDialog(QWidget *parent) :
+RouteDialog::RouteDialog(RouteSaveDialog *parent) :
QDialog(parent), ui(new Ui::RouteDialog)
{
qDebug() << "__RouteDialog";
ui->setupUi(this);
- helpRoutingDialog = NULL;
-
this->setWindowTitle("Route");
left = 5; top = 5; right = 495; bottom = 295; // Limits in screen coordinates
+ helpRoutingDialog = NULL;
+
// Button settings
ui->sendPushButton->setAutoFillBackground(true);
ui->sendPushButton->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
// Clear labels
ui->labelInfoToUser->setText("");
ui->speedValueLabel->setText("");
+ ui->avgSpeedValueLabel->setText("");
// Check login
checkLogin();
+
+ // Set average speed
+ QString average;
+ ui->avgSpeedValueLabel->setText(average.sprintf("%.1f", parent->getAverageSpeed()) + " km/h");
+ ui->distanceValueLabel->setText(parent->getDistanceTraveled() + " km");
}
/**
qDebug() << "__~RouteDialog";
if(ui)
delete ui;
+ if(calibrateDialog)
+ delete calibrateDialog;
}
/**
// Show max velocity point by yellow circle
painter.drawEllipse( x1Screen-5, y1Screen-5, 10, 10);
- painter.drawEllipse( 650, 225, 10, 10);
+ painter.drawEllipse( ui->maxSpeedLabel->geometry().x()-15, ui->maxSpeedLabel->geometry().y()+15, 10, 10);
QString jono;
//jono = QString("%1 km/h").arg(maxv);
/**
*
*/
-bool RouteDialog::readRouteFromFile( QString &routeFile)
- {
+bool RouteDialog::readRouteFromFile( QString &routeFile , CalibrateDialog *calibrateDialog)
+{
QString rFile = routeFile; //Not used
Vector temp;
QString rivi;
QFile file;
+ progresbar = calibrateDialog;
+ int progresbarValue = 0;
+ progresbar->setProgressValue(++progresbarValue);
+
//QString fileName = QFileDialog::getOpenFileName(this,
// tr("Read Route"), "./", tr("Route Files (*.txt)"));
if (!file.open(QIODevice::ReadOnly))
{
QMessageBox::about(0, "Error", "File not found");
+ progresbar->setProgressValue(100);
return false;
}
*/
return true;
- }
+}
/**
* Find out data range for x-, y- and z-coordinates