Add PLC integration for field sensors, motors, and lights.

This commit is contained in:
Patrick Fairbank
2017-09-03 20:51:20 -07:00
parent fa70323b85
commit d5ec68b77e
23 changed files with 713 additions and 59 deletions

View File

@@ -415,7 +415,7 @@ func (web *Web) matchPlayWebsocketHandler(w http.ResponseWriter, r *http.Request
}
// Send out the status again after handling the command, as it most likely changed as a result.
err = websocket.Write("status", web.arena)
err = websocket.Write("status", web.arena.GetStatus())
if err != nil {
log.Printf("Websocket error: %s", err)
return
@@ -541,7 +541,7 @@ func (web *Web) commitMatchScore(match *model.Match, matchResult *model.MatchRes
func (web *Web) getCurrentMatchResult() *model.MatchResult {
return &model.MatchResult{MatchId: web.arena.CurrentMatch.Id, MatchType: web.arena.CurrentMatch.Type,
RedScore: web.arena.RedRealtimeScore.CurrentScore, BlueScore: web.arena.BlueRealtimeScore.CurrentScore,
RedScore: &web.arena.RedRealtimeScore.CurrentScore, BlueScore: &web.arena.BlueRealtimeScore.CurrentScore,
RedCards: web.arena.RedRealtimeScore.Cards, BlueCards: web.arena.BlueRealtimeScore.Cards}
}