diff --git a/wled00/data/liveviewws2D.htm b/wled00/data/liveviewws2D.htm index 3b8ac72f..92a4754b 100644 --- a/wled00/data/liveviewws2D.htm +++ b/wled00/data/liveviewws2D.htm @@ -46,9 +46,10 @@ if (leds[0] != 76 || leds[1] != 2 || !ctx) return; //'L', set in ws.cpp let mW = leds[2]; // matrix width let mH = leds[3]; // matrix height - let pPL = Math.min(c.width / mW, c.height / mH); // pixels per LED (width of circle) + let pPL = Math.min(c.width / mW, (c.height-10) / mH); // pixels per LED (width of circle) WLEDSR -10 for prompts let lOf = Math.floor((c.width - pPL*mW)/2); //left offeset (to center matrix) - var i = 4; + var i = 6; + ctx.clearRect(0, 0, c.width, c.height); //WLEDSR for (y=0.5;y= strip.getMaxSegments()) return; + //WLEDSR: add compatibility for SR presets + // Serial.printf("before %d: %s %s %s %s\n", id, elem["start"].as().c_str(), elem["stop"].as().c_str(), elem["startY"].as().c_str(), elem["stopY"].as().c_str()); + if (strip.isMatrix && !elem["start"].isNull() && !elem["stop"].isNull() && elem["startY"].isNull() && elem["stopY"].isNull()) { + uint16_t start1=elem["start"], stop1=elem["stop"]; + elem["start"] = start1%strip.matrixWidth; + elem["startY"]= strip.matrixWidth?(start1 / strip.matrixWidth):0; + elem["stop"] = (stop1-1)%strip.matrixWidth + 1; + elem["stopY"]= strip.matrixWidth?((stop1-1) / strip.matrixWidth) + 1:0; + // Serial.printf("after %s %s %s %s\n", elem["start"].as().c_str(), elem["stop"].as().c_str(), elem["startY"].as().c_str(), elem["stopY"].as().c_str()); + } + if (!elem["c1x"].isNull()) elem["c1"] = elem["c1x"]; + if (!elem["c2x"].isNull()) elem["c2"] = elem["c2x"]; + if (!elem["c3x"].isNull()) elem["c3"] = elem["c3x"]; + if (!elem["rev2D"].isNull()) elem["rY"] = elem["rev2D"]; + if (!elem["rot2D"].isNull()) elem["tp"] = elem["rot2D"]; + int stop = elem["stop"] | -1; // if using vectors use this code to append segment diff --git a/wled00/wled.h b/wled00/wled.h index 0add4047..23d80512 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2210191 +#define VERSION 2210201 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG diff --git a/wled00/ws.cpp b/wled00/ws.cpp index 8c1a9d3d..1e72b7db 100644 --- a/wled00/ws.cpp +++ b/wled00/ws.cpp @@ -151,7 +151,7 @@ bool sendLiveLedsWs(uint32_t wsClient) uint16_t used = strip.getLengthTotal(); const uint16_t MAX_LIVE_LEDS_WS = strip.isMatrix ? 1024 : 256; uint16_t n = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS - uint16_t pos = (strip.isMatrix ? 4 : 2); + uint16_t pos = (strip.isMatrix ? 6 : 2); //WLEDSR 6 instead of 4 uint16_t bufSize = pos + (used/n)*3; AsyncWebSocketMessageBuffer * wsBuf = ws.makeBuffer(bufSize); if (!wsBuf) return false; //out of memory @@ -163,6 +163,8 @@ bool sendLiveLedsWs(uint32_t wsClient) buffer[1] = 2; //version buffer[2] = strip.matrixWidth; buffer[3] = strip.matrixHeight; + buffer[4] = currentPreset; //WLEDSR + buffer[5] = currentPlaylist; //WLEDSR } #endif