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

@@ -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;

View File

@@ -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");