code cleanup

This commit is contained in:
2018-11-30 16:14:45 +01:00
parent 4dd765b341
commit adbdc93315
8 changed files with 60 additions and 42 deletions

View File

@@ -158,7 +158,8 @@ void Training::shellSlot(int time, int sector) {
this->ui->lWShellTime->setModel(timeModelShell);
this->ui->lBridgeShellTop->setText(QString::number(
(double)QVectorHelper::getMinSec1(VecShell) / 1000));
static_cast<double>(QVectorHelper::getMinSec1(VecShell)) /
1000));
break;
case 2:
@@ -174,7 +175,8 @@ void Training::shellSlot(int time, int sector) {
}
this->ui->lStraightShellTop->setText(QString::number(
(double)QVectorHelper::getMinSec2(VecShell) / 1000));
static_cast<double>(QVectorHelper::getMinSec2(VecShell)) /
1000));
break;
case 3:
if (VecShell.size() > 0) {
@@ -197,15 +199,19 @@ void Training::shellSlot(int time, int sector) {
if (QVectorHelper::getCurTime(VecShell.last()) <=
QVectorHelper::getMin(VecShell)) {
ui->lBestZeitShell->setText(QString::number(
(double)QVectorHelper::getMin(VecShell) / 1000));
static_cast<double>(
QVectorHelper::getMin(VecShell)) /
1000));
}
ui->lCurRoundTimeShell->setText(QString::number(
(double)QVectorHelper::getCurTime(VecShell.last()) /
static_cast<double>(
QVectorHelper::getCurTime(VecShell.last())) /
1000));
}
this->ui->lCurvesShellTop->setText(QString::number(
(double)QVectorHelper::getMinSec3(VecShell) / 1000));
static_cast<double>(QVectorHelper::getMinSec3(VecShell)) /
1000));
theoreticalMinShell = 9999;
theoreticalMinShell = QVectorHelper::getMinSec1(VecShell) +
QVectorHelper::getMinSec2(VecShell) +
@@ -213,7 +219,7 @@ void Training::shellSlot(int time, int sector) {
deltaShell =
QVectorHelper::getMin(VecShell) - theoreticalMinShell;
this->ui->lDeltaTopTimeShell->setText(
QString::number((double)deltaShell / 1000));
QString::number(static_cast<double>(deltaShell) / 1000));
break;
}
ui->lWShellTime->scrollToBottom();
@@ -224,7 +230,7 @@ void Training::shellSlot(int time, int sector) {
}
void Training::closeEvent(QCloseEvent * event) {
Hardware->setStop();
// delete this->Hardware;
Q_UNUSED(event);
}
void Training::deaSlot(int time, int sector) {
@@ -247,7 +253,8 @@ void Training::deaSlot(int time, int sector) {
timeModelDea = new TimeModel(VecDea, minSecTime, this);
this->ui->lWDeaTime->setModel(timeModelDea);
this->ui->lBridgeDeaTop->setText(QString::number(
(double)QVectorHelper::getMinSec1(VecDea) / 1000));
static_cast<double>(QVectorHelper::getMinSec1(VecDea)) /
1000));
break;
case 2:
if (VecDea.size() > 0) {
@@ -262,7 +269,8 @@ void Training::deaSlot(int time, int sector) {
// VecDea[VecDea.size()-1].append(9999);
}
this->ui->lStraightDeaTop->setText(QString::number(
(double)QVectorHelper::getMinSec2(VecDea) / 1000));
static_cast<double>(QVectorHelper::getMinSec2(VecDea)) /
1000));
}
break;
case 3:
@@ -289,14 +297,17 @@ void Training::deaSlot(int time, int sector) {
if (QVectorHelper::getCurTime(VecDea.last()) <=
QVectorHelper::getMin(VecDea)) {
ui->lBestZeitDea->setText(QString::number(
(double)QVectorHelper::getMin(VecDea) / 1000));
static_cast<double>(QVectorHelper::getMin(VecDea)) /
1000));
}
ui->lCurRoundDea->setText(QString::number(
(double)QVectorHelper::getCurTime(VecDea.last()) /
static_cast<double>(
QVectorHelper::getCurTime(VecDea.last())) /
1000));
this->ui->lCurvesDeaTop->setText(QString::number(
(double)QVectorHelper::getMinSec3(VecDea) / 1000));
static_cast<double>(QVectorHelper::getMinSec3(VecDea)) /
1000));
theoreticalMinDea = 9999;
theoreticalMinDea = QVectorHelper::getMinSec1(VecDea) +
QVectorHelper::getMinSec2(VecDea) +
@@ -304,7 +315,7 @@ void Training::deaSlot(int time, int sector) {
deltaDea =
QVectorHelper::getMin(VecDea) - theoreticalMinDea;
this->ui->lDeltaTopTimeDea->setText(
QString::number((double)deltaDea / 1000));
QString::number(static_cast<double>(deltaDea) / 1000));
}
break;
}