Fixed stopped and reaction time (Fix #9)
This commit is contained in:
parent
6037d29c4c
commit
7529095d6f
2 changed files with 44 additions and 42 deletions
|
@ -72,7 +72,9 @@ ScStw::StatusCode ScStwRace::start(bool asyncronous) {
|
||||||
this->setState(PREPAIRING);
|
this->setState(PREPAIRING);
|
||||||
|
|
||||||
if(asyncronous) {
|
if(asyncronous) {
|
||||||
QTimer::singleShot(1, [=](){this->playSoundsAndStartTimers();});
|
QTimer::singleShot(1, [=]() {
|
||||||
|
this->playSoundsAndStartTimers();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this->playSoundsAndStartTimers();
|
this->playSoundsAndStartTimers();
|
||||||
|
@ -352,7 +354,7 @@ bool ScStwRace::playSoundsAndStartTimers() {
|
||||||
// start all timers
|
// start all timers
|
||||||
bool startOk = true;
|
bool startOk = true;
|
||||||
foreach(ScStwTimer *timer, this->timers) {
|
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;
|
startOk = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ void ScStwTimer::handleClimberStart(double timeOfStart) {
|
||||||
this->reactionTime = timeOfStart - this->startTime;
|
this->reactionTime = timeOfStart - this->startTime;
|
||||||
qDebug() << "+ [INFO][TIMER] reaction time: " << this->reactionTime;
|
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;
|
qDebug() << "[INFO][TIMER] False Start detected: " << "start Time: " << startTime << " reactionTime: " << reactionTime;
|
||||||
this->setState(FAILING);
|
this->setState(FAILING);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue