From de6f59548aeccfdbe1e602be315b56408e58a470 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 28 Dec 2018 22:48:07 -0600 Subject: [PATCH] Persist vision log enabled setting on client side (#13) --- .../rpiConfigServer_src/resources/frcvision.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/deps/tools/rpiConfigServer_src/resources/frcvision.js b/deps/tools/rpiConfigServer_src/resources/frcvision.js index 74b4ae2..7d63e6a 100644 --- a/deps/tools/rpiConfigServer_src/resources/frcvision.js +++ b/deps/tools/rpiConfigServer_src/resources/frcvision.js @@ -115,6 +115,14 @@ $('#systemWritable').click(function() { var visionSettingsServer = {}; var visionSettingsDisplay = {'cameras': []}; +function pushVisionLogEnabled() { + var msg = { + type: 'visionLogEnabled', + value: visionLogEnabled.prop('checked') + }; + connection.send(JSON.stringify(msg)); +} + // WebSocket automatic reconnection timer var reconnectTimerId = 0; @@ -132,6 +140,7 @@ function connect() { reconnectTimerId = 0; } displayConnected(); + pushVisionLogEnabled(); }; connection.onclose = function(evt) { displayDisconnected(); @@ -236,11 +245,7 @@ $('#visionKill').click(function() { }); $('#visionLogEnabled').change(function() { - var msg = { - type: 'visionLogEnabled', - value: this.checked - }; - connection.send(JSON.stringify(msg)); + pushVisionLogEnabled(); }); //