diff --git a/field/driver_station_connection.go b/field/driver_station_connection.go index dbe67d6..4184d6d 100644 --- a/field/driver_station_connection.go +++ b/field/driver_station_connection.go @@ -34,6 +34,7 @@ type DriverStationConnection struct { Enabled bool Estop bool DsLinked bool + RadioLinked bool RobotLinked bool BatteryVoltage float64 DsRobotTripTimeMs int @@ -95,6 +96,7 @@ func (arena *Arena) listenForDsUdpPackets() { dsConn.DsLinked = true dsConn.lastPacketTime = time.Now() + dsConn.RadioLinked = data[3]&0x10 != 0 dsConn.RobotLinked = data[3]&0x20 != 0 if dsConn.RobotLinked { dsConn.lastRobotLinkedTime = time.Now() @@ -115,6 +117,7 @@ func (dsConn *DriverStationConnection) update(arena *Arena) error { if time.Since(dsConn.lastPacketTime).Seconds() > driverStationUdpLinkTimeoutSec { dsConn.DsLinked = false + dsConn.RadioLinked = false dsConn.RobotLinked = false dsConn.BatteryVoltage = 0 dsConn.MBpsToRobot = 0 diff --git a/field/team_match_log.go b/field/team_match_log.go index 4002ac2..348939c 100644 --- a/field/team_match_log.go +++ b/field/team_match_log.go @@ -45,7 +45,7 @@ func NewTeamMatchLog(teamId int, match *model.Match) (*TeamMatchLog, error) { // Adds a line to the log when a packet is received. func (log *TeamMatchLog) LogDsPacket(matchTimeSec float64, packetType int, dsConn *DriverStationConnection) { log.logger.Printf("%f,%d,%d,%s,%v,%v,%v,%v,%f,%d,%d", matchTimeSec, packetType, dsConn.TeamId, - dsConn.AllianceStation, dsConn.RobotLinked, dsConn.Auto, dsConn.Enabled, dsConn.Estop, + dsConn.AllianceStation, dsConn.RadioLinked, dsConn.RobotLinked, dsConn.Auto, dsConn.Enabled, dsConn.Estop, dsConn.BatteryVoltage, dsConn.MissedPacketCount, dsConn.DsRobotTripTimeMs) } diff --git a/static/css/cheesy-arena.css b/static/css/cheesy-arena.css index 55f0d03..e5f6dbf 100644 --- a/static/css/cheesy-arena.css +++ b/static/css/cheesy-arena.css @@ -46,7 +46,7 @@ .modal-large { width: 60%; } -.ds-status, .robot-status, .battery-status, .bypass-status, .bypass-status-fta, .trip-time, .packet-loss { +.ds-status, .radio-status, .robot-status, .battery-status, .bypass-status, .bypass-status-fta, .trip-time, .packet-loss { background-color: #aaa; color: #000; border: 1px solid #999; diff --git a/static/js/fta_display.js b/static/js/fta_display.js index c1b7cba..7c2a42d 100644 --- a/static/js/fta_display.js +++ b/static/js/fta_display.js @@ -20,6 +20,7 @@ var handleStatus = function(data) { var dsConn = stationStatus.DsConn; $("#status" + station + " .ds-status").attr("data-status-ok", dsConn.DsLinked); $("#status" + station + " .ds-status").text(dsConn.MBpsToRobot.toFixed(1) + "/" + dsConn.MBpsFromRobot.toFixed(1)); + $("#status" + station + " .radio-status").attr("data-status-ok", dsConn.RadioLinked); $("#status" + station + " .robot-status").attr("data-status-ok", dsConn.RobotLinked); if (stationStatus.DsConn.SecondsSinceLastRobotLink > 1 && stationStatus.DsConn.SecondsSinceLastRobotLink < 1000) { $("#status" + station + " .robot-status").text(stationStatus.DsConn.SecondsSinceLastRobotLink.toFixed()); @@ -40,6 +41,8 @@ var handleStatus = function(data) { } else { $("#status" + station + " .ds-status").attr("data-status-ok", ""); $("#status" + station + " .ds-status").text(""); + $("#status" + station + " .radio-status").attr("data-status-ok", ""); + $("#status" + station + " .radio-status").text(""); $("#status" + station + " .robot-status").attr("data-status-ok", ""); $("#status" + station + " .robot-status").text(""); $("#status" + station + " .battery-status").attr("data-status-ok", ""); diff --git a/templates/fta_display.html b/templates/fta_display.html index cf2dd09..689a35b 100644 --- a/templates/fta_display.html +++ b/templates/fta_display.html @@ -9,11 +9,27 @@