diff --git a/simgui.json b/simgui.json index ada88462..92d25d94 100644 --- a/simgui.json +++ b/simgui.json @@ -37,13 +37,14 @@ "Auto Chooser": { "open": true }, - "open": true + "Column": { + "open": true + } }, "Main Driver": { "Next Position": { "open": true - }, - "open": true + } }, "open": true }, diff --git a/src/main/deploy/nodeselector/auto.html b/src/main/deploy/nodeselector/auto.html index 81f6de8a..4cc48801 100644 --- a/src/main/deploy/nodeselector/auto.html +++ b/src/main/deploy/nodeselector/auto.html @@ -18,30 +18,33 @@
diff --git a/src/main/deploy/nodeselector/css/style.css b/src/main/deploy/nodeselector/css/style.css index 23e55054..1fed0626 100644 --- a/src/main/deploy/nodeselector/css/style.css +++ b/src/main/deploy/nodeselector/css/style.css @@ -135,4 +135,12 @@ div#confirm-node>div { display: inline-block; */ font-size: 10vh; text-align: center; +} + +.aprilgood { + background-color: #00ff08; +} + +.aprilbad { + background-color: red; } \ No newline at end of file diff --git a/src/main/deploy/nodeselector/js/index.js b/src/main/deploy/nodeselector/js/index.js index a71a5b6a..de15eb1d 100644 --- a/src/main/deploy/nodeselector/js/index.js +++ b/src/main/deploy/nodeselector/js/index.js @@ -23,6 +23,7 @@ const ColumnActive = "/Shuffleboard/Auto/Column/active"; const ColumnSelected = "/Shuffleboard/Auto/Column/selected"; const fieldPos = "/Shuffleboard/Auto/Field Pos/Robot"; const enableDock = "/Shuffleboard/Auto/Enable Dock"; +const aprilTagStatus = "/Shuffleboard/Auto/Currently Seeing April Tag"; let active = null; @@ -153,18 +154,23 @@ let client = new NT4_Client( $("#columnChooser").append(new Option(value[i], value[i])); } } else if (topic.name == ColumnActive) { - // console.log("Auto Chooser Active - " + value); $("#columnChooser").val(value); } else if (topic.name == LevelOptions) { - // console.log("Auto Chooser Options - " + value); // let values = value.split(","); $("#levelChooser").children("option").remove(); for (let i = 0; i < value.length; i++) { $("#levelChooser").append(new Option(value[i], value[i])); } } else if (topic.name == LevelActive) { - // console.log("Auto Chooser Active - " + value); $("#levelChooser").val(value); + } else if (topic.name == aprilTagStatus) { + let element = $("#aprilTagStatus"); + element.removeClass("aprilgood aprilbad"); + if (value) { + element.addClass("aprilgood"); + } else { + element.addClass("aprilbad"); + } } }, () => { @@ -213,6 +219,7 @@ window.addEventListener("load", () => { ColumnActive, ColumnOptions, ColumnSelected, + aprilTagStatus, ], false, false, @@ -268,7 +275,8 @@ window.addEventListener("load", () => { client.addSample(LevelSelected, value); }) $("#enableDock").change(function () { - let value = $("#enableDock").prop('checked'); + // let value = $("#enableDock").prop('checked'); + let value = $("#enableDock").val() === "true"; client.addSample(enableDock, value); }) // each((cell, index) => { diff --git a/src/main/deploy/nodeselector/nav.html b/src/main/deploy/nodeselector/nav.html index ccfd5ced..f3e3a839 100644 --- a/src/main/deploy/nodeselector/nav.html +++ b/src/main/deploy/nodeselector/nav.html @@ -8,7 +8,7 @@
\ No newline at end of file diff --git a/src/main/deploy/nodeselector/react.html b/src/main/deploy/nodeselector/react.html new file mode 100644 index 00000000..1c8dc94c --- /dev/null +++ b/src/main/deploy/nodeselector/react.html @@ -0,0 +1,47 @@ + + +
+ +
+ + + + + + + + + + + +
+ +