Add more scouting server messages
Signed-off-by: Sabina Leaver <100027607@mvla.net>
Change-Id: Icac2a428c3ad887fd765ad54e03f6d499a29325b
diff --git a/BUILD b/BUILD
index da7cb6e..232ac67 100644
--- a/BUILD
+++ b/BUILD
@@ -15,6 +15,12 @@
# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/error_response //scouting/webserver/requests/messages:error_response_go_fbs
# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/submit_data_scouting //scouting/webserver/requests/messages:submit_data_scouting_go_fbs
# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/submit_data_scouting_response //scouting/webserver/requests/messages:submit_data_scouting_response_go_fbs
+# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/request_data_scouting_response //scouting/webserver/requests/messages:query_data_scouting_response_go_fbs
+# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/request_data_scouting //scouting/webserver/requests/messages:request_data_scouting_go_fbs
+# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/request_matches_for_team_response //scouting/webserver/requests/messages:request_matches_for_team_response_go_fbs
+# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/request_matches_for_team //scouting/webserver/requests/messages:request_matches_for_team_go_fbs
+# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/request_all_matches_response //scouting/webserver/requests/messages:request_all_matches_response_go_fbs
+# gazelle:resolve go github.com/frc971/971-Robot-Code/scouting/webserver/requests/messages/request_all_matches //scouting/webserver/requests/messages:request_all_matches_go_fbs
gazelle(
name = "gazelle",
diff --git a/scouting/webserver/requests/debug/cli/cli_test.py b/scouting/webserver/requests/debug/cli/cli_test.py
index 925cb99..782b968 100644
--- a/scouting/webserver/requests/debug/cli/cli_test.py
+++ b/scouting/webserver/requests/debug/cli/cli_test.py
@@ -58,7 +58,14 @@
json_path = write_json({
"team": 971,
"match": 42,
- "upper_goal_hits": 3,
+ "missed_shots_auto": 9971,
+ "upper_goal_auto": 9971,
+ "lower_goal_auto": 9971,
+ "missed_shots_tele": 9971,
+ "upper_goal_tele": 9971,
+ "lower_goal_tele": 9971,
+ "defense_rating": 9971,
+ "climbing": 9971,
})
exit_code, _stdout, stderr = run_debug_cli(["-submitDataScouting", json_path])
diff --git a/scouting/webserver/requests/messages/BUILD b/scouting/webserver/requests/messages/BUILD
index 1567935..53ceab2 100644
--- a/scouting/webserver/requests/messages/BUILD
+++ b/scouting/webserver/requests/messages/BUILD
@@ -4,6 +4,12 @@
"error_response",
"submit_data_scouting",
"submit_data_scouting_response",
+ "request_all_matches",
+ "request_all_matches_response",
+ "request_matches_for_team",
+ "request_matches_for_team_response",
+ "request_data_scouting",
+ "request_data_scouting_response",
)
filegroup(
diff --git a/scouting/webserver/requests/messages/request_all_matches.fbs b/scouting/webserver/requests/messages/request_all_matches.fbs
new file mode 100644
index 0000000..1d4acc2
--- /dev/null
+++ b/scouting/webserver/requests/messages/request_all_matches.fbs
@@ -0,0 +1,6 @@
+namespace scouting.webserver.requests;
+
+table RequestMatchList {
+}
+
+root_type RequestMatchList;
\ No newline at end of file
diff --git a/scouting/webserver/requests/messages/request_all_matches_response.fbs b/scouting/webserver/requests/messages/request_all_matches_response.fbs
new file mode 100644
index 0000000..d4a1658
--- /dev/null
+++ b/scouting/webserver/requests/messages/request_all_matches_response.fbs
@@ -0,0 +1,19 @@
+namespace scouting.webserver.requests;
+
+table Match {
+ match_number:int (id: 0);
+ round:int (id: 1);
+ comp_level:string (id: 2);
+ r1:int (id: 3);
+ r2:int (id: 4);
+ r3:int (id: 5);
+ b1:int (id: 6);
+ b2:int (id: 7);
+ b3:int (id: 8);
+}
+
+table RequestMatchListResponse {
+ match_list:[Match] (id:0);
+}
+
+root_type RequestMatchListResponse;
\ No newline at end of file
diff --git a/scouting/webserver/requests/messages/request_data_scouting.fbs b/scouting/webserver/requests/messages/request_data_scouting.fbs
new file mode 100644
index 0000000..45f6308
--- /dev/null
+++ b/scouting/webserver/requests/messages/request_data_scouting.fbs
@@ -0,0 +1,7 @@
+namespace scouting.webserver.requests;
+
+table QueryDataScouting {
+ // TODO: Implement this.
+}
+
+root_type QueryDataScouting;
\ No newline at end of file
diff --git a/scouting/webserver/requests/messages/request_data_scouting_response.fbs b/scouting/webserver/requests/messages/request_data_scouting_response.fbs
new file mode 100644
index 0000000..83f5cd0
--- /dev/null
+++ b/scouting/webserver/requests/messages/request_data_scouting_response.fbs
@@ -0,0 +1,20 @@
+namespace scouting.webserver.requests;
+
+struct Stats {
+ team:int (id: 0);
+ match:int (id: 1);
+ missed_shots_auto:int (id: 2);
+ upper_goal_auto:int (id:3);
+ lower_goal_auto:int (id:4);
+ missed_shots_tele:int (id: 5);
+ upper_goal_tele:int (id:6);
+ lower_goal_tele:int (id:7);
+ defense_rating:int (id:8);
+ climbing:int (id:9);
+}
+
+table QueryDataScoutingResponse {
+ stats_list:[Stats] (id:0);
+}
+
+root_type QueryDataScoutingResponse;
\ No newline at end of file
diff --git a/scouting/webserver/requests/messages/request_matches_for_team.fbs b/scouting/webserver/requests/messages/request_matches_for_team.fbs
new file mode 100644
index 0000000..388533e
--- /dev/null
+++ b/scouting/webserver/requests/messages/request_matches_for_team.fbs
@@ -0,0 +1,7 @@
+namespace scouting.webserver.requests;
+
+table QueryMatchList {
+ team:int (id: 0);
+}
+
+root_type QueryMatchList;
\ No newline at end of file
diff --git a/scouting/webserver/requests/messages/request_matches_for_team_response.fbs b/scouting/webserver/requests/messages/request_matches_for_team_response.fbs
new file mode 100644
index 0000000..7345520
--- /dev/null
+++ b/scouting/webserver/requests/messages/request_matches_for_team_response.fbs
@@ -0,0 +1,20 @@
+namespace scouting.webserver.requests;
+
+table Match {
+ match_number:int (id: 0);
+ round:int (id: 1);
+ comp_level:string (id: 2);
+ r1:int (id: 3);
+ r2:int (id: 4);
+ r3:int (id: 5);
+ b1:int (id: 6);
+ b2:int (id: 7);
+ b3:int (id: 8);
+}
+//TODO(Sabina): de-duplicate the Match struct in request_all_matches
+
+table QueryMatchListResponse {
+ match_list:[Match] (id:0);
+}
+
+root_type QueryMatchListResponse;
\ No newline at end of file
diff --git a/scouting/webserver/requests/messages/submit_data_scouting.fbs b/scouting/webserver/requests/messages/submit_data_scouting.fbs
index 63bba7a..6213dd5 100644
--- a/scouting/webserver/requests/messages/submit_data_scouting.fbs
+++ b/scouting/webserver/requests/messages/submit_data_scouting.fbs
@@ -3,9 +3,14 @@
table SubmitDataScouting {
team:int (id: 0);
match:int (id: 1);
-
- upper_goal_hits:int (id: 2);
- // TODO: Implement the rest of this.
+ missed_shots_auto:int (id: 2);
+ upper_goal_auto:int (id:3);
+ lower_goal_auto:int (id:4);
+ missed_shots_tele:int (id: 5);
+ upper_goal_tele:int (id:6);
+ lower_goal_tele:int (id:7);
+ defense_rating:int (id:8);
+ climbing:int (id:9);
}
root_type SubmitDataScouting;
diff --git a/scouting/webserver/requests/requests_test.go b/scouting/webserver/requests/requests_test.go
index 4a19eaf..0125da5 100644
--- a/scouting/webserver/requests/requests_test.go
+++ b/scouting/webserver/requests/requests_test.go
@@ -69,9 +69,16 @@
builder := flatbuffers.NewBuilder(1024)
builder.Finish((&submit_data_scouting.SubmitDataScoutingT{
- Team: 971,
- Match: 1,
- UpperGoalHits: 9971,
+ Team: 971,
+ Match: 1,
+ MissedShotsAuto: 9971,
+ UpperGoalAuto: 9971,
+ LowerGoalAuto: 9971,
+ MissedShotsTele: 9971,
+ UpperGoalTele: 9971,
+ LowerGoalTele: 9971,
+ DefenseRating: 9971,
+ Climbing: 9971,
}).Pack(builder))
resp, err := http.Post("http://localhost:8080/requests/submit/data_scouting", "application/octet-stream", bytes.NewReader(builder.FinishedBytes()))