diff --git a/ScStwLibraries/headers/ScStw.hpp b/ScStwLibraries/headers/ScStw.hpp index 46aba53..c38f72f 100644 --- a/ScStwLibraries/headers/ScStw.hpp +++ b/ScStwLibraries/headers/ScStw.hpp @@ -81,7 +81,7 @@ public: StopRaceCommand = 1001, ResetRaceCommand = 1002, CancelRaceCommand = 1003, - SetTimerDisabled = 1004, + SetTimerDisabledCommand = 1004, GetRaceStateCommand = 2000, GetRaceDetailsCommand = 2001, diff --git a/ScStwLibraries/headers/client/scstwremoterace.h b/ScStwLibraries/headers/client/scstwremoterace.h index ccf780f..75488c7 100644 --- a/ScStwLibraries/headers/client/scstwremoterace.h +++ b/ScStwLibraries/headers/client/scstwremoterace.h @@ -53,6 +53,7 @@ public slots: ScStw::StatusCode cancel(); ScStw::StatusCode stop(); ScStw::StatusCode reset(); + ScStw::StatusCode setTimerDisabled(int id, bool disabled); bool addTimer(ScStwTimer *timer); QVariantMap getCurrentStartDelay(); bool getIsReadyForNextState(); diff --git a/ScStwLibraries/sources/client/scstwremoterace.cpp b/ScStwLibraries/sources/client/scstwremoterace.cpp index 272fa5e..6d26201 100644 --- a/ScStwLibraries/sources/client/scstwremoterace.cpp +++ b/ScStwLibraries/sources/client/scstwremoterace.cpp @@ -90,6 +90,27 @@ ScStw::StatusCode ScStwRemoteRace::reset() { return ScStw::StatusCode(reply["status"].toInt()); } +ScStw::StatusCode ScStwRemoteRace::setTimerDisabled(int timerId, bool disabled) { + if(this->state != IDLE && this->state != WAITING) + return ScStw::CurrentStateNotVaildForOperationError; + + if(timerId < 0 || timerId - 1 > this->timers.length()) + return ScStw::ItemNotFoundError; + + qDebug() << "+ --- setting timer " << timerId << " to disabled: " << disabled; + + QVariantMap requestData = { + {"timerId", timerId}, + {"disabled", disabled} + }; + + QVariantMap reply = this->scStwClient->sendCommand(ScStw::SetTimerDisabledCommand, QJsonValue::fromVariant(requestData)); + + qDebug() << "+ --- timer disabled command returned: " << reply; + + return ScStw::StatusCode(reply["status"].toInt()); +} + // ------------------------- // --- Base Station sync --- // ------------------------- diff --git a/ScStwLibraries/sources/styling/scstwappthememanager.cpp b/ScStwLibraries/sources/styling/scstwappthememanager.cpp index afa31c2..e2eca13 100644 --- a/ScStwLibraries/sources/styling/scstwappthememanager.cpp +++ b/ScStwLibraries/sources/styling/scstwappthememanager.cpp @@ -116,7 +116,7 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent) {"success", "#6bd43b"}, {"error", "#e03b2f"}, - {"warning", "#e0b928"}, + {"warning", "#d6ae1e"}, {"line", "grey"},