Add PLC integration for field sensors, motors, and lights.

This commit is contained in:
Patrick Fairbank
2017-09-03 20:51:20 -07:00
parent fa70323b85
commit d5ec68b77e
23 changed files with 713 additions and 59 deletions

View File

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

View File

@@ -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) {

View File

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