🎨 Clean up TFT Color UI display items (#25712)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Alexey D. Filimonov 2023-04-22 12:06:19 +03:00 committed by GitHub
parent fba1f83855
commit 89ccede139
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 50 deletions

View file

@ -228,25 +228,25 @@ void MarlinUI::draw_status_screen() {
for (i = 0 ; i < ITEMS_COUNT; i++) { for (i = 0 ; i < ITEMS_COUNT; i++) {
x = (TFT_WIDTH / ITEMS_COUNT - 80) / 2 + (TFT_WIDTH * i / ITEMS_COUNT); x = (TFT_WIDTH / ITEMS_COUNT - 80) / 2 + (TFT_WIDTH * i / ITEMS_COUNT);
switch (i) { switch (i) {
#ifdef ITEM_E0 #if HAS_EXTRUDERS
case ITEM_E0: draw_heater_status(x, y, H_E0); break; case ITEM_E0: draw_heater_status(x, y, H_E0); break;
#endif #endif
#ifdef ITEM_E1 #if HAS_MULTI_HOTEND
case ITEM_E1: draw_heater_status(x, y, H_E1); break; case ITEM_E1: draw_heater_status(x, y, H_E1); break;
#endif #endif
#ifdef ITEM_E2 #if HOTENDS > 2
case ITEM_E2: draw_heater_status(x, y, H_E2); break; case ITEM_E2: draw_heater_status(x, y, H_E2); break;
#endif #endif
#ifdef ITEM_BED #if HAS_HEATED_BED
case ITEM_BED: draw_heater_status(x, y, H_BED); break; case ITEM_BED: draw_heater_status(x, y, H_BED); break;
#endif #endif
#ifdef ITEM_CHAMBER #if HAS_TEMP_CHAMBER
case ITEM_CHAMBER: draw_heater_status(x, y, H_CHAMBER); break; case ITEM_CHAMBER: draw_heater_status(x, y, H_CHAMBER); break;
#endif #endif
#ifdef ITEM_COOLER #if HAS_TEMP_COOLER
case ITEM_COOLER: draw_heater_status(x, y, H_COOLER); break; case ITEM_COOLER: draw_heater_status(x, y, H_COOLER); break;
#endif #endif
#ifdef ITEM_FAN #if HAS_FAN
case ITEM_FAN: draw_fan_status(x, y, blink); break; case ITEM_FAN: draw_fan_status(x, y, blink); break;
#endif #endif
} }

View file

@ -230,25 +230,25 @@ void MarlinUI::draw_status_screen() {
for (i = 0 ; i < ITEMS_COUNT; i++) { for (i = 0 ; i < ITEMS_COUNT; i++) {
x = (TFT_WIDTH / ITEMS_COUNT - 64) / 2 + (TFT_WIDTH * i / ITEMS_COUNT); x = (TFT_WIDTH / ITEMS_COUNT - 64) / 2 + (TFT_WIDTH * i / ITEMS_COUNT);
switch (i) { switch (i) {
#ifdef ITEM_E0 #if HAS_EXTRUDERS
case ITEM_E0: draw_heater_status(x, y, H_E0); break; case ITEM_E0: draw_heater_status(x, y, H_E0); break;
#endif #endif
#ifdef ITEM_E1 #if HAS_MULTI_HOTEND
case ITEM_E1: draw_heater_status(x, y, H_E1); break; case ITEM_E1: draw_heater_status(x, y, H_E1); break;
#endif #endif
#ifdef ITEM_E2 #if HOTENDS > 2
case ITEM_E2: draw_heater_status(x, y, H_E2); break; case ITEM_E2: draw_heater_status(x, y, H_E2); break;
#endif #endif
#ifdef ITEM_BED #if HAS_HEATED_BED
case ITEM_BED: draw_heater_status(x, y, H_BED); break; case ITEM_BED: draw_heater_status(x, y, H_BED); break;
#endif #endif
#ifdef ITEM_CHAMBER #if HAS_TEMP_CHAMBER
case ITEM_CHAMBER: draw_heater_status(x, y, H_CHAMBER); break; case ITEM_CHAMBER: draw_heater_status(x, y, H_CHAMBER); break;
#endif #endif
#ifdef ITEM_COOLER #if HAS_TEMP_COOLER
case ITEM_COOLER: draw_heater_status(x, y, H_COOLER); break; case ITEM_COOLER: draw_heater_status(x, y, H_COOLER); break;
#endif #endif
#ifdef ITEM_FAN #if HAS_FAN
case ITEM_FAN: draw_fan_status(x, y, blink); break; case ITEM_FAN: draw_fan_status(x, y, blink); break;
#endif #endif
} }

View file

@ -228,25 +228,25 @@ void MarlinUI::draw_status_screen() {
for (i = 0 ; i < ITEMS_COUNT; i++) { for (i = 0 ; i < ITEMS_COUNT; i++) {
x = (TFT_WIDTH / ITEMS_COUNT - 80) / 2 + (TFT_WIDTH * i / ITEMS_COUNT); x = (TFT_WIDTH / ITEMS_COUNT - 80) / 2 + (TFT_WIDTH * i / ITEMS_COUNT);
switch (i) { switch (i) {
#ifdef ITEM_E0 #if HAS_EXTRUDERS
case ITEM_E0: draw_heater_status(x, y, H_E0); break; case ITEM_E0: draw_heater_status(x, y, H_E0); break;
#endif #endif
#ifdef ITEM_E1 #if HAS_MULTI_HOTEND
case ITEM_E1: draw_heater_status(x, y, H_E1); break; case ITEM_E1: draw_heater_status(x, y, H_E1); break;
#endif #endif
#ifdef ITEM_E2 #if HOTENDS > 2
case ITEM_E2: draw_heater_status(x, y, H_E2); break; case ITEM_E2: draw_heater_status(x, y, H_E2); break;
#endif #endif
#ifdef ITEM_BED #if HAS_HEATED_BED
case ITEM_BED: draw_heater_status(x, y, H_BED); break; case ITEM_BED: draw_heater_status(x, y, H_BED); break;
#endif #endif
#ifdef ITEM_CHAMBER #if HAS_TEMP_CHAMBER
case ITEM_CHAMBER: draw_heater_status(x, y, H_CHAMBER); break; case ITEM_CHAMBER: draw_heater_status(x, y, H_CHAMBER); break;
#endif #endif
#ifdef ITEM_COOLER #if HAS_TEMP_COOLER
case ITEM_COOLER: draw_heater_status(x, y, H_COOLER); break; case ITEM_COOLER: draw_heater_status(x, y, H_COOLER); break;
#endif #endif
#ifdef ITEM_FAN #if HAS_FAN
case ITEM_FAN: draw_fan_status(x, y, blink); break; case ITEM_FAN: draw_fan_status(x, y, blink); break;
#endif #endif
} }

View file

@ -57,32 +57,15 @@ void menu_item(const uint8_t row, bool sel = false);
#define ABSOLUTE_ZERO -273.15 #define ABSOLUTE_ZERO -273.15
#if HAS_TEMP_CHAMBER && HAS_MULTI_HOTEND enum {
#define ITEM_E0 0 OPTITEM(HAS_EXTRUDERS, ITEM_E0)
#define ITEM_E1 1 OPTITEM(HAS_MULTI_HOTEND, ITEM_E1)
#define ITEM_BED 2 #if HOTENDS > 2
#define ITEM_CHAMBER 3 ITEM_E2,
#define ITEM_FAN 4 #endif
#define ITEMS_COUNT 5 OPTITEM(HAS_HEATED_BED, ITEM_BED)
#elif HAS_TEMP_CHAMBER OPTITEM(HAS_TEMP_CHAMBER, ITEM_CHAMBER)
#define ITEM_E0 0 OPTITEM(HAS_TEMP_COOLER, ITEM_COOLER)
#define ITEM_BED 1 OPTITEM(HAS_FAN, ITEM_FAN)
#define ITEM_CHAMBER 2 ITEMS_COUNT
#define ITEM_FAN 3 };
#define ITEMS_COUNT 4
#elif HAS_TEMP_COOLER
#define ITEM_COOLER 0
#define ITEM_FAN 1
#define ITEMS_COUNT 2
#elif HAS_MULTI_HOTEND
#define ITEM_E0 0
#define ITEM_E1 1
#define ITEM_BED 2
#define ITEM_FAN 3
#define ITEMS_COUNT 4
#else
#define ITEM_E0 0
#define ITEM_BED 1
#define ITEM_FAN 2
#define ITEMS_COUNT 3
#endif