implemented shared libraries for local timer
(remote is still not working)
This commit is contained in:
parent
32012fa67b
commit
e73d1106be
5 changed files with 80 additions and 72 deletions
|
@ -15,12 +15,9 @@ class ScStwAppBackend : public QObject
|
||||||
|
|
||||||
//Q_PROPERTY(int state READ getState NOTIFY stateChanged)
|
//Q_PROPERTY(int state READ getState NOTIFY stateChanged)
|
||||||
Q_PROPERTY(int mode READ getMode NOTIFY modeChanged)
|
Q_PROPERTY(int mode READ getMode NOTIFY modeChanged)
|
||||||
Q_PROPERTY(QVariant timers READ getTimerTextList NOTIFY timerTextChanged)
|
|
||||||
//Q_PROPERTY(QString baseStationState READ getBaseStationState NOTIFY baseStationStateChanged)
|
//Q_PROPERTY(QString baseStationState READ getBaseStationState NOTIFY baseStationStateChanged)
|
||||||
Q_PROPERTY(ScStwRace* race READ getRace NOTIFY raceChanged)
|
Q_PROPERTY(ScStwRace* race READ getRace NOTIFY raceChanged)
|
||||||
Q_PROPERTY(QVariant baseStationConnections READ getBaseStationConnections NOTIFY baseStationConnectionsChanged)
|
Q_PROPERTY(QVariant baseStationConnections READ getBaseStationConnections NOTIFY baseStationConnectionsChanged)
|
||||||
Q_PROPERTY(double nextStartActionDelayProgress READ getNextStartActionDelayProgress NOTIFY nextStartActionDelayProgressChanged)
|
|
||||||
Q_PROPERTY(int nextStartAction READ getNextStartAction NOTIFY nextStartActionChanged)
|
|
||||||
Q_PROPERTY(QVariantMap baseStationProperties READ getBaseStationProperties NOTIFY baseStationPropertiesChanged)
|
Q_PROPERTY(QVariantMap baseStationProperties READ getBaseStationProperties NOTIFY baseStationPropertiesChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -48,9 +45,6 @@ public slots:
|
||||||
Q_INVOKABLE ScStwRace *getRace();
|
Q_INVOKABLE ScStwRace *getRace();
|
||||||
//Q_INVOKABLE int getState();
|
//Q_INVOKABLE int getState();
|
||||||
Q_INVOKABLE int getMode();
|
Q_INVOKABLE int getMode();
|
||||||
Q_INVOKABLE QVariant getTimerTextList();
|
|
||||||
Q_INVOKABLE double getNextStartActionDelayProgress();
|
|
||||||
Q_INVOKABLE int getNextStartAction();
|
|
||||||
|
|
||||||
Q_INVOKABLE void writeSetting(QString key, QVariant value);
|
Q_INVOKABLE void writeSetting(QString key, QVariant value);
|
||||||
Q_INVOKABLE void writeSetting(ScStw::BaseStationSetting key, QVariant value);
|
Q_INVOKABLE void writeSetting(ScStw::BaseStationSetting key, QVariant value);
|
||||||
|
@ -79,15 +73,12 @@ public slots:
|
||||||
private slots:
|
private slots:
|
||||||
void refreshTimerText();
|
void refreshTimerText();
|
||||||
void refreshMode();
|
void refreshMode();
|
||||||
|
void reloadRaceSettings();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void modeChanged();
|
void modeChanged();
|
||||||
void raceChanged();
|
void raceChanged();
|
||||||
|
|
||||||
void nextStartActionChanged();
|
|
||||||
void nextStartActionDelayProgressChanged();
|
|
||||||
|
|
||||||
void timerTextChanged();
|
|
||||||
void baseStationStateChanged();
|
void baseStationStateChanged();
|
||||||
void baseStationConnectionsChanged();
|
void baseStationConnectionsChanged();
|
||||||
void baseStationPropertiesChanged();
|
void baseStationPropertiesChanged();
|
||||||
|
|
|
@ -18,7 +18,7 @@ Column {
|
||||||
|
|
||||||
function updateSetting(key, val, del){
|
function updateSetting(key, val, del){
|
||||||
del.busy = true
|
del.busy = true
|
||||||
speedBackend.writeSetting(key, val)
|
speedBackend.writeSetting(scStw.baseStationSettingToString(key) , val)
|
||||||
del.busy = false
|
del.busy = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ Column {
|
||||||
|
|
||||||
text: qsTr("say 'ready'")
|
text: qsTr("say 'ready'")
|
||||||
|
|
||||||
checked: parent.loadSetting("ReadySoundEnable", ready_del) === "true"
|
checked: parent.loadSetting(ScStw.ReadySoundEnableSetting, ready_del) === "true"
|
||||||
|
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
parent.updateSetting("ReadySoundEnable", checked, ready_del)
|
parent.updateSetting(ScStw.ReadySoundEnableSetting, checked, ready_del)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,10 +59,10 @@ Column {
|
||||||
inputHint: qsTr("time")
|
inputHint: qsTr("time")
|
||||||
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
||||||
|
|
||||||
inputText: control.loadSetting("ReadySoundDelay", ready_delay_del)
|
inputText: control.loadSetting(ScStw.ReadySoundDelaySetting, ready_delay_del)
|
||||||
|
|
||||||
onInputFinished: {
|
onInputFinished: {
|
||||||
control.updateSetting("ReadySoundDelay", inputText, ready_delay_del)
|
control.updateSetting(ScStw.ReadySoundDelaySetting, inputText, ready_delay_del)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,10 +78,10 @@ Column {
|
||||||
|
|
||||||
text: qsTr("say 'at your marks'")
|
text: qsTr("say 'at your marks'")
|
||||||
|
|
||||||
checked: control.loadSetting("AtYourMarksSoundEnable", ready_del) === "true"
|
checked: control.loadSetting(ScStw.AtYourMarksSoundEnableSetting , ready_del) === "true"
|
||||||
|
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
parent.updateSetting("AtYourMarksSoundEnable", at_marks_del.checked, at_marks_del)
|
parent.updateSetting(ScStw.AtYourMarksSoundEnableSetting, at_marks_del.checked, at_marks_del)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,10 +99,10 @@ Column {
|
||||||
|
|
||||||
enabled: !busy && at_marks_del.checked
|
enabled: !busy && at_marks_del.checked
|
||||||
|
|
||||||
inputText: control.loadSetting("AtYourMarksSoundDelay", at_marks_delay_del)
|
inputText: control.loadSetting(ScStw.AtYourMarksSoundDelaySetting, at_marks_delay_del)
|
||||||
|
|
||||||
onInputFinished: {
|
onInputFinished: {
|
||||||
control.updateSetting("AtYourMarksSoundDelay", inputText, at_marks_delay_del)
|
control.updateSetting(ScStw.AtYourMarksSoundDelaySetting, inputText, at_marks_delay_del)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,10 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScStw {
|
||||||
|
id: scStw
|
||||||
|
}
|
||||||
|
|
||||||
SpeedBackend {
|
SpeedBackend {
|
||||||
id: speedBackend
|
id: speedBackend
|
||||||
}
|
}
|
||||||
|
@ -65,32 +69,31 @@ Window {
|
||||||
var stateString
|
var stateString
|
||||||
console.log("race state changed to: " + state)
|
console.log("race state changed to: " + state)
|
||||||
switch (state){
|
switch (state){
|
||||||
case 0:
|
case ScStwRace.IDLE:
|
||||||
stateString = "IDLE"
|
stateString = "IDLE"
|
||||||
break;
|
break;
|
||||||
case 1:
|
case ScStwRace.STARTING:
|
||||||
stateString = "STARTING"
|
stateString = "STARTING"
|
||||||
settingsDialog.close()
|
settingsDialog.close()
|
||||||
profilesDialog.close()
|
profilesDialog.close()
|
||||||
break;
|
break;
|
||||||
case 2:
|
case ScStwRace.WAITING:
|
||||||
stateString = "WAITING"
|
stateString = "WAITING"
|
||||||
settingsDialog.close()
|
settingsDialog.close()
|
||||||
profilesDialog.close()
|
profilesDialog.close()
|
||||||
break;
|
break;
|
||||||
case 3:
|
case ScStwRace.RUNNING:
|
||||||
stateString = "RUNNING"
|
stateString = "RUNNING"
|
||||||
settingsDialog.close()
|
settingsDialog.close()
|
||||||
profilesDialog.close()
|
profilesDialog.close()
|
||||||
break;
|
break;
|
||||||
case 4:
|
case ScStwRace.STOPPED:
|
||||||
stateString = "STOPPED"
|
stateString = "STOPPED"
|
||||||
settingsDialog.close()
|
settingsDialog.close()
|
||||||
profilesDialog.close()
|
profilesDialog.close()
|
||||||
}
|
}
|
||||||
app.state = stateString
|
app.state = stateString
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppTheme {
|
AppTheme {
|
||||||
|
@ -140,12 +143,13 @@ Window {
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
opacity: ( speedBackend.state < 3 ) ? 1:0
|
opacity: ( speedBackend.race.state < ScStwRace.RUNNING ) ? 1:0
|
||||||
|
|
||||||
width: parent.width * 0.7
|
width: parent.width * 0.7
|
||||||
height: parent.height * 0.7
|
height: parent.height * 0.7
|
||||||
|
|
||||||
text: implicitText === "NEXT_START_ACTION" ? ["at your \nmarks", "ready", "starting...", ""][speedBackend.nextStartAction]:implicitText
|
text: implicitText === "NEXT_START_ACTION" ?
|
||||||
|
["", "at your \nmarks", "ready", "starting..."][speedBackend.race.nextStartActionDetails[ScStwRace.NextStartAction]+1]:implicitText
|
||||||
|
|
||||||
color: appTheme.style.textColor
|
color: appTheme.style.textColor
|
||||||
|
|
||||||
|
@ -172,14 +176,14 @@ Window {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.bottomMargin: app.landscape() ? 0:parent.height * 0.1
|
anchors.bottomMargin: app.landscape() ? 0:parent.height * 0.1
|
||||||
|
|
||||||
opacity: ( speedBackend.state < 3 ) ? 0:1
|
opacity: ( speedBackend.race.state < ScStwRace.RUNNING ) ? 0:1
|
||||||
|
|
||||||
spacing: height * 0.05
|
spacing: height * 0.05
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: timerRep
|
id: timerRep
|
||||||
|
|
||||||
model: speedBackend.timers.length
|
model: speedBackend.race.timers.length
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: timerDel
|
id: timerDel
|
||||||
|
@ -200,9 +204,9 @@ Window {
|
||||||
["LOST", "FAILED"].includes(speedBackend.timers[index]["state"]) ? appTheme.style.errorColor:
|
["LOST", "FAILED"].includes(speedBackend.timers[index]["state"]) ? appTheme.style.errorColor:
|
||||||
appTheme.style.textColor
|
appTheme.style.textColor
|
||||||
|
|
||||||
enabled: speedBackend.timers[index]["state"] !== "DISABLED"
|
enabled: speedBackend.race.timers[index]["state"] !== ScStwTimer.DISABLED
|
||||||
|
|
||||||
text: speedBackend.timers[index]["text"]
|
text: speedBackend.race.timers[index]["text"]
|
||||||
|
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
|
|
||||||
|
@ -224,7 +228,7 @@ Window {
|
||||||
Label {
|
Label {
|
||||||
id: react_time
|
id: react_time
|
||||||
|
|
||||||
property int rtime: speedBackend.timers[index]["reacttime"]
|
property int rtime: speedBackend.race.timers[index]["reactionTime"]
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
centerIn: parent
|
centerIn: parent
|
||||||
|
@ -408,7 +412,7 @@ Window {
|
||||||
app.start()
|
app.start()
|
||||||
break
|
break
|
||||||
case "RUNNING":
|
case "RUNNING":
|
||||||
app.stop(0)
|
app.stop()
|
||||||
break
|
break
|
||||||
case "STOPPED":
|
case "STOPPED":
|
||||||
app.reset()
|
app.reset()
|
||||||
|
@ -479,6 +483,9 @@ Window {
|
||||||
|
|
||||||
ProgressCircle {
|
ProgressCircle {
|
||||||
id: prog
|
id: prog
|
||||||
|
|
||||||
|
property double progress: speedBackend.race.nextStartActionDetails[ScStwRace.NextStartActionDelayProgress]
|
||||||
|
|
||||||
anchors.fill: startButt
|
anchors.fill: startButt
|
||||||
opacity: app.state === "STARTING" ? 1:0
|
opacity: app.state === "STARTING" ? 1:0
|
||||||
|
|
||||||
|
@ -487,7 +494,7 @@ Window {
|
||||||
lineWidth: prog.width * 0.02
|
lineWidth: prog.width * 0.02
|
||||||
|
|
||||||
arcBegin: 0
|
arcBegin: 0
|
||||||
arcEnd: 360 * speedBackend.nextStartActionDelayProgress
|
arcEnd: 360 * (1 - (progress > 0 ? progress:1))
|
||||||
|
|
||||||
colorCircle: "grey"
|
colorCircle: "grey"
|
||||||
|
|
||||||
|
@ -521,7 +528,7 @@ Window {
|
||||||
enabled: app.state === "STARTING"
|
enabled: app.state === "STARTING"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
app.stop(1)
|
app.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
@ -842,26 +849,33 @@ Window {
|
||||||
/*----Functions to control the stopwatch----*/
|
/*----Functions to control the stopwatch----*/
|
||||||
function start(){
|
function start(){
|
||||||
var ret = speedBackend.race.start()
|
var ret = speedBackend.race.start()
|
||||||
if(!ret){
|
if(ret !== 200){
|
||||||
console.log("+ --- error starting race!")
|
console.log("+ --- error starting race: " + ret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop(type){
|
function cancel() {
|
||||||
|
var ret = speedBackend.race.cancelStart(false)
|
||||||
|
if(ret !== 200){
|
||||||
|
console.log("+ --- error canellingr race: " + ret)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var ret = speedBackend.stopRace(type)
|
function stop(){
|
||||||
|
|
||||||
if(!ret){
|
var ret = speedBackend.race.stop()
|
||||||
console.log("+ --- error stopping race: ")
|
|
||||||
|
if(ret !== 200){
|
||||||
|
console.log("+ --- error stopping race: " + ret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset(){
|
function reset(){
|
||||||
|
|
||||||
var ret = speedBackend.resetRace()
|
var ret = speedBackend.race.reset()
|
||||||
|
|
||||||
if(ret !== 200){
|
if(ret !== 200){
|
||||||
console.log("+ --- error resetting race: "+ret)
|
console.log("+ --- error resetting race: " + ret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
|
#include <QQmlEngine>
|
||||||
#include <QSqlDatabase>
|
#include <QSqlDatabase>
|
||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -54,7 +55,9 @@
|
||||||
//#include "headers/climbingrace.h"
|
//#include "headers/climbingrace.h"
|
||||||
#include "headers/apptheme.h"
|
#include "headers/apptheme.h"
|
||||||
#include "headers/scstwappbackend.h"
|
#include "headers/scstwappbackend.h"
|
||||||
|
#include <scstwtimer.h>
|
||||||
#include <scstwrace.h>
|
#include <scstwrace.h>
|
||||||
|
#include <ScStw.hpp>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -86,7 +89,10 @@ int main(int argc, char *argv[])
|
||||||
// setup speed backend and App themes
|
// setup speed backend and App themes
|
||||||
qmlRegisterType<ScStwAppBackend>("com.itsblue.speedclimbingstopwatch", 2, 0, "SpeedBackend");
|
qmlRegisterType<ScStwAppBackend>("com.itsblue.speedclimbingstopwatch", 2, 0, "SpeedBackend");
|
||||||
qmlRegisterType<ScStwRace>("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwRace");
|
qmlRegisterType<ScStwRace>("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwRace");
|
||||||
|
qmlRegisterType<ScStwTimer>("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStwTimer");
|
||||||
qmlRegisterType<AppTheme>("com.itsblue.speedclimbingstopwatch", 2, 0, "AppTheme");
|
qmlRegisterType<AppTheme>("com.itsblue.speedclimbingstopwatch", 2, 0, "AppTheme");
|
||||||
|
//qmlRegisterUncreatableType<ScStw>("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStw", "This is a static class and therefore not instantiable");
|
||||||
|
qmlRegisterType<ScStw>("com.itsblue.speedclimbingstopwatch", 2, 0, "ScStw");
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
|
|
|
@ -13,6 +13,7 @@ ScStwAppBackend::ScStwAppBackend(QObject *parent) : QObject(parent)
|
||||||
connect(this, &ScStwAppBackend::baseStationStateChanged, this, &ScStwAppBackend::baseStationPropertiesChanged);
|
connect(this, &ScStwAppBackend::baseStationStateChanged, this, &ScStwAppBackend::baseStationPropertiesChanged);
|
||||||
|
|
||||||
this->localRace->addTimer(new ScStwTimer(this));
|
this->localRace->addTimer(new ScStwTimer(this));
|
||||||
|
this->reloadRaceSettings();
|
||||||
|
|
||||||
this->timerTextRefreshTimer = new QTimer(this);
|
this->timerTextRefreshTimer = new QTimer(this);
|
||||||
this->timerTextRefreshTimer->setInterval(1);
|
this->timerTextRefreshTimer->setInterval(1);
|
||||||
|
@ -21,11 +22,6 @@ ScStwAppBackend::ScStwAppBackend(QObject *parent) : QObject(parent)
|
||||||
this->refreshTimerText();
|
this->refreshTimerText();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------
|
|
||||||
// --- Main Functionality ---
|
|
||||||
// --------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------
|
// -------------------------
|
||||||
// --- Base Station sync ---
|
// --- Base Station sync ---
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
@ -124,8 +120,7 @@ void ScStwAppBackend::refreshMode() {
|
||||||
if(newMode == LOCAL){
|
if(newMode == LOCAL){
|
||||||
// if the new mode is local -> connection to base station has been lost
|
// if the new mode is local -> connection to base station has been lost
|
||||||
|
|
||||||
// reset race
|
// reset local race
|
||||||
// reset state
|
|
||||||
this->getRace()->reset();
|
this->getRace()->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,18 +133,14 @@ void ScStwAppBackend::refreshMode() {
|
||||||
void ScStwAppBackend::refreshTimerText() {
|
void ScStwAppBackend::refreshTimerText() {
|
||||||
|
|
||||||
// --- refresh timer text ---
|
// --- refresh timer text ---
|
||||||
|
if(this->getRace()->getState() == ScStwRace::RUNNING) {
|
||||||
QVariantList newTimerTextList;
|
emit this->getRace()->timersChanged();
|
||||||
|
}
|
||||||
newTimerTextList = this->getRace()->getTimerDetailList();
|
|
||||||
|
|
||||||
// --- refresh next start action delay progress ---
|
// --- refresh next start action delay progress ---
|
||||||
double nextStartActionDelayProgress = 0;
|
if(this->getRace()->getState() == ScStwRace::STARTING) {
|
||||||
|
emit this->getRace()->nextStartActionDetailsChanged();
|
||||||
nextStartActionDelayProgress = this->getRace()->getNextStartActionDetails()["nextActionDelayProg"].toDouble();
|
}
|
||||||
|
|
||||||
if(nextStartActionDelayProgress < 1.0)
|
|
||||||
emit this->nextStartActionDelayProgressChanged();
|
|
||||||
|
|
||||||
this->timerTextRefreshTimer->start();
|
this->timerTextRefreshTimer->start();
|
||||||
}
|
}
|
||||||
|
@ -258,18 +249,6 @@ int ScStwAppBackend::getMode() {
|
||||||
return this->mode;
|
return this->mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant ScStwAppBackend::getTimerTextList() {
|
|
||||||
return this->getRace()->getTimerDetailList();
|
|
||||||
}
|
|
||||||
|
|
||||||
double ScStwAppBackend::getNextStartActionDelayProgress() {
|
|
||||||
return this->getRace()->getNextStartActionDetails()["nextActionDelayProg"].toDouble();
|
|
||||||
}
|
|
||||||
|
|
||||||
int ScStwAppBackend::getNextStartAction() {
|
|
||||||
return this->getRace()->getNextStartActionDetails()["nextAction"].toInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScStwAppBackend::writeSetting(QString key, QVariant value) {
|
void ScStwAppBackend::writeSetting(QString key, QVariant value) {
|
||||||
if(this->mode == REMOTE && ScStw::baseStationSettingFromString(key) != ScStw::InvalidSetting ){
|
if(this->mode == REMOTE && ScStw::baseStationSettingFromString(key) != ScStw::InvalidSetting ){
|
||||||
this->scStwClient->writeRemoteSetting(ScStw::baseStationSettingFromString(key), value.toString());
|
this->scStwClient->writeRemoteSetting(ScStw::baseStationSettingFromString(key), value.toString());
|
||||||
|
@ -277,6 +256,8 @@ void ScStwAppBackend::writeSetting(QString key, QVariant value) {
|
||||||
else {
|
else {
|
||||||
this->appSettings->writeSetting(key, value);
|
this->appSettings->writeSetting(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->reloadRaceSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScStwAppBackend::writeSetting(ScStw::BaseStationSetting key, QVariant value) {
|
void ScStwAppBackend::writeSetting(ScStw::BaseStationSetting key, QVariant value) {
|
||||||
|
@ -301,6 +282,22 @@ QString ScStwAppBackend::readSetting(ScStw::BaseStationSetting key) {
|
||||||
return "false";
|
return "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScStwAppBackend::reloadRaceSettings() {
|
||||||
|
this->getRace()->writeStartActionSetting(
|
||||||
|
ScStwRace::AtYourMarks,
|
||||||
|
this->appSettings->loadSetting(ScStw::baseStationSettingToString(ScStw::AtYourMarksSoundEnableSetting)) == "true",
|
||||||
|
this->appSettings->loadSetting(ScStw::baseStationSettingToString(ScStw::AtYourMarksSoundDelaySetting)).toDouble()
|
||||||
|
);
|
||||||
|
|
||||||
|
this->getRace()->writeStartActionSetting(
|
||||||
|
ScStwRace::Ready,
|
||||||
|
this->appSettings->loadSetting(ScStw::baseStationSettingToString(ScStw::ReadySoundEnableSetting)) == "true",
|
||||||
|
this->appSettings->loadSetting(ScStw::baseStationSettingToString(ScStw::ReadySoundDelaySetting)).toDouble()
|
||||||
|
);
|
||||||
|
|
||||||
|
this->getRace()->setSoundVolume(1);
|
||||||
|
|
||||||
|
}
|
||||||
void ScStwAppBackend::connectBaseStation() {
|
void ScStwAppBackend::connectBaseStation() {
|
||||||
this->reloadBaseStationIpAdress();
|
this->reloadBaseStationIpAdress();
|
||||||
this->scStwClient->connectToHost();
|
this->scStwClient->connectToHost();
|
||||||
|
|
Reference in a new issue