bugfix: minimum lap time not checked

This commit is contained in:
2017-12-27 11:20:20 +01:00
parent 2a1a082a30
commit 54294c63d7
3 changed files with 12 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ void HardwareSetup::run() {
if (testmode) {
while (1) {
int validTimes = 1;
int validTimes = 0;
if (validTimes) {
Shell(1100, 1);
sleep(1);
@@ -194,11 +194,11 @@ void HardwareSetup::run() {
sleep(1);
Shell(700, 3);
sleep(1);
Dea(700, 1);
Dea(500, 1);
sleep(1);
Dea(700, 2);
sleep(1);
Dea(700, 3);
Dea(3000, 3);
// this->stop = 0;
sleep(1);
}

View File

@@ -104,7 +104,10 @@ int QVectorHelper::getMin(const QVector<QVector<int>> x) {
int min;
if (x.size() > 0) {
if (x.at(0).size() >= 3) {
if (getCurTime(x.at(0)) >= minTrackTime) {
if (getCurTime(x.at(0)) >= minTrackTime &&
x.at(0).at(0) > QVectorHelper::minSec1 &&
x.at(0).at(1) > QVectorHelper::minSec2 &&
x.at(0).at(2) > QVectorHelper::minSec3) {
min = getCurTime(x.at(0));
}
}
@@ -117,7 +120,10 @@ int QVectorHelper::getMin(const QVector<QVector<int>> x) {
}
for (int i = 1; i < x.size(); i++) {
if (getCurTime(x.at(i)) < min) {
if (getCurTime(x.at(0)) >= minTrackTime) {
if (getCurTime(x.at(i)) >= minTrackTime &&
x.at(i).at(0) > QVectorHelper::minSec1 &&
x.at(i).at(1) > QVectorHelper::minSec2 &&
x.at(i).at(2) > QVectorHelper::minSec3) {
min = getCurTime(x.at(i));
}
}

View File

@@ -49,6 +49,7 @@ WindowRace::WindowRace(DataBase * db, QWidget * parent)
QVectorHelper::minSec2 = this->minSecTime.at(1);
QVectorHelper::minSec3 = this->minSecTime.at(2);
QVectorHelper::minTrackTime = this->minSecTime.at(3);
cout << "Track time minimum:" << QVectorHelper::minTrackTime << endl;
firstTimeDea = true;
firstTimeShell = true;