Fixed stopped and reaction time (Fix #9)

This commit is contained in:
Dorian Zedler 2021-03-19 12:05:20 +01:00
parent 6037d29c4c
commit 7529095d6f
Signed by: dorian
GPG key ID: 989DE36109AFA354
2 changed files with 44 additions and 42 deletions

View file

@ -72,7 +72,9 @@ ScStw::StatusCode ScStwRace::start(bool asyncronous) {
this->setState(PREPAIRING);
if(asyncronous) {
QTimer::singleShot(1, [=](){this->playSoundsAndStartTimers();});
QTimer::singleShot(1, [=]() {
this->playSoundsAndStartTimers();
});
}
else
this->playSoundsAndStartTimers();
@ -352,7 +354,7 @@ bool ScStwRace::playSoundsAndStartTimers() {
// start all timers
bool startOk = true;
foreach(ScStwTimer *timer, this->timers) {
if(!timer->start(timeOfSoundPlaybackStart + 3100) && timer->getState() != ScStwTimer::DISABLED){
if(!timer->start(timeOfSoundPlaybackStart + 3000) && timer->getState() != ScStwTimer::DISABLED) {
startOk = false;
}
}

View file

@ -87,7 +87,7 @@ void ScStwTimer::handleClimberStart(double timeOfStart) {
this->reactionTime = timeOfStart - this->startTime;
qDebug() << "+ [INFO][TIMER] reaction time: " << this->reactionTime;
if(this->reactionTime <= 0 && this->reactionTime){
if(this->reactionTime <= 100 && this->reactionTime) {
qDebug() << "[INFO][TIMER] False Start detected: " << "start Time: " << startTime << " reactionTime: " << reactionTime;
this->setState(FAILING);
}