chore(color): implement publish/subscribe messaging to simplify code and further code consolidation (#7032)

This commit is contained in:
philmoz
2026-01-29 15:45:10 +10:00
committed by GitHub
parent 2579bc6132
commit 9a44335601
125 changed files with 1701 additions and 2054 deletions
+1 -1
View File
@@ -1293,7 +1293,7 @@ const char *ModelsList::save(LabelsVector newOrder)
f_puts("\r\n", &file);
f_close(&file);
modelslabels._isDirty = false;
modelslabels.resetDirty();
return NULL;
}
+13 -14
View File
@@ -139,6 +139,7 @@ class ModelMap : protected std::multimap<uint16_t, ModelCell *>
}
std::string getBulletLabelString(ModelCell *, const char *noresults = "");
void setDirty(bool save = false);
void resetDirty() { _isDirty = false; }
bool isDirty() { return _isDirty; }
// Currently selected labels in the GUI
@@ -163,18 +164,6 @@ class ModelMap : protected std::multimap<uint16_t, ModelCell *>
const std::string &from,
const std::string &to);
protected:
ModelsSortBy _sortOrder = DEFAULT_MODEL_SORT;
bool _isDirty = true;
std::set<uint32_t> filtlbls;
std::string currentlabel = "";
void updateModelCell(ModelCell *);
bool removeModels(
ModelCell *); // Should only be called from ModelsList remove model
bool updateModelFile(ModelCell *);
void sortModelsBy(ModelsVector &mv, ModelsSortBy sortby);
void clear()
{
_isDirty = true;
@@ -182,6 +171,18 @@ class ModelMap : protected std::multimap<uint16_t, ModelCell *>
std::multimap<uint16_t, ModelCell *>::clear();
}
void updateModelCell(ModelCell *);
bool removeModels(ModelCell *);
protected:
ModelsSortBy _sortOrder = DEFAULT_MODEL_SORT;
bool _isDirty = true;
std::set<uint32_t> filtlbls;
std::string currentlabel = "";
bool updateModelFile(ModelCell *);
void sortModelsBy(ModelsVector &mv, ModelsSortBy sortby);
int getIndexByLabel(const std::string &str)
{
auto a = std::find(labels.begin(), labels.end(), str);
@@ -196,8 +197,6 @@ class ModelMap : protected std::multimap<uint16_t, ModelCell *>
return std::string();
}
friend class ModelsList;
private:
LabelsVector labels; // Storage space for discovered labels
};
+7
View File
@@ -118,6 +118,13 @@ void postRadioSettingsLoad()
serialSetMode(port_nr, UART_MODE_NONE);
}
#endif
#if defined(COLORLCD)
// Ensure ON brightness >= OFF brightness
if ((BACKLIGHT_LEVEL_MAX - g_eeGeneral.backlightBright) < g_eeGeneral.blOffBright)
g_eeGeneral.backlightBright =
BACKLIGHT_LEVEL_MAX - g_eeGeneral.blOffBright;
#endif
}
static bool sortMixerLines()