Add XYZ_NO_FRAME option

This commit is contained in:
Scott Lahteine 2020-05-03 01:24:39 -05:00
parent 36efe75ad1
commit 9a6934874a
7 changed files with 20 additions and 14 deletions

View File

@ -1259,7 +1259,8 @@
// Show SD percentage next to the progress bar // Show SD percentage next to the progress bar
//#define DOGM_SD_PERCENT //#define DOGM_SD_PERCENT
// Enable to save many cycles by drawing a hollow frame on the Info Screen // Save many cycles by drawing a hollow frame or no frame on the Info Screen
//#define XYZ_NO_FRAME
#define XYZ_HOLLOW_FRAME #define XYZ_HOLLOW_FRAME
// Enable to save many cycles by drawing a hollow frame on Menu Screens // Enable to save many cycles by drawing a hollow frame on Menu Screens

View File

@ -104,6 +104,7 @@
#endif #endif
#define PROGRESS_BAR_X 54 #define PROGRESS_BAR_X 54
#define PROGRESS_BAR_Y (EXTRAS_BASELINE + 2)
#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) { FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
@ -597,7 +598,7 @@ void MarlinUI::draw_status_screen() {
// //
if (PAGE_CONTAINS(49, 52)) if (PAGE_CONTAINS(49, 52))
u8g.drawFrame(PROGRESS_BAR_X, 49, PROGRESS_BAR_WIDTH, 4); u8g.drawFrame(PROGRESS_BAR_X, PROGRESS_BAR_Y, PROGRESS_BAR_WIDTH, 4);
// //
// Progress bar solid part // Progress bar solid part
@ -638,7 +639,7 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(DOGM_SD_PERCENT) #if ENABLED(DOGM_SD_PERCENT)
if (progress_string[0]) { if (progress_string[0]) {
lcd_put_u8str(55, 48, progress_string); // Percent complete lcd_put_u8str(55, EXTRAS_BASELINE, progress_string); // Percent complete
lcd_put_wchar('%'); lcd_put_wchar('%');
} }
#endif #endif
@ -665,7 +666,7 @@ void MarlinUI::draw_status_screen() {
// XYZ Coordinates // XYZ Coordinates
// //
#if ENABLED(XYZ_HOLLOW_FRAME) #if EITHER(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME)
#define XYZ_FRAME_TOP 29 #define XYZ_FRAME_TOP 29
#define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 3 #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 3
#else #else
@ -675,15 +676,17 @@ void MarlinUI::draw_status_screen() {
if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) { if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) {
#if ENABLED(XYZ_HOLLOW_FRAME) #if DISABLED(XYZ_NO_FRAME)
u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39 #if ENABLED(XYZ_HOLLOW_FRAME)
#else u8g.drawFrame(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 29-40 7: 29-39
u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37 #else
u8g.drawBox(0, XYZ_FRAME_TOP, LCD_PIXEL_WIDTH, XYZ_FRAME_HEIGHT); // 8: 30-39 7: 30-37
#endif
#endif #endif
if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_ASCENT - 1), XYZ_BASELINE)) { if (PAGE_CONTAINS(XYZ_BASELINE - (INFO_FONT_ASCENT - 1), XYZ_BASELINE)) {
#if DISABLED(XYZ_HOLLOW_FRAME) #if NONE(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME)
u8g.setColorIndex(0); // white on black u8g.setColorIndex(0); // white on black
#endif #endif
@ -722,7 +725,7 @@ void MarlinUI::draw_status_screen() {
_draw_axis_value(Z_AXIS, zstring, blink); _draw_axis_value(Z_AXIS, zstring, blink);
#if DISABLED(XYZ_HOLLOW_FRAME) #if NONE(XYZ_NO_FRAME, XYZ_HOLLOW_FRAME)
u8g.setColorIndex(1); // black on white u8g.setColorIndex(1); // black on white
#endif #endif
} }
@ -770,10 +773,11 @@ void MarlinUI::draw_status_screen() {
lcd_put_wchar(':'); lcd_put_wchar(':');
lcd_put_u8str(mstring); lcd_put_u8str(mstring);
lcd_put_wchar('%'); lcd_put_wchar('%');
return;
} }
else
#endif #endif
draw_status_message(blink);
draw_status_message(blink);
} }
} }

View File

@ -26,7 +26,6 @@
// //
// Limit Switches // Limit Switches
// //
#define X_MIN_PIN P1_29 #define X_MIN_PIN P1_29
#define X_MAX_PIN P1_28 #define X_MAX_PIN P1_28
#define Y_MIN_PIN P1_27 #define Y_MIN_PIN P1_27

View File

@ -39,4 +39,5 @@
#endif #endif
#define IS_RAMPS_13 #define IS_RAMPS_13
#include "pins_RAMPS.h" #include "pins_RAMPS.h"

View File

@ -44,6 +44,7 @@
#endif #endif
#define BOARD_INFO_NAME "RAMPS4DUE" #define BOARD_INFO_NAME "RAMPS4DUE"
#define IS_RAMPS4DUE #define IS_RAMPS4DUE
// //

View File

@ -50,6 +50,7 @@
#define BOARD_INFO_NAME "RAMPS Duo" #define BOARD_INFO_NAME "RAMPS Duo"
#define IS_RAMPS_DUO #define IS_RAMPS_DUO
#include "../ramps/pins_RAMPS.h" #include "../ramps/pins_RAMPS.h"
// //

View File

@ -65,7 +65,6 @@
#endif #endif
#define BOARD_INFO_NAME "RAMPS-SMART" #define BOARD_INFO_NAME "RAMPS-SMART"
#define IS_RAMPS_SMART #define IS_RAMPS_SMART
#include "../ramps/pins_RAMPS.h" #include "../ramps/pins_RAMPS.h"