2
0
Fork 0

Feat: add new settings and extra lane state

This commit is contained in:
Dorian Zedler 2024-11-13 12:35:02 +01:00
parent 408f250614
commit 5460506f84
Signed by: dorian
GPG key ID: 989DE36109AFA354
2 changed files with 109 additions and 21 deletions

View file

@ -2,6 +2,27 @@ syntax = "proto3";
package ScStw; package ScStw;
message TrainingClassicRaceExtraState {
// If this stays `true` for at least the configured autostart
// standstillDurationBeforeStart, an autostart will be executed.
// Once this becomes true, clients should display indicate it and
// optionally show a countdown.
bool autostartPending = 1;
// If this is `true`, the time is calculated and the valid.
// This happens when the athlete does a false start but still finishes.
// In this case, the client should mark the time as invalid.
bool timeIsCalculated = 2;
}
message LaneExtraState {
oneof state {
TrainingClassicRaceExtraState trainingClassicRaceExtraState = 1;
// TODO CompetitionRelayExtraState competitionRelayMode = 2;
// TODO Competition4SpeedExtraState competition4SpeedMode = 3;
}
}
message LaneFullState { message LaneFullState {
enum State { enum State {
IDLE = 0; IDLE = 0;
@ -22,12 +43,7 @@ message LaneFullState {
uint32 reactionTime = 2; uint32 reactionTime = 2;
uint32 climbingTime = 3; uint32 climbingTime = 3;
// This is only relevant in training mode! LaneExtraState extraState = 4;
// If this stays `true` for at least the configured autostart
// standstillDurationBeforeStart, an autostart will be executed.
// Once this becomes true, clients should display indicate it and
// optionally show a countdown.
bool autostartPending = 4;
} }
message RaceFullState { message RaceFullState {

View file

@ -2,35 +2,107 @@ syntax = "proto3";
package ScStw; package ScStw;
message ManualStartProcedureSettings {} message SoundSettings {
// Software volume control, between 0 and 254
message AutomatedStartProcedureSettings { uint32 volume = 1;
bool sayReady = 1; bool muteInternalSpeaker = 2;
int32 standstillDurationBeforeReady = 2;
} }
message StartProcedureSettings { message SecuritySettings {
oneof startProcedureSettings { // If set to true, the bluetooth interface won't be initialized on startup
ManualStartProcedureSettings manualStartProcedureSettings = 1; // This can only be changed over a web socket connection to avoid lockout
AutomatedStartProcedureSettings automatedStartProcedureSettings = 2; // At least one lane must be enabled. Otherwise, the first lane will be
// enabled!
bool disableBluetooth = 1;
}
//
// TimerMode
//
// = Competition classic race =
message ManualStartProcedure {
// If set to true, the timer will play the "Ready" sound before starting when
// RaceStartCommand is sent.
bool sayReady = 1;
}
message CompetitionClassicRaceMode {
ManualStartProcedure manualStartProcedure = 1;
}
// = Training classic race =
message AutomatedStartProcedure {
bool sayReady = 1;
int32 standstillDurationBeforeStart = 2;
bool autoReset = 3;
}
message StartProcedure {
oneof startProcedure {
ManualStartProcedure manualStartProcedure = 1;
AutomatedStartProcedure automatedStartProcedure = 2;
} }
} }
message LaneSettings { message LaneSettings {
string letter = 1; reserved 1; // Deprecated "letter"
bool disable = 2; // If set to true, the lane won't be usable and won't show up in the UI
// Can be used if there is only a single lane in the gym
bool disabled = 2;
} }
message SoundSettings { uint32 volume = 1; } message AbortAfterFalseStart {}
message ContinueAfterFalseStart {
// This time will be assumed as the reaction time when calculating the final
// time
uint32 assumedReactionTime = 1;
// If set to true, there will be no false start tone and the normal tone will
// continue Also, the indicator of wildcard lanes will continue as normal
bool continueStartSequenceAfterFalseStart = 2;
}
message RaceSettings { message FalseStartBehaviour {
StartProcedureSettings startProcedure = 1; oneof behaviour {
AbortAfterFalseStart abortAfterFalseStart = 1;
ContinueAfterFalseStart continueAfterFalseStart = 2;
}
}
message FalseStartSettings {
FalseStartBehaviour behaviour = 1;
uint32 soundDuration = 2;
bool muteIndicators = 3;
}
message TrainingClassicRaceMode {
StartProcedure startProcedure = 1;
// The number of lanes cannot be changed by the client
repeated LaneSettings lanes = 2; repeated LaneSettings lanes = 2;
FalseStartSettings falseStartSettings = 3;
// Software brightness control, between 0 and 254
uint32 indicatorBrightness = 4;
}
message TimerMode {
oneof mode {
CompetitionClassicRaceMode competitionClassicRaceMode = 1;
TrainingClassicRaceMode trainingClassicRaceMode = 2;
// TODO CompetitionRelayMode competitionRelayMode = 3;
// TODO Competition4SpeedMode competition4SpeedMode = 4;
}
} }
message Settings { message Settings {
// if the settings are stored as default in the flash memory // if the settings are stored as default in the flash memory
bool default = 1; bool default = 1;
RaceSettings race = 2;
// DEPRECATED, just kept for compatibility, use TimerMode instead!
// Will be ignored when TimerMode is set
TrainingClassicRaceMode trainingClassicRaceMode = 2 [ deprecated = true ];
SoundSettings sound = 3; SoundSettings sound = 3;
TimerMode timerMode = 4;
SecuritySettings securitySettings = 5;
} }