From 75bf758042eb75f7c37a7f1e1197618c19354ac0 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sat, 19 Jun 2021 18:06:30 +0200 Subject: [PATCH] Incerased max segments. Removed v2 JSON API. Replaced col[] array handling. Settings UI optimisations. Increased DEBUG output period to 60s. --- wled00/FX.h | 4 +- wled00/const.h | 2 +- wled00/data/index.js | 25 +- wled00/data/settings_time.htm | 18 +- wled00/data/style.css | 5 +- wled00/fcn_declare.h | 2 +- wled00/html_other.h | 2 +- wled00/html_settings.h | 17 +- wled00/html_ui.h | 1423 ++++++++++++++++----------------- wled00/json.cpp | 51 +- wled00/wled.cpp | 2 +- wled00/wled.h | 2 +- 12 files changed, 774 insertions(+), 779 deletions(-) diff --git a/wled00/FX.h b/wled00/FX.h index 81d5ff152..2e7ccc91f 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -53,13 +53,13 @@ /* each segment uses 52 bytes of SRAM memory, so if you're application fails because of insufficient memory, decreasing MAX_NUM_SEGMENTS may help */ #ifdef ESP8266 - #define MAX_NUM_SEGMENTS 18 + #define MAX_NUM_SEGMENTS 24 /* How many color transitions can run at once */ #define MAX_NUM_TRANSITIONS 8 /* How much data bytes all segments combined may allocate */ #define MAX_SEGMENT_DATA 4096 #else - #define MAX_NUM_SEGMENTS 24 + #define MAX_NUM_SEGMENTS 32 #define MAX_NUM_TRANSITIONS 24 #define MAX_SEGMENT_DATA 20480 #endif diff --git a/wled00/const.h b/wled00/const.h index d44ad290e..6c07c9782 100644 --- a/wled00/const.h +++ b/wled00/const.h @@ -269,7 +269,7 @@ // Maximum size of node map (list of other WLED instances) #ifdef ESP8266 - #define WLED_MAX_NODES 15 + #define WLED_MAX_NODES 24 #else #define WLED_MAX_NODES 150 #endif diff --git a/wled00/data/index.js b/wled00/data/index.js index 47b130c3c..bae90ecc7 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -1032,8 +1032,6 @@ function cmpP(a, b) function handleJson(s) { if (!s) return false; - var e1 = gId('fxlist'); - var e2 = gId('selectPalette'); isOn = s.on; gId('sliderBri').value= s.bri; @@ -1069,6 +1067,7 @@ function handleJson(s) b = i.col[e][2]; if (isRgbw) w = i.col[e][3]; } else { + // unsigned long RGBW (@blazoncek v2 experimental API implementation) r = (i.col[e]>>16) & 0xFF; g = (i.col[e]>> 8) & 0xFF; b = (i.col[e] ) & 0xFF; @@ -1086,28 +1085,6 @@ function handleJson(s) selectedPal = i.pal; selectedFx = i.fx; -/*/--- AC addition ---// -// unfortunately this will trigger JSON request loop due to onchange event on input elements -// and it may not be necessary with websockes - - // Effects - var selFx = e1.querySelector(`input[name="fx"][value="${i.fx}"]`); - if (selFx) selFx.checked = true; - else location.reload(); //effect list is gone (e.g. if restoring tab). Reload. - - var selElement = e1.querySelector('.selected'); - if (selElement) selElement.classList.remove('selected'); - var selectedEffect = e1.querySelector(`.lstI[data-id="${i.fx}"]`); - if (selectedEffect) selectedEffect.classList.add('selected'); - - // Palettes - var selPa = e2.querySelector(`input[name="palette"][value="${i.pal}"]`); - if (selPa) selPa.checked = true; - selElement = e2.querySelector('.selected'); - if (selElement) selElement.classList.remove('selected'); - e2.querySelector(`.lstI[data-id="${i.pal}"]`).classList.add('selected'); -//--- AC addition ---/*/ - displayRover(lastinfo, s); clearErrorToast(); diff --git a/wled00/data/settings_time.htm b/wled00/data/settings_time.htm index a2891a6da..38c10f0da 100644 --- a/wled00/data/settings_time.htm +++ b/wled00/data/settings_time.htm @@ -46,13 +46,15 @@ var ih="ActiveHourMinutePresetMTWTFSS"; for (i=0;i<8;i++) { - ih+=""; + ih+=""; for (j=1;j<8;j++) ih+=""; + ih+=""; } - ih+="Sunrise"; + ih+="Sunrise"; for (j=1;j<8;j++) ih+=""; - ih+="Sunset"; + ih+="Sunset"; for (j=1;j<8;j++) ih+=""; + ih+=""; gId("TMT").innerHTML=ih; } function FC() @@ -84,11 +86,11 @@ td = tr.insertCell(0); td.innerHTML = `Button ${i}:`; td = tr.insertCell(1); - td.innerHTML = ``; + td.innerHTML = ``; td = tr.insertCell(2); - td.innerHTML = ``; + td.innerHTML = ``; td = tr.insertCell(3); - td.innerHTML = ``; + td.innerHTML = ``; } function GetV() { @@ -132,8 +134,8 @@
UTC offset: seconds (max. 18 hours)
Current local time is unknown.
- Latitude (N): - Longitude (E): + Latitude (N): + Longitude (E):

Clock

Clock Overlay: diff --git a/wled00/data/style.css b/wled00/data/style.css index 2a231f4f1..a607a4a87 100644 --- a/wled00/data/style.css +++ b/wled00/data/style.css @@ -45,7 +45,10 @@ input[type="number"] { margin: 2px; } input[type="number"].big { - width: 80px; + width: 70px; +} +input[type="number"].med { + width: 55px; } input[type="number"].small { width: 40px; diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index 90ebe65b9..44eb133d5 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -102,7 +102,7 @@ void handleIR(); void deserializeSegment(JsonObject elem, byte it, byte presetId = 0); bool deserializeState(JsonObject root, byte presetId = 0); -void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id, bool forPreset = false, bool segmentBounds = true, uint8_t versionAPI = 1); +void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id, bool forPreset = false, bool segmentBounds = true); void serializeState(JsonObject root, bool forPreset = false, bool includeBri = true, bool segmentBounds = true); void serializeInfo(JsonObject root); void serveJson(AsyncWebServerRequest* request, uint8_t versionAPI = 1); diff --git a/wled00/html_other.h b/wled00/html_other.h index f16b20477..4a825137f 100644 --- a/wled00/html_other.h +++ b/wled00/html_other.h @@ -42,7 +42,7 @@ function B(){window.history.back()}function U(){document.getElementById("uf").st .bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}#msg{display:none}

WLED Software Update

-Installed version: 0.12.2-bl3
Download the latest binary: Download the latest binary:

body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%%;margin:0}hr{border-color:#666}button{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;border-radius:24px;display:inline-block;font-size:20px;margin:12px 8px 8px;padding:8px 12px;min-width:48px;cursor:pointer}.toprow{top:0;position:sticky;background-color:#222;z-index:1}.helpB{text-align:left;position:absolute;width:60px}input{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.5ch solid #333}input[type=number]{width:4em;font-size:medium;margin:2px}input[type=number].big{width:80px}input[type=number].small{width:40px}select{margin:2px;font-size:medium}input[type=checkbox]{-ms-transform:scale(2);-moz-transform:scale(2);-webkit-transform:scale(2);-o-transform:scale(2);transform:scale(2);margin-right:10px}select{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.5ch solid #333}td{padding:2px}.d5{width:4.5em!important}#toast{opacity:0;background-color:#444;border-radius:5px;bottom:64px;color:#fff;font-size:17px;padding:16px;pointer-events:none;position:fixed;text-align:center;z-index:5;transform:translateX(-50%%);max-width:90%%;left:50%%}#toast.show{opacity:1;background-color:#264;animation:fadein .5s,fadein .5s 2.5s reverse}#toast.error{opacity:1;background-color:#b21;animation:fadein .5s})====="; +const char PAGE_settingsCss[] PROGMEM = R"=====()====="; // Autogenerated from wled00/data/settings.htm, do not edit!! @@ -311,7 +311,7 @@ type="submit">Save
)====="; // Autogenerated from wled00/data/settings_time.htm, do not edit!! const char PAGE_settings_time[] PROGMEM = R"=====( Time Settings