From d10803745fee19b6dba56d75647ed5b292182256 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 4 Oct 2020 16:05:16 +0200 Subject: [PATCH 1/2] added som missing stuff --- ScStwLibraries/sources/client/scstwremoterace.cpp | 2 ++ ScStwLibraries/sources/scstwtimer.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ScStwLibraries/sources/client/scstwremoterace.cpp b/ScStwLibraries/sources/client/scstwremoterace.cpp index 7ac0307..096dd7e 100644 --- a/ScStwLibraries/sources/client/scstwremoterace.cpp +++ b/ScStwLibraries/sources/client/scstwremoterace.cpp @@ -111,6 +111,8 @@ void ScStwRemoteRace::handleClientStateChange() { this->timers = this->localTimers; this->localTimers.clear(); emit this->timersChanged(); + emit this->detailsChanged(); + emit this->currentStartDelayChanged(); this->competitionMode = false; this->setState(IDLE); break; diff --git a/ScStwLibraries/sources/scstwtimer.cpp b/ScStwLibraries/sources/scstwtimer.cpp index fdded29..b0e01e5 100644 --- a/ScStwLibraries/sources/scstwtimer.cpp +++ b/ScStwLibraries/sources/scstwtimer.cpp @@ -250,11 +250,14 @@ QString ScStwTimer::getText() { case ScStwTimer::FAILED: newText = "false start"; break; + case ScStwTimer::WILDCARD: + newText = "wildcard"; + break; case ScStwTimer::CANCELLED: newText = "cancelled"; break; case ScStwTimer::INCIDENT: - newText = "Technical incident!"; + newText = "Technical\nincident!"; break; case ScStwTimer::DISABLED: newText = "---"; From df33598049258d84bbe7f394a385d5f704eddab2 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 4 Oct 2020 17:55:39 +0200 Subject: [PATCH 2/2] fixed some stuff with wildcard state and reaction time --- .../de/itsblue/ScStw/Styling/Components/TimerColumn.qml | 2 +- ScStwLibraries/sources/client/scstwremoterace.cpp | 3 ++- ScStwLibraries/sources/client/scstwremotetimer.cpp | 3 ++- ScStwLibraries/sources/scstwtimer.cpp | 9 ++++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml index 5150516..4e252c7 100644 --- a/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml +++ b/ScStwLibraries/resources/qml/lib/de/itsblue/ScStw/Styling/Components/TimerColumn.qml @@ -87,7 +87,7 @@ Column { width: parent.width * 0.8 height: parent.height * 0.8 - color: ([ScStwTimer.WON].indexOf(control.timers[index]["state"]) >= 0 ? control.colors.success : + color: ([ScStwTimer.WON,ScStwTimer.WILDCARD].indexOf(control.timers[index]["state"]) >= 0 ? control.colors.success : [ScStwTimer.FAILED,ScStwTimer.LOST].indexOf(control.timers[index]["state"]) >= 0 ? control.colors.error: control.colors.text) diff --git a/ScStwLibraries/sources/client/scstwremoterace.cpp b/ScStwLibraries/sources/client/scstwremoterace.cpp index 096dd7e..e7ddc8a 100644 --- a/ScStwLibraries/sources/client/scstwremoterace.cpp +++ b/ScStwLibraries/sources/client/scstwremoterace.cpp @@ -141,7 +141,6 @@ bool ScStwRemoteRace::local() { * @param data */ void ScStwRemoteRace::handleBaseStationSignal(ScStw::SignalKey key, QVariant data) { - //qDebug() << "got signal: " << data; switch (key) { case ScStw::RaceDetailsChanged: { @@ -156,6 +155,8 @@ void ScStwRemoteRace::handleBaseStationSignal(ScStw::SignalKey key, QVariant dat void ScStwRemoteRace::refreshDetails(QVariantMap details) { // the details of the race have changed: + qDebug() << "RACE DETAILS: " << details; + // state this->setState(ScStwRace::RaceState(details["state"].toInt())); diff --git a/ScStwLibraries/sources/client/scstwremotetimer.cpp b/ScStwLibraries/sources/client/scstwremotetimer.cpp index a1c55b2..771d0c6 100644 --- a/ScStwLibraries/sources/client/scstwremotetimer.cpp +++ b/ScStwLibraries/sources/client/scstwremotetimer.cpp @@ -19,6 +19,7 @@ void ScStwRemoteTimer::setStopTime(double stopTime) { void ScStwRemoteTimer::setReactionTime(double reactionTime) { this->reactionTime = reactionTime; + emit this->reactionTimeChanged(); } void ScStwRemoteTimer::setLetter(QString newLetter) { @@ -36,6 +37,6 @@ void ScStwRemoteTimer::setState(TimerState newState){ if(this->state != newState) { this->state = newState; qDebug() << "+ [INFO][REMOTETIMER] timer state changed: " << newState; - emit this->stateChanged(); + emit this->stateChanged(this->state); } } diff --git a/ScStwLibraries/sources/scstwtimer.cpp b/ScStwLibraries/sources/scstwtimer.cpp index f2beada..718d186 100644 --- a/ScStwLibraries/sources/scstwtimer.cpp +++ b/ScStwLibraries/sources/scstwtimer.cpp @@ -241,18 +241,21 @@ QString ScStwTimer::getText() { case ScStwTimer::STARTING: newTime = 0; break; - case ScStwTimer::WAITING: - newText = "please wait..."; - break; case ScStwTimer::RUNNING: newTime = this->getCurrentTime(); break; + case ScStwTimer::WAITING: + newText = "please wait..."; + break; case ScStwTimer::WON: newTime = this->getCurrentTime(); break; case ScStwTimer::LOST: newTime = this->getCurrentTime(); break; + case ScStwTimer::FAILING: + newText = "please wait..."; + break; case ScStwTimer::FAILED: newText = "false start"; break;