Merge remote-tracking branch 'origin/master'

This commit is contained in:
Dorian Zedler 2020-10-06 14:09:44 +02:00
commit 10645e9eb8
Signed by: dorian
GPG key ID: D3B255CB8BC7CD37
4 changed files with 24 additions and 2 deletions

View file

@ -81,7 +81,7 @@ public:
StopRaceCommand = 1001, StopRaceCommand = 1001,
ResetRaceCommand = 1002, ResetRaceCommand = 1002,
CancelRaceCommand = 1003, CancelRaceCommand = 1003,
SetTimerDisabled = 1004, SetTimerDisabledCommand = 1004,
GetRaceStateCommand = 2000, GetRaceStateCommand = 2000,
GetRaceDetailsCommand = 2001, GetRaceDetailsCommand = 2001,

View file

@ -53,6 +53,7 @@ public slots:
ScStw::StatusCode cancel(); ScStw::StatusCode cancel();
ScStw::StatusCode stop(); ScStw::StatusCode stop();
ScStw::StatusCode reset(); ScStw::StatusCode reset();
ScStw::StatusCode setTimerDisabled(int id, bool disabled);
bool addTimer(ScStwTimer *timer); bool addTimer(ScStwTimer *timer);
QVariantMap getCurrentStartDelay(); QVariantMap getCurrentStartDelay();
bool getIsReadyForNextState(); bool getIsReadyForNextState();

View file

@ -90,6 +90,27 @@ ScStw::StatusCode ScStwRemoteRace::reset() {
return ScStw::StatusCode(reply["status"].toInt()); 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 --- // --- Base Station sync ---
// ------------------------- // -------------------------

View file

@ -116,7 +116,7 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent)
{"success", "#6bd43b"}, {"success", "#6bd43b"},
{"error", "#e03b2f"}, {"error", "#e03b2f"},
{"warning", "#e0b928"}, {"warning", "#d6ae1e"},
{"line", "grey"}, {"line", "grey"},