Library migration #36

Merged
dorian merged 62 commits from library_migration into master 2024-10-17 17:52:36 +02:00
6 changed files with 26 additions and 20 deletions
Showing only changes of commit 3ee017104f - Show all commits

View file

@ -6,7 +6,7 @@
#include <scstwclient.h> #include <scstwclient.h>
#include <scstwrace.h> #include <scstwrace.h>
#include <ScStw.hpp> #include <ScStw.hpp>
#include <scstwremotemonitorrace.h> #include <scstwremoterace.h>
#include "headers/scstwappsettings.h" #include "headers/scstwappsettings.h"
@ -34,7 +34,7 @@ private:
QTimer * timerTextRefreshTimer; QTimer * timerTextRefreshTimer;
ScStwRace * localRace; ScStwRace * localRace;
ScStwRemoteMonitorRace * remoteRace; ScStwRemoteRace * remoteRace;
public slots: public slots:
// functions for qml // functions for qml

View file

@ -13,9 +13,9 @@ import de.itsblue.ScStw.Styling.Components 1.0
Item { Item {
id: control id: control
// ---------------------------------- property ScStwSetting competitionModeSetting: speedBackend.settings.getSetting(ScStwSettings.CompetitionModeSetting, ScStwSettings.KeyLevel)
// -- Start / Stop / Reset button --- property ScStwSetting readySoundEnableSetting: speedBackend.settings.getSetting(ScStwSettings.ReadySoundEnableSetting, ScStwSettings.KeyLevel)
// ----------------------------------
GridLayout { GridLayout {
id: centerLayout id: centerLayout
@ -43,8 +43,6 @@ Item {
MainActionButton { MainActionButton {
id: mainActionButton id: mainActionButton
property ScStwSetting setting: speedBackend.settings.getSetting(ScStwSettings.CompetitionModeSetting, ScStwSettings.KeyLevel)
property double size property double size
startProgress: speedBackend.race.currentStartDelay[ScStwRace.CurrentStartStateDelayProgress] startProgress: speedBackend.race.currentStartDelay[ScStwRace.CurrentStartStateDelayProgress]
@ -73,8 +71,13 @@ Item {
case ScStwRace.IDLE: case ScStwRace.IDLE:
ret = speedBackend.race.start() ret = speedBackend.race.start()
break; break;
case ScStwRace.PREPAIRING:
case ScStwRace.WAITING: case ScStwRace.WAITING:
if(!control.readySoundEnableSetting.value)
ret = speedBackend.race.start()
else
ret = speedBackend.race.cancel()
break;
case ScStwRace.PREPAIRING:
case ScStwRace.STARTING: case ScStwRace.STARTING:
ret = speedBackend.race.cancel() ret = speedBackend.race.cancel()
break; break;
@ -133,7 +136,8 @@ Item {
PropertyChanges { PropertyChanges {
target: mainActionButton target: mainActionButton
size: 0.9 size: 0.9
text: "cancel" text: control.readySoundEnableSetting.value ? "cancel":"ready"
enabled: control.readySoundEnableSetting.value ? true:speedBackend.race.isReadyForNextState
} }
}, },
@ -152,7 +156,7 @@ Item {
target: mainActionButton target: mainActionButton
size: 0.9 size: 0.9
text: "stop" text: "stop"
progressControlActivated: speedBackend.scStwClient.state === ScStwClient.CONNECTED // TODO && mainActionButton.setting.value === true progressControlActivated: speedBackend.scStwClient.state === ScStwClient.CONNECTED && control.competitionModeSetting.value
} }
}, },

View file

@ -79,7 +79,8 @@ DelayButton {
onPaint: { onPaint: {
var progress var progress
var showHoldProgress = (control.down && control.progressControlActivated) var showHoldProgress = ((control.startProgress <= 0 || control.startProgress === 1) && control.progressControlActivated)
if(showHoldProgress) if(showHoldProgress)
progress = control.progress progress = control.progress
else else

View file

@ -75,7 +75,8 @@ ApplicationWindow {
console.log("race state changed to: " + speedBackend.race.state) console.log("race state changed to: " + speedBackend.race.state)
if(speedBackend.race.state != ScStwRace.IDLE) { if(speedBackend.race.state != ScStwRace.IDLE) {
//settingsDialog.close() settingsDialog.close()
profilesDialog.close()
} }
app.state = speedBackend.race.state app.state = speedBackend.race.state
@ -240,16 +241,16 @@ ApplicationWindow {
height: width height: width
} }
/*ProfilesDialog { ProfilesDialog {
id: profilesDialog id: profilesDialog
property int margin: app.landscape() ? app.height * 0.05:app.width * 0.05 property int margin: app.landscape() ? app.height * 0.05:app.width * 0.05
x: app.landscape() ? topContainerItm.width + margin:topContainerItm.x + margin x: centerContent.x + margin
y: !app.landscape() ? topContainerItm.height + margin:topContainerItm.x + margin y: centerContent.y + margin
width: app.landscape() ? app.width - topContainerItm.width - menu_container.width - margin * 2 : app.width - margin * 2 width: centerContent.width - margin * 2
height: !app.landscape() ? app.height - topContainerItm.height - menu_container.height - margin * 2 : app.height - margin * 2 height: centerContent.height - margin * 2
}*/ }
/* /*
states: [ states: [

@ -1 +1 @@
Subproject commit a247a6c3054545ec69c4eff14b5134f4c084ec31 Subproject commit 3c626b82da8373a2a69b6b7979ecf17d962076dd

View file

@ -5,7 +5,7 @@ ScStwAppBackend::ScStwAppBackend(QObject *parent) : QObject(parent)
this->scStwClient = new ScStwClient(this); this->scStwClient = new ScStwClient(this);
this->appSettings = new ScStwAppSettings(this->scStwClient, this); this->appSettings = new ScStwAppSettings(this->scStwClient, this);
this->localRace = new ScStwRace(this); this->localRace = new ScStwRace(this);
this->remoteRace = new ScStwRemoteMonitorRace(this->scStwClient, this); this->remoteRace = new ScStwRemoteRace(this->scStwClient, this);
this->mode = LOCAL; this->mode = LOCAL;
connect(this->appSettings, &ScStwAppSettings::settingChanged, this, &ScStwAppBackend::handleSettingChange); connect(this->appSettings, &ScStwAppSettings::settingChanged, this, &ScStwAppBackend::handleSettingChange);