From 30ca5c63707b4989eb6d29e1423c7feb17af98c4 Mon Sep 17 00:00:00 2001 From: TD-er Date: Sun, 7 Jun 2026 22:39:40 +0200 Subject: [PATCH] [SysVarSort] Only sort system variables on ESP32 due to build size --- .gitignore | 2 ++ src/src/WebServer/SysVarPage.cpp | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f4a4487ca..a195b861d 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,5 @@ sdkconfig.* src/Custom_.h compile_commands.json + +*.Identifier diff --git a/src/src/WebServer/SysVarPage.cpp b/src/src/WebServer/SysVarPage.cpp index 0eedeb4a9..a9a3c0eaa 100644 --- a/src/src/WebServer/SysVarPage.cpp +++ b/src/src/WebServer/SysVarPage.cpp @@ -18,6 +18,11 @@ # include "../Helpers/SystemVariables.h" +#if defined(ESP32) && (!defined(LIMIT_BUILD_SIZE) || FEATURE_STRING_VARIABLES) +#define FEATURE_CUSTOM_STRING_SORT 1 +#else +#define FEATURE_CUSTOM_STRING_SORT 0 +#endif // ******************************************************************************** // Web Interface sysvars showing all system vars and their value. // ******************************************************************************** @@ -52,7 +57,7 @@ void handle_sysvars() { html_table_header(F("URL encoded"), F("RTDReference/SystemVariable.html"), 0); addTableSeparator(F("Custom Variables"), 3, 3); - # if !defined(LIMIT_BUILD_SIZE) || FEATURE_STRING_VARIABLES + #if FEATURE_CUSTOM_STRING_SORT auto numAlphaSort = [](const String& a, const String& b) { const int32_t ai = a.toInt(); const int32_t bi = b.toInt(); @@ -64,7 +69,7 @@ void handle_sysvars() { }; std::vector customStringSort; - # endif // if !defined(LIMIT_BUILD_SIZE) || FEATURE_STRING_VARIABLES + # endif // FEATURE_CUSTOM_STRING_SORT if (customFloatVar.empty()) { html_TR_TD(); @@ -72,7 +77,7 @@ void handle_sysvars() { html_TD(); html_TD(); } else { - # if !defined(LIMIT_BUILD_SIZE) || FEATURE_STRING_VARIABLES + #if FEATURE_CUSTOM_STRING_SORT for (auto it = customFloatVar.begin(); it != customFloatVar.end(); ++it) { customStringSort.push_back(it->first); @@ -88,7 +93,7 @@ void handle_sysvars() { } addSysVar_html(strformat(F("%%%s%s%%"), FsP(isv_ ? F("v_") : F("v")), it.c_str()), false); } - # else // if !defined(LIMIT_BUILD_SIZE) || FEATURE_STRING_VARIABLES + # else // FEATURE_CUSTOM_STRING_SORT for (auto it = customFloatVar.begin(); it != customFloatVar.end(); ++it) { NumericalType detectedType; bool isv_ = true; @@ -98,7 +103,7 @@ void handle_sysvars() { } addSysVar_html(strformat(F("%%%s%s%%"), FsP(isv_ ? F("v_") : F("v")), it->first.c_str()), false); } - # endif // if !defined(LIMIT_BUILD_SIZE) || FEATURE_STRING_VARIABLES + # endif // FEATURE_CUSTOM_STRING_SORT } # if FEATURE_STRING_VARIABLES