diff --git a/static/js/scoring_display.js b/static/js/scoring_display.js index cdd68fa..f386855 100644 --- a/static/js/scoring_display.js +++ b/static/js/scoring_display.js @@ -10,7 +10,8 @@ var scoreCommitted = false; var handleScore = function(data) { // Update autonomous period values. var score = data.Score.CurrentScore; - $("#autoMobility").text(score.AutoMobility); + $("#autoRuns").text(score.AutoRuns); + $("#climbs").text(score.Climbs); // Update component visibility. if (!data.AutoCommitted) { @@ -36,11 +37,17 @@ var handleScore = function(data) { var handleKeyPress = function(event) { var key = String.fromCharCode(event.keyCode); switch (key) { - case "m": - websocket.send("mobility"); + case "r": + websocket.send("autoRun"); break; - case "M": - websocket.send("undoMobility"); + case "R": + websocket.send("undoAutoRun"); + break; + case "c": + websocket.send("climb"); + break; + case "C": + websocket.send("undoClimb"); break; case "\r": websocket.send("commit"); diff --git a/templates/scoring_display.html b/templates/scoring_display.html index a97f46a..1a9955e 100644 --- a/templates/scoring_display.html +++ b/templates/scoring_display.html @@ -16,8 +16,8 @@

Autonomous Period

Use the following keyboard shortcuts:

-
m/M
-
Robot mobility +/-
+
r/R
+
Auto runs +/-
Enter
@@ -29,8 +29,8 @@

Autonomous Score

-
Robot mobility
-
+
Auto runs
+

Press Enter to commit autonomous score

@@ -41,6 +41,10 @@

Teleoperated Period

Use the following keyboard shortcuts:

+
+
c/C
+
Climbs +/- (ignore Levitate)
+
a
Back to autonomous
@@ -50,6 +54,10 @@

Teleoperated Score

+
+
Climbs
+
+
diff --git a/web/scoring_display.go b/web/scoring_display.go index bc59a0c..d55038d 100644 --- a/web/scoring_display.go +++ b/web/scoring_display.go @@ -145,18 +145,30 @@ func (web *Web) scoringDisplayWebsocketHandler(w http.ResponseWriter, r *http.Re } switch messageType { - case "mobility": + case "autoRun": if !autoCommitted { if (*score).CurrentScore.AutoRuns < 3 { (*score).CurrentScore.AutoRuns++ } } - case "undoMobility": + case "undoAutoRun": if !autoCommitted { if (*score).CurrentScore.AutoRuns > 0 { (*score).CurrentScore.AutoRuns-- } } + case "climb": + if autoCommitted { + if (*score).CurrentScore.Climbs < 3 { + (*score).CurrentScore.Climbs++ + } + } + case "undoClimb": + if autoCommitted { + if (*score).CurrentScore.Climbs > 0 { + (*score).CurrentScore.Climbs-- + } + } case "commit": if web.arena.MatchState != field.PreMatch || web.arena.CurrentMatch.Type == "test" { autoCommitted = true