Merge remote-tracking branch 'upstream/main' into mdev

Some additions:

pio.ini: add debug entries
cfg.cpp, set.cpp, xml/cpp: keep storing basic 2D setup

index.js: use ledmapFileNames

settings_2D.htm: keep using basic and advanced

FX_2Dfcn.cpp: use gaptable and also MM ledmaps

FX_fcn.cpp: extend enumerateledmaps with AC ledmapNames (but not used in UI)
This commit is contained in:
Ewoud
2023-02-22 16:09:27 +01:00
62 changed files with 2521 additions and 8104 deletions

View File

@@ -211,6 +211,14 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
if (t <= 250) bootPreset = t;
gammaCorrectBri = request->hasArg(F("GB"));
gammaCorrectCol = request->hasArg(F("GC"));
gammaCorrectVal = request->arg(F("GV")).toFloat();
if (gammaCorrectVal > 1.0f && gammaCorrectVal <= 3)
calcGammaTable(gammaCorrectVal);
else {
gammaCorrectVal = 1.0f; // no gamma correction
gammaCorrectBri = false;
gammaCorrectCol = false;
}
fadeTransition = request->hasArg(F("TF"));
t = request->arg(F("TD")).toInt();
@@ -243,6 +251,10 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
}
simplifiedUI = request->hasArg(F("SU"));
#endif
DEBUG_PRINTLN(F("Enumerating ledmaps"));
strip.enumerateLedmaps();
DEBUG_PRINTLN(F("Loading custom palettes"));
strip.loadCustomPalettes(); // (re)load all custom palettes
}
//SYNC
@@ -289,6 +301,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
if (t >= 0 && t <= 510) DMXAddress = t;
t = request->arg(F("XX")).toInt();
if (t >= 0 && t <= 150) DMXSegmentSpacing = t;
t = request->arg(F("PY")).toInt();
if (t >= 0 && t <= 200) e131Priority = t;
t = request->arg(F("DM")).toInt();
if (t >= DMX_MODE_DISABLED && t <= DMX_MODE_PRESET) DMXMode = t;
t = request->arg(F("ET")).toInt();
@@ -303,16 +317,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
t = request->arg(F("AP")).toInt();
if (t >= 0 && t <= 9) alexaNumPresets = t;
#ifndef WLED_DISABLE_BLYNK
strlcpy(blynkHost, request->arg("BH").c_str(), 33);
t = request->arg(F("BP")).toInt();
if (t > 0) blynkPort = t;
if (request->hasArg("BK") && !request->arg("BK").equals(F("Hidden"))) {
strlcpy(blynkApiKey, request->arg("BK").c_str(), 36); initBlynk(blynkApiKey, blynkHost, blynkPort);
}
#endif
#ifdef WLED_ENABLE_MQTT
mqttEnabled = request->hasArg(F("MQ"));
strlcpy(mqttServer, request->arg(F("MS")).c_str(), 33);
@@ -412,15 +416,15 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
k[0] = 'W'; //weekdays
timerWeekday[i] = request->arg(k).toInt();
if (i<8) {
k[0] = 'M'; //start month
timerMonth[i] = request->arg(k).toInt() & 0x0F;
timerMonth[i] <<= 4;
k[0] = 'P'; //end month
timerMonth[i] += (request->arg(k).toInt() & 0x0F);
k[0] = 'D'; //start day
timerDay[i] = request->arg(k).toInt();
k[0] = 'E'; //end day
timerDayEnd[i] = request->arg(k).toInt();
k[0] = 'M'; //start month
timerMonth[i] = request->arg(k).toInt() & 0x0F;
timerMonth[i] <<= 4;
k[0] = 'P'; //end month
timerMonth[i] += (request->arg(k).toInt() & 0x0F);
k[0] = 'D'; //start day
timerDay[i] = request->arg(k).toInt();
k[0] = 'E'; //end day
timerDayEnd[i] = request->arg(k).toInt();
}
}
}
@@ -674,22 +678,23 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
if (subPage == 10)
{
strip.isMatrix = request->arg(F("SOMP")).toInt();
// strip.panelH = MAX(1,MIN(128,request->arg(F("PH")).toInt()));
// strip.panelW = MAX(1,MIN(128,request->arg(F("PW")).toInt()));
strip.panel.clear(); // release memory if allocated
if (strip.isMatrix) {
strip.panels = MAX(1,MIN(WLED_MAX_PANELS,request->arg(F("MPC")).toInt()));
//WLEDMM: keep storing basic 2d setup
strip.bOrA = request->arg(F("BA")).toInt(); //WLEDMM basic or advanced
strip.panelsH = request->arg(F("MPH")).toInt(); //WLEDMM needs to be stored as well
strip.panelsV = request->arg(F("MPV")).toInt(); //WLEDMM needs to be stored as well
strip.panelsH = request->arg(F("MPH")).toInt();
strip.panelsV = request->arg(F("MPV")).toInt();
strip.matrix.bottomStart = request->arg(F("PB")).toInt();
strip.matrix.rightStart = request->arg(F("PR")).toInt();
strip.matrix.vertical = request->arg(F("PV")).toInt();
strip.matrix.serpentine = request->hasArg(F("PS"));
strip.panelO.bottomStart = request->arg(F("PBL")).toInt(); //WLEDMM
strip.panelO.rightStart = request->arg(F("PRL")).toInt(); //WLEDMM
strip.panelO.vertical = request->arg(F("PVL")).toInt(); //WLEDMM
strip.panelO.serpentine = request->hasArg(F("PSL")); //WLEDMM
strip.panelO.bottomStart = request->arg(F("PBL")).toInt();
strip.panelO.rightStart = request->arg(F("PRL")).toInt();
strip.panelO.vertical = request->arg(F("PVL")).toInt();
strip.panelO.serpentine = request->hasArg(F("PSL"));
strip.panel.reserve(strip.panels); // pre-allocate memory
for (uint8_t i=0; i<strip.panels; i++) {
WS2812FX::Panel p;
@@ -709,12 +714,13 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
pO[l] = 'H'; p.height = request->arg(pO).toInt();
strip.panel.push_back(p);
}
strip.setUpMatrix(); // will check limits
strip.makeAutoSegments(true);
strip.deserializeMap();
} else {
Segment::maxWidth = strip.getLengthTotal();
Segment::maxHeight = 1;
}
strip.setUpMatrix(); // will check limits
strip.resetSegments(true); //WLEDMM reset segments, boundsOnly!!
}
#endif
@@ -837,7 +843,7 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
//apply preset
if (updateVal(req.c_str(), "PL=", &presetCycCurr, presetCycMin, presetCycMax)) {
unloadPlaylist();
unloadPlaylist();
applyPreset(presetCycCurr);
}