some fixes, added timer disable function
This commit is contained in:
parent
1ee5a059ac
commit
886abb2a02
4 changed files with 24 additions and 2 deletions
|
@ -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,
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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 ---
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
|
@ -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"},
|
||||||
|
|
||||||
|
|
Reference in a new issue