mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Add PLC integration for field sensors, motors, and lights.
This commit is contained in:
@@ -54,11 +54,11 @@ var handleMatchTime = function(data) {
|
||||
var handleRealtimeScore = function(data) {
|
||||
$("#redScoreNumber").text(data.RedScoreSummary.Score);
|
||||
$("#redPressurePoints").text(data.RedScoreSummary.PressurePoints);
|
||||
$("#redRotors").text(data.RedScoreSummary.Rotors);
|
||||
$("#redRotors").text(data.RedScore.AutoRotors + data.RedScore.Rotors);
|
||||
$("#redTakeoffs").text(data.RedScore.Takeoffs);
|
||||
$("#blueScoreNumber").text(data.BlueScoreSummary.Score);
|
||||
$("#bluePressurePoints").text(data.BlueScoreSummary.PressurePoints);
|
||||
$("#blueRotors").text(data.BlueScoreSummary.Rotors);
|
||||
$("#blueRotors").text(data.BlueScore.AutoRotors + data.BlueScore.Rotors);
|
||||
$("#blueTakeoffs").text(data.BlueScore.Takeoffs);
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ var handleStatus = function(data) {
|
||||
$("#status" + station + " .packet-loss").text("");
|
||||
}
|
||||
|
||||
if (stationStatus.EmergencyStop) {
|
||||
if (stationStatus.Estop) {
|
||||
$("#status" + station + " .bypass-status-fta").attr("data-status-ok", false);
|
||||
$("#status" + station + " .bypass-status-fta").text("ES");
|
||||
} else if (stationStatus.Bypass) {
|
||||
|
||||
@@ -87,7 +87,7 @@ var handleStatus = function(data) {
|
||||
$("#status" + station + " .battery-status").text("");
|
||||
}
|
||||
|
||||
if (stationStatus.EmergencyStop) {
|
||||
if (stationStatus.Estop) {
|
||||
$("#status" + station + " .bypass-status").attr("data-status-ok", false);
|
||||
$("#status" + station + " .bypass-status").text("ES");
|
||||
} else if (stationStatus.Bypass) {
|
||||
@@ -127,6 +127,15 @@ var handleStatus = function(data) {
|
||||
$("#editResults").prop("disabled", false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (data.PlcIsHealthy) {
|
||||
$("#plcStatus").text("Connected");
|
||||
$("#plcStatus").attr("data-ready", true);
|
||||
} else {
|
||||
$("#plcStatus").text("Not Connected");
|
||||
$("#plcStatus").attr("data-ready", false);
|
||||
}
|
||||
$("#fieldEstop").attr("data-ready", !data.FieldEstop)
|
||||
};
|
||||
|
||||
// Handles a websocket message to update the match time countdown.
|
||||
|
||||
Reference in New Issue
Block a user