mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Decode ArmorBlock status register from PLC and surface individual statuses on Match Play page.
This commit is contained in:
@@ -662,6 +662,11 @@ func (arena *Arena) checkCanStartMatch() error {
|
||||
if arena.Plc.GetFieldEstop() {
|
||||
return fmt.Errorf("Cannot start match while field emergency stop is active.")
|
||||
}
|
||||
for name, status := range arena.Plc.GetArmorBlockStatuses() {
|
||||
if !status {
|
||||
return fmt.Errorf("Cannot start match while PLC ArmorBlock '%s' is not connected.", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -89,11 +89,13 @@ func (arena *Arena) generateArenaStatusMessage() interface{} {
|
||||
AllianceStations map[string]*AllianceStation
|
||||
TeamWifiStatuses map[string]network.TeamWifiStatus
|
||||
MatchState
|
||||
CanStartMatch bool
|
||||
PlcIsHealthy bool
|
||||
FieldEstop bool
|
||||
CanStartMatch bool
|
||||
PlcIsHealthy bool
|
||||
FieldEstop bool
|
||||
PlcArmorBlockStatuses map[string]bool
|
||||
}{arena.CurrentMatch.Id, arena.AllianceStations, teamWifiStatuses, arena.MatchState,
|
||||
arena.checkCanStartMatch() == nil, arena.Plc.IsHealthy, arena.Plc.GetFieldEstop()}
|
||||
arena.checkCanStartMatch() == nil, arena.Plc.IsHealthy, arena.Plc.GetFieldEstop(),
|
||||
arena.Plc.GetArmorBlockStatuses()}
|
||||
}
|
||||
|
||||
func (arena *Arena) generateAudienceDisplayModeMessage() interface{} {
|
||||
|
||||
Reference in New Issue
Block a user