diff --git a/qrc_resource.cpp b/qrc_resource.cpp new file mode 100644 index 0000000..325b3da --- /dev/null +++ b/qrc_resource.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** Resource object code +** +** Created by: The Resource Compiler for Qt version 5.11.2 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +static const unsigned char qt_resource_data[] = { + // /home/johannes/Dokumente/rennbahnc/ampel.png + 0x0,0x0,0x1,0x13, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x17,0x0,0x0,0x0,0x17,0x8,0x6,0x0,0x0,0x0,0xe0,0x2a,0xd4,0xa0, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13, + 0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xde,0x8, + 0x15,0x9,0x2,0x11,0xe4,0x0,0x42,0x6c,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74, + 0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20, + 0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0, + 0x8d,0x49,0x44,0x41,0x54,0x48,0xc7,0xbd,0x95,0x4b,0xa,0x80,0x30,0xc,0x5,0x27, + 0xb9,0x58,0xeb,0xcd,0xf4,0x66,0xed,0xc9,0xe2,0xc2,0xa,0x45,0x90,0x6a,0x4d,0x1c, + 0x8,0x94,0x2e,0x86,0xd7,0xf,0x89,0x30,0xc0,0x20,0x73,0x54,0xea,0xb6,0x2b,0x50, + 0x4,0xa,0x33,0x18,0xac,0x6,0xf6,0xa0,0xd6,0x37,0xd2,0xfc,0x50,0x7a,0xad,0xec, + 0x95,0xf6,0xdd,0x29,0x3e,0x24,0xbe,0x3d,0x81,0x74,0x72,0xc3,0x9,0x69,0x5e,0x3d, + 0xaf,0x3,0x47,0x4e,0x9f,0x78,0xa7,0xee,0xd3,0xeb,0xf0,0x95,0xe7,0xd3,0x67,0x25, + 0x48,0x4e,0x93,0xa7,0x20,0x79,0x52,0x2,0x9,0x97,0xd7,0x20,0x77,0x55,0x66,0x3b, + 0xdb,0x98,0x12,0xfb,0xcf,0xdb,0x7a,0x73,0x76,0x6f,0xff,0xf4,0x96,0xc6,0xe2,0xe4, + 0x5e,0xfe,0xed,0xe7,0xe1,0x93,0xc8,0x7b,0x86,0x4a,0xe4,0xf4,0xdf,0x1,0x86,0x7c, + 0xe3,0xd7,0x18,0x40,0xe0,0xb4,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42, + 0x60,0x82, + +}; + +static const unsigned char qt_resource_name[] = { + // new + 0x0,0x3, + 0x0,0x0,0x74,0xc7, + 0x0,0x6e, + 0x0,0x65,0x0,0x77, + // prefix1 + 0x0,0x7, + 0x7,0x8b,0xd0,0x51, + 0x0,0x70, + 0x0,0x72,0x0,0x65,0x0,0x66,0x0,0x69,0x0,0x78,0x0,0x31, + // ampel.png + 0x0,0x9, + 0x6,0xbf,0x87,0xc7, + 0x0,0x61, + 0x0,0x6d,0x0,0x70,0x0,0x65,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/new + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x2, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/new/prefix1 + 0x0,0x0,0x0,0xc,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x3, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, + // :/new/prefix1/ampel.png + 0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, +0x0,0x0,0x1,0x67,0x60,0x15,0xfe,0x5d, + +}; + +#ifdef QT_NAMESPACE +# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name +# define QT_RCC_MANGLE_NAMESPACE0(x) x +# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b +# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b) +# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \ + QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE)) +#else +# define QT_RCC_PREPEND_NAMESPACE(name) name +# define QT_RCC_MANGLE_NAMESPACE(name) name +#endif + +#ifdef QT_NAMESPACE +namespace QT_NAMESPACE { +#endif + +bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *); + +#ifdef QT_NAMESPACE +} +#endif + +int QT_RCC_MANGLE_NAMESPACE(qInitResources_resource)(); +int QT_RCC_MANGLE_NAMESPACE(qInitResources_resource)() +{ + QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData) + (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resource)(); +int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resource)() +{ + QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData) + (0x2, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +namespace { + struct initializer { + initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_resource)(); } + ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_resource)(); } + } dummy; +} diff --git a/training.cpp b/training.cpp index 113e834..7a712ef 100644 --- a/training.cpp +++ b/training.cpp @@ -36,7 +36,6 @@ Training::Training(QWidget * parent, DataBase * db) firstTimeDea = true; firstTimeShell = true; started = true; - paused = false; this->Hardware = new HardwareSetup; @@ -87,6 +86,7 @@ Training::Training(QWidget * parent, DataBase * db) } } void Training::ResetShell() { + this->VecShell.clear(); // this->ui->lWShellTime->clear(); @@ -101,6 +101,7 @@ void Training::ResetShell() { this->ui->lStraightShellTop->setText("∞"); this->ui->lCurvesShellTop->setText("∞"); this->ui->lDeltaTopTimeShell->setText("∞"); + this->ui->lShellLaps->setText("0"); } void Training::ResetDea() { this->VecDea.clear(); @@ -119,6 +120,7 @@ void Training::ResetDea() { this->ui->lStraightDeaTop->setText("∞"); this->ui->lCurvesDeaTop->setText("∞"); this->ui->lDeltaTopTimeDea->setText("∞"); + this->ui->lDeaLaps->setText("0"); } void Training::Reset() { this->ResetDea(); @@ -234,6 +236,15 @@ void Training::shellSlot(int time, int sector) { QVectorHelper::getMin(VecShell) - theoreticalMinShell; this->ui->lDeltaTopTimeShell->setText( QString::number(static_cast(deltaShell) / 1000)); + + // count valid laps + int validLaps = 0; + for (auto vec : VecShell) { + if (vec.size() == 3) { + validLaps += 1; + } + } + this->ui->lShellLaps->setText(QString::number(validLaps)); break; } ui->lWShellTime->scrollToBottom(); @@ -331,6 +342,13 @@ void Training::deaSlot(int time, int sector) { this->ui->lDeltaTopTimeDea->setText( QString::number(static_cast(deltaDea) / 1000)); } + int validLaps = 0; + for (auto vec : VecDea) { + if (vec.size() == 3) { + validLaps += 1; + } + } + this->ui->lDeaLaps->setText(QString::number(validLaps)); break; } ui->lWDeaTime->scrollToBottom(); diff --git a/training.ui b/training.ui index 66fd295..9805d70 100644 --- a/training.ui +++ b/training.ui @@ -39,30 +39,60 @@ - - - - 12 - - - - Bestzeit - - - - - - - 20 - - - - - - - - - + + + + + + 12 + + + + Bestzeit + + + + + + + 20 + + + + + + + + + + + + + + + 12 + + + + Runden + + + + + + + 20 + + + + 0 + + + + + + + @@ -219,30 +249,60 @@ - - - - 12 - - - - Bestzeit - - - - - - - 20 - - - - - - - - - + + + + + + 12 + + + + Bestzeit + + + + + + + 20 + + + + + + + + + + + + + + + 12 + + + + Runden + + + + + + + 20 + + + + 0 + + + + + + + @@ -390,7 +450,7 @@ 0 0 1136 - 22 + 24 diff --git a/windowrace.cpp b/windowrace.cpp index ccb8eeb..11ed119 100644 --- a/windowrace.cpp +++ b/windowrace.cpp @@ -181,6 +181,10 @@ void WindowRace::ReturnPress() { } void WindowRace::prepareNextRace() { + + this->ui->lDeaLaps->setText("0"); + this->ui->lShellLaps->setText("0"); + this->firstTimeShell = true; this->firstTimeDea = true; @@ -475,11 +479,16 @@ void WindowRace::shellSlot(int time, int sector) { } } } - + // count valid laps + int validLaps = 0; + for (auto vec : VecShell) { + if (vec.size() == 3) { + validLaps += 1; + } + } + this->ui->lShellLaps->setText(QString::number(validLaps)); break; } - if (sector == 3) { - } ui->lWShellTime->scrollToBottom(); } @@ -582,6 +591,14 @@ void WindowRace::deaSlot(int time, int sector) { this->db->setData(statement.toStdString()); ui->lWDeaTime->scrollToBottom(); } + // count valid laps + int validLaps = 0; + for (auto vec : VecDea) { + if (vec.size() == 3) { + validLaps += 1; + } + } + this->ui->lDeaLaps->setText(QString::number(validLaps)); break; } } diff --git a/windowrace.ui b/windowrace.ui index a4d1827..40589b0 100644 --- a/windowrace.ui +++ b/windowrace.ui @@ -6,7 +6,7 @@ 0 0 - 840 + 1139 600 @@ -49,30 +49,60 @@ - - - - 12 - - - - Bestzeit - - - - - - - 20 - - - - - - - - - + + + + + + 12 + + + + Bestzeit + + + + + + + 20 + + + + + + + + + + + + + + + 12 + + + + Runden + + + + + + + 20 + + + + 0 + + + + + + + @@ -598,30 +628,60 @@ - - - - 12 - - - - Bestzeit - - - - - - - 20 - - - - - - - - - + + + + + + 12 + + + + Bestzeit + + + + + + + 20 + + + + + + + + + + + + + + + 12 + + + + Runden + + + + + + + 20 + + + + 0 + + + + + + + @@ -775,8 +835,8 @@ 0 0 - 840 - 22 + 1139 + 24