Make the scouting webserver accept prescouting data
This patch makes it so that the webserver parses the pre-scouting bit
when actions are submitted. The web page doesn't currently support
this, but will in a future patch.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I8c324c1dfed37ca1ad391667ebb00d8a711f7846
diff --git a/scouting/webserver/requests/requests_test.go b/scouting/webserver/requests/requests_test.go
index c2bc750..5561829 100644
--- a/scouting/webserver/requests/requests_test.go
+++ b/scouting/webserver/requests/requests_test.go
@@ -408,6 +408,7 @@
Timestamp: 4200,
},
},
+ PreScouting: false,
}).Pack(builder))
submitActions := submit_actions.GetRootAsSubmitActions(builder.FinishedBytes(), 0)
@@ -418,7 +419,8 @@
}
expected := db.Stats2023{
- TeamNumber: "4244", MatchNumber: 3, SetNumber: 1,
+ PreScouting: false,
+ TeamNumber: "4244", MatchNumber: 3, SetNumber: 1,
CompLevel: "quals", StartingQuadrant: 1, LowCubesAuto: 1,
MiddleCubesAuto: 0, HighCubesAuto: 0, CubesDroppedAuto: 1,
LowConesAuto: 0, MiddleConesAuto: 0, HighConesAuto: 0,
@@ -824,6 +826,7 @@
Timestamp: 1009,
},
},
+ PreScouting: true,
}).Pack(builder))
_, err := debug.SubmitActions("http://localhost:8080", builder.FinishedBytes())
@@ -860,6 +863,7 @@
expectedActions := []db.Action{
{
+ PreScouting: true,
TeamNumber: "1234",
MatchNumber: 4,
SetNumber: 1,
@@ -869,6 +873,7 @@
Timestamp: 2400,
},
{
+ PreScouting: true,
TeamNumber: "1234",
MatchNumber: 4,
SetNumber: 1,