Decode ArmorBlock status register from PLC and surface individual statuses on Match Play page.

This commit is contained in:
Patrick Fairbank
2020-04-04 23:53:25 -07:00
parent 3739cd8690
commit 4e74a7a4cd
8 changed files with 102 additions and 11 deletions

View File

@@ -72,14 +72,15 @@ func (web *Web) matchPlayHandler(w http.ResponseWriter, r *http.Request) {
isReplay := matchResult != nil
data := struct {
*model.EventSettings
PlcIsEnabled bool
MatchesByType map[string]MatchPlayList
CurrentMatchType string
Match *model.Match
AllowSubstitution bool
IsReplay bool
PlcIsEnabled bool
MatchesByType map[string]MatchPlayList
CurrentMatchType string
Match *model.Match
AllowSubstitution bool
IsReplay bool
PlcArmorBlockStatuses map[string]bool
}{web.arena.EventSettings, web.arena.Plc.IsEnabled(), matchesByType, currentMatchType, web.arena.CurrentMatch,
web.arena.CurrentMatch.ShouldAllowSubstitution(), isReplay}
web.arena.CurrentMatch.ShouldAllowSubstitution(), isReplay, web.arena.Plc.GetArmorBlockStatuses()}
err = template.ExecuteTemplate(w, "base", data)
if err != nil {
handleWebErr(w, err)