mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Add ethernet connected, trip time, missed packets, and tooltips to the field monitor (closes #63).
This commit is contained in:
@@ -5,9 +5,6 @@
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
cursor: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
body {
|
||||
@@ -74,7 +71,7 @@ body {
|
||||
width: 100%;
|
||||
}
|
||||
.team-box {
|
||||
width: 25%;
|
||||
width: 20%;
|
||||
height: 100%;
|
||||
font-size: 2.5vw;
|
||||
background-color: #333;
|
||||
|
||||
@@ -19,6 +19,7 @@ var handleArenaStatus = function(data) {
|
||||
teamElementPrefix = "#" + blueSide + "Team" + station[1];
|
||||
}
|
||||
var teamIdElement = $(teamElementPrefix + "Id");
|
||||
var teamEthernetElement = $(teamElementPrefix + "Ethernet");
|
||||
var teamDsElement = $(teamElementPrefix + "Ds");
|
||||
var teamRadioElement = $(teamElementPrefix + "Radio");
|
||||
var teamRadioTextElement = $(teamElementPrefix + "Radio span");
|
||||
@@ -47,6 +48,14 @@ var handleArenaStatus = function(data) {
|
||||
teamIdElement.attr("data-status", "");
|
||||
}
|
||||
|
||||
// Format the Ethernet status box.
|
||||
teamEthernetElement.attr("data-status-ok", stationStatus.Ethernet ? "true" : "");
|
||||
if (stationStatus.DsConn && stationStatus.DsConn.DsRobotTripTimeMs > 0) {
|
||||
teamEthernetElement.text(stationStatus.DsConn.DsRobotTripTimeMs);
|
||||
} else {
|
||||
teamEthernetElement.text("ETH");
|
||||
}
|
||||
|
||||
var wifiStatus = data.TeamWifiStatuses[station];
|
||||
teamRadioTextElement.text(wifiStatus.TeamId);
|
||||
|
||||
@@ -54,6 +63,7 @@ var handleArenaStatus = function(data) {
|
||||
// Format the driver station status box.
|
||||
var dsConn = stationStatus.DsConn;
|
||||
teamDsElement.attr("data-status-ok", dsConn.DsLinked);
|
||||
teamDsElement.text(dsConn.MissedPacketCount);
|
||||
|
||||
// Format the radio status box according to the connection status of the robot radio.
|
||||
var radioOkay = stationStatus.Team && stationStatus.Team.Id === wifiStatus.TeamId && wifiStatus.RadioLinked;
|
||||
@@ -69,6 +79,7 @@ var handleArenaStatus = function(data) {
|
||||
}
|
||||
} else {
|
||||
teamDsElement.attr("data-status-ok", "");
|
||||
teamDsElement.text("DS");
|
||||
teamRobotElement.attr("data-status-ok", "");
|
||||
teamRobotElement.text("RBT");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user