From e37ea4c0656d1e29f9ce2e851318791a6b3ae532 Mon Sep 17 00:00:00 2001 From: ewc340 Date: Wed, 23 Sep 2020 20:01:35 -0700 Subject: [PATCH] Add back old protos --- old-protos/ansible.proto | 32 ++++++++++++++++++++++++++++++++ old-protos/notification.proto | 25 +++++++++++++++++++++++++ old-protos/runtime.proto | 30 ++++++++++++++++++++++++++++++ package.json | 4 ++-- 4 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 old-protos/ansible.proto create mode 100644 old-protos/notification.proto create mode 100644 old-protos/runtime.proto diff --git a/old-protos/ansible.proto b/old-protos/ansible.proto new file mode 100644 index 00000000..60cb6966 --- /dev/null +++ b/old-protos/ansible.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +message DawnData { + enum StudentCodeStatus { + IDLE = 0; + TELEOP = 1; + AUTONOMOUS = 2; + ESTOP = 3; + } + + enum TeamColor { + NONE = 0; + BLUE = 1; + GOLD = 2; + } + + message Gamepad { + int32 index = 1; // Gamepad index, there may be up to 4 + repeated double axes = 2; + repeated bool buttons = 3; + } + + message Gamecode { + int32 code = 1; + } + + StudentCodeStatus student_code_status = 1; + repeated Gamepad gamepads = 2; + repeated string peripheral_names = 3; + TeamColor team_color = 4; + Gamecode gamecode = 5; +} diff --git a/old-protos/notification.proto b/old-protos/notification.proto new file mode 100644 index 00000000..9d08d5a0 --- /dev/null +++ b/old-protos/notification.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +message Notification { + enum Type { + CONSOLE_LOGGING = 0; + STUDENT_SENT = 1; + STUDENT_RECEIVED = 2; + STUDENT_NOT_RECEIVED = 3; + SENSOR_MAPPING = 4; + TIMESTAMP_UP = 5; + TIMESTAMP_DOWN = 6; + GAMECODE_TRANSMISSION = 7; + } + message SensorMapping { + string device_uid = 1; + string device_student_name = 2; + } + Type header = 1; + string console_output = 2; // Console Output From Runtime to Dawn + repeated SensorMapping sensor_mapping = 3; + repeated double timestamps = 4; + repeated int32 gamecode_solutions = 5; + repeated int32 gamecodes = 6; + repeated int32 rfids = 7; +} diff --git a/old-protos/runtime.proto b/old-protos/runtime.proto new file mode 100644 index 00000000..14fe98b3 --- /dev/null +++ b/old-protos/runtime.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +message RuntimeData { + enum State { + STUDENT_CRASHED = 0; + STUDENT_RUNNING = 1; + STUDENT_STOPPED = 2; + TELEOP = 3; + AUTO = 4; + ESTOP = 5; + } + message ParamValue { + string param = 1; + oneof kind { + float float_value = 2; + int32 int_value = 3; + bool bool_value = 4; + } + } + message SensorData { + reserved "value"; + reserved 3; + string device_type = 1; + string device_name = 2; + string uid = 4; + uint32 int_device_type = 5; + repeated ParamValue param_value = 6; + } + State robot_state = 1; + repeated SensorData sensor_data = 2; +} diff --git a/package.json b/package.json index 4bc0653b..52160a4f 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,13 @@ }, "betterScripts": { "start": { - "command": "cp ../ansible-protos/*.proto ./build && electron build/main.js", + "command": "cp ./old-protos/*.proto ./build && electron build/main.js", "env": { "NODE_ENV": "development" } }, "build": { - "command": "mkdir -p ./build && cp ../ansible-protos/*.proto ./build && webpack --mode production --progress", + "command": "mkdir -p ./build && cp ../old-protos/*.proto ./build && webpack --mode production --progress", "env": { "NODE_ENV": "production" }