Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
10645e9eb8
4 changed files with 24 additions and 2 deletions
|
@ -81,7 +81,7 @@ public:
|
|||
StopRaceCommand = 1001,
|
||||
ResetRaceCommand = 1002,
|
||||
CancelRaceCommand = 1003,
|
||||
SetTimerDisabled = 1004,
|
||||
SetTimerDisabledCommand = 1004,
|
||||
|
||||
GetRaceStateCommand = 2000,
|
||||
GetRaceDetailsCommand = 2001,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 ---
|
||||
// -------------------------
|
||||
|
|
|
@ -116,7 +116,7 @@ ScStwAppThemeManager::ScStwAppThemeManager(QObject *parent) : QObject(parent)
|
|||
|
||||
{"success", "#6bd43b"},
|
||||
{"error", "#e03b2f"},
|
||||
{"warning", "#e0b928"},
|
||||
{"warning", "#d6ae1e"},
|
||||
|
||||
{"line", "grey"},
|
||||
|
||||
|
|
Reference in a new issue