This commit is contained in:
2018-12-09 21:06:34 +01:00
parent 0a6b6b7d72
commit ddb632c4fd
2 changed files with 27 additions and 15 deletions

View File

@@ -466,7 +466,6 @@ int Result::getMinimum(int fahrerId, int bahnId, int rennId, int autoid,
<< boost::lexical_cast<string>(bahnId); << boost::lexical_cast<string>(bahnId);
try { try {
cout << statement.str() << endl;
vector<vector<QString>> res = this->db->getData2(statement.str(), 1); vector<vector<QString>> res = this->db->getData2(statement.str(), 1);
// filter impossible values // filter impossible values
vector<int> validTimes; vector<int> validTimes;

View File

@@ -345,7 +345,8 @@ void WindowRace::countdownUpdate() {
} }
else { else {
ui->lCountdown->setText(timeWrapper(countdownValue)); ui->lCountdown->setText(timeWrapper(countdownValue));
this->ui->pbTime->setValue(this->fahrzeit - countdownValue); this->ui->pbTime->setValue(this->fahrzeit -
static_cast<int>(countdownValue));
} }
} }
} }
@@ -389,7 +390,8 @@ void WindowRace::shellSlot(int time, int sector) {
ui->lWShellTime->setModel(this->timeModelShell); ui->lWShellTime->setModel(this->timeModelShell);
this->ui->lBridgeShell->setText(QString::number( this->ui->lBridgeShell->setText(QString::number(
(double)QVectorHelper::getMinSec1(VecShell) / 1000)); static_cast<double>(QVectorHelper::getMinSec1(VecShell)) /
1000));
break; break;
case 2: case 2:
@@ -408,7 +410,9 @@ void WindowRace::shellSlot(int time, int sector) {
// TimeModel(VecShell, this); // TimeModel(VecShell, this);
this->ui->lWShellTime->setModel(timeModelShell); this->ui->lWShellTime->setModel(timeModelShell);
this->ui->lStraightShell->setText(QString::number( this->ui->lStraightShell->setText(QString::number(
(double)QVectorHelper::getMinSec2(VecShell) / 1000)); static_cast<double>(
QVectorHelper::getMinSec2(VecShell)) /
1000));
} }
break; break;
case 3: case 3:
@@ -421,11 +425,13 @@ void WindowRace::shellSlot(int time, int sector) {
if (QVectorHelper::getCurTime(VecShell.last()) <= if (QVectorHelper::getCurTime(VecShell.last()) <=
QVectorHelper::getMin(VecShell)) { QVectorHelper::getMin(VecShell)) {
ui->lBestZeitShell->setText(QString::number( ui->lBestZeitShell->setText(QString::number(
(double)QVectorHelper::getMin(VecShell) / static_cast<double>(
QVectorHelper::getMin(VecShell)) /
1000)); 1000));
} }
ui->lCurRoundTimeShell->setText(QString::number( ui->lCurRoundTimeShell->setText(QString::number(
(double)QVectorHelper::getCurTime(VecShell.last()) / static_cast<double>(
QVectorHelper::getCurTime(VecShell.last())) /
1000)); 1000));
// update tableview // update tableview
@@ -440,7 +446,8 @@ void WindowRace::shellSlot(int time, int sector) {
this->ui->lWShellTime->setModel(timeModelShell); this->ui->lWShellTime->setModel(timeModelShell);
this->ui->lCurvesShell->setText(QString::number( this->ui->lCurvesShell->setText(QString::number(
(double)QVectorHelper::getMinSec3(VecShell) / static_cast<double>(
QVectorHelper::getMinSec3(VecShell)) /
1000)); 1000));
theoreticalMinShell = 9999; theoreticalMinShell = 9999;
theoreticalMinShell = theoreticalMinShell =
@@ -449,8 +456,8 @@ void WindowRace::shellSlot(int time, int sector) {
QVectorHelper::getMinSec3(VecShell); QVectorHelper::getMinSec3(VecShell);
deltaShell = QVectorHelper::getMin(VecShell) - deltaShell = QVectorHelper::getMin(VecShell) -
theoreticalMinShell; theoreticalMinShell;
this->ui->lDeltaShellTop->setText( this->ui->lDeltaShellTop->setText(QString::number(
QString::number((double)deltaShell / 1000)); static_cast<double>(deltaShell) / 1000));
if (VecShell.size() > 0) { if (VecShell.size() > 0) {
int zeit = int zeit =
@@ -498,7 +505,8 @@ void WindowRace::deaSlot(int time, int sector) {
this->ui->lWDeaTime->setModel(timeModelDea); this->ui->lWDeaTime->setModel(timeModelDea);
this->ui->lBridgeDea->setText(QString::number( this->ui->lBridgeDea->setText(QString::number(
(double)QVectorHelper::getMinSec1(VecDea) / 1000)); static_cast<double>(QVectorHelper::getMinSec1(VecDea)) /
1000));
break; break;
case 2: case 2:
@@ -509,7 +517,9 @@ void WindowRace::deaSlot(int time, int sector) {
timeModelDea = new TimeModel(VecDea, minSecTime, this); timeModelDea = new TimeModel(VecDea, minSecTime, this);
this->ui->lWDeaTime->setModel(timeModelDea); this->ui->lWDeaTime->setModel(timeModelDea);
this->ui->lStraightDea->setText(QString::number( this->ui->lStraightDea->setText(QString::number(
(double)QVectorHelper::getMinSec2(VecDea) / 1000)); static_cast<double>(
QVectorHelper::getMinSec2(VecDea)) /
1000));
} }
else { else {
// VecDea[VecDea.size()-1].append(9999); // VecDea[VecDea.size()-1].append(9999);
@@ -540,22 +550,25 @@ void WindowRace::deaSlot(int time, int sector) {
if (QVectorHelper::getCurTime(VecDea.last()) <= if (QVectorHelper::getCurTime(VecDea.last()) <=
QVectorHelper::getMin(VecDea)) { QVectorHelper::getMin(VecDea)) {
ui->lBestZeitDea->setText(QString::number( ui->lBestZeitDea->setText(QString::number(
(double)QVectorHelper::getMin(VecDea) / 1000)); static_cast<double>(QVectorHelper::getMin(VecDea)) /
1000));
} }
ui->lCurRoundDea->setText(QString::number( ui->lCurRoundDea->setText(QString::number(
(double)QVectorHelper::getCurTime(VecDea.last()) / static_cast<double>(
QVectorHelper::getCurTime(VecDea.last())) /
1000)); 1000));
} }
this->ui->lCurvesDea->setText(QString::number( this->ui->lCurvesDea->setText(QString::number(
(double)QVectorHelper::getMinSec3(VecDea) / 1000)); static_cast<double>(QVectorHelper::getMinSec3(VecDea)) /
1000));
theoreticalMinDea = 9999; theoreticalMinDea = 9999;
theoreticalMinDea = QVectorHelper::getMinSec1(VecDea) + theoreticalMinDea = QVectorHelper::getMinSec1(VecDea) +
QVectorHelper::getMinSec2(VecDea) + QVectorHelper::getMinSec2(VecDea) +
QVectorHelper::getMinSec3(VecDea); QVectorHelper::getMinSec3(VecDea);
deltaDea = QVectorHelper::getMin(VecDea) - theoreticalMinDea; deltaDea = QVectorHelper::getMin(VecDea) - theoreticalMinDea;
this->ui->lDeltaDeaTop->setText( this->ui->lDeltaDeaTop->setText(
QString::number((double)deltaDea / 1000)); QString::number(static_cast<double>(deltaDea) / 1000));
if (VecDea.size() > 0) { if (VecDea.size() > 0) {
int zeit = QVectorHelper::getCurTime(VecDea.last()); int zeit = QVectorHelper::getCurTime(VecDea.last());
QString statement = QString statement =