Skip to content

Commit fa8cb01

Browse files
committed
TFT: Add time elapsed/remaining images
1 parent 7db787b commit fa8cb01

File tree

7 files changed

+137
-3
lines changed

7 files changed

+137
-3
lines changed
3.05 KB
Binary file not shown.
3.05 KB
Binary file not shown.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
23+
#include "../../../inc/MarlinConfigPre.h"
24+
25+
#if HAS_GRAPHICAL_TFT
26+
27+
extern const uint8_t time_elapsed_32x32x4[512] = {
28+
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xcd, 0xca, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
29+
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8e, 0xff, 0xff, 0xfe, 0xb8, 0x88, 0x88, 0x88, 0x88, 0x88,
30+
0x88, 0x88, 0x88, 0x89, 0xcc, 0x98, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xc8, 0x88, 0x88, 0x88, 0x88,
31+
0x88, 0x88, 0x88, 0x8d, 0xff, 0xd8, 0x8e, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x88, 0x88, 0x88, 0x88,
32+
0x88, 0x88, 0x88, 0x8e, 0xff, 0xe7, 0x79, 0xde, 0xde, 0xff, 0xff, 0xff, 0xe9, 0x88, 0x88, 0x88,
33+
0x88, 0x88, 0x88, 0x8c, 0xff, 0xb6, 0x68, 0x86, 0x66, 0x8d, 0xff, 0xff, 0xfe, 0x88, 0x88, 0x88,
34+
0x88, 0x88, 0x98, 0x88, 0x98, 0x66, 0x67, 0x87, 0x66, 0x66, 0x9e, 0xff, 0xff, 0xd8, 0x88, 0x88,
35+
0x88, 0x8e, 0xfe, 0x88, 0x87, 0x66, 0x78, 0x88, 0x88, 0x88, 0x77, 0xdf, 0xff, 0xfc, 0x78, 0x88,
36+
0x88, 0xbf, 0xff, 0xb7, 0x88, 0x77, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8e, 0xff, 0xff, 0x78, 0x88,
37+
0x88, 0xaf, 0xff, 0xa6, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8a, 0xff, 0xff, 0xb7, 0x88,
38+
0x88, 0x8b, 0xdb, 0x66, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xdf, 0xff, 0xe6, 0x78,
39+
0x88, 0x88, 0x76, 0x66, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x9f, 0xff, 0xf8, 0x78,
40+
0x88, 0x88, 0x77, 0x67, 0x78, 0x88, 0x8b, 0xee, 0xed, 0xca, 0x98, 0x88, 0x8e, 0xff, 0xfa, 0x68,
41+
0x8c, 0xee, 0xa8, 0x88, 0x88, 0x88, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xed, 0xad, 0xff, 0xfc, 0x67,
42+
0x9f, 0xff, 0xe8, 0x88, 0x88, 0x88, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfd, 0x67,
43+
0x9f, 0xff, 0xe6, 0x78, 0x88, 0x88, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xfd, 0x67,
44+
0x8c, 0xee, 0x96, 0x68, 0x88, 0x88, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0xdc, 0xa8, 0xef, 0xe8, 0x66,
45+
0x88, 0x86, 0x66, 0x68, 0x88, 0x88, 0x8b, 0xee, 0xdc, 0xb9, 0x86, 0x66, 0x66, 0x68, 0x66, 0x66,
46+
0x88, 0x87, 0x66, 0x78, 0x88, 0x88, 0x88, 0x76, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x66, 0x67,
47+
0x88, 0x8b, 0xdc, 0x88, 0x88, 0x88, 0x88, 0x87, 0x66, 0x66, 0x77, 0x78, 0xad, 0xc8, 0x77, 0x78,
48+
0x88, 0xaf, 0xff, 0xa8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xef, 0xfc, 0x88, 0x88,
49+
0x88, 0xbf, 0xff, 0xb7, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x89, 0xff, 0xfd, 0x77, 0x88,
50+
0x88, 0x8d, 0xfd, 0x76, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xcf, 0xe9, 0x67, 0x88,
51+
0x88, 0x88, 0x96, 0x66, 0x99, 0x88, 0x88, 0x88, 0x88, 0x88, 0x9a, 0x88, 0x89, 0x76, 0x66, 0x88,
52+
0x88, 0x88, 0x76, 0x6b, 0xff, 0xc8, 0x88, 0x88, 0x88, 0x8a, 0xef, 0xd8, 0x88, 0x76, 0x67, 0x88,
53+
0x88, 0x88, 0x87, 0x8e, 0xff, 0xe8, 0x89, 0xcd, 0xa8, 0x8d, 0xff, 0xf9, 0x78, 0x87, 0x78, 0x88,
54+
0x88, 0x88, 0x88, 0x8d, 0xff, 0xd6, 0x7d, 0xff, 0xe8, 0x8b, 0xff, 0xe7, 0x67, 0x88, 0x88, 0x88,
55+
0x88, 0x88, 0x88, 0x89, 0xcc, 0x86, 0x6e, 0xff, 0xf9, 0x78, 0xbc, 0x96, 0x67, 0x88, 0x88, 0x88,
56+
0x88, 0x88, 0x88, 0x88, 0x86, 0x66, 0x6c, 0xff, 0xd6, 0x67, 0x87, 0x66, 0x67, 0x88, 0x88, 0x88,
57+
0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x78, 0xaa, 0x76, 0x67, 0x87, 0x76, 0x78, 0x88, 0x88, 0x88,
58+
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x66, 0x67, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
59+
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88
60+
};
61+
62+
#endif // HAS_GRAPHICAL_TFT
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
23+
#include "../../../inc/MarlinConfigPre.h"
24+
25+
#if HAS_GRAPHICAL_TFT
26+
27+
extern const uint8_t time_remaining_32x32x4[512] = {
28+
0x88, 0x88, 0x88, 0x88, 0x88, 0x89, 0xbc, 0xdd, 0x98, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
29+
0x88, 0x88, 0x88, 0x88, 0x8b, 0xef, 0xff, 0xff, 0xf8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
30+
0x88, 0x88, 0x88, 0x8c, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x78, 0xbd, 0xa8, 0x88, 0x88, 0x88, 0x88,
31+
0x88, 0x88, 0x89, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x6b, 0xff, 0xe9, 0x88, 0x88, 0x88, 0x88,
32+
0x88, 0x88, 0x9e, 0xff, 0xff, 0xff, 0xdc, 0xdd, 0x96, 0x6c, 0xff, 0xf9, 0x78, 0x88, 0x88, 0x88,
33+
0x88, 0x89, 0xef, 0xff, 0xff, 0xd8, 0x66, 0x66, 0x66, 0x6a, 0xef, 0xd6, 0x67, 0x88, 0x88, 0x88,
34+
0x88, 0x8d, 0xff, 0xff, 0xe9, 0x66, 0x66, 0x66, 0x66, 0x78, 0x99, 0x76, 0x69, 0x88, 0x88, 0x88,
35+
0x88, 0xcf, 0xff, 0xfd, 0x66, 0x66, 0x67, 0x88, 0x88, 0x88, 0x87, 0x66, 0xcf, 0xea, 0x88, 0x88,
36+
0x88, 0xff, 0xff, 0xe6, 0x66, 0x67, 0x88, 0x88, 0x88, 0x88, 0x88, 0x79, 0xff, 0xfd, 0x78, 0x88,
37+
0x8b, 0xff, 0xff, 0xa6, 0x66, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x89, 0xef, 0xfc, 0x67, 0x88,
38+
0x8e, 0xff, 0xfd, 0x66, 0x67, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xad, 0xc7, 0x66, 0x88,
39+
0x9f, 0xff, 0xf8, 0x66, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x66, 0x67, 0x88,
40+
0xaf, 0xff, 0xe6, 0x66, 0x89, 0xab, 0xde, 0xee, 0xb8, 0x88, 0x88, 0x88, 0x88, 0x77, 0x77, 0x88,
41+
0xbf, 0xff, 0xda, 0xce, 0xef, 0xff, 0xff, 0xff, 0xfb, 0x88, 0x88, 0x88, 0x89, 0xef, 0xd8, 0x88,
42+
0xcf, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x77, 0x88, 0x88, 0x8c, 0xff, 0xfb, 0x88,
43+
0xbf, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x67, 0x88, 0x88, 0x8c, 0xff, 0xfa, 0x67,
44+
0x8e, 0xff, 0xaa, 0xcd, 0xef, 0xff, 0xff, 0xff, 0xfb, 0x66, 0x88, 0x88, 0x89, 0xde, 0xd7, 0x67,
45+
0x88, 0x87, 0x66, 0x66, 0x68, 0x9b, 0xcd, 0xee, 0xa6, 0x66, 0x88, 0x88, 0x88, 0x88, 0x66, 0x67,
46+
0x88, 0x76, 0x66, 0x77, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x88, 0x88, 0x88, 0x87, 0x66, 0x67,
47+
0x88, 0x8b, 0xdc, 0x88, 0x88, 0x77, 0x77, 0x66, 0x66, 0x78, 0x88, 0x88, 0xad, 0xc8, 0x77, 0x88,
48+
0x88, 0xaf, 0xff, 0xa8, 0x88, 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x88, 0xef, 0xfc, 0x88, 0x88,
49+
0x88, 0xbf, 0xff, 0xb7, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x89, 0xff, 0xfd, 0x77, 0x88,
50+
0x88, 0x8d, 0xfd, 0x76, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0xcf, 0xe9, 0x67, 0x88,
51+
0x88, 0x88, 0x96, 0x66, 0x99, 0x88, 0x88, 0x88, 0x88, 0x88, 0x9a, 0x88, 0x89, 0x76, 0x66, 0x88,
52+
0x88, 0x88, 0x76, 0x6b, 0xff, 0xc8, 0x88, 0x88, 0x88, 0x8a, 0xef, 0xd8, 0x88, 0x76, 0x67, 0x88,
53+
0x88, 0x88, 0x87, 0x8e, 0xff, 0xe8, 0x89, 0xcd, 0xa8, 0x8d, 0xff, 0xf9, 0x78, 0x87, 0x78, 0x88,
54+
0x88, 0x88, 0x88, 0x8d, 0xff, 0xd6, 0x7d, 0xff, 0xe8, 0x8b, 0xff, 0xe7, 0x67, 0x88, 0x88, 0x88,
55+
0x88, 0x88, 0x88, 0x89, 0xcc, 0x86, 0x6e, 0xff, 0xf9, 0x78, 0xbc, 0x96, 0x67, 0x88, 0x88, 0x88,
56+
0x88, 0x88, 0x88, 0x88, 0x86, 0x66, 0x6c, 0xff, 0xd6, 0x67, 0x87, 0x66, 0x67, 0x88, 0x88, 0x88,
57+
0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x78, 0xaa, 0x76, 0x67, 0x87, 0x76, 0x78, 0x88, 0x88, 0x88,
58+
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x66, 0x67, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
59+
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88
60+
};
61+
62+
#endif // HAS_GRAPHICAL_TFT

Marlin/src/lcd/tft/tft_image.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ const tImage Pause_64x64x4 = { (void *)pause_64x64x4, 64, 64, GREYSCALE
6464

6565
const tImage Feedrate_32x32x4 = { (void *)feedrate_32x32x4, 32, 32, GREYSCALE4 };
6666
const tImage Flowrate_32x32x4 = { (void *)flowrate_32x32x4, 32, 32, GREYSCALE4 };
67+
const tImage Time_Elapsed_32x32x4 = { (void *)time_elapsed_32x32x4, 32, 32, GREYSCALE4 };
68+
const tImage Time_Remaining_32x32x4 = { (void *)time_remaining_32x32x4, 32, 32, GREYSCALE4 };
6769
const tImage Directory_32x32x4 = { (void *)directory_32x32x4, 32, 32, GREYSCALE4 };
6870
const tImage Back_32x32x4 = { (void *)back_32x32x4, 32, 32, GREYSCALE4 };
6971
const tImage Up_32x32x4 = { (void *)up_32x32x4, 32, 32, GREYSCALE4 };
@@ -89,6 +91,8 @@ const tImage Images[imgCount] = {
8991
Fan_Fast1_64x64x4,
9092
Feedrate_32x32x4,
9193
Flowrate_32x32x4,
94+
Time_Elapsed_32x32x4,
95+
Time_Remaining_32x32x4,
9296
SD_64x64x4,
9397
Menu_64x64x4,
9498
Settings_64x64x4,

Marlin/src/lcd/tft/tft_image.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ extern const uint8_t pause_64x64x4[];
5353

5454
extern const uint8_t feedrate_32x32x4[];
5555
extern const uint8_t flowrate_32x32x4[];
56+
extern const uint8_t time_elapsed_32x32x4[];
57+
extern const uint8_t time_remaining_32x32x4[];
5658
extern const uint8_t directory_32x32x4[];
5759
extern const uint8_t back_32x32x4[];
5860
extern const uint8_t up_32x32x4[];
@@ -78,6 +80,8 @@ enum MarlinImage : uint8_t {
7880
imgFanFast1,
7981
imgFeedRate,
8082
imgFlowRate,
83+
imgTimeElapsed,
84+
imgTimeRemaining,
8185
imgSD,
8286
imgMenu,
8387
imgSettings,
@@ -164,6 +168,8 @@ extern const tImage Pause_64x64x4;
164168

165169
extern const tImage Feedrate_32x32x4;
166170
extern const tImage Flowrate_32x32x4;
171+
extern const tImage Time_Elapsed_32x32x4;
172+
extern const tImage Time_Remaining_32x32x4;
167173
extern const tImage Directory_32x32x4;
168174
extern const tImage Back_32x32x4;
169175
extern const tImage Up_32x32x4;

Marlin/src/lcd/tft/ui_480x320.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void MarlinUI::draw_status_screen() {
342342
tft.set_background(COLOR_BACKGROUND);
343343
tft_string.set(elapsed_str);
344344
uint16_t text_pos_x = tft_string.center(time_str_width - image_width);
345-
tft.add_image(text_pos_x, 0, imgFeedRate, COLOR_PRINT_TIME);
345+
tft.add_image(text_pos_x, 0, imgTimeElapsed, COLOR_PRINT_TIME);
346346
tft.add_text(text_pos_x + image_width, 1, COLOR_PRINT_TIME, tft_string);
347347
#else
348348
// Print duration so far (time elapsed) - aligned under feed rate
@@ -352,7 +352,7 @@ void MarlinUI::draw_status_screen() {
352352

353353
tft.canvas(96, y, 144, 32);
354354
tft.set_background(COLOR_BACKGROUND);
355-
tft.add_image(0, 0, imgFeedRate, COLOR_PRINT_TIME);
355+
tft.add_image(0, 0, imgTimeElapsed, COLOR_PRINT_TIME);
356356
tft_string.set(elapsed_str);
357357
tft.add_text(36, 1, COLOR_PRINT_TIME, tft_string);
358358

@@ -384,7 +384,7 @@ void MarlinUI::draw_status_screen() {
384384
tft.canvas(256, y, 144, 32);
385385
tft.set_background(COLOR_BACKGROUND);
386386
color = printingIsActive() ? COLOR_PRINT_TIME : COLOR_INACTIVE;
387-
tft.add_image(0, 0, imgFeedRate, color);
387+
tft.add_image(0, 0, imgTimeRemaining, color);
388388
tft.add_text(36, 1, color, tft_string);
389389
#endif
390390

0 commit comments

Comments
 (0)