fixed some stuff with wildcard state and reaction time

This commit is contained in:
Dorian Zedler 2020-10-04 17:55:39 +02:00
parent 0cd1cc0484
commit df33598049
Signed by: dorian
GPG Key ID: D3B255CB8BC7CD37
4 changed files with 11 additions and 6 deletions

View File

@ -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)

View File

@ -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()));

View File

@ -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);
}
}

View File

@ -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;