mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 04:36:38 +00:00
Add HASP_DEBUG_OBJ_TREE compile flag
This commit is contained in:
parent
c3b10fd2c8
commit
3e0ca0241f
@ -143,5 +143,5 @@
|
|||||||
//#define HASP_START_HTTP 0 // Disable starting of web interface at boot
|
//#define HASP_START_HTTP 0 // Disable starting of web interface at boot
|
||||||
//#define LV_MEM_SIZE (64 * 1024U) // 64KiB of lvgl memory (default 48)
|
//#define LV_MEM_SIZE (64 * 1024U) // 64KiB of lvgl memory (default 48)
|
||||||
//#define LV_VDB_SIZE (32 * 1024U) // 32KiB of lvgl draw buffer (default 32)
|
//#define LV_VDB_SIZE (32 * 1024U) // 32KiB of lvgl draw buffer (default 32)
|
||||||
|
//#define HASP_DEBUG_OBJ_TREE // Output all objects to the log on page changes
|
||||||
#endif
|
#endif
|
||||||
|
@ -384,13 +384,14 @@ void hasp_set_theme(uint8_t themeid)
|
|||||||
if(themeid < 0 || themeid > 5) return; // check bounds
|
if(themeid < 0 || themeid > 5) return; // check bounds
|
||||||
|
|
||||||
#if(LV_USE_THEME_HASP == 1)
|
#if(LV_USE_THEME_HASP == 1)
|
||||||
uint32_t hasp_flags = LV_THEME_HASP_FLAG_LIGHT;
|
uint32_t hasp_flags = LV_THEME_HASP_FLAG_LIGHT + LV_THEME_HASP_FLAG_NO_TRANSITION + LV_THEME_HASP_FLAG_NO_FOCUS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if(LV_USE_THEME_MATERIAL == 1)
|
#if(LV_USE_THEME_MATERIAL == 1)
|
||||||
// LV_THEME_MATERIAL_FLAG_NO_TRANSITION : disable transitions(state change animations)
|
// LV_THEME_MATERIAL_FLAG_NO_TRANSITION : disable transitions(state change animations)
|
||||||
// LV_THEME_MATERIAL_FLAG_NO_FOCUS: disable indication of focused state)
|
// LV_THEME_MATERIAL_FLAG_NO_FOCUS: disable indication of focused state)
|
||||||
uint32_t material_flags = LV_THEME_MATERIAL_FLAG_LIGHT + LV_THEME_MATERIAL_FLAG_NO_TRANSITION;
|
uint32_t material_flags =
|
||||||
|
LV_THEME_MATERIAL_FLAG_LIGHT + LV_THEME_MATERIAL_FLAG_NO_TRANSITION + LV_THEME_MATERIAL_FLAG_NO_FOCUS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(themeid) {
|
switch(themeid) {
|
||||||
@ -404,11 +405,11 @@ void hasp_set_theme(uint8_t themeid)
|
|||||||
|
|
||||||
#if(LV_USE_THEME_HASP == 1)
|
#if(LV_USE_THEME_HASP == 1)
|
||||||
case 2: // Dark
|
case 2: // Dark
|
||||||
hasp_flags = LV_THEME_HASP_FLAG_DARK;
|
hasp_flags = LV_THEME_HASP_FLAG_DARK + LV_THEME_HASP_FLAG_NO_TRANSITION + LV_THEME_HASP_FLAG_NO_FOCUS;
|
||||||
case 1: // Light
|
case 1: // Light
|
||||||
case 8: // Light (old id)
|
case 8: // Light (old id)
|
||||||
th = lv_theme_hasp_init(color_primary, color_secondary, hasp_flags + LV_THEME_HASP_FLAG_NO_FOCUS,
|
th = lv_theme_hasp_init(color_primary, color_secondary, hasp_flags, haspFonts[0], haspFonts[1],
|
||||||
haspFonts[0], haspFonts[1], haspFonts[2], haspFonts[3]);
|
haspFonts[2], haspFonts[3]);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -421,12 +422,12 @@ void hasp_set_theme(uint8_t themeid)
|
|||||||
|
|
||||||
#if LV_USE_THEME_MATERIAL == 1
|
#if LV_USE_THEME_MATERIAL == 1
|
||||||
case 5: // Dark
|
case 5: // Dark
|
||||||
material_flags = LV_THEME_MATERIAL_FLAG_DARK + LV_THEME_MATERIAL_FLAG_NO_TRANSITION;
|
material_flags =
|
||||||
|
LV_THEME_MATERIAL_FLAG_DARK + LV_THEME_MATERIAL_FLAG_NO_TRANSITION + LV_THEME_MATERIAL_FLAG_NO_FOCUS;
|
||||||
case 4: // Light
|
case 4: // Light
|
||||||
case 9: // Light (old id)
|
case 9: // Light (old id)
|
||||||
th =
|
th = lv_theme_material_init(color_primary, color_secondary, material_flags, haspFonts[0], haspFonts[1],
|
||||||
lv_theme_material_init(color_primary, color_secondary, material_flags + LV_THEME_MATERIAL_FLAG_NO_FOCUS,
|
haspFonts[2], haspFonts[3]);
|
||||||
haspFonts[0], haspFonts[1], haspFonts[2], haspFonts[3]);
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -641,24 +642,6 @@ void haspClearPage(uint16_t pageid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t haspGetPage()
|
|
||||||
{
|
|
||||||
return current_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void haspSetPage(uint8_t pageid)
|
|
||||||
{
|
|
||||||
lv_obj_t* page = haspPages.get_obj(pageid);
|
|
||||||
if(!page || pageid == 0 || pageid > HASP_NUM_PAGES) {
|
|
||||||
LOG_WARNING(TAG_HASP, F(D_HASP_INVALID_PAGE), pageid);
|
|
||||||
} else {
|
|
||||||
LOG_TRACE(TAG_HASP, F(D_HASP_CHANGE_PAGE), pageid);
|
|
||||||
current_page = pageid;
|
|
||||||
lv_scr_load(page);
|
|
||||||
hasp_object_tree(page, pageid, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void hasp_get_info(JsonDocument& doc)
|
void hasp_get_info(JsonDocument& doc)
|
||||||
{
|
{
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
|
@ -91,7 +91,9 @@ void Page::set(uint8_t pageid, lv_scr_load_anim_t animation)
|
|||||||
if(page != lv_scr_act()) {
|
if(page != lv_scr_act()) {
|
||||||
LOG_TRACE(TAG_HASP, F(D_HASP_CHANGE_PAGE), pageid);
|
LOG_TRACE(TAG_HASP, F(D_HASP_CHANGE_PAGE), pageid);
|
||||||
lv_scr_load_anim(page, animation, 500, 0, false);
|
lv_scr_load_anim(page, animation, 500, 0, false);
|
||||||
|
#if defined(HASP_DEBUG_OBJ_TREE)
|
||||||
hasp_object_tree(page, pageid, 0);
|
hasp_object_tree(page, pageid, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ void TASMO_TELE_JSON()
|
|||||||
haspDevice.get_version(), long(millis() / 1000));
|
haspDevice.get_version(), long(millis() / 1000));
|
||||||
|
|
||||||
snprintf_P(buffer, sizeof(buffer), PSTR("\"espCanUpdate\":\"false\",\"page\":%u,\"numPages\":%u,"),
|
snprintf_P(buffer, sizeof(buffer), PSTR("\"espCanUpdate\":\"false\",\"page\":%u,\"numPages\":%u,"),
|
||||||
haspGetPage(), (HASP_NUM_PAGES));
|
haspPages.get(), (HASP_NUM_PAGES));
|
||||||
strcat(data, buffer);
|
strcat(data, buffer);
|
||||||
snprintf_P(buffer, sizeof(buffer), PSTR("\"tftDriver\":\"%s\",\"tftWidth\":%u,\"tftHeight\":%u}"),
|
snprintf_P(buffer, sizeof(buffer), PSTR("\"tftDriver\":\"%s\",\"tftWidth\":%u,\"tftHeight\":%u}"),
|
||||||
halDisplayDriverName().c_str(), (TFT_WIDTH), (TFT_HEIGHT));
|
halDisplayDriverName().c_str(), (TFT_WIDTH), (TFT_HEIGHT));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user