Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new interface #44

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
10 changes: 4 additions & 6 deletions proto/Handshake.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ package proto;

import "UiOptions.proto";

// A message which contains either a list of declarations or a list of values for a single module.
message Handshake {
daw1012345 marked this conversation as resolved.
Show resolved Hide resolved
string name = 1;
repeated UiOption options = 2;
}

message HandshakeAccumulation {
repeated Handshake handshakes = 1;
string module_name = 1;
UiOptionDeclarations declarations = 2;
rolfvdhulst marked this conversation as resolved.
Show resolved Hide resolved
UiValues values = 3;
}
9 changes: 1 addition & 8 deletions proto/State.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@ message State {
repeated SSL_Referee processed_referee_packets = 11;
}

message SystemState{
State state = 1;
UiSettings ui_settings = 2;
}

message HandshakeState {
State state = 1;
}
message ModuleState {
SystemState system_state = 1;
State system_state = 1;
repeated Handshake handshakes = 2;
}
14 changes: 8 additions & 6 deletions proto/UiOptions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ message TextField {
string text = 1;
}

message UiOption {
message UiOptionDeclaration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the one thing I'm unsure about is how we'll toggle the mutability of a field. Should this be a boolean here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one, I'll add it. Worst case we don't end up using/needing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also forgot to mention field descriptions we discussed - it appears those are missing as well.

string name = 1;
oneof ui_elements {
Slider slider = 2;
Expand All @@ -40,17 +40,19 @@ message UiOption {
TextField textfield = 6;
}
}

message PossibleUiValue {
oneof ui_value {
message UiOptionDeclarations{
repeated UiOptionDeclaration options = 1;
}
message UiValue {
oneof value {
float float_value = 1;
bool bool_value = 2;
int64 integer_value = 3;
string text_value = 4;
}
}

message UiSettings {
message UiValues {
// maps UiOption::name to the value it currently contains.
map<string, PossibleUiValue> ui_values = 1;
map<string, UiValue> ui_values = 1;
}