added a very fancy indicator for timer rady state during waiting state of race
This commit is contained in:
parent
df33598049
commit
620e943bd2
4 changed files with 10 additions and 5 deletions
|
@ -105,6 +105,7 @@ public:
|
|||
ExtensionBatteryNotFine, /*!< The battery level of one or more extension is critical or unknown */
|
||||
ClimberIsNotReady /*!< The startpad of the timer is not triggered */
|
||||
};
|
||||
Q_ENUM(ReadyState)
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
|
|
@ -157,9 +157,6 @@ void ScStwRemoteRace::refreshDetails(QVariantMap details) {
|
|||
|
||||
qDebug() << "RACE DETAILS: " << details;
|
||||
|
||||
// state
|
||||
this->setState(ScStwRace::RaceState(details["state"].toInt()));
|
||||
|
||||
// competition mode
|
||||
if(this->competitionMode != details["competitionMode"].toBool()) {
|
||||
this->competitionMode = details["competitionMode"].toBool();
|
||||
|
@ -182,6 +179,9 @@ void ScStwRemoteRace::refreshDetails(QVariantMap details) {
|
|||
// timers
|
||||
this->refreshRemoteTimers(details["timers"].toList());
|
||||
|
||||
// state
|
||||
this->setState(ScStwRace::RaceState(details["state"].toInt()));
|
||||
|
||||
// isReady
|
||||
if(this->state == WAITING) {
|
||||
this->isReadyForNextState = details["isReadyForNextState"].toBool();
|
||||
|
@ -212,6 +212,8 @@ void ScStwRemoteRace::rebuildRemoteTimers(QVariantList remoteTimers) {
|
|||
|
||||
bool ScStwRemoteRace::refreshRemoteTimers(QVariantList remoteTimers) {
|
||||
|
||||
qDebug() << "REFRESHING TIMERS";
|
||||
|
||||
if(remoteTimers.length() != this->remoteTimers.length()){
|
||||
// local timers are out of sync
|
||||
this->rebuildRemoteTimers(remoteTimers);
|
||||
|
@ -242,6 +244,8 @@ bool ScStwRemoteRace::refreshRemoteTimers(QVariantList remoteTimers) {
|
|||
this->remoteTimers[currId]->setState(newState);
|
||||
}
|
||||
|
||||
emit this->timersChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ QString ScStwTimer::getText() {
|
|||
newText = "cancelled";
|
||||
break;
|
||||
case ScStwTimer::INCIDENT:
|
||||
newText = "Technical\nincident!";
|
||||
newText = "Technical incident!";
|
||||
break;
|
||||
case ScStwTimer::DISABLED:
|
||||
newText = "---";
|
||||
|
|
Reference in a new issue