From 5386ecd4a5eefb5c533519b1f6b99f9859823de6 Mon Sep 17 00:00:00 2001 From: Duncan Brown Date: Thu, 4 Jun 2020 09:54:06 -0400 Subject: [PATCH 01/16] add calibration page --- data/about.htm | 3 ++ data/calibration.htm | 91 ++++++++++++++++++++++++++++++++++++++++++++ data/index.htm | 5 ++- data/restarting.htm | 5 ++- data/settings.htm | 5 ++- data/updating.htm | 5 ++- data/wifi_reset.htm | 5 ++- src/http_server.cpp | 9 ++++- 8 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 data/calibration.htm diff --git a/data/about.htm b/data/about.htm index 159ba6d..bf73113 100644 --- a/data/about.htm +++ b/data/about.htm @@ -38,6 +38,9 @@ + diff --git a/data/calibration.htm b/data/calibration.htm new file mode 100644 index 0000000..1ba75bd --- /dev/null +++ b/data/calibration.htm @@ -0,0 +1,91 @@ + + + + + + + TiltBridge - Settings + + + + + + + + + + + + + + +
+ +

Calibration

+ +
+ + + + + + + + + + + diff --git a/data/index.htm b/data/index.htm index 5b992b6..82cfc1f 100644 --- a/data/index.htm +++ b/data/index.htm @@ -40,6 +40,9 @@ + @@ -120,4 +123,4 @@
Google Sheets: {{sensor.gsheets_name}} - \ No newline at end of file + diff --git a/data/restarting.htm b/data/restarting.htm index c3e91c2..c29c775 100644 --- a/data/restarting.htm +++ b/data/restarting.htm @@ -42,6 +42,9 @@ + @@ -65,4 +68,4 @@

Restarting Tiltbridge

- \ No newline at end of file + diff --git a/data/settings.htm b/data/settings.htm index 5f47a3f..52fe2c8 100644 --- a/data/settings.htm +++ b/data/settings.htm @@ -38,6 +38,9 @@ + @@ -327,4 +330,4 @@
- \ No newline at end of file + diff --git a/data/updating.htm b/data/updating.htm index 9db45ed..0410463 100644 --- a/data/updating.htm +++ b/data/updating.htm @@ -40,6 +40,9 @@ + @@ -64,4 +67,4 @@

Updating Firmware

- \ No newline at end of file + diff --git a/data/wifi_reset.htm b/data/wifi_reset.htm index 2a90577..04325f0 100644 --- a/data/wifi_reset.htm +++ b/data/wifi_reset.htm @@ -40,6 +40,9 @@ + @@ -64,4 +67,4 @@

Resetting WiFi Settings

- \ No newline at end of file + diff --git a/src/http_server.cpp b/src/http_server.cpp index 3e16670..52625ad 100644 --- a/src/http_server.cpp +++ b/src/http_server.cpp @@ -201,6 +201,8 @@ void processConfig() { } +void processCalibration() { +} //This function is overkill for how we're handling things, but @@ -238,10 +240,12 @@ void root_from_spiffs() { void settings_from_spiffs() { loadFromSpiffs("/settings.htm"); } +void calibration_from_spiffs() { + loadFromSpiffs("/calibration.htm"); +} void about_from_spiffs() { loadFromSpiffs("/about.htm"); } - void favicon_from_spiffs() { loadFromSpiffs("/favicon.ico"); } @@ -298,6 +302,9 @@ void httpServer::init(){ server.on("/settings/", settings_from_spiffs); server.on("/settings/update/", processConfig); + server.on("/calibration/", calibration_from_spiffs); + server.on("/calibration/", processCalibration); + server.on("/json/", http_json); server.on("/settings/json/", settings_json); #ifndef DISABLE_OTA_UPDATES From e23bf96a026e0ba68d36e33fd5cd72d46eb7860d Mon Sep 17 00:00:00 2001 From: Duncan Brown Date: Thu, 4 Jun 2020 14:41:51 -0400 Subject: [PATCH 02/16] added calibration calculation --- data/calibration.htm | 798 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 792 insertions(+), 6 deletions(-) diff --git a/data/calibration.htm b/data/calibration.htm index 1ba75bd..0855e05 100644 --- a/data/calibration.htm +++ b/data/calibration.htm @@ -4,7 +4,7 @@ - TiltBridge - Settings + TiltBridge - Calibration @@ -19,10 +19,42 @@ padding: 0.75rem 1.25rem; } + .ledreddim { + background: #DE912F; + } + + .ledgreen { + background: #70FC57; + } + + .round-led-circle { + width: 16px; + height: 0; + padding-bottom: 16px; + border-radius: 50%; + border-style: outset; + overflow: hidden; + display: inline-block; + } + + span.round-led { + width: 15px; + height: 15px; + display: table-cell; + text-align: center; + vertical-align: middle; + font-weight: bold; + text-decoration: none; + } + + #graph { + width: 500px; + height: 300px; + } - +