Improved debug UI.

This commit is contained in:
Avamander 2021-12-01 15:50:36 +02:00
parent 9108952e6b
commit cccec6e1ab
2 changed files with 25 additions and 1 deletions

View file

@ -892,7 +892,7 @@ target_compile_options(${EXECUTABLE_NAME} PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os> $<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3 -fno-rtti> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3 -fno-rtti>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os -fno-rtti> $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -O1 -g3 -fno-rtti>
$<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp> $<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp>
) )

View file

@ -140,6 +140,14 @@ std::unique_ptr<Screen> Weather::CreateScreenClouds() {
std::unique_ptr<Controllers::WeatherData::Clouds>& current = weatherService.GetCurrentClouds(); std::unique_ptr<Controllers::WeatherData::Clouds>& current = weatherService.GetCurrentClouds();
if (current->timestamp == 0) { if (current->timestamp == 0) {
// Do not use the data, it's invalid // Do not use the data, it's invalid
lv_label_set_text_fmt(label,
"#FFFF00 Clouds#\n\n"
"#444444 %d%%#\n\n"
"%d\n"
"%d\n",
0,
0,
0);
} else { } else {
lv_label_set_text_fmt(label, lv_label_set_text_fmt(label,
"#FFFF00 Clouds#\n\n" "#FFFF00 Clouds#\n\n"
@ -161,6 +169,14 @@ std::unique_ptr<Screen> Weather::CreateScreenPrecipitation() {
std::unique_ptr<Controllers::WeatherData::Precipitation>& current = weatherService.GetCurrentPrecipitation(); std::unique_ptr<Controllers::WeatherData::Precipitation>& current = weatherService.GetCurrentPrecipitation();
if (current->timestamp == 0) { if (current->timestamp == 0) {
// Do not use the data, it's invalid // Do not use the data, it's invalid
lv_label_set_text_fmt(label,
"#FFFF00 Precipitation#\n\n"
"#444444 %d%%#\n\n"
"%d\n"
"%d\n",
0,
0,
0);
} else { } else {
lv_label_set_text_fmt(label, lv_label_set_text_fmt(label,
"#FFFF00 Precipitation#\n\n" "#FFFF00 Precipitation#\n\n"
@ -182,6 +198,14 @@ std::unique_ptr<Screen> Weather::CreateScreenHumidity() {
std::unique_ptr<Controllers::WeatherData::Humidity>& current = weatherService.GetCurrentHumidity(); std::unique_ptr<Controllers::WeatherData::Humidity>& current = weatherService.GetCurrentHumidity();
if (current->timestamp == 0) { if (current->timestamp == 0) {
// Do not use the data, it's invalid // Do not use the data, it's invalid
lv_label_set_text_fmt(label,
"#FFFF00 Humidity#\n\n"
"#444444 %d%%#\n\n"
"%d\n"
"%d\n",
0,
0,
0);
} else { } else {
lv_label_set_text_fmt(label, lv_label_set_text_fmt(label,
"#FFFF00 Humidity#\n\n" "#FFFF00 Humidity#\n\n"