* Acceleration start dialog
*
* @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
* Acceleration start dialog
*
- * @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
public:
accelerationstart(QWidget *parent = 0);
~accelerationstart();
+ AccRealTimeDialog* accRealTimeDialog;
QString getMeasureCategory();
protected:
private:
Ui::accelerationstart *ui;
- AccRealTimeDialog* accRealTimeDialog;
double stopMeasureSpeed;
QString measureCategory;
* Acceleration info in real time dialog
*
* @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
* Acceleration info in real time dialog
*
- * @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Jukka Kurttila <jukka.kurttila@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
public:
AccRealTimeDialog(QWidget *parent = 0);
~AccRealTimeDialog();
+ ResultDialog* resultDialog;
void Calibrate();
void startAccelerationMeasure();
void SetStopMeasureSpeed(double speed);
protected:
void changeEvent(QEvent *e);
-private slots:
- void on_buttonAbort_clicked();
- void readAccelerometerData();
- void sendResult(double);
-
-signals:
- void sendresult(double);
-
private:
Ui::AccRealTimeDialog *ui;
void resetAccelerometerMeasurements();
- ResultDialog* resultDialog;
QTimer *accelerometerTimer;
QTime elapsedTime;
QString currentSpeed;
QString totalTime;
+
+private slots:
+ void on_buttonAbort_clicked();
+ void readAccelerometerData();
+ void sendResult(double);
+
+signals:
+ void sendresult(double);
};
#endif // ACCREALTIMEDIALOG_H
currentDownload = netManager->post(request, ("xml=" + xmlbuffer->data()));
connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfResult()));
//connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
- myMainw->resultDialog->setLabelInfoToUser("Sending result to server");
+
+ //Indicating user
+ myMainw->accstart->accRealTimeDialog->resultDialog->setLabelInfoToUser("Sending result to server");
xmlbuffer->close();
}
{
qDebug() << "_ackOfResult";
- myMainw->resultDialog->setLabelInfoToUser("");
+ //Indicating user
+ myMainw->accstart->accRealTimeDialog->resultDialog->setLabelInfoToUser("");
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
errorcode = reply->error();
if(errorcode != 0) {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- QMessageBox::about(myMainw->resultDialog, "Server reply to result sending ",reply->errorString());
+
+ //Indicating user
+ QMessageBox::about(myMainw->accstart->accRealTimeDialog->resultDialog, "Server reply to result sending ",reply->errorString());
}
else {
qDebug() << "errorcode:" << errorcode << reply->errorString();
- QMessageBox::about(myMainw->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
+
+ //Indicating user
+ QMessageBox::about(myMainw->accstart->accRealTimeDialog->resultDialog, "Server reply to result sending", "Result received " + reply->readAll());
}
}
routeDialog = new RouteDialog;
connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
- routeSaveDialog = new RouteSaveDialog;
helpDialog = NULL;
+ routeSaveDialog = NULL;
settingsDialog = new SettingsDialog;
connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(clientRegUserToServer()));
connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
- resultDialog = new ResultDialog;
-
accstart = NULL;
//creditsDialog = new CreditsDialog;
*/
void MainWindow::on_pushButtonRoute_clicked()
{
+ if(!routeSaveDialog)
+ routeSaveDialog = new RouteSaveDialog;
+ connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute()));
routeSaveDialog->show();
}
topResultDialog->showTopList(topList);
}
+/**
+ * This function
+ */
void MainWindow::clientRegUserToServer()
{
httpClient->requestRegistration();
*/
void MainWindow::clientSendResult(QString category, double result)
{
- /*QMessageBox msgBox;
- msgBox.setWindowTitle("client send result!");
- msgBox.setText("client send result!");
- msgBox.setDefaultButton(QMessageBox::Ok);
- msgBox.exec();*/
-
qDebug() << "__clientSendResult";
if(accstart) {
qDebug() << "_clientSendResult, calling server";
httpClient->sendResultXml(category, result);
- //httpClient->sendResultXml(accstart->getMeasureCategory(), resultDialog->getResult());
}
}
/*
* Mainwindow for speedFreak project
*
- * @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
+ * @author Rikhard Kuutti <rikhard.kuutti@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
accelerationstart* accstart;
TopResultDialog *topResultDialog;
HttpClient *httpClient;
- ResultDialog *resultDialog;
HelpDialog *helpDialog;
protected:
void clientSendRoute();
void clientRegUserToServer();
void clientUserLogin();
- void clientSendResult(QString, double);
+ void clientSendResult(QString category, double result);
void setCategoryCompoBox();
void showTop10();
* CarMainWindow main class
*
* @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
* CarMainWindow main class
*
- * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
* RouteDialog class
*
- * @author Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/*
* RouteDialog class
*
- * @author Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author Olavi Pulkkinen <olavi.pulkkinen@fudeco.com>
+ * @author Toni Jussila <toni.jussila@fudeco.com>
* @copyright (c) 2010 Speed Freak team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
*@param QWidget pointer to parent object. By default the value is NULL.
*/
RouteSaveDialog::RouteSaveDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::RouteSaveDialog)
-{
+ QDialog(parent), ui(new Ui::RouteSaveDialog){
+
ui->setupUi(this);
this->setWindowTitle("Tracking");
- routeDialog = new RouteDialog;
+ routeDialog = NULL;
//Button settings
buttonStatus = true;
delete iconRouteStart;
}
+/**
+ *
+ */
void RouteSaveDialog::changeEvent(QEvent *e)
{
QDialog::changeEvent(e);
location->stopPollingGPS();
QString routeFile = QString("routetemp.xml");
- if (routeDialog->readRouteFromFile( routeFile) == true)
+ if (routeDialog->readRouteFromFile( routeFile ) == true)
{
+ if(!routeDialog)
+ routeDialog = new RouteDialog;
+ connect(routeDialog, SIGNAL(sendroute()), this, SLOT(sendRoute()));
routeDialog->show();
}
timerRoutePicture->start();
}
+/**
+ *
+ */
void RouteSaveDialog::gpsStatus()
{
//IF GPS start button clicked
ui->labelGpsSpeed->setVisible(0);
}
}
+
+/**
+ * This slot function is called when routeDialog emit sendroute (sendPushButton).
+ */
+void RouteSaveDialog::sendRoute()
+{
+ emit sendroute(); //Emit mainwindow clientSendRoute
+}
void timerSatellitePictureTimeout();
void timerRoutePictureTimeout();
void gpsStatus();
+ void sendRoute();
+
+signals:
+ void sendroute();
+
};
#endif // ROUTESAVEDIALOG_H