connect(location,SIGNAL(agnss()),this,SLOT(gpsStatus()));
gpsTime = new QDateTime();
- time = 0;
- speed = 0;
+ this->time = 0;
+ this->speed = 0;
counterForSaveResults = 0;
timer = new QTimer();
accelerometerTimer = new QTimer(this);
connect(accelerometerTimer, SIGNAL(timeout()), this, SLOT(readAccelerometerData()));
- accelerometerTimer->start(kAccelerometerSampleRate);
+ //accelerometerTimer->start(kAccelerometerSampleRate);
// Calculate
calculate = new Calculate();
measures = new Measures();
this->initializeMeasures();
- timer->setInterval(300);
+ this->timer->setInterval(300);
connect(this->timer, SIGNAL(timeout()), this, SLOT(after_timeout()));
connect(myLogin, SIGNAL( userNameChanged()), this, SLOT(updateUserName()));
void CarMainWindow::on_autoStartButton_clicked()
{
initializeMeasures();
+ resetAccelerometerMeasurements();
+ ui->pushButtonSendResult->setEnabled(false);
ui->pushButtonShowResultDialog->setEnabled(false);
choice = ui->listViewStartTabAccelerationCategories->currentIndex();
choiceInt = choice.row();
}
ui->labelMeasureTabResult->setText("");
- timer->start();
- time = 0;
- speed = 0;
+ this->accelerometerTimer->start(kAccelerometerSampleRate);
+ this->timer->start();
+ this->time = 0;
+ this->speed = 0;
ui->tabWidget->setCurrentWidget(this->ui->tabMeasureResult);
}
*/
void CarMainWindow::on_pushButtonMeasureTabAbort_clicked()
{
+ ui->pushButtonSendResult->setEnabled(false);
+ ui->pushButtonShowResultDialog->setEnabled(false);
+ ui->labelMeasureTabResult->hide();
+ ui->labelMeasureTabTime->setText("");
+ ui->labelMeasureTabSpeed->setText("");
measures->setTime10kmh(0);
measures->setTime20kmh(0);
measures->setTime30kmh(0);
measures->setTime80kmh(0);
measures->setTime90kmh(0);
measures->setTime100kmh(0);
- timer->stop();
- time = 0;
- speed = 0;
+ this->accelerometerTimer->stop();
+ this->timer->stop();
+ this->time = 0;
+ this->speed = 0;
ui->tabWidget->setCurrentWidget(this->ui->StartTab);
//this->close();
}
if (choiceInt == 0 && measures->getTime40kmh() != 0)
{
setTimeAxisGapAndShowResult(measures->getTime40kmh());
- timer->stop();
- //this->accelerometerTimer->stop();
- time = 0;
- speed = 0;
+ this->timer->stop();
+ this->accelerometerTimer->stop();
+ this->time = 0;
+ this->speed = 0;
counterForSaveResults = 0;
}
else if (choiceInt == 1 && measures->getTime100kmh() != 0)
{
setTimeAxisGapAndShowResult(measures->getTime100kmh());
- timer->stop();
- //this->accelerometerTimer->stop();
- time = 0;
- speed = 0;
+ this->timer->stop();
+ this->accelerometerTimer->stop();
+ this->time = 0;
+ this->speed = 0;
counterForSaveResults = 0;
}
else if (choiceInt != 1 && choiceInt != 0 && measures->getTime80kmh() != 0)
{
setTimeAxisGapAndShowResult(measures->getTime80kmh());
- timer->stop();
- //this->accelerometerTimer->stop();
- time = 0;
- speed = 0;
+ this->timer->stop();
+ this->accelerometerTimer->stop();
+ this->time = 0;
+ this->speed = 0;
counterForSaveResults = 0;
}
void CarMainWindow::setTimeAxisGapAndShowResult(double pTime)
{
ui->pushButtonShowResultDialog->setEnabled(true);
+ ui->pushButtonSendResult->setEnabled(true);
QString timeInteger;
timeInteger.setNum(pTime);
ui->labelMeasureTabResult->show();