Add ethernet connected, trip time, missed packets, and tooltips to the field monitor (closes #63).

This commit is contained in:
Patrick Fairbank
2020-03-31 20:04:42 -07:00
parent a5a7821b3f
commit 30b0679b6e
5 changed files with 47 additions and 13 deletions

View File

@@ -82,11 +82,12 @@ type Arena struct {
}
type AllianceStation struct {
DsConn *DriverStationConnection
Astop bool
Estop bool
Bypass bool
Team *model.Team
DsConn *DriverStationConnection
Ethernet bool
Astop bool
Estop bool
Bypass bool
Team *model.Team
}
// Creates the arena and sets it to its initial state.
@@ -747,6 +748,13 @@ func (arena *Arena) handlePlcInput() {
arena.handleEstop("B1", blueEstops[0])
arena.handleEstop("B2", blueEstops[1])
arena.handleEstop("B3", blueEstops[2])
redEthernets, blueEthernets := arena.Plc.GetEthernetConnected()
arena.AllianceStations["R1"].Ethernet = redEthernets[0]
arena.AllianceStations["R2"].Ethernet = redEthernets[1]
arena.AllianceStations["R3"].Ethernet = redEthernets[2]
arena.AllianceStations["B1"].Ethernet = blueEthernets[0]
arena.AllianceStations["B2"].Ethernet = blueEthernets[1]
arena.AllianceStations["B3"].Ethernet = blueEthernets[2]
if arena.MatchState == PreMatch || arena.MatchState == PostMatch || arena.MatchState == TimeoutActive ||
arena.MatchState == PostTimeout {