🧑‍💻 LCD Code patches

This commit is contained in:
Scott Lahteine
2024-01-29 22:31:49 -06:00
parent 6b65665aa8
commit 108f0b0cf5
312 changed files with 3053 additions and 1887 deletions

View File

@@ -103,7 +103,7 @@
#elif ENABLED(YHCB2004) #elif ENABLED(YHCB2004)
LCD_CLASS lcd(YHCB2004_CLK, 20, 4, YHCB2004_MOSI, YHCB2004_MISO); // CLK, cols, rows, MOSI, MISO LCD_CLASS lcd(YHCB2004_SCK_PIN, 20, 4, YHCB2004_MOSI_PIN, YHCB2004_MISO_PIN); // CLK, cols, rows, MOSI, MISO
#else #else
@@ -521,7 +521,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
else if (axis_should_home(axis)) else if (axis_should_home(axis))
while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?'); while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?');
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis)) else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" ")); lcd_put_u8str(TERN0(HAS_Z_AXIS, axis == Z_AXIS) ? F(" ") : F(" "));
else else
lcd_put_u8str(value); lcd_put_u8str(value);
} }
@@ -537,7 +537,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
*/ */
FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) { FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) {
#if HAS_HEATED_BED #if HAS_HEATED_BED
const bool isBed = TERN(HAS_HEATED_CHAMBER, heater_id == H_BED, heater_id < 0); const bool isBed = heater_id == H_BED;
const celsius_t t1 = (isBed ? thermalManager.wholeDegBed() : thermalManager.wholeDegHotend(heater_id)), const celsius_t t1 = (isBed ? thermalManager.wholeDegBed() : thermalManager.wholeDegHotend(heater_id)),
t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id)); t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
#else #else
@@ -546,7 +546,17 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
if (prefix >= 0) lcd_put_lchar(prefix); if (prefix >= 0) lcd_put_lchar(prefix);
lcd_put_u8str(t1 < 0 ? "err" : i16tostr3rj(t1)); if (t1 >= 0)
lcd_put_u8str(ui16tostr3rj(t1));
else {
#if ENABLED(SHOW_TEMPERATURE_BELOW_ZERO)
char * const str = i16tostr3rj(t1);
lcd_put_u8str(&str[1]);
#else
lcd_put_u8str(F("err"));
#endif
}
lcd_put_u8str(F("/")); lcd_put_u8str(F("/"));
#if !HEATER_IDLE_HANDLER #if !HEATER_IDLE_HANDLER
@@ -762,9 +772,10 @@ void MarlinUI::draw_status_message(const bool blink) {
#define TPOFFSET (LCD_WIDTH - 1) #define TPOFFSET (LCD_WIDTH - 1)
static uint8_t timepos = TPOFFSET - 6; static uint8_t timepos = TPOFFSET - 6;
static char buffer[8]; static char buffer[8];
static lcd_uint_t pc, pr;
#if ENABLED(SHOW_PROGRESS_PERCENT) #if ENABLED(SHOW_PROGRESS_PERCENT)
static lcd_uint_t pc = 0, pr = 2;
inline void setPercentPos(const lcd_uint_t c, const lcd_uint_t r) { pc = c; pr = r; }
void MarlinUI::drawPercent() { void MarlinUI::drawPercent() {
const uint8_t progress = ui.get_progress_percent(); const uint8_t progress = ui.get_progress_percent();
if (progress) { if (progress) {
@@ -926,7 +937,7 @@ void MarlinUI::draw_status_screen() {
#if LCD_WIDTH < 20 #if LCD_WIDTH < 20
#if HAS_PRINT_PROGRESS #if HAS_PRINT_PROGRESS
pc = 0; pr = 2; TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(0, 2));
rotate_progress(); rotate_progress();
#endif #endif
@@ -952,25 +963,25 @@ void MarlinUI::draw_status_screen() {
// Two-component mix / gradient instead of XY // Two-component mix / gradient instead of XY
char mixer_messages[12]; char mixer_messages[15];
const char *mix_label; PGM_P mix_label;
#if ENABLED(GRADIENT_MIX) #if ENABLED(GRADIENT_MIX)
if (mixer.gradient.enabled) { if (mixer.gradient.enabled) {
mixer.update_mix_from_gradient(); mixer.update_mix_from_gradient();
mix_label = "Gr"; mix_label = PSTR("Gr");
} }
else else
#endif #endif
{ {
mixer.update_mix_from_vtool(); mixer.update_mix_from_vtool();
mix_label = "Mx"; mix_label = PSTR("Mx");
} }
sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
lcd_put_u8str(mixer_messages); lcd_put_u8str(mixer_messages);
#else // !HAS_DUAL_MIXING #else // !HAS_DUAL_MIXING
const bool show_e_total = TERN0(LCD_SHOW_E_TOTAL, printingIsActive()); const bool show_e_total = TERN1(HAS_X_AXIS, TERN0(LCD_SHOW_E_TOTAL, printingIsActive()));
if (show_e_total) { if (show_e_total) {
#if ENABLED(LCD_SHOW_E_TOTAL) #if ENABLED(LCD_SHOW_E_TOTAL)
@@ -981,10 +992,14 @@ void MarlinUI::draw_status_screen() {
#endif #endif
} }
else { else {
#if HAS_X_AXIS
const xy_pos_t lpos = current_position.asLogical(); const xy_pos_t lpos = current_position.asLogical();
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); _draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink);
lcd_put_u8str(F(" ")); #endif
#if HAS_Y_AXIS
TERN_(HAS_X_AXIS, lcd_put_u8str(F(" ")));
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); _draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink);
#endif
} }
#endif // !HAS_DUAL_MIXING #endif // !HAS_DUAL_MIXING
@@ -993,12 +1008,13 @@ void MarlinUI::draw_status_screen() {
#endif // LCD_WIDTH >= 20 #endif // LCD_WIDTH >= 20
#if HAS_Z_AXIS
lcd_moveto(LCD_WIDTH - 8, 1); lcd_moveto(LCD_WIDTH - 8, 1);
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
#if HAS_LEVELING && !HAS_HEATED_BED #if HAS_LEVELING && !HAS_HEATED_BED
lcd_put_lchar(planner.leveling_active || blink ? '_' : ' '); lcd_put_lchar(planner.leveling_active || blink ? '_' : ' ');
#endif #endif
#endif
#endif // LCD_HEIGHT > 2 #endif // LCD_HEIGHT > 2
@@ -1013,7 +1029,7 @@ void MarlinUI::draw_status_screen() {
#if LCD_WIDTH >= 20 #if LCD_WIDTH >= 20
#if HAS_PRINT_PROGRESS #if HAS_PRINT_PROGRESS
pc = 6; pr = 2; TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(6, 2));
rotate_progress(); rotate_progress();
#else #else
char c; char c;
@@ -1059,8 +1075,10 @@ void MarlinUI::draw_status_screen() {
// //
// Z Coordinate // Z Coordinate
// //
#if HAS_Z_AXIS
lcd_moveto(LCD_WIDTH - 9, 0); lcd_moveto(LCD_WIDTH - 9, 0);
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
#endif
#if HAS_LEVELING && (HAS_MULTI_HOTEND || !HAS_HEATED_BED) #if HAS_LEVELING && (HAS_MULTI_HOTEND || !HAS_HEATED_BED)
lcd_put_lchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' '); lcd_put_lchar(LCD_WIDTH - 1, 0, planner.leveling_active || blink ? '_' : ' ');
@@ -1094,7 +1112,7 @@ void MarlinUI::draw_status_screen() {
_draw_bed_status(blink); _draw_bed_status(blink);
#elif HAS_PRINT_PROGRESS #elif HAS_PRINT_PROGRESS
#define DREW_PRINT_PROGRESS 1 #define DREW_PRINT_PROGRESS 1
pc = 0; pr = 2; TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(0, 2));
rotate_progress(); rotate_progress();
#endif #endif
@@ -1102,7 +1120,7 @@ void MarlinUI::draw_status_screen() {
// All progress strings // All progress strings
// //
#if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS #if HAS_PRINT_PROGRESS && !DREW_PRINT_PROGRESS
pc = LCD_WIDTH - 9; pr = 2; TERN_(SHOW_PROGRESS_PERCENT, setPercentPos(LCD_WIDTH - 9, 2));
rotate_progress(); rotate_progress();
#endif #endif
#endif // LCD_INFO_SCREEN_STYLE 1 #endif // LCD_INFO_SCREEN_STYLE 1

View File

@@ -103,5 +103,5 @@
#endif #endif
#include "../fontutils.h" #include "../utf8.h"
#include "../lcdprint.h" #include "../lcdprint.h"

View File

@@ -864,20 +864,20 @@ void MarlinUI::draw_status_screen() {
#if DUAL_MIXING_EXTRUDER #if DUAL_MIXING_EXTRUDER
lcd_moveto(0, 4); lcd_moveto(0, 4);
// Two-component mix / gradient instead of XY // Two-component mix / gradient instead of XY
char mixer_messages[12]; char mixer_messages[15];
const char *mix_label; PGM_P mix_label;
#if ENABLED(GRADIENT_MIX) #if ENABLED(GRADIENT_MIX)
if (mixer.gradient.enabled) { if (mixer.gradient.enabled) {
mixer.update_mix_from_gradient(); mixer.update_mix_from_gradient();
mix_label = "Gr"; mix_label = PSTR("Gr");
} }
else else
#endif #endif
{ {
mixer.update_mix_from_vtool(); mixer.update_mix_from_vtool();
mix_label = "Mx"; mix_label = PSTR("Mx");
} }
sprintf_P(mixer_messages, PSTR("%s %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1])); sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
lcd_put_u8str(mixer_messages); lcd_put_u8str(mixer_messages);
#endif #endif
#endif #endif

View File

@@ -57,7 +57,6 @@ class TFTGLCD {
extern TFTGLCD lcd; extern TFTGLCD lcd;
#include "../fontutils.h"
#include "../lcdprint.h" #include "../lcdprint.h"
// Use panel encoder - free old encoder pins // Use panel encoder - free old encoder pins

View File

@@ -21,7 +21,9 @@
*/ */
#pragma once #pragma once
// Use this file to select the com driver for device drivers that are NOT in the U8G library /**
* Assign custom or standard U8G device drivers
*/
#include <U8glib-HAL.h> #include <U8glib-HAL.h>
@@ -114,6 +116,7 @@
#define U8G_COM_ST7920_HAL_SW_SPI u8g_com_ST7920_sw_spi_fn #define U8G_COM_ST7920_HAL_SW_SPI u8g_com_ST7920_sw_spi_fn
#endif #endif
// U8G_HAL_LINKS is defined for LPC1768/9 and Native envs by -DU8G_HAL_LINKS in platform.ini
#ifndef U8G_COM_HAL_SW_SPI_FN #ifndef U8G_COM_HAL_SW_SPI_FN
#define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn #define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn
#endif #endif

View File

@@ -7,4 +7,10 @@
#include "langdata.h" #include "langdata.h"
static const uxg_fontinfo_t g_fontinfo_ro[] PROGMEM = {}; const u8g_fntpgm_uint8_t fontpage_2_131_131[31] U8G_FONT_SECTION("fontpage_2_131_131") = {
0x00,0x0C,0x0F,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x83,0x83,0x00,0x08,0x00,0x00,
0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x88,0x70,0x00,0x70,0x08,0x78,0x88,0x78};
static const uxg_fontinfo_t g_fontinfo_ro[] PROGMEM = {
FONTDATA_ITEM(2, 131, 131, fontpage_2_131_131), // 'ă' -- 'ă'
};

View File

@@ -16,7 +16,7 @@
#include "../marlinui.h" #include "../marlinui.h"
#include "../../MarlinCore.h" #include "../../MarlinCore.h"
#include "../fontutils.h" #include "../utf8.h"
#include "u8g_fontutf8.h" #include "u8g_fontutf8.h"
#include "../lcdprint.h" #include "../lcdprint.h"

View File

@@ -47,7 +47,7 @@
#endif #endif
#include "../lcdprint.h" #include "../lcdprint.h"
#include "../fontutils.h" #include "../utf8.h"
#include "../../libs/numtostr.h" #include "../../libs/numtostr.h"
#include "../marlinui.h" #include "../marlinui.h"

View File

@@ -36,15 +36,20 @@
// RepRapWorld Graphical LCD // RepRapWorld Graphical LCD
#if HAS_MEDIA
#if !HAS_MEDIA && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) #ifdef __SAMD21__
#define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL
#else
// Hardware SPI on DUE
#define U8G_CLASS U8GLIB_ST7920_128X64_4X
#endif
#define U8G_PARAM LCD_PINS_RS
#elif (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN)
// Hardware SPI shared with SD Card
#define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL
#define U8G_PARAM LCD_PINS_RS #define U8G_PARAM LCD_PINS_RS
#elif HAS_MEDIA && __SAMD21__
#define U8G_CLASS U8GLIB_ST7920_128X64_4X
#define U8G_PARAM LCD_PINS_RS
#else #else
// Software SPI
#define U8G_CLASS U8GLIB_ST7920_128X64_4X #define U8G_CLASS U8GLIB_ST7920_128X64_4X
#define U8G_PARAM LCD_PINS_D4, LCD_PINS_EN, LCD_PINS_RS #define U8G_PARAM LCD_PINS_D4, LCD_PINS_EN, LCD_PINS_RS
#endif #endif
@@ -95,7 +100,7 @@
#define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF) #define SMART_RAMPS MB(RAMPS_SMART_EFB, RAMPS_SMART_EEB, RAMPS_SMART_EFF, RAMPS_SMART_EEF, RAMPS_SMART_SF)
#define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI) #define U8G_CLASS U8GLIB_64128N_2X_HAL // 4 stripes (HW-SPI)
#if (SMART_RAMPS && defined(__SAM3X8E__)) || DOGLCD_SCK != SD_SCK_PIN || DOGLCD_MOSI != SD_MOSI_PIN #if (SMART_RAMPS && defined(__SAM3X8E__)) || (defined(DOGLCD_SCK) && (DOGLCD_SCK != -1 && DOGLCD_SCK != SD_SCK_PIN)) || (defined(DOGLCD_MOSI) && (DOGLCD_MOSI != -1 && DOGLCD_MOSI != SD_MOSI_PIN))
#define FORCE_SOFT_SPI // SW-SPI #define FORCE_SOFT_SPI // SW-SPI
#endif #endif

View File

@@ -41,32 +41,32 @@
#ifdef STATUS_CHAMBER_ANIM #ifdef STATUS_CHAMBER_ANIM
const unsigned char status_chamber_bmp[] PROGMEM = { const unsigned char status_chamber_bmp[] PROGMEM = {
B00011111,B11111111,B11111000, B00001111,B11111111,B11111000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00011111,B11111111,B11111000, B00001111,B11111111,B11111000,
B00011111,B11111111,B11111000 B00001111,B11111111,B11111000
}; };
const unsigned char status_chamber_on_bmp[] PROGMEM = { const unsigned char status_chamber_on_bmp[] PROGMEM = {
B00011111,B11111111,B11111000, B00001111,B11111111,B11111000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00010000,B10000100,B00001000, B00001000,B10000100,B00001000,
B00010000,B01000010,B00001000, B00001000,B01000010,B00001000,
B00010000,B01000010,B00001000, B00001000,B01000010,B00001000,
B00010000,B10000100,B00001000, B00001000,B10000100,B00001000,
B00010001,B00001000,B00001000, B00001001,B00001000,B00001000,
B00010001,B00001000,B00001000, B00001001,B00001000,B00001000,
B00010000,B10000100,B00001000, B00001000,B10000100,B00001000,
B00010000,B00000000,B00001000, B00001000,B00000000,B00001000,
B00011111,B11111111,B11111000, B00001111,B11111111,B11111000,
B00011111,B11111111,B11111000 B00001111,B11111111,B11111000
}; };
#else #else

View File

@@ -96,9 +96,10 @@
DRAWBIT_HOTEND, DRAWBIT_HOTEND,
DRAWBIT_BED = HOTENDS, DRAWBIT_BED = HOTENDS,
DRAWBIT_CHAMBER, DRAWBIT_CHAMBER,
DRAWBIT_CUTTER DRAWBIT_CUTTER,
DRAWBIT_COUNT
}; };
IF<(DRAWBIT_CUTTER > 7), uint16_t, uint8_t>::type draw_bits; bits_t(DRAWBIT_COUNT) draw_bits;
#endif #endif
#if ANIM_HOTEND #if ANIM_HOTEND

View File

@@ -73,7 +73,7 @@
#if ENABLED(LIGHTWEIGHT_UI) #if ENABLED(LIGHTWEIGHT_UI)
#include "../marlinui.h" #include "../marlinui.h"
#include "../fontutils.h" #include "../utf8.h"
#include "../lcdprint.h" #include "../lcdprint.h"
#include "../../libs/duration_t.h" #include "../../libs/duration_t.h"
#include "../../module/motion.h" #include "../../module/motion.h"
@@ -680,10 +680,10 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::draw_progress_string(uint8_t addr, const char *str) { void ST7920_Lite_Status_Screen::draw_progress_string(uint8_t addr, const char *str) {
set_ddram_address(addr); set_ddram_address(addr);
begin_data(); begin_data();
write_str(str, TERN(HOTENDS == 1, 8, 6)); write_str(str, HOTENDS == 1 ? 8 : 6);
} }
#define PPOS (DDRAM_LINE_3 + TERN(HOTENDS == 1, 4, 5)) // progress string position, in 16-bit words constexpr uint8_t PPOS = (DDRAM_LINE_3 + (HOTENDS == 1 ? 4 : 5)); // Progress string position, in 16-bit words
#if ENABLED(SHOW_PROGRESS_PERCENT) #if ENABLED(SHOW_PROGRESS_PERCENT)
void MarlinUI::drawPercent() { lightUI.drawPercent(); } void MarlinUI::drawPercent() { lightUI.drawPercent(); }

View File

@@ -84,19 +84,19 @@ static const uint8_t u8g_dev_st7920_128x64_HAL_init_seq[] PROGMEM = {
void clear_graphics_DRAM(u8g_t *u8g, u8g_dev_t *dev) { void clear_graphics_DRAM(u8g_t *u8g, u8g_dev_t *dev) {
u8g_SetChipSelect(u8g, dev, 1); u8g_SetChipSelect(u8g, dev, 1);
u8g_Delay(1); u8g_Delay(1);
u8g_SetAddress(u8g, dev, 0); // cmd mode u8g_SetAddress(u8g, dev, 0); // Cmd mode
u8g_WriteByte(u8g, dev, 0x08); //display off, cursor+blink off u8g_WriteByte(u8g, dev, 0x08); // Display off, cursor+blink off
u8g_WriteByte(u8g, dev, 0x3E); //extended mode + GDRAM active u8g_WriteByte(u8g, dev, 0x3E); // Extended mode + GDRAM active
for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; ++y) { //clear GDRAM for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; ++y) { // Clear GDRAM
u8g_WriteByte(u8g, dev, 0x80 | y); //set y u8g_WriteByte(u8g, dev, 0x80 | y); // Set y
u8g_WriteByte(u8g, dev, 0x80); //set x = 0 u8g_WriteByte(u8g, dev, 0x80); // Set x = 0
u8g_SetAddress(u8g, dev, 1); /* data mode */ u8g_SetAddress(u8g, dev, 1); // Data mode
for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; ++i) //2x width clears both segments for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; ++i) // 2x width clears both segments
u8g_WriteByte(u8g, dev, 0); u8g_WriteByte(u8g, dev, 0);
u8g_SetAddress(u8g, dev, 0); /* cmd mode */ u8g_SetAddress(u8g, dev, 0); // Cmd mode
} }
u8g_WriteByte(u8g, dev, 0x0C); //display on, cursor+blink off u8g_WriteByte(u8g, dev, 0x0C); // Display on, cursor+blink off
u8g_SetChipSelect(u8g, dev, 0); u8g_SetChipSelect(u8g, dev, 0);
} }

View File

@@ -12,7 +12,7 @@
#if HAS_MARLINUI_U8GLIB #if HAS_MARLINUI_U8GLIB
#include <string.h> #include <string.h>
#include "../fontutils.h" #include "../utf8.h"
#include "u8g_fontutf8.h" #include "u8g_fontutf8.h"
typedef void font_t; typedef void font_t;

View File

@@ -9,7 +9,7 @@
#pragma once #pragma once
#include <U8glib-HAL.h> #include <U8glib-HAL.h>
#include "../fontutils.h" #include "../utf8.h"
// the macro to indicate a UTF-8 string // the macro to indicate a UTF-8 string
// You should to save the C/C++ source in UTF-8 encoding! // You should to save the C/C++ source in UTF-8 encoding!

View File

@@ -28,13 +28,15 @@ typedef uint8_t fontid_t;
* 0x00=6*12 0x01=8*16 0x02=10*20 0x03=12*24 0x04=14*28 * 0x00=6*12 0x01=8*16 0x02=10*20 0x03=12*24 0x04=14*28
* 0x05=16*32 0x06=20*40 0x07=24*48 0x08=28*56 0x09=32*64 * 0x05=16*32 0x06=20*40 0x07=24*48 0x08=28*56 0x09=32*64
*/ */
#define font6x12 0x00 #if DISABLED(TJC_DISPLAY)
#define font6x12 0x00
#define font20x40 0x06
#define font24x48 0x07
#define font28x56 0x08
#define font32x64 0x09
#endif
#define font8x16 0x01 #define font8x16 0x01
#define font10x20 0x02 #define font10x20 0x02
#define font12x24 0x03 #define font12x24 0x03
#define font14x28 0x04 #define font14x28 0x04
#define font16x32 0x05 #define font16x32 0x05
#define font20x40 0x06
#define font24x48 0x07
#define font28x56 0x08
#define font32x64 0x09

View File

@@ -87,7 +87,10 @@ EncoderState Encoder_ReceiveAnalyze() {
#if PIN_EXISTS(LCD_LED) #if PIN_EXISTS(LCD_LED)
//LED_Action(); //LED_Action();
#endif #endif
if (!ui.backlight) ui.refresh_brightness(); if (!ui.backlight) {
ui.refresh_brightness();
return ENCODER_DIFF_NO;
}
const bool was_waiting = wait_for_user; const bool was_waiting = wait_for_user;
wait_for_user = false; wait_for_user = false;
return was_waiting ? ENCODER_DIFF_NO : ENCODER_DIFF_ENTER; return was_waiting ? ENCODER_DIFF_NO : ENCODER_DIFF_ENTER;
@@ -154,6 +157,10 @@ EncoderState Encoder_ReceiveAnalyze() {
temp_diff = 0; temp_diff = 0;
} }
if (temp_diffState != ENCODER_DIFF_NO) {
TERN_(HAS_BACKLIGHT_TIMEOUT, ui.refresh_backlight_timeout());
if (!ui.backlight) ui.refresh_brightness();
}
return temp_diffState; return temp_diffState;
} }

View File

@@ -45,7 +45,7 @@ typedef enum {
ENCODER_DIFF_ENTER = 3 // click ENCODER_DIFF_ENTER = 3 // click
} EncoderState; } EncoderState;
#define ENCODER_WAIT_MS 20 #define ENCODER_WAIT_MS TERN(DWIN_LCD_PROUI, 10, 20)
// Encoder initialization // Encoder initialization
void Encoder_Configuration(); void Encoder_Configuration();

View File

@@ -45,7 +45,7 @@
#define JUST_BABYSTEP 1 #define JUST_BABYSTEP 1
#endif #endif
#include "../../fontutils.h" #include "../../utf8.h"
#include "../../marlinui.h" #include "../../marlinui.h"
#include "../../../sd/cardreader.h" #include "../../../sd/cardreader.h"
@@ -1273,7 +1273,7 @@ void Goto_MainMenu() {
DWIN_Frame_TitleCopy(2, 2, 26, 13); // "Home" etc DWIN_Frame_TitleCopy(2, 2, 26, 13); // "Home" etc
else { else {
#ifdef USE_STRING_HEADINGS #ifdef USE_STRING_HEADINGS
Draw_Title(GET_TEXT_F(MSG_MAIN)); Draw_Title(GET_TEXT_F(MSG_MAIN_MENU));
#else #else
DWIN_Frame_TitleCopy(0, 2, 40, 11); // "Home" DWIN_Frame_TitleCopy(0, 2, 40, 11); // "Home"
#endif #endif

View File

@@ -96,7 +96,7 @@
#define MENU_CHAR_LIMIT 24 #define MENU_CHAR_LIMIT 24
#define STATUS_Y 352 #define STATUS_Y 352
#define MAX_PRINT_SPEED 500 #define MAX_PRINT_SPEED 999
#define MIN_PRINT_SPEED 10 #define MIN_PRINT_SPEED 10
#if HAS_FAN #if HAS_FAN
@@ -116,7 +116,7 @@
#endif #endif
#if HAS_HOTEND #if HAS_HOTEND
#define MAX_FLOW_RATE 200 #define MAX_FLOW_RATE 299
#define MIN_FLOW_RATE 10 #define MIN_FLOW_RATE 10
#define MAX_E_TEMP (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT) #define MAX_E_TEMP (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT)
@@ -203,7 +203,7 @@ bool livemove = false;
bool liveadjust = false; bool liveadjust = false;
uint8_t preheatmode = 0; uint8_t preheatmode = 0;
float zoffsetvalue = 0; float zoffsetvalue = 0;
uint8_t gridpoint; grid_count_t gridpoint;
float corner_avg; float corner_avg;
float corner_pos; float corner_pos;
@@ -416,7 +416,7 @@ private:
// Draw value text on // Draw value text on
if (viewer_print_value) { if (viewer_print_value) {
int8_t offset_x, offset_y = cell_height_px / 2 - 6; const int8_t offset_y = cell_height_px / 2 - 6;
if (isnan(bedlevel.z_values[x][y])) { // undefined if (isnan(bedlevel.z_values[x][y])) { // undefined
DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X"));
} }
@@ -425,7 +425,7 @@ private:
sprintf_P(buf, PSTR("%s"), dtostrf(abs(bedlevel.z_values[x][y]), 1, 2, str_1)); sprintf_P(buf, PSTR("%s"), dtostrf(abs(bedlevel.z_values[x][y]), 1, 2, str_1));
else else
sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(bedlevel.z_values[x][y] - (int16_t)bedlevel.z_values[x][y]) * 100)); sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(bedlevel.z_values[x][y] - (int16_t)bedlevel.z_values[x][y]) * 100));
offset_x = cell_width_px / 2 - 3 * (strlen(buf)) - 2; const int8_t offset_x = cell_width_px / 2 - 3 * (strlen(buf)) - 2;
if (!(GRID_MAX_POINTS_X < 10)) if (!(GRID_MAX_POINTS_X < 10))
DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F(".")); DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F("."));
DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + 1 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, buf); DWIN_Draw_String(false, font6x12, Color_White, Color_Bg_Blue, start_x_px + 1 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, buf);
@@ -810,8 +810,8 @@ void CrealityDWINClass::Draw_SD_Item(const uint8_t item, const uint8_t row) {
else { else {
card.selectFileByIndexSorted(item - 1); card.selectFileByIndexSorted(item - 1);
char * const filename = card.longest_filename(); char * const filename = card.longest_filename();
size_t max = MENU_CHAR_LIMIT; constexpr uint8_t max = MENU_CHAR_LIMIT;
size_t pos = strlen(filename), len = pos; uint8_t pos = strlen(filename), len = pos;
if (!card.flag.filenameIsDir) if (!card.flag.filenameIsDir)
while (pos && filename[pos] != '.') pos--; while (pos && filename[pos] != '.') pos--;
len = pos; len = pos;
@@ -832,7 +832,7 @@ void CrealityDWINClass::Draw_SD_List(const bool removed/*=false*/) {
scrollpos = 0; scrollpos = 0;
process = File; process = File;
if (card.isMounted() && !removed) { if (card.isMounted() && !removed) {
for (uint8_t i = 0; i < _MIN(card.get_num_Files() + 1, TROWS); ++i) for (int16_t i = 0; i < _MIN(card.get_num_items() + 1, TROWS); ++i)
Draw_SD_Item(i, i); Draw_SD_Item(i, i);
} }
else { else {

View File

@@ -25,7 +25,7 @@
#if IS_DWIN_MARLINUI #if IS_DWIN_MARLINUI
#include "dwin_string.h" #include "dwin_string.h"
//#include "../../fontutils.h" //#include "../../utf8.h"
char DWIN_String::data[]; char DWIN_String::data[];
uint16_t DWIN_String::span; uint16_t DWIN_String::span;
@@ -44,7 +44,7 @@ uint8_t read_byte(const uint8_t *byte) { return *byte; }
* Add a string, applying substitutions for the following characters: * Add a string, applying substitutions for the following characters:
* *
* $ displays the clipped string given by fstr or cstr * $ displays the clipped string given by fstr or cstr
* = displays '0'....'10' for indexes 0 - 10 * { displays '0'....'10' for indexes 0 - 10
* ~ displays '1'....'11' for indexes 0 - 10 * ~ displays '1'....'11' for indexes 0 - 10
* * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL)
* @ displays an axis name such as XYZUVW, or E for an extruder * @ displays an axis name such as XYZUVW, or E for an extruder
@@ -57,9 +57,9 @@ void DWIN_String::add(const char *tpl, const int8_t index, const char *cstr/*=nu
if (wc > 255) wc |= 0x0080; if (wc > 255) wc |= 0x0080;
const uint8_t ch = uint8_t(wc & 0x00FF); const uint8_t ch = uint8_t(wc & 0x00FF);
if (ch == '=' || ch == '~' || ch == '*') { if (ch == '{' || ch == '~' || ch == '*') {
if (index >= 0) { if (index >= 0) {
int8_t inum = index + ((ch == '=') ? 0 : LCD_FIRST_TOOL); int8_t inum = index + ((ch == '{') ? 0 : LCD_FIRST_TOOL);
if (ch == '*') add_character('E'); if (ch == '*') add_character('E');
if (inum >= 10) { add_character('0' + (inum / 10)); inum %= 10; } if (inum >= 10) { add_character('0' + (inum / 10)); inum %= 10; }
add_character('0' + inum); add_character('0' + inum);

View File

@@ -23,7 +23,7 @@
// TODO: Make AVR-compatible with separate ROM / RAM string methods // TODO: Make AVR-compatible with separate ROM / RAM string methods
#include "../../fontutils.h" #include "../../utf8.h"
#include "../../marlinui.h" #include "../../marlinui.h"
#include <stdint.h> #include <stdint.h>

View File

@@ -30,7 +30,7 @@
//#include "../../lcdprint.h" //#include "../../lcdprint.h"
#include "lcdprint_dwin.h" #include "lcdprint_dwin.h"
#include "../../fontutils.h" #include "../../utf8.h"
#include "../../../libs/numtostr.h" #include "../../../libs/numtostr.h"
#include "../../marlinui.h" #include "../../marlinui.h"

View File

@@ -29,7 +29,7 @@
#include "dwin_string.h" #include "dwin_string.h"
#include "lcdprint_dwin.h" #include "lcdprint_dwin.h"
#include "../../fontutils.h" #include "../../utf8.h"
#include "../../../libs/numtostr.h" #include "../../../libs/numtostr.h"
#include "../../marlinui.h" #include "../../marlinui.h"

View File

@@ -62,7 +62,7 @@
#warning "MESH_EDIT_MENU is recommended with ProUI." #warning "MESH_EDIT_MENU is recommended with ProUI."
#endif #endif
#include "../../fontutils.h" #include "../../utf8.h"
#include "../../marlinui.h" #include "../../marlinui.h"
#include "../../../sd/cardreader.h" #include "../../../sd/cardreader.h"
@@ -1003,10 +1003,9 @@ void Draw_Print_File_Menu() {
if (card.isMounted()) { if (card.isMounted()) {
if (SET_MENU(FileMenu, MSG_MEDIA_MENU, nr_sd_menu_items() + 1)) { if (SET_MENU(FileMenu, MSG_MEDIA_MENU, nr_sd_menu_items() + 1)) {
BACK_ITEM(Goto_Main_Menu); BACK_ITEM(Goto_Main_Menu);
for (uint8_t i = 0; i < nr_sd_menu_items(); ++i) { for (uint8_t i = 0; i < nr_sd_menu_items(); ++i)
MenuItemAdd(onDrawFileName, onClickSDItem); MenuItemAdd(onDrawFileName, onClickSDItem);
} }
}
UpdateMenu(FileMenu); UpdateMenu(FileMenu);
TERN_(DASH_REDRAW, DWIN_RedrawDash()); TERN_(DASH_REDRAW, DWIN_RedrawDash());
} }

View File

@@ -19,6 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once
/** /**
* DWIN general defines and data structs for PRO UI * DWIN general defines and data structs for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC) * Author: Miguel A. Risco-Castillo (MRISCOC)
@@ -26,8 +28,6 @@
* Date: 2022/08/08 * Date: 2022/08/08
*/ */
#pragma once
//#define DEBUG_DWIN 1 //#define DEBUG_DWIN 1
//#define NEED_HEX_PRINT 1 //#define NEED_HEX_PRINT 1

View File

@@ -19,6 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once
/** /**
* DWIN Enhanced implementation for PRO UI * DWIN Enhanced implementation for PRO UI
@@ -27,8 +28,6 @@
* Date: 2022/07/05 * Date: 2022/07/05
*/ */
#pragma once
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#include "../common/dwin_set.h" #include "../common/dwin_set.h"

View File

@@ -21,7 +21,7 @@
*/ */
/** /**
* DWIN g-code thumbnail preview * DWIN G-code thumbnail preview
* Author: Miguel A. Risco-Castillo * Author: Miguel A. Risco-Castillo
* version: 3.1.2 * version: 3.1.2
* Date: 2022/09/03 * Date: 2022/09/03

View File

@@ -1,12 +1,13 @@
/** /**
* DWIN g-code thumbnail preview * Marlin 3D Printer Firmware
* Author: Miguel A. Risco-Castillo * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* version: 3.1.2 *
* Date: 2022/09/03 * Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU General Public License as published by
* published by the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@@ -14,14 +15,19 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* For commercial applications additional licenses can be requested
*/ */
#pragma once #pragma once
/**
* DWIN G-code thumbnail preview
* Author: Miguel A. Risco-Castillo
* version: 3.1.2
* Date: 2022/09/03
*/
void Preview_DrawFromSD(); void Preview_DrawFromSD();
void Preview_Invalidate(); void Preview_Invalidate();
bool Preview_Valid(); bool Preview_Valid();

View File

@@ -19,6 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
#pragma once
/** /**
* DWIN Single var plot * DWIN Single var plot
@@ -41,7 +42,6 @@
* *
* For commercial applications additional licenses can be requested * For commercial applications additional licenses can be requested
*/ */
#pragma once
#include "dwinui.h" #include "dwinui.h"

View File

@@ -49,7 +49,7 @@ namespace ExtUI {
void onMediaError() { Chiron.MediaEvent(AC_media_error); } void onMediaError() { Chiron.MediaEvent(AC_media_error); }
void onMediaRemoved() { Chiron.MediaEvent(AC_media_removed); } void onMediaRemoved() { Chiron.MediaEvent(AC_media_removed); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) { void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
#if ENABLED(SPEAKER) #if ENABLED(SPEAKER)
::tone(BEEPER_PIN, frequency, duration); ::tone(BEEPER_PIN, frequency, duration);
#endif #endif
@@ -94,20 +94,22 @@ namespace ExtUI {
// Called after loading or resetting stored settings // Called after loading or resetting stored settings
} }
void onSettingsStored(bool success) { void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written, // Called after the entire EEPROM has been written,
// whether successful or not. // whether successful or not.
} }
void onSettingsLoaded(bool success) { void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read, // Called after the entire EEPROM has been read,
// whether successful or not. // whether successful or not.
} }
#if HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
#endif
#if HAS_MESH
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
//SERIAL_ECHOLNPGM("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval); //SERIAL_ECHOLNPGM("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
@@ -120,6 +122,12 @@ namespace ExtUI {
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
// Called on resume from power-loss // Called on resume from power-loss
void onPowerLossResume() { Chiron.PowerLossRecovery(); } void onPowerLossResume() { Chiron.PowerLossRecovery(); }
#endif #endif

View File

@@ -41,7 +41,7 @@ namespace ExtUI {
void onMediaInserted() { AnycubicTFT.OnSDCardStateChange(true); } void onMediaInserted() { AnycubicTFT.OnSDCardStateChange(true); }
void onMediaError() { AnycubicTFT.OnSDCardError(); } void onMediaError() { AnycubicTFT.OnSDCardError(); }
void onMediaRemoved() { AnycubicTFT.OnSDCardStateChange(false); } void onMediaRemoved() { AnycubicTFT.OnSDCardStateChange(false); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) { void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration)); TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration));
} }
void onPrintTimerStarted() { AnycubicTFT.OnPrintTimerStarted(); } void onPrintTimerStarted() { AnycubicTFT.OnPrintTimerStarted(); }
@@ -81,21 +81,22 @@ namespace ExtUI {
// Called after loading or resetting stored settings // Called after loading or resetting stored settings
} }
void onSettingsStored(bool success) { void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written, // Called after the entire EEPROM has been written,
// whether successful or not. // whether successful or not.
} }
void onSettingsLoaded(bool success) { void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read, // Called after the entire EEPROM has been read,
// whether successful or not. // whether successful or not.
} }
#if HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
#endif
#if HAS_MESH
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
} }
@@ -106,6 +107,12 @@ namespace ExtUI {
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() { void onPowerLossResume() {
// Called on resume from power-loss // Called on resume from power-loss
} }

View File

@@ -227,7 +227,7 @@ void DGUSDisplay::ProcessRx() {
} }
} }
size_t DGUSDisplay::GetFreeTxBuffer() { return SERIAL_GET_TX_BUFFER_FREE(); } size_t DGUSDisplay::GetFreeTxBuffer() { return LCD_SERIAL_TX_BUFFER_FREE(); }
void DGUSDisplay::WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen) { void DGUSDisplay::WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen) {
LCD_SERIAL.write(DGUS_HEADER1); LCD_SERIAL.write(DGUS_HEADER1);

View File

@@ -52,7 +52,7 @@ namespace ExtUI {
void onMediaError() { TERN_(HAS_MEDIA, ScreenHandler.SDCardError()); } void onMediaError() { TERN_(HAS_MEDIA, ScreenHandler.SDCardError()); }
void onMediaRemoved() { TERN_(HAS_MEDIA, ScreenHandler.SDCardRemoved()); } void onMediaRemoved() { TERN_(HAS_MEDIA, ScreenHandler.SDCardRemoved()); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {}
void onPrintTimerStarted() {} void onPrintTimerStarted() {}
void onPrintTimerPaused() {} void onPrintTimerPaused() {}
void onPrintTimerStopped() {} void onPrintTimerStopped() {}
@@ -102,20 +102,22 @@ namespace ExtUI {
// Called after loading or resetting stored settings // Called after loading or resetting stored settings
} }
void onSettingsStored(bool success) { void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written, // Called after the entire EEPROM has been written,
// whether successful or not. // whether successful or not.
} }
void onSettingsLoaded(bool success) { void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read, // Called after the entire EEPROM has been read,
// whether successful or not. // whether successful or not.
} }
#if HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
#endif
#if HAS_MESH
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
} }
@@ -126,6 +128,12 @@ namespace ExtUI {
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() { void onPowerLossResume() {
// Called on resume from power-loss // Called on resume from power-loss
IF_DISABLED(DGUS_LCD_UI_MKS, ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POWER_LOSS)); IF_DISABLED(DGUS_LCD_UI_MKS, ScreenHandler.GotoScreen(DGUSLCD_SCREEN_POWER_LOSS));

View File

@@ -190,7 +190,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) { if (!movevalue) {
// homing // homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" homing ", C(axiscode));
char buf[6] = "G28 X"; char buf[6] = "G28 X";
buf[4] = axiscode; buf[4] = axiscode;
//DEBUG_ECHOPGM(" ", buf); //DEBUG_ECHOPGM(" ", buf);
@@ -201,7 +201,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
} }
else { else {
// movement // movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" move ", C(axiscode));
bool old_relative_mode = relative_mode; bool old_relative_mode = relative_mode;
if (!relative_mode) { if (!relative_mode) {
//DEBUG_ECHOPGM(" G91"); //DEBUG_ECHOPGM(" G91");
@@ -237,7 +237,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
return; return;
cannotmove: cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); DEBUG_ECHOLNPGM(" cannot move ", C(axiscode));
return; return;
} }

View File

@@ -190,7 +190,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) { if (!movevalue) {
// homing // homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" homing ", C(axiscode));
char buf[6] = "G28 X"; char buf[6] = "G28 X";
buf[4] = axiscode; buf[4] = axiscode;
//DEBUG_ECHOPGM(" ", buf); //DEBUG_ECHOPGM(" ", buf);
@@ -201,7 +201,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
} }
else { else {
// movement // movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" move ", C(axiscode));
bool old_relative_mode = relative_mode; bool old_relative_mode = relative_mode;
if (!relative_mode) { if (!relative_mode) {
//DEBUG_ECHOPGM(" G91"); //DEBUG_ECHOPGM(" G91");
@@ -237,7 +237,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
return; return;
cannotmove: cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); DEBUG_ECHOLNPGM(" cannot move ", C(axiscode));
return; return;
} }

View File

@@ -429,7 +429,7 @@ void DGUSScreenHandlerMKS::LanguageChange(DGUS_VP_Variable &var, void *val_ptr)
} }
#if ENABLED(MESH_BED_LEVELING) #if ENABLED(MESH_BED_LEVELING)
uint8_t mesh_point_count = GRID_MAX_POINTS; grid_count_t mesh_point_count = GRID_MAX_POINTS;
#endif #endif
void DGUSScreenHandlerMKS::Level_Ctrl(DGUS_VP_Variable &var, void *val_ptr) { void DGUSScreenHandlerMKS::Level_Ctrl(DGUS_VP_Variable &var, void *val_ptr) {
@@ -825,7 +825,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) { if (!movevalue) {
// homing // homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" homing ", C(axiscode));
// char buf[6] = "G28 X"; // char buf[6] = "G28 X";
// buf[4] = axiscode; // buf[4] = axiscode;
@@ -847,7 +847,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
} }
else { else {
// movement // movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" move ", C(axiscode));
bool old_relative_mode = relative_mode; bool old_relative_mode = relative_mode;
if (!relative_mode) { if (!relative_mode) {
@@ -885,7 +885,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
return; return;
cannotmove: cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); DEBUG_ECHOLNPGM(" cannot move ", C(axiscode));
return; return;
} }

View File

@@ -190,7 +190,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
if (!movevalue) { if (!movevalue) {
// homing // homing
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" homing ", C(axiscode));
char buf[6] = "G28 X"; char buf[6] = "G28 X";
buf[4] = axiscode; buf[4] = axiscode;
//DEBUG_ECHOPGM(" ", buf); //DEBUG_ECHOPGM(" ", buf);
@@ -201,7 +201,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
} }
else { else {
// movement // movement
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode)); DEBUG_ECHOPGM(" move ", C(axiscode));
bool old_relative_mode = relative_mode; bool old_relative_mode = relative_mode;
if (!relative_mode) { if (!relative_mode) {
//DEBUG_ECHOPGM(" G91"); //DEBUG_ECHOPGM(" G91");
@@ -237,7 +237,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
return; return;
cannotmove: cannotmove:
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode)); DEBUG_ECHOLNPGM(" cannot move ", C(axiscode));
return; return;
} }

View File

@@ -366,8 +366,8 @@ void DGUSDisplay::ProcessRx() {
} }
size_t DGUSDisplay::GetFreeTxBuffer() { size_t DGUSDisplay::GetFreeTxBuffer() {
#ifdef LCD_SERIAL_GET_TX_BUFFER_FREE #ifdef LCD_SERIAL_TX_BUFFER_FREE
return LCD_SERIAL_GET_TX_BUFFER_FREE(); return LCD_SERIAL_TX_BUFFER_FREE();
#else #else
return SIZE_MAX; return SIZE_MAX;
#endif #endif

View File

@@ -138,7 +138,7 @@ void DGUSScreenHandler::Loop() {
if (current_screen == DGUS_Screen::LEVELING_PROBING && IsPrinterIdle()) { if (current_screen == DGUS_Screen::LEVELING_PROBING && IsPrinterIdle()) {
dgus_display.PlaySound(3); dgus_display.PlaySound(3);
SetStatusMessage(ExtUI::getMeshValid() ? F("Probing successful") : F("Probing failed")); SetStatusMessage(ExtUI::getLevelingIsValid() ? F("Probing successful") : F("Probing failed"));
MoveToScreen(DGUS_Screen::LEVELING_AUTOMATIC); MoveToScreen(DGUS_Screen::LEVELING_AUTOMATIC);
return; return;
@@ -200,7 +200,7 @@ void DGUSScreenHandler::StoreSettings(char *buff) {
data.initialized = true; data.initialized = true;
data.volume = dgus_display.GetVolume(); data.volume = dgus_display.GetVolume();
data.brightness = dgus_display.GetBrightness(); data.brightness = dgus_display.GetBrightness();
data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getMeshValid()); data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getLevelingIsValid());
memcpy(buff, &data, sizeof(data)); memcpy(buff, &data, sizeof(data));
} }
@@ -216,7 +216,7 @@ void DGUSScreenHandler::LoadSettings(const char *buff) {
dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS); dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS);
if (data.initialized) { if (data.initialized) {
leveling_active = (data.abl_okay && ExtUI::getMeshValid()); leveling_active = (data.abl_okay && ExtUI::getLevelingIsValid());
ExtUI::setLevelingActive(leveling_active); ExtUI::setLevelingActive(leveling_active);
} }
} }
@@ -257,7 +257,7 @@ void DGUSScreenHandler::MeshUpdate(const int8_t xpos, const int8_t ypos) {
uint8_t point = ypos * GRID_MAX_POINTS_X + xpos; uint8_t point = ypos * GRID_MAX_POINTS_X + xpos;
probing_icons[point < 16 ? 0 : 1] |= (1U << (point % 16)); probing_icons[point < 16 ? 0 : 1] |= (1U << (point % 16));
if (xpos >= GRID_MAX_POINTS_X - 1 && ypos >= GRID_MAX_POINTS_Y - 1 && !ExtUI::getMeshValid()) if (xpos >= GRID_MAX_POINTS_X - 1 && ypos >= GRID_MAX_POINTS_Y - 1 && !ExtUI::getLevelingIsValid())
probing_icons[0] = probing_icons[1] = 0; probing_icons[0] = probing_icons[1] = 0;
TriggerFullUpdate(); TriggerFullUpdate();

View File

@@ -148,7 +148,7 @@ bool DGUSSetupHandler::LevelingOffset() {
} }
bool DGUSSetupHandler::LevelingAutomatic() { bool DGUSSetupHandler::LevelingAutomatic() {
if (ExtUI::getMeshValid()) { if (ExtUI::getLevelingIsValid()) {
dgus_screen_handler.leveling_active = true; dgus_screen_handler.leveling_active = true;
ExtUI::setLevelingActive(true); ExtUI::setLevelingActive(true);

View File

@@ -21,19 +21,19 @@
*/ */
#pragma once #pragma once
constexpr uint8_t DGUS_LINE_LEN = 32; #define DGUS_LINE_LEN 32
constexpr uint8_t DGUS_STATUS_LEN = 32; #define DGUS_STATUS_LEN 32
constexpr uint8_t DGUS_FILE_COUNT = 5; #define DGUS_FILE_COUNT 5
constexpr uint8_t DGUS_FILENAME_LEN = 32; #define DGUS_FILENAME_LEN 32
constexpr uint8_t DGUS_ELLAPSED_LEN = 15; #define DGUS_ELAPSED_LEN 15
constexpr uint8_t DGUS_LEVEL_GRID_SIZE = 25; #define DGUS_LEVEL_GRID_SIZE 25
constexpr uint8_t DGUS_MACHINE_LEN = 24; #define DGUS_MACHINE_LEN 24
constexpr uint8_t DGUS_BUILDVOLUME_LEN = 24; #define DGUS_BUILDVOLUME_LEN 24
constexpr uint8_t DGUS_VERSION_LEN = 16; #define DGUS_VERSION_LEN 16
constexpr uint8_t DGUS_PRINTTIME_LEN = 24; #define DGUS_PRINTTIME_LEN 24
constexpr uint8_t DGUS_LONGESTPRINT_LEN = 24; #define DGUS_LONGESTPRINT_LEN 24
constexpr uint8_t DGUS_FILAMENTUSED_LEN = 24; #define DGUS_FILAMENTUSED_LEN 24
constexpr uint8_t DGUS_GCODE_LEN = 32; #define DGUS_GCODE_LEN 32
enum class DGUS_Addr : uint16_t { enum class DGUS_Addr : uint16_t {
MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F

View File

@@ -25,7 +25,9 @@
#include "DGUS_Addr.h" #include "DGUS_Addr.h"
static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), "DGUS_LEVEL_GRID_SIZE incompatible with current mesh."); #if DGUS_LEVEL_GRID_SIZE != GRID_MAX_POINTS
#error "DGUS_LEVEL_GRID_SIZE is incompatible with current mesh."
#endif
#ifndef DGUS_DEFAULT_VOLUME #ifndef DGUS_DEFAULT_VOLUME
#define DGUS_DEFAULT_VOLUME 50 #define DGUS_DEFAULT_VOLUME 50

View File

@@ -178,7 +178,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
nullptr, nullptr,
&DGUSTxHandler::PositionZ), &DGUSTxHandler::PositionZ),
VP_HELPER(DGUS_Addr::STATUS_Ellapsed, VP_HELPER(DGUS_Addr::STATUS_Ellapsed,
DGUS_ELLAPSED_LEN, DGUS_ELAPSED_LEN,
VPFLAG_AUTOUPLOAD, VPFLAG_AUTOUPLOAD,
nullptr, nullptr,
nullptr, nullptr,

View File

@@ -54,7 +54,7 @@ namespace ExtUI {
void onMediaError() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardError()); } void onMediaError() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardError()); }
void onMediaRemoved() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardRemoved()); } void onMediaRemoved() { TERN_(HAS_MEDIA, dgus_screen_handler.SDCardRemoved()); }
void onPlayTone(const uint16_t frequency, const uint16_t duration) { void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
dgus_screen_handler.PlayTone(frequency, duration); dgus_screen_handler.PlayTone(frequency, duration);
} }
@@ -100,18 +100,20 @@ namespace ExtUI {
void onPostprocessSettings() {} void onPostprocessSettings() {}
void onSettingsStored(bool success) { void onSettingsStored(const bool success) {
dgus_screen_handler.ConfigurationStoreWritten(success); dgus_screen_handler.ConfigurationStoreWritten(success);
} }
void onSettingsLoaded(bool success) { void onSettingsLoaded(const bool success) {
dgus_screen_handler.ConfigurationStoreRead(success); dgus_screen_handler.ConfigurationStoreRead(success);
} }
#if HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
#endif
#if HAS_MESH
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
dgus_screen_handler.MeshUpdate(xpos, ypos); dgus_screen_handler.MeshUpdate(xpos, ypos);
} }
@@ -123,6 +125,12 @@ namespace ExtUI {
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() { void onPowerLossResume() {
// Called on resume from power-loss // Called on resume from power-loss
dgus_screen_handler.PowerLossResume(); dgus_screen_handler.PowerLossResume();

View File

@@ -50,7 +50,7 @@ namespace ExtUI {
void onMediaInserted() {} void onMediaInserted() {}
void onMediaError() {} void onMediaError() {}
void onMediaRemoved() {} void onMediaRemoved() {}
void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {}
void onPrintTimerStarted() {} void onPrintTimerStarted() {}
void onPrintTimerPaused() {} void onPrintTimerPaused() {}
void onPrintTimerStopped() {} void onPrintTimerStopped() {}
@@ -88,20 +88,22 @@ namespace ExtUI {
// Called after loading or resetting stored settings // Called after loading or resetting stored settings
} }
void onSettingsStored(bool success) { void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written, // Called after the entire EEPROM has been written,
// whether successful or not. // whether successful or not.
} }
void onSettingsLoaded(bool success) { void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read, // Called after the entire EEPROM has been read,
// whether successful or not. // whether successful or not.
} }
#if HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
#endif
#if HAS_MESH
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) { void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
// Called when any mesh points are updated // Called when any mesh points are updated
} }
@@ -112,6 +114,12 @@ namespace ExtUI {
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() { void onPowerLossResume() {
// Called on resume from power-loss // Called on resume from power-loss
} }

View File

@@ -43,7 +43,7 @@ void MainMenu::onRedraw(draw_mode_t what) {
if (what & FOREGROUND) { if (what & FOREGROUND) {
CommandProcessor cmd; CommandProcessor cmd;
cmd.cmd(COLOR_RGB(bg_text_enabled)) cmd.cmd(COLOR_RGB(bg_text_enabled))
.font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_MAIN)) .font(font_large).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_MAIN_MENU))
.colors(normal_btn) .colors(normal_btn)
.font(font_medium) .font(font_medium)
.tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME)) .tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME))

View File

@@ -0,0 +1,133 @@
/****************************************************************************
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <http://www.gnu.org/licenses/>. *
****************************************************************************/
/**
* This file was auto-generated using "svg2cpp.pl"
*
* The encoding consists of x,y pairs with the min and max scaled to
* 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the
* start of a new closed path.
*/
#pragma once
constexpr float x_min = 0.000000;
constexpr float x_max = 480.000000;
constexpr float y_min = 0.000000;
constexpr float y_max = 272.000000;
const PROGMEM uint16_t outline[] = {
0x8278, 0xC8E7, 0x7714, 0xC659, 0x6D20, 0xC0EF, 0x64D1, 0xB8D4, 0x5E5F, 0xAE2F,
0x5AF5, 0xA493, 0x58F2, 0x99F6, 0x5886, 0x8B4E, 0x590F, 0x7956, 0x5997, 0x69F3,
0x5B46, 0x5E96, 0x5E92, 0x5430, 0x6363, 0x4AF8, 0x69A4, 0x4327, 0x6F5B, 0x3E4A,
0x7871, 0x3979, 0x82A1, 0x371E, 0x8CBB, 0x3756, 0x95A1, 0x3997, 0x9D90, 0x3D88,
0xA50B, 0x43B6, 0xA6BC, 0x46C9, 0xA776, 0x4A42, 0xA669, 0x6D96, 0xA54B, 0x71E5,
0xA030, 0x7B45, 0x9ECB, 0x7CC5, 0x9B2C, 0x7E1D, 0x9717, 0x7C80, 0x9521, 0x7B11,
0x8FAD, 0x77D6, 0x8A1D, 0x7607, 0x82E0, 0x7609, 0x7CDD, 0x7812, 0x77F3, 0x7C15,
0x75EF, 0x7EC5, 0x7830, 0x8278, 0x7D94, 0x8772, 0x847F, 0x8A0B, 0x8B98, 0x89F7,
0x9127, 0x8806, 0x96AB, 0x849C, 0x9C6D, 0x81F2, 0x9F8E, 0x82E5, 0xA22C, 0x85FF,
0xA63C, 0x8D9E, 0xA78B, 0x931F, 0xA68F, 0xB5E2, 0xA5D0, 0xB944, 0xA430, 0xBC3E,
0x9E55, 0xC146, 0x94CA, 0xC660, 0x8A75, 0xC8DB, 0x8278, 0xC8E7, 0x8278, 0xC8E7
};
const PROGMEM uint16_t shadow[] = {
0x8699, 0x52F4, 0x807A, 0x5409, 0x7A89, 0x576A, 0x7583, 0x5D79, 0x7227, 0x6695,
0x714B, 0x70C7, 0x71C8, 0x75DB, 0x730A, 0x7A69, 0x7496, 0x7A0E, 0x7601, 0x787F,
0x78EF, 0x7565, 0x80E9, 0x7178, 0x8924, 0x7108, 0x914E, 0x7393, 0x9914, 0x789A,
0x9B62, 0x792D, 0x9D8A, 0x7823, 0xA0FE, 0x72DA, 0xA34C, 0x6DC9, 0xA3D7, 0x6766,
0xA42B, 0x5E98, 0xA3FD, 0x55F8, 0xA279, 0x55CE, 0xA12E, 0x578E, 0x9FE2, 0x59BB,
0x9E59, 0x5AD8, 0x9AAC, 0x5AE1, 0x9728, 0x58ED, 0x9019, 0x54A3, 0x8699, 0x52F4,
0x8699, 0x52F4, 0xFFFF, 0x5CA3, 0x849F, 0x5B93, 0x8686, 0x5B52, 0x896F, 0x5B3F,
0x8FA9, 0x5C60, 0x9D67, 0x6003, 0xA994, 0x6582, 0xB393, 0x6C3B, 0xBAC7, 0x7604,
0xC0E2, 0x8047, 0xC3D1, 0x8AB3, 0xC3DC, 0x94FB, 0xC14A, 0x9C85, 0xBD52, 0xA35D,
0xB6C2, 0xA41B, 0xABC2, 0xA460, 0xA092, 0xA416, 0x9C7C, 0xA33E, 0x9B91, 0xA20E,
0x9C3C, 0x9618, 0xA353, 0x8992, 0xA62E, 0x7CED, 0xA4E9, 0x7097, 0x9FA2, 0x6ADE,
0x9B4F, 0x65A4, 0x9557, 0x6117, 0x8DDF, 0x5D63, 0x850D, 0x5CA3, 0x849F, 0x5CA3,
0x849F
};
const PROGMEM uint16_t highlight[] = {
0x861C, 0x5348, 0x8243, 0x53C6, 0x7EBF, 0x5693, 0x7C12, 0x5B55, 0x7ABE, 0x61B3,
0x7AFC, 0x6656, 0x7C42, 0x6A49, 0x7FB1, 0x7163, 0x862A, 0x7090, 0x8C99, 0x717A,
0x92E2, 0x740A, 0x98E8, 0x782A, 0x9AB3, 0x7852, 0x9C22, 0x7665, 0x9E0C, 0x7087,
0x9E69, 0x65BE, 0x9C07, 0x5BDE, 0x9319, 0x568D, 0x8E92, 0x544E, 0x89E2, 0x534D,
0x861C, 0x5348, 0x861C, 0x5348, 0xFFFF, 0x6B6A, 0x9CA0, 0x69D9, 0x9F11, 0x695E,
0xA2AD, 0x6A25, 0xAA51, 0x6DB0, 0xBBAA, 0x785A, 0xC170, 0x8372, 0xC3D0, 0x8E9F,
0xC2E2, 0x9987, 0xBEBD, 0x9CAB, 0xBCE9, 0x9EFE, 0xB9D2, 0x9E63, 0xB379, 0x9CE9,
0xAD92, 0x98DE, 0xA2B8, 0x8D7F, 0xA5FA, 0x81FE, 0xA636, 0x76A6, 0xA32E, 0x6BC5,
0x9CA0, 0x6B6A, 0x9CA0, 0x6B6A, 0x9CA0
};
const PROGMEM uint16_t stroke[] = {
0x8282, 0xC890, 0x7A14, 0xC6FB, 0x7257, 0xC3D9, 0x6B6A, 0xBF38, 0x6569, 0xB928,
0x5E84, 0xADEC, 0x5B1E, 0xA460, 0x5926, 0x99F8, 0x58A5, 0x90C0, 0x59B6, 0x6B3D,
0x5B4C, 0x5F6C, 0x5EA3, 0x549E, 0x63A2, 0x4B13, 0x6A2E, 0x430B, 0x71D8, 0x3D0C,
0x7A7A, 0x3923, 0x83D5, 0x3761, 0x8DAA, 0x37DB, 0x98A8, 0x3B38, 0xA283, 0x4193,
0xA638, 0x4620, 0xA741, 0x4B64, 0xA6C5, 0x5D20, 0xA613, 0x6E81, 0xA43A, 0x738A,
0xA01F, 0x7AE8, 0x9DE9, 0x7D0E, 0x9B69, 0x7DBD, 0x9629, 0x7B6D, 0x905C, 0x77C9,
0x8A94, 0x75BF, 0x8402, 0x7587, 0x7E52, 0x76FE, 0x79CA, 0x79CE, 0x75B1, 0x7EC7,
0x780B, 0x82C0, 0x7C5E, 0x8702, 0x8193, 0x89A9, 0x8702, 0x8AA4, 0x8C76, 0x8A18,
0x91F2, 0x8803, 0x977B, 0x8464, 0x9C8C, 0x825E, 0x9EAF, 0x82C4, 0xA0FC, 0x84BC,
0xA3C6, 0x8965, 0xA6CF, 0x8FEF, 0xA756, 0x9463, 0xA6DA, 0xA612, 0xA5DF, 0xB86B,
0xA414, 0xBBE7, 0xA03D, 0xBF7C, 0x9648, 0xC56A, 0x8B45, 0xC86E, 0x8282, 0xC890,
0x8282, 0xC890, 0xFFFF, 0x89EE, 0xC221, 0x9395, 0xBFE8, 0x9C6D, 0xBB4F, 0xA047,
0xB837, 0xA298, 0xB561, 0xA30A, 0xAA1F, 0xA34B, 0x9D6D, 0xA204, 0x9E54, 0x9820,
0xA474, 0x960F, 0xA542, 0x886E, 0xA808, 0x803F, 0xA783, 0x785E, 0xA57C, 0x703C,
0xA168, 0x691E, 0x9BB9, 0x623D, 0x92BA, 0x5D27, 0x8795, 0x5C9D, 0x868D, 0x5C4D,
0x90BE, 0x5DBC, 0x9E89, 0x6126, 0xA944, 0x6630, 0xB207, 0x6CB0, 0xB914, 0x6E6F,
0xBA8C, 0x7080, 0xBC05, 0x78E3, 0xC016, 0x8263, 0xC21E, 0x89EE, 0xC221, 0x89EE,
0xC221, 0xFFFF, 0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0,
0xA39A, 0x92E9, 0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73,
0x8FB6, 0x8F97, 0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD,
0x706D, 0x7C88, 0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0,
0x76F3, 0x5586, 0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF,
0x98F7, 0x552D, 0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E,
0xA381, 0x4A6D, 0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9,
0x7DFC, 0x3EA4, 0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B,
0x60B0, 0x5AA7, 0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666,
0x6620, 0x9016, 0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B,
0x8CBB, 0xA14B, 0xFFFF, 0x7481, 0x77DA, 0x793F, 0x7317, 0x7EE3, 0x701D, 0x8044,
0x6FBD, 0x81B4, 0x6F76, 0x846C, 0x6F18, 0x8E1D, 0x7044, 0x97FF, 0x75D2, 0x9B2B,
0x772F, 0x9DAF, 0x75F3, 0xA26D, 0x6D0E, 0xA2E9, 0x62B8, 0xA33C, 0x583A, 0xA31E,
0x573E, 0xA252, 0x5871, 0x9FC0, 0x5BDB, 0x9CD5, 0x5D2A, 0x9751, 0x5AEC, 0x914A,
0x5720, 0x8B83, 0x5519, 0x83E3, 0x5506, 0x7ECB, 0x56B4, 0x7A0F, 0x59E9, 0x765D,
0x5E9D, 0x73CE, 0x64A3, 0x727C, 0x6BCF, 0x7286, 0x72FD, 0x73A3, 0x78D6, 0x7481,
0x77DA, 0x7481, 0x77DA
};
const PROGMEM uint16_t surface[] = {
0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0, 0xA39A, 0x92E9,
0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73, 0x8FB6, 0x8F97,
0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD, 0x706D, 0x7C88,
0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0, 0x76F3, 0x5586,
0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF, 0x98F7, 0x552D,
0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E, 0xA381, 0x4A6D,
0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9, 0x7DFC, 0x3EA4,
0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B, 0x60B0, 0x5AA7,
0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666, 0x6620, 0x9016,
0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B, 0x8CBB, 0xA14B
};
//#define LOGO_BACKGROUND 0xF05A22
#define LOGO_BACKGROUND 0xFFFFFF
#define LOGO_PAINT_PATHS \
LOGO_PAINT_PATH(0xF27121, surface) \
LOGO_PAINT_PATH(0x6B2C1B, shadow) \
LOGO_PAINT_PATH(0xBC3E26, highlight) \
LOGO_PAINT_PATH(0x3C2215, stroke)

View File

@@ -0,0 +1,116 @@
/********************
* about_screen.cpp *
********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#include "../screens.h"
#ifdef COCOA_ABOUT_SCREEN
#define GRID_COLS 4
#define GRID_ROWS 8
using namespace FTDI;
using namespace Theme;
using namespace ExtUI;
void AboutScreen::onEntry() {
BaseScreen::onEntry();
sound.play(chimes, PLAY_ASYNCHRONOUS);
}
void AboutScreen::onRedraw(draw_mode_t) {
CommandProcessor cmd;
cmd.cmd(CLEAR_COLOR_RGB(bg_color))
.cmd(CLEAR(true,true,true))
.cmd(COLOR_RGB(bg_text_enabled))
.tag(0);
#define HEADING_POS BTN_POS(1,1), BTN_SIZE(4,2)
#define FW_VERS_POS BTN_POS(1,3), BTN_SIZE(4,1)
#define FW_INFO_POS BTN_POS(1,4), BTN_SIZE(4,1)
#define LICENSE_POS BTN_POS(1,5), BTN_SIZE(4,3)
#define STATS_POS BTN_POS(1,8), BTN_SIZE(2,1)
#define BACK_POS BTN_POS(3,8), BTN_SIZE(2,1)
char about_str[1
+ strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2))
#ifdef TOOLHEAD_NAME
+ strlen_P(TOOLHEAD_NAME)
#endif
];
#ifdef TOOLHEAD_NAME
// If MSG_ABOUT_TOUCH_PANEL_2 has %s, substitute in the toolhead name.
// But this is optional, so squelch the compiler warning here.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-extra-args"
sprintf_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2), TOOLHEAD_NAME);
#pragma GCC diagnostic pop
#else
strcpy_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2));
#endif
draw_text_box(cmd, HEADING_POS,
#ifdef MACHINE_NAME
F(MACHINE_NAME)
#else
GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1)
#endif
, OPT_CENTER, font_xlarge
);
#if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU)
cmd.tag(3);
#endif
draw_text_box(cmd, FW_VERS_POS,
#ifdef TOUCH_UI_VERSION
F(TOUCH_UI_VERSION)
#else
FPSTR(getFirmwareName_str())
#endif
, OPT_CENTER, font_medium);
cmd.tag(0);
draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium);
draw_text_box(cmd, LICENSE_POS, GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny);
cmd.font(font_medium);
#if ENABLED(PRINTCOUNTER)
cmd.colors(normal_btn)
.tag(2).button(STATS_POS, GET_TEXT_F(MSG_INFO_STATS_MENU));
#endif
cmd.colors(action_btn)
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE));
}
bool AboutScreen::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
#if ENABLED(PRINTCOUNTER)
case 2: GOTO_SCREEN(StatisticsScreen); break;
#endif
#if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU)
case 3: GOTO_SCREEN(DeveloperMenu); break;
#endif
default: return false;
}
return true;
}
#endif // COCOA_ABOUT_SCREEN

View File

@@ -0,0 +1,33 @@
/******************
* about_screen.h *
******************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#pragma once
#define COCOA_ABOUT_SCREEN
#define COCOA_ABOUT_SCREEN_CLASS AboutScreen
class AboutScreen : public BaseScreen, public UncachedScreen {
public:
static void onEntry();
static void onRedraw(draw_mode_t);
static bool onTouchEnd(uint8_t tag);
};

View File

@@ -0,0 +1,248 @@
const unsigned char cocoa_press_ui[2941] PROGMEM = {
0x78, 0x9C, 0xED, 0xDD, 0x3B, 0x96, 0xA3, 0xC8, 0xB6, 0x00, 0xD0, 0xC9,
0x68, 0x28, 0x1A, 0x0A, 0x06, 0x3D, 0x8F, 0x34, 0x24, 0x83, 0x59, 0x94,
0x91, 0x8E, 0x0C, 0x30, 0x34, 0x86, 0x32, 0xCA, 0x2A, 0x03, 0x23, 0x99,
0x42, 0x8D, 0xE0, 0x62, 0xE8, 0x0A, 0x21, 0x20, 0x22, 0xF8, 0x54, 0xF6,
0xBA, 0x6F, 0x3D, 0xA5, 0x52, 0x7B, 0x1B, 0xDD, 0x29, 0x50, 0xA0, 0xA0,
0xD7, 0x39, 0xC4, 0x0F, 0xE8, 0xCB, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0,
0xFF, 0x48, 0x5B, 0xFF, 0x2E, 0xCB, 0x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 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xBE, 0x8A, 0xB6, 0x69, 0xDA, 0x47, 0xD7, 0x01, 0xBE, 0xA2, 0xB6,
0x3A, 0x66, 0x37, 0x87, 0xB2, 0x79, 0x74, 0x5D, 0xE0, 0x6B, 0x69, 0x8B,
0x2C, 0x3B, 0x56, 0xF5, 0x55, 0xD5, 0xFD, 0xA5, 0x15, 0x81, 0x49, 0x99,
0x65, 0xD5, 0xF4, 0xE9, 0x9C, 0x65, 0xA7, 0xC7, 0xD5, 0x05, 0xBE, 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
0xEA, 0x22, 0x73, 0xDF, 0x15, 0xC4, 0xCA, 0x6C, 0x54, 0x7A, 0xB5, 0x28,
0xA4, 0xDA, 0xBA, 0x3A, 0x9D, 0xCA, 0x5A, 0xCF, 0x0A, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0xF4, 0x5F, 0xC3, 0x54, 0x94,
0x5A
};

View File

@@ -1,52 +1,32 @@
/**************************************************************************** const PROGMEM uint16_t menu_btn[] = {0x0AAC, 0x0DF3, 0x6D54, 0x0DF3, 0x6D54, 0x2E89, 0x0AAC, 0x2E89, 0x0AAC, 0x0DF3};
* This program is free software: you can redistribute it and/or modify * const PROGMEM uint16_t print_btn[] = {0x4800, 0xCCCC, 0x7FFF, 0xCCCC, 0x7FFF, 0xED62, 0x4800, 0xED62, 0x4800, 0xCCCC};
* it under the terms of the GNU General Public License as published by * const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAC, 0x37D8, 0x6D54, 0x37D8, 0x6D54, 0x586E, 0x0AAC, 0x586E, 0x0AAC, 0x37D8};
* the Free Software Foundation, either version 3 of the License, or * const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAC, 0x5D15, 0x6D54, 0x5D15, 0x6D54, 0x7DAB, 0x0AAC, 0x7DAB, 0x0AAC, 0x5D15};
* (at your option) any later version. * const PROGMEM uint16_t extrude_btn[] = {0x0AAC, 0x8252, 0x6D54, 0x8252, 0x6D54, 0xA2E8, 0x0AAC, 0xA2E8, 0x0AAC, 0x8252};
* * const PROGMEM uint16_t media_btn[] = {0x0AAC, 0xCCCC, 0x42AA, 0xCCCC, 0x42AA, 0xED62, 0x0AAC, 0xED62, 0x0AAC, 0xCCCC};
* This program is distributed in the hope that it will be useful, * const PROGMEM uint16_t pause_btn[] = {0x8554, 0xCCCC, 0xBD53, 0xCCCC, 0xBD53, 0xED62, 0x8554, 0xED62, 0x8554, 0xCCCC};
* but WITHOUT ANY WARRANTY; without even the implied warranty of * const PROGMEM uint16_t print_time_hms[] = {0xAB02, 0x82EE, 0xE4F8, 0x82EE, 0xE4F8, 0xA24C, 0xAB02, 0xA24C, 0xAB02, 0x82EE};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * const PROGMEM uint16_t print_time_pct[] = {0x7386, 0x82E2, 0xA500, 0x82E2, 0xA500, 0xA258, 0x7386, 0xA258, 0x7386, 0x82E2};
* GNU General Public License for more details. * const PROGMEM uint16_t file_name[] = {0x0B08, 0xA830, 0xF4F5, 0xA830, 0xF4F5, 0xC784, 0x0B08, 0xC784, 0x0B08, 0xA830};
* * const PROGMEM uint16_t h0_label[] = {0x85B6, 0x3884, 0xAF9B, 0x3884, 0xAF9B, 0x57C1, 0x85B6, 0x57C1, 0x85B6, 0x3884};
* To view a copy of the GNU General Public License, go to the following * const PROGMEM uint16_t h0_temp[] = {0x85B6, 0x5DC1, 0xAF9B, 0x5DC1, 0xAF9B, 0x7CFF, 0x85B6, 0x7CFF, 0x85B6, 0x5DC1};
* location: <https://www.gnu.org/licenses/>. * const PROGMEM uint16_t h1_label[] = {0xBB0B, 0x3884, 0xE4EF, 0x3884, 0xE4EF, 0x57C1, 0xBB0B, 0x57C1, 0xBB0B, 0x3884};
****************************************************************************/ const PROGMEM uint16_t h1_temp[] = {0xBB0B, 0x5DC1, 0xE4EF, 0x5DC1, 0xE4EF, 0x7CFF, 0xBB0B, 0x7CFF, 0xBB0B, 0x5DC1};
const PROGMEM uint16_t stop_btn[] = {0xC2A8, 0xCCCC, 0xF551, 0xCCCC, 0xF551, 0xED62, 0xC2A8, 0xED62, 0xC2A8, 0xCCCC};
/** const PROGMEM uint16_t z_wizard_heading[] = {0x5332, 0x0FFF, 0xB331, 0x0FFF, 0xB331, 0x2AAA, 0x5332, 0x2AAA, 0x5332, 0x0FFF};
* This file was auto-generated using "svg2cpp.py" const PROGMEM uint16_t z_wizard_plus_btn[] = {0x9CCB, 0x3AAA, 0xAFFE, 0x3AAA, 0xAFFE, 0x5554, 0x9CCB, 0x5554, 0x9CCB, 0x3AAA};
* const PROGMEM uint16_t z_wizard_edit_box[] = {0x0CCC, 0x9FFE, 0x5332, 0x9FFE, 0x5332, 0xC553, 0x0CCC, 0xC553, 0x0CCC, 0x9FFE};
* The encoding consists of x,y pairs with the min and max scaled to const PROGMEM uint16_t z_wizard_inc1_btn[] = {0x5998, 0xA016, 0x8998, 0xA016, 0x8998, 0xC553, 0x5998, 0xC553, 0x5998, 0xA016};
* 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the const PROGMEM uint16_t z_wizard_inc2_btn[] = {0x8FFE, 0xA016, 0xBFFE, 0xA016, 0xBFFE, 0xC553, 0x8FFE, 0xC553, 0x8FFE, 0xA016};
* start of a new closed path. const PROGMEM uint16_t z_wizard_inc3_btn[] = {0xC664, 0xA016, 0xF664, 0xA016, 0xF664, 0xC553, 0xC664, 0xC553, 0xC664, 0xA016};
*/ const PROGMEM uint16_t z_wizard_done_btn[] = {0xBFFE, 0xCFFE, 0xF664, 0xCFFE, 0xF664, 0xF553, 0xBFFE, 0xF553, 0xBFFE, 0xCFFE};
#pragma once const PROGMEM uint16_t z_wizard_neg_btn[] = {0x9CCB, 0x5FFF, 0xAFFE, 0x5FFF, 0xAFFE, 0x7AA9, 0x9CCB, 0x7AA9, 0x9CCB, 0x5FFF};
const PROGMEM uint16_t z_wizard_diagram[] = {0x6D65, 0x4DBE, 0x6D65, 0x6015, 0x7ADB, 0x6015, 0x7F1F, 0x6C6A, 0x8303, 0x6C6A, 0x8747, 0x6015, 0x94BE, 0x6015, 0x94BE, 0x4DBE, 0x6D65, 0x4DBE, 0xFFFF, 0x0D06, 0x8527, 0x0D06, 0x9554, 0xF664, 0x9554, 0xF664, 0x8527, 0x0D06, 0x8527};
constexpr float x_min = 0.000000; const PROGMEM uint16_t load_screen_extrude[] = {0x382D, 0x897E, 0x4189, 0x897E, 0x4189, 0xAA6A, 0x4638, 0xAA6A, 0x3CDB, 0xBAE0, 0x337F, 0xAA6A, 0x382D, 0xAA6A, 0x382D, 0x897E};
constexpr float x_max = 480.000000; const PROGMEM uint16_t load_screen_retract[] = {0x382D, 0x7908, 0x4189, 0x7908, 0x4189, 0x581C, 0x4638, 0x581C, 0x3CDB, 0x47A6, 0x337F, 0x581C, 0x382D, 0x581C, 0x382D, 0x7908};
constexpr float y_min = 0.000000; const PROGMEM uint16_t load_screen_back_btn[] = {0x1556, 0xC825, 0xEAA7, 0xC825, 0xEAA7, 0xED62, 0x1556, 0xED62, 0x1556, 0xC825};
constexpr float y_max = 272.000000; const PROGMEM uint16_t load_screen_unload_btn[] = {0x67FF, 0x6FB4, 0xEAA7, 0x6FB4, 0xEAA7, 0x94F1, 0x67FF, 0x94F1, 0x67FF, 0x6FB4};
const PROGMEM uint16_t load_screen_start_stop_btn[] = {0x67FF, 0x9998, 0xEAA7, 0x9998, 0xEAA7, 0xBED6, 0x67FF, 0xBED6, 0x67FF, 0x9998};
const PROGMEM uint16_t menu_btn[] = {0x0AAA, 0x0E1E, 0x6D54, 0x0E1E, 0x6D54, 0x2F0E, 0x0AAA, 0x2F0E, 0x0AAA, 0x0E1E}; const PROGMEM uint16_t load_screen_load_btn[] = {0x67FF, 0x45CF, 0xEAA7, 0x45CF, 0xEAA7, 0x6B0C, 0x67FF, 0x6B0C, 0x67FF, 0x45CF};
const PROGMEM uint16_t print_btn[] = {0x47FF, 0xCF0D, 0x7FFF, 0xCF0D, 0x7FFF, 0xEFFE, 0x47FF, 0xEFFE, 0x47FF, 0xCF0D}; const PROGMEM uint16_t load_screen_continuous[] = {0x67FF, 0x1743, 0xEAA7, 0x1743, 0xEAA7, 0x3C80, 0x67FF, 0x3C80, 0x67FF, 0x1743};
const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAA, 0x3878, 0x6D54, 0x3878, 0x6D54, 0x5968, 0x0AAA, 0x5968, 0x0AAA, 0x3878}; const PROGMEM uint16_t load_screen_increment[] = {0x1556, 0x1743, 0x62AA, 0x1743, 0x62AA, 0x3C80, 0x1556, 0x3C80, 0x1556, 0x1743};
const PROGMEM uint16_t extrude_btn[] = {0x0AAA, 0x5E1D, 0x6D54, 0x5E1D, 0x6D54, 0x7F0E, 0x0AAA, 0x7F0E, 0x0AAA, 0x5E1D};
const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAA, 0x83C2, 0x6D54, 0x83C2, 0x6D54, 0xA4B3, 0x0AAA, 0xA4B3, 0x0AAA, 0x83C2};
const PROGMEM uint16_t media_btn[] = {0x0AAA, 0xCF0D, 0x42AA, 0xCF0D, 0x42AA, 0xEFFE, 0x0AAA, 0xEFFE, 0x0AAA, 0xCF0D};
const PROGMEM uint16_t pause_btn[] = {0x8554, 0xCF0D, 0xBD53, 0xCF0D, 0xBD53, 0xEFFE, 0x8554, 0xEFFE, 0x8554, 0xCF0D};
const PROGMEM uint16_t print_time_hms[] = {0xC59E, 0xAEA0, 0xF510, 0xAEA0, 0xF510, 0xC52D, 0xC59E, 0xC52D, 0xC59E, 0xAEA0};
const PROGMEM uint16_t file_name[] = {0x0B0E, 0xAECD, 0xBCEF, 0xAECD, 0xBCEF, 0xC4AB, 0x0B0E, 0xC4AB, 0x0B0E, 0xAECD};
const PROGMEM uint16_t chocolate_label[] = {0x75C1, 0x1369, 0xF4FE, 0x1369, 0xF4FE, 0x2AB1, 0x75C1, 0x2AB1, 0x75C1, 0x1369};
const PROGMEM uint16_t h0_label[] = {0x8304, 0x4BEB, 0xB271, 0x4BEB, 0xB271, 0x63B0, 0x8304, 0x63B0, 0x8304, 0x4BEB};
const PROGMEM uint16_t h0_temp[] = {0x8304, 0x7190, 0xB271, 0x7190, 0xB271, 0x8955, 0x8304, 0x8955, 0x8304, 0x7190};
const PROGMEM uint16_t h1_label[] = {0xBB04, 0x4BEB, 0xEA71, 0x4BEB, 0xEA71, 0x63B0, 0xBB04, 0x63B0, 0xBB04, 0x4BEB};
const PROGMEM uint16_t h1_temp[] = {0xBB04, 0x7190, 0xEA71, 0x7190, 0xEA71, 0x8956, 0xBB04, 0x8956, 0xBB04, 0x7190};
const PROGMEM uint16_t stop_btn[] = {0xC2A9, 0xCF0D, 0xF553, 0xCF0D, 0xF553, 0xEFFE, 0xC2A9, 0xEFFE, 0xC2A9, 0xCF0D};
const PROGMEM uint16_t load_screen_extrude[] = {0x382C, 0x8B02, 0x4188, 0x8B02, 0x4188, 0xAC4A, 0x4637, 0xAC4A, 0x3CDA, 0xBCEE, 0x337D, 0xAC4A, 0x382C, 0xAC4A, 0x382C, 0x8B02};
const PROGMEM uint16_t load_screen_retract[] = {0x382C, 0x7A5D, 0x4188, 0x7A5D, 0x4188, 0x5915, 0x4637, 0x5915, 0x3CDA, 0x4871, 0x337E, 0x5915, 0x382C, 0x5915, 0x382C, 0x7A5D};
const PROGMEM uint16_t load_screen_back_btn[] = {0x1555, 0xCA58, 0xEAA8, 0xCA58, 0xEAA8, 0xEFFE, 0x1555, 0xEFFE, 0x1555, 0xCA58};
const PROGMEM uint16_t load_screen_unload_btn[] = {0x67FF, 0x70F0, 0xEAA8, 0x70F0, 0xEAA8, 0x9695, 0x67FF, 0x9695, 0x67FF, 0x70F0};
const PROGMEM uint16_t load_screen_start_stop_btn[] = {0x67FF, 0x9B4A, 0xEAA8, 0x9B4A, 0xEAA8, 0xC0EF, 0x67FF, 0xC0EF, 0x67FF, 0x9B4A};
const PROGMEM uint16_t load_screen_load_btn[] = {0x67FF, 0x4696, 0xEAA8, 0x4696, 0xEAA8, 0x6C3B, 0x67FF, 0x6C3B, 0x67FF, 0x4696};
const PROGMEM uint16_t load_screen_continuous[] = {0x67FF, 0x1787, 0xEAA8, 0x1787, 0xEAA8, 0x3D2C, 0x67FF, 0x3D2C, 0x67FF, 0x1787};
const PROGMEM uint16_t load_screen_increment[] = {0x1555, 0x1787, 0x62A9, 0x1787, 0x62A9, 0x3D2C, 0x1555, 0x3D2C, 0x1555, 0x1787};

View File

@@ -77,7 +77,7 @@ const char *FilesScreen::getSelectedFilename(bool shortName) {
} }
void FilesScreen::drawSelectedFile() { void FilesScreen::drawSelectedFile() {
if(mydata.selected_tag == 0xFF) return; if (mydata.selected_tag == 0xFF) return;
FileList files; FileList files;
files.seek(getSelectedFileIndex(), true); files.seek(getSelectedFileIndex(), true);
mydata.flags.is_dir = files.isDir(); mydata.flags.is_dir = files.isDir();
@@ -171,13 +171,10 @@ void FilesScreen::drawFooter() {
cmd.colors(normal_btn) cmd.colors(normal_btn)
.font(font_medium) .font(font_medium)
.colors(normal_btn) .colors(normal_btn)
.enabled(!mydata.flags.is_root) .tag(mydata.flags.is_root ? 240 : 245).button(BTN2_POS, F("Back"))
.tag(245).button(BTN2_POS, F("Up Dir"))
.colors(action_btn); .colors(action_btn);
if (mydata.flags.is_empty) if (has_selection && mydata.flags.is_dir)
cmd.tag(240).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_DONE));
else if (has_selection && mydata.flags.is_dir)
cmd.tag(244).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_OPEN)); cmd.tag(244).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_OPEN));
else else
cmd.tag(241).enabled(has_selection).button(BTN1_POS, F("Select")); cmd.tag(241).enabled(has_selection).button(BTN1_POS, F("Select"));
@@ -214,12 +211,9 @@ void FilesScreen::gotoPage(uint8_t page) {
bool FilesScreen::onTouchEnd(uint8_t tag) { bool FilesScreen::onTouchEnd(uint8_t tag) {
switch (tag) { switch (tag) {
case 240: // Done button, always select first file case 240: // Back button
{ card.filename[0] = card.longFilename[0] = '\0'; // Clear file selection
FileList files;
files.seek(0);
GOTO_PREVIOUS(); GOTO_PREVIOUS();
}
return true; return true;
case 241: // Select highlighted file case 241: // Select highlighted file
GOTO_PREVIOUS(); GOTO_PREVIOUS();

View File

@@ -25,24 +25,31 @@
#if ENABLED(COCOA_LEVELING_MENU) #if ENABLED(COCOA_LEVELING_MENU)
#if ALL(HAS_BED_PROBE, BLTOUCH)
#include "../../../../feature/bltouch.h"
#endif
using namespace FTDI; using namespace FTDI;
using namespace ExtUI; using namespace ExtUI;
using namespace Theme; using namespace Theme;
#define GRID_COLS 3 #if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#define GRID_ROWS 5 #define GRID_COLS 3
#define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) #define GRID_ROWS 6
#define PROBE_BED_POS BTN_POS(1,2), BTN_SIZE(1,1) #define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1)
#define SHOW_MESH_POS BTN_POS(2,2), BTN_SIZE(1,1) #define WARNING_POS BTN_POS(1,2), BTN_SIZE(3,2)
#define EDIT_MESH_POS BTN_POS(3,2), BTN_SIZE(1,1) #define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define BLTOUCH_TITLE_POS BTN_POS(1,3), BTN_SIZE(3,1) #define SHOW_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define BLTOUCH_RESET_POS BTN_POS(1,4), BTN_SIZE(1,1) #define EDIT_MESH_POS BTN_POS(3,4), BTN_SIZE(1,1)
#define BLTOUCH_TEST_POS BTN_POS(2,4), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,6), BTN_SIZE(3,1)
#define BACK_POS BTN_POS(1,5), BTN_SIZE(3,1) #else
#define GRID_COLS 2
#define GRID_ROWS 6
#define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1)
#define WARNING_POS BTN_POS(1,2), BTN_SIZE(2,2)
#define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define SHOW_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1)
// Hide the editor button if motion to grid point not supported
#define EDIT_MESH_POS BTN_POS(4,7), BTN_SIZE(1,1)
#endif
void LevelingMenu::onRedraw(draw_mode_t what) { void LevelingMenu::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) { if (what & BACKGROUND) {
@@ -57,38 +64,26 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
cmd.font(font_large) cmd.font(font_large)
.cmd(COLOR_RGB(bg_text_enabled)) .cmd(COLOR_RGB(bg_text_enabled))
.text(BED_MESH_TITLE_POS, GET_TEXT_F(MSG_BED_LEVELING)) .text(BED_MESH_TITLE_POS, GET_TEXT_F(MSG_BED_LEVELING))
#if ENABLED(BLTOUCH)
.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
#endif
.font(font_medium).colors(normal_btn) .font(font_medium).colors(normal_btn)
.tag(2).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) .tag(2).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED))
.enabled(ENABLED(HAS_MESH)) .enabled(ENABLED(HAS_MESH))
.tag(3).button(SHOW_MESH_POS, GET_TEXT_F(MSG_MESH_VIEW)) .tag(3).button(SHOW_MESH_POS, GET_TEXT_F(MSG_MESH_VIEW))
.enabled(ENABLED(HAS_MESH)) .enabled(ENABLED(HAS_MESH))
.tag(4).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH)) .tag(4).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH))
#undef GRID_COLS
#define GRID_COLS 2
#if ENABLED(BLTOUCH)
.tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET))
.tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST))
#endif
#undef GRID_COLS
#define GRID_COLS 3
.colors(action_btn) .colors(action_btn)
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE))
.cmd(COLOR_RGB(bg_text_enabled))
.tag(0);
draw_text_box(cmd, WARNING_POS, F("Remove chocolate cartridge before probing. This reduces the possibility of damaging a part."), OPT_CENTER, font_medium);
} }
} }
bool LevelingMenu::onTouchEnd(uint8_t tag) { bool LevelingMenu::onTouchEnd(uint8_t tag) {
switch (tag) { switch (tag) {
case 1: GOTO_PREVIOUS(); break; case 1: GOTO_PREVIOUS(); break;
case 2: BedMeshViewScreen::doProbe(); break; case 2: SaveSettingsDialogBox::settingsChanged(); injectCommands(F(BED_LEVELING_COMMANDS)); break;
case 3: BedMeshViewScreen::show(); break; case 3: BedMeshViewScreen::show(); break;
case 4: BedMeshEditScreen::show(); break; case 4: SaveSettingsDialogBox::settingsChanged(); BedMeshEditScreen::show(); break;
#if ENABLED(BLTOUCH)
case 5: injectCommands(F("M280 P0 S60")); break;
case 6: SpinnerDialogBox::enqueueAndWait(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
#endif
default: return false; default: return false;
} }
return true; return true;

View File

@@ -54,11 +54,10 @@ void LoadChocolateScreen::draw_buttons(draw_mode_t what) {
cmd.tag(3).colors(mydata.repeat_tag == 6 ? action_btn : normal_btn).button(x, y, h, v, GET_TEXT_F(MSG_LOAD)); cmd.tag(3).colors(mydata.repeat_tag == 6 ? action_btn : normal_btn).button(x, y, h, v, GET_TEXT_F(MSG_LOAD));
ui.bounds(POLY(load_screen_start_stop_btn), x, y, h, v); ui.bounds(POLY(load_screen_start_stop_btn), x, y, h, v);
if(mydata.repeat_tag == 0) { if (mydata.repeat_tag == 0)
cmd.colors(normal_btn).enabled(false); cmd.colors(normal_btn).enabled(false);
} else { else
cmd.colors(mydata.repeating ? action_btn : normal_btn).enabled(true); cmd.colors(mydata.repeating ? action_btn : normal_btn).enabled(true);
}
cmd.tag(4).button(x, y, h, v, GET_TEXT_F(MSG_START_STOP)); cmd.tag(4).button(x, y, h, v, GET_TEXT_F(MSG_START_STOP));
ui.bounds(POLY(load_screen_back_btn), x, y, h, v); ui.bounds(POLY(load_screen_back_btn), x, y, h, v);
@@ -115,24 +114,16 @@ void LoadChocolateScreen::onRedraw(draw_mode_t what) {
} }
bool LoadChocolateScreen::onTouchStart(uint8_t tag) { bool LoadChocolateScreen::onTouchStart(uint8_t tag) {
if(tag != 4) { if (tag != 4) mydata.repeating = false;
mydata.repeating = false;
}
return true; return true;
} }
bool LoadChocolateScreen::onTouchEnd(uint8_t tag) { bool LoadChocolateScreen::onTouchEnd(uint8_t tag) {
using namespace ExtUI; using namespace ExtUI;
switch (tag) { switch (tag) {
case 2: case 2: mydata.repeat_tag = 5; break;
mydata.repeat_tag = 5; case 3: mydata.repeat_tag = 6; break;
break; case 4: mydata.repeating = !mydata.repeating; break;
case 3:
mydata.repeat_tag = 6;
break;
case 4:
mydata.repeating = !mydata.repeating;
break;
case 1: GOTO_PREVIOUS(); break; case 1: GOTO_PREVIOUS(); break;
} }
return true; return true;
@@ -153,12 +144,8 @@ bool LoadChocolateScreen::onTouchHeld(uint8_t tag) {
#define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis); #define UI_INCREMENT_AXIS(axis) UI_INCREMENT(AxisPosition_mm, axis);
#define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis); #define UI_DECREMENT_AXIS(axis) UI_DECREMENT(AxisPosition_mm, axis);
switch (tag) { switch (tag) {
case 5: case 5: UI_INCREMENT_AXIS(E0); break;
UI_INCREMENT_AXIS(E0); case 6: UI_DECREMENT_AXIS(E0); break;
break;
case 6:
UI_DECREMENT_AXIS(E0);
break;
default: return false; default: return false;
} }
#undef UI_DECREMENT_AXIS #undef UI_DECREMENT_AXIS
@@ -170,10 +157,10 @@ void LoadChocolateScreen::onIdle() {
reset_menu_timeout(); reset_menu_timeout();
if (mydata.repeating) onTouchHeld(mydata.repeat_tag); if (mydata.repeating) onTouchHeld(mydata.repeat_tag);
if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
if (!EventLoop::is_touch_held()) if (!EventLoop::is_touch_held()) onRefresh();
onRefresh();
refresh_timer.start(); refresh_timer.start();
} }
BaseScreen::onIdle(); BaseScreen::onIdle();
} }
#endif // COCOA_LOAD_CHOCOLATE_SCREEN #endif // COCOA_LOAD_CHOCOLATE_SCREEN

View File

@@ -23,6 +23,7 @@
#include "../config.h" #include "../config.h"
#include "../screens.h" #include "../screens.h"
#include "../../../../module/stepper.h"
#ifdef COCOA_MAIN_MENU #ifdef COCOA_MAIN_MENU
@@ -34,13 +35,13 @@ using namespace Theme;
#define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1) #define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1)
#define MOVE_XYZ_POS BTN_POS(1,2), BTN_SIZE(1,1) #define MOVE_XYZ_POS BTN_POS(1,2), BTN_SIZE(1,1)
#define TEMPERATURE_POS BTN_POS(2,1), BTN_SIZE(1,1) #define LEVELING_POS BTN_POS(2,1), BTN_SIZE(1,1)
#define MOVE_E_POS BTN_POS(2,2), BTN_SIZE(1,1) #define MOVE_E_POS BTN_POS(2,2), BTN_SIZE(1,1)
#define SPEED_POS BTN_POS(1,3), BTN_SIZE(1,1) #define SPEED_POS BTN_POS(1,3), BTN_SIZE(1,1)
#define FLOW_POS BTN_POS(2,3), BTN_SIZE(1,1) #define FLOW_POS BTN_POS(2,3), BTN_SIZE(1,1)
#define ADVANCED_SETTINGS_POS BTN_POS(1,4), BTN_SIZE(1,1) #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(1,1)
#define DISABLE_STEPPERS_POS BTN_POS(2,4), BTN_SIZE(1,1) #define DISABLE_STEPPERS_POS BTN_POS(2,4), BTN_SIZE(1,1)
#define LEVELING_POS BTN_POS(1,5), BTN_SIZE(1,1) #define ADVANCED_SETTINGS_POS BTN_POS(1,5), BTN_SIZE(1,1)
#define ABOUT_PRINTER_POS BTN_POS(2,5), BTN_SIZE(1,1) #define ABOUT_PRINTER_POS BTN_POS(2,5), BTN_SIZE(1,1)
#define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1) #define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1)
@@ -63,6 +64,10 @@ void MainMenu::onRedraw(draw_mode_t what) {
.tag( 6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) .tag( 6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED))
.tag( 7).button(FLOW_POS, GET_TEXT_F(MSG_FLOW)) .tag( 7).button(FLOW_POS, GET_TEXT_F(MSG_FLOW))
.tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) .tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS))
.enabled(stepper.axis_is_enabled(X_AXIS) ||
stepper.axis_is_enabled(Y_AXIS) ||
stepper.axis_is_enabled(Z_AXIS) ||
stepper.axis_is_enabled(E0_AXIS))
.tag( 9).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS)) .tag( 9).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS))
.enabled(ENABLED(HAS_LEVELING)) .enabled(ENABLED(HAS_LEVELING))
.tag(10).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(10).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING))
@@ -97,4 +102,12 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
return true; return true;
} }
void MainMenu::onIdle() {
if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
if (!EventLoop::is_touch_held())
onRefresh();
refresh_timer.start();
}
}
#endif // COCOA_MAIN_MENU #endif // COCOA_MAIN_MENU

View File

@@ -30,4 +30,5 @@ class MainMenu : public BaseScreen, public CachedScreen<MENU_SCREEN_CACHE> {
public: public:
static void onRedraw(draw_mode_t); static void onRedraw(draw_mode_t);
static bool onTouchEnd(uint8_t tag); static bool onTouchEnd(uint8_t tag);
static void onIdle();
}; };

View File

@@ -32,40 +32,24 @@ using namespace Theme;
#define GRID_ROWS 5 #define GRID_ROWS 5
void PreheatMenu::onRedraw(draw_mode_t what) { void PreheatMenu::onRedraw(draw_mode_t what) {
const int16_t w = TERN0(COCOA_PRESS_EXTRA_HEATER, has_extra_heater()) ? BTN_W(1) : BTN_W(2);
const int16_t h = BTN_H(1);
if (what & BACKGROUND) { if (what & BACKGROUND) {
CommandProcessor cmd; CommandProcessor cmd;
cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
.cmd(CLEAR(true,true,true)) .cmd(CLEAR(true,true,true))
.tag(0)
.cmd(COLOR_RGB(bg_text_enabled)) .cmd(COLOR_RGB(bg_text_enabled))
.font(Theme::font_medium) .font(Theme::font_medium)
.text( BTN_POS(1,1), w, h, GET_TEXT_F(MSG_SELECT_CHOCOLATE_TYPE)); .tag(0).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_SELECT_CHOCOLATE_TYPE));
#if ENABLED(COCOA_PRESS_EXTRA_HEATER)
if (has_extra_heater()) {
cmd.text( BTN_POS(2,1), w, h, GET_TEXT_F(MSG_EXTERNAL));
}
#endif
} }
if (what & FOREGROUND) { if (what & FOREGROUND) {
CommandProcessor cmd; CommandProcessor cmd;
cmd.font(Theme::font_medium) cmd.font(Theme::font_medium)
.colors(normal_btn) .colors(normal_btn)
.tag(2).button(BTN_POS(1,2), w, h, F("Dark Chocolate")) .tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), F("Dark Chocolate"))
.tag(3).button(BTN_POS(1,3), w, h, F("Milk Chocolate")) .tag(3).button(BTN_POS(1,3), BTN_SIZE(2,1), F("Milk Chocolate"))
.tag(4).button(BTN_POS(1,4), w, h, F("White Chocolate")); .tag(4).button(BTN_POS(1,4), BTN_SIZE(2,1), F("White Chocolate"))
#if ENABLED(COCOA_PRESS_EXTRA_HEATER) .colors(action_btn)
if (has_extra_heater()) { .tag(1).button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE));
cmd.tag(5).button(BTN_POS(2,2), w, h, F("Dark Chocolate"))
.tag(6).button(BTN_POS(2,3), w, h, F("Milk Chocolate"))
.tag(7).button(BTN_POS(2,4), w, h, F("White Chocolate"));
}
#endif
cmd.colors(action_btn)
.tag(1) .button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE));
} }
} }
@@ -73,38 +57,20 @@ bool PreheatMenu::onTouchEnd(uint8_t tag) {
switch (tag) { switch (tag) {
case 1: GOTO_PREVIOUS(); break; case 1: GOTO_PREVIOUS(); break;
case 2: case 2:
#ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT
injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT)); injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT));
#endif #endif
GOTO_SCREEN(PreheatTimerScreen); GOTO_SCREEN(PreheatTimerScreen);
break; break;
case 3: case 3:
#ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT
injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT)); injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT));
#endif #endif
GOTO_SCREEN(PreheatTimerScreen); GOTO_SCREEN(PreheatTimerScreen);
break; break;
case 4: case 4:
#ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT
injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT)); injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT));
#endif
GOTO_SCREEN(PreheatTimerScreen);
break;
case 5:
#ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT
injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT));
#endif
GOTO_SCREEN(PreheatTimerScreen);
break;
case 6:
#ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT
injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT));
#endif
GOTO_SCREEN(PreheatTimerScreen);
break;
case 7:
#ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT
injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT));
#endif #endif
GOTO_SCREEN(PreheatTimerScreen); GOTO_SCREEN(PreheatTimerScreen);
break; break;

View File

@@ -116,7 +116,9 @@ void PreheatTimerScreen::onRedraw(draw_mode_t what) {
draw_interaction_buttons(what); draw_interaction_buttons(what);
draw_adjuster(what, 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0), NOZZLE_ADJ_POS); draw_adjuster(what, 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0), NOZZLE_ADJ_POS);
draw_adjuster(what, 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1), BODY_ADJ_POS); draw_adjuster(what, 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1), BODY_ADJ_POS);
#if HAS_HEATED_CHAMBER
draw_adjuster(what, 6, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS); draw_adjuster(what, 6, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS);
#endif
} }
bool PreheatTimerScreen::onTouchHeld(uint8_t tag) { bool PreheatTimerScreen::onTouchHeld(uint8_t tag) {
@@ -126,8 +128,10 @@ bool PreheatTimerScreen::onTouchHeld(uint8_t tag) {
case 3: UI_INCREMENT(TargetTemp_celsius, E0); break; case 3: UI_INCREMENT(TargetTemp_celsius, E0); break;
case 4: UI_DECREMENT(TargetTemp_celsius, E1); break; case 4: UI_DECREMENT(TargetTemp_celsius, E1); break;
case 5: UI_INCREMENT(TargetTemp_celsius, E1); break; case 5: UI_INCREMENT(TargetTemp_celsius, E1); break;
#if HAS_HEATED_CHAMBER
case 6: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; case 6: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break;
case 7: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; case 7: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break;
#endif
default: default:
return false; return false;
} }

View File

@@ -83,7 +83,6 @@ enum {
#include "../generic/base_numeric_adjustment_screen.h" #include "../generic/base_numeric_adjustment_screen.h"
#include "../generic/dialog_box_base_class.h" #include "../generic/dialog_box_base_class.h"
#include "../generic/boot_screen.h" #include "../generic/boot_screen.h"
#include "../generic/about_screen.h"
#include "../generic/kill_screen.h" #include "../generic/kill_screen.h"
#include "../generic/alert_dialog_box.h" #include "../generic/alert_dialog_box.h"
#include "../generic/spinner_dialog_box.h" #include "../generic/spinner_dialog_box.h"
@@ -104,13 +103,10 @@ enum {
#include "../generic/lock_screen.h" #include "../generic/lock_screen.h"
#include "../generic/endstop_state_screen.h" #include "../generic/endstop_state_screen.h"
#include "../generic/display_tuning_screen.h" #include "../generic/display_tuning_screen.h"
#include "../generic/statistics_screen.h"
#include "../generic/stepper_current_screen.h" #include "../generic/stepper_current_screen.h"
#include "../generic/z_offset_screen.h"
#include "../generic/bed_mesh_base.h" #include "../generic/bed_mesh_base.h"
#include "../generic/bed_mesh_view_screen.h" #include "../generic/bed_mesh_view_screen.h"
#include "../generic/bed_mesh_edit_screen.h" #include "../generic/bed_mesh_edit_screen.h"
#include "../generic/case_light_screen.h"
#include "../generic/linear_advance_screen.h" #include "../generic/linear_advance_screen.h"
#include "../generic/move_axis_screen.h" #include "../generic/move_axis_screen.h"
#include "../generic/flow_percent_screen.h" #include "../generic/flow_percent_screen.h"
@@ -131,3 +127,7 @@ enum {
#include "move_e_screen.h" #include "move_e_screen.h"
#include "files_screen.h" #include "files_screen.h"
#include "confirm_start_print_dialog_box.h" #include "confirm_start_print_dialog_box.h"
#include "z_offset_screen.h"
#include "z_offset_wizard.h"
#include "about_screen.h"
#include "statistics_screen.h"

View File

@@ -0,0 +1,82 @@
/*************************
* statistics_screen.cpp *
*************************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#include "../screens.h"
#ifdef COCOA_STATISTICS_SCREEN
using namespace FTDI;
using namespace ExtUI;
using namespace Theme;
#define GRID_COLS 4
#define GRID_ROWS 7
void StatisticsScreen::onRedraw(draw_mode_t what) {
CommandProcessor cmd;
if (what & BACKGROUND) {
char buffer[21];
cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
.cmd(CLEAR(true,true,true))
.cmd(COLOR_RGB(bg_text_enabled))
.tag(0)
.font(Theme::font_medium)
.text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
.font(Theme::font_small)
.tag(0)
.text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_COUNT), OPT_RIGHTX | OPT_CENTERY)
.text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), OPT_RIGHTX | OPT_CENTERY)
.text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_TIME), OPT_RIGHTX | OPT_CENTERY)
.text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_LONGEST), OPT_RIGHTX | OPT_CENTERY)
.text(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), OPT_RIGHTX | OPT_CENTERY);
// Don't chain the following, it causes strange issues with evaluation ordering!
cmd.text(BTN_POS(3,2), BTN_SIZE(2,1), getTotalPrints_str(buffer));
cmd.text(BTN_POS(3,3), BTN_SIZE(2,1), getFinishedPrints_str(buffer));
cmd.text(BTN_POS(3,4), BTN_SIZE(2,1), getTotalPrintTime_str(buffer));
cmd.text(BTN_POS(3,5), BTN_SIZE(2,1), getLongestPrint_str(buffer));
// Express in grams of chocolate rather than mm
const printStatistics stats = print_job_timer.getStats();
const long gramsChocolate = stats.filamentUsed * 0.53; // 1mm of extrusion is 0.53g
sprintf_P(buffer, PSTR("%ldg"), gramsChocolate);
cmd.text(BTN_POS(3,6), BTN_SIZE(2,1), buffer);
}
if (what & FOREGROUND) {
cmd.font(Theme::font_medium)
.colors(action_btn)
.tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BUTTON_DONE));
}
}
bool StatisticsScreen::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); return true;
default: return false;
}
}
#endif // COCOA_STATISTICS_SCREEN

View File

@@ -0,0 +1,32 @@
/***********************
* statistics_screen.h *
***********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#pragma once
#define COCOA_STATISTICS_SCREEN
#define COCOA_STATISTICS_SCREEN_CLASS StatisticsScreen
class StatisticsScreen : public BaseScreen, public UncachedScreen {
public:
static void onRedraw(draw_mode_t);
static bool onTouchEnd(uint8_t tag);
};

View File

@@ -23,22 +23,30 @@
#include "../config.h" #include "../config.h"
#include "../screens.h" #include "../screens.h"
#include "../screen_data.h"
#ifdef COCOA_STATUS_SCREEN #ifdef COCOA_STATUS_SCREEN
#include "cocoa_press_ui.h" #include "cocoa_press_ui.h"
#include "cocoa_press_bitmap.h"
#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0]))
#define ICON_POS(x,y,w,h) x, y, h, h #define ICON_POS(x,y,w,h) x, y, h, h
#define TEXT_POS(x,y,w,h) x + h, y, w - h, h #define TEXT_POS(x,y,w,h) x + h, y, w - h, h
const uint8_t shadow_depth = 5;
using namespace FTDI; using namespace FTDI;
using namespace Theme; using namespace Theme;
using namespace ExtUI; using namespace ExtUI;
float StatusScreen::increment; const uint8_t shadow_depth = 5;
constexpr static StatusScreenData &mydata = screen_data.StatusScreen;
// Format for background image
constexpr uint8_t format = RGB332;
constexpr uint16_t bitmap_w = 800;
constexpr uint16_t bitmap_h = 480;
void StatusScreen::_format_time(char *outstr, uint32_t time) { void StatusScreen::_format_time(char *outstr, uint32_t time) {
const uint8_t hrs = time / 3600, const uint8_t hrs = time / 3600,
@@ -69,6 +77,64 @@ void StatusScreen::loadBitmaps() {
#endif #endif
} }
void StatusScreen::draw_bkgnd(draw_mode_t what) {
if (what & BACKGROUND) {
constexpr float scale_w = float(FTDI::display_width)/bitmap_w;
constexpr float scale_h = float(FTDI::display_height)/bitmap_h;
uint16_t linestride;
uint32_t color;
switch (format) {
case RGB565: linestride = bitmap_w * 2; color = 0xFFFFFF; break;
case RGB332: linestride = bitmap_w ; color = 0xFFFFFF; break;
case L1: linestride = bitmap_w/8 ; color = 0x000000; break;
case L2: linestride = bitmap_w/4 ; color = 0x000000; break;
case L4: linestride = bitmap_w/2 ; color = 0x000000; break;
case L8: linestride = bitmap_w ; color = 0x000000; break;
}
CommandProcessor cmd;
cmd.cmd(COLOR_RGB(color))
.cmd(BITMAP_SOURCE(BACKGROUND_OFFSET))
.tag(0)
.bitmap_layout(format, linestride, bitmap_h)
.bitmap_size(NEAREST, BORDER, BORDER, bitmap_w*scale_w, bitmap_h*scale_h)
.cmd(BITMAP_TRANSFORM_A(uint32_t(float(256)/scale_w)))
.cmd(BITMAP_TRANSFORM_E(uint32_t(float(256)/scale_h)))
.cmd(BEGIN(BITMAPS))
.cmd(VERTEX2II(0, 0, 0, 0))
.cmd(BITMAP_TRANSFORM_A(256))
.cmd(BITMAP_TRANSFORM_E(256))
.cmd(COLOR_RGB(bg_text_enabled));
}
}
void StatusScreen::send_buffer(CommandProcessor &cmd, const void *data, uint16_t len) {
const char *ptr = (const char*) data;
constexpr uint16_t block_size = 512;
char block[block_size];
for (;len > 0;) {
const uint16_t nBytes = min(len, block_size);
memcpy_P(block, ptr, nBytes);
cmd.write((const void*)block, nBytes);
cmd.execute();
if(cmd.has_fault()) {
SERIAL_ECHOLNPGM("Recovering from fault: ");
cmd.reset();
delay(1000);
return;
}
ptr += nBytes;
len -= nBytes;
}
}
void StatusScreen::load_background(const void *data, uint16_t len) {
CommandProcessor cmd;
cmd.inflate(BACKGROUND_OFFSET)
.execute();
send_buffer(cmd, data, len);
cmd.wait();
}
void StatusScreen::draw_time(draw_mode_t what) { void StatusScreen::draw_time(draw_mode_t what) {
CommandProcessor cmd; CommandProcessor cmd;
PolyUI ui(cmd, what); PolyUI ui(cmd, what);
@@ -96,23 +162,27 @@ void StatusScreen::draw_time(draw_mode_t what) {
} }
} }
void StatusScreen::draw_percent(draw_mode_t what) {
void StatusScreen::draw_progress(draw_mode_t what) {
CommandProcessor cmd; CommandProcessor cmd;
PolyUI ui(cmd, what); PolyUI ui(cmd, what);
int16_t x, y, w, h; int16_t x, y, w, h;
ui.bounds(POLY(print_time_pct), x, y, w, h);
cmd.cmd(COLOR_RGB(accent_color_1));
cmd.font(font_medium);
if (what & FOREGROUND) { if (what & FOREGROUND) {
// Draw progress bar const uint16_t current_progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, getProgress_permyriad(), getProgress_percent() * 100);
ui.bounds(POLY(file_name), x, y, w, h); char progress_str[10];
const uint16_t bar_width = w * getProgress_percent() / 100; sprintf_P(progress_str,
cmd.tag(8) #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
.cmd(COLOR_RGB(accent_color_5)) PSTR("%3d.%02d%%"), uint8_t(current_progress / 100), current_progress % 100
.rectangle(x, y, bar_width, h); #else
PSTR("%3d%%"), uint8_t(current_progress / 100)
#endif
);
cmd.font(font_medium)
.cmd(COLOR_RGB(bg_text_enabled))
.text(TEXT_POS(x, y, w, h), progress_str);
} }
} }
@@ -123,17 +193,8 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
int16_t x, y, w, h; int16_t x, y, w, h;
if (what & BACKGROUND) { if (what & BACKGROUND) {
cmd.cmd(COLOR_RGB(fluid_rgb)); cmd.cmd(COLOR_RGB(bg_text_enabled));
cmd.font(font_medium).tag(10); cmd.font(font_medium).tag(0);
/*ui.bounds(POLY(temp_lbl), x, y, w, h);
cmd.text(x, y, w, h, F("Temp"));
ui.bounds(POLY(set_lbl), x, y, w, h);
cmd.text(x, y, w, h, F("Set"));*/
ui.bounds(POLY(chocolate_label), x, y, w, h);
cmd.text(x, y, w, h, F("Cocoa Press"));
ui.bounds(POLY(h0_label), x, y, w, h); ui.bounds(POLY(h0_label), x, y, w, h);
cmd.text(x, y, w, h, GET_TEXT_F(MSG_NOZZLE)); cmd.text(x, y, w, h, GET_TEXT_F(MSG_NOZZLE));
@@ -141,18 +202,6 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
ui.bounds(POLY(h1_label), x, y, w, h); ui.bounds(POLY(h1_label), x, y, w, h);
cmd.text(x, y, w, h, GET_TEXT_F(MSG_BODY)); cmd.text(x, y, w, h, GET_TEXT_F(MSG_BODY));
#if ENABLED(COCOA_PRESS_EXTRA_HEATER)
if (has_extra_heater()) {
ui.bounds(POLY(h2_label), x, y, w, h);
cmd.text(x, y, w, h, GET_TEXT_F(MSG_EXTERNAL));
}
#endif
#if ENABLED(COCOA_PRESS_CHAMBER_COOLER)
ui.bounds(POLY(h3_label), x, y, w, h);
cmd.text(x, y, w, h, GET_TEXT_F(MSG_CHAMBER));
#endif
#if ENABLED(TOUCH_UI_USE_UTF8) #if ENABLED(TOUCH_UI_USE_UTF8)
load_utf8_bitmaps(cmd); // Restore font bitmap handles load_utf8_bitmaps(cmd); // Restore font bitmap handles
#endif #endif
@@ -160,60 +209,22 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
if (what & FOREGROUND) { if (what & FOREGROUND) {
char str[15]; char str[15];
cmd.cmd(COLOR_RGB(fluid_rgb)); cmd.font(font_medium).colors(normal_btn).tag(10);
cmd.font(font_large).tag(10);
// Show the actual temperatures // Show the actual temperatures
format_temp(str, getActualTemp_celsius(E0)); format_temp(str, getActualTemp_celsius(E0));
ui.bounds(POLY(h0_temp), x, y, w, h); ui.bounds(POLY(h0_temp), x, y, w, h);
cmd.text(x, y, w, h, str); cmd.button(x, y, w, h, str);
format_temp(str, getActualTemp_celsius(E1)); format_temp(str, getActualTemp_celsius(E1));
ui.bounds(POLY(h1_temp), x, y, w, h); ui.bounds(POLY(h1_temp), x, y, w, h);
cmd.text(x, y, w, h, str); cmd.button(x, y, w, h, str);
#if ENABLED(COCOA_PRESS_EXTRA_HEATER)
if (has_extra_heater()) {
format_temp(str, getActualTemp_celsius(E2));
ui.bounds(POLY(h2_temp), x, y, w, h);
cmd.text(x, y, w, h, str);
}
#endif
#if ENABLED(COCOA_PRESS_CHAMBER_COOLER)
format_temp(str, getActualTemp_celsius(CHAMBER));
ui.bounds(POLY(h3_temp), x, y, w, h);
cmd.text(x, y, w, h, str);
#endif
/*// Show the set temperatures
format_temp(str, getTargetTemp_celsius(E0));
ui.bounds(POLY(h0_set), x, y, w, h);
cmd.text(x, y, w, h, str);
format_temp(str, getTargetTemp_celsius(E1));
ui.bounds(POLY(h1_set), x, y, w, h);
cmd.text(x, y, w, h, str);
#if ENABLED(COCOA_PRESS_EXTRA_HEATER)
if (has_extra_heater()) {
format_temp(str, getTargetTemp_celsius(E2));
ui.bounds(POLY(h2_set), x, y, w, h);
cmd.text(x, y, w, h, str);
}
#endif
#if ENABLED(COCOA_PRESS_CHAMBER_COOLER)
format_temp(str, getTargetTemp_celsius(CHAMBER));
ui.bounds(POLY(h3_set), x, y, w, h);
cmd.text(x, y, w, h, str);
#endif*/
} }
} }
void StatusScreen::draw_buttons(draw_mode_t what) { void StatusScreen::draw_buttons(draw_mode_t what) {
if (what & FOREGROUND) {
int16_t x, y, w, h; int16_t x, y, w, h;
const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected(); const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected();
@@ -249,65 +260,74 @@ void StatusScreen::draw_buttons(draw_mode_t what) {
ui.bounds(POLY(stop_btn), x, y, w, h); ui.bounds(POLY(stop_btn), x, y, w, h);
cmd.tag(9).enabled(sdOrHostPrinting).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_STOP)); cmd.tag(9).enabled(sdOrHostPrinting).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_STOP));
}
} }
// When visible, the file name occupies the same space as the status
// message and must be drawn opaque.
void StatusScreen::draw_file(draw_mode_t what) { void StatusScreen::draw_file(draw_mode_t what) {
if (mydata.gotMessage) return;
if (what & FOREGROUND) {
int16_t x, y, w, h; int16_t x, y, w, h;
CommandProcessor cmd; CommandProcessor cmd;
PolyUI ui(cmd, what); PolyUI ui(cmd, what);
ui.bounds(POLY(file_name), x, y, w, h); ui.bounds(POLY(file_name), x, y, w, h);
if (what & BACKGROUND) {
cmd.tag(5) cmd.tag(5)
.cmd(COLOR_RGB(bg_text_enabled)) .cmd (COLOR_RGB(bg_color))
.rectangle(x, y, w, h)
.cmd (COLOR_RGB(bg_text_enabled))
.cmd (BITMAP_SOURCE(File_Icon_Info)) .cmd (BITMAP_SOURCE(File_Icon_Info))
.cmd (BITMAP_LAYOUT(File_Icon_Info)) .cmd (BITMAP_LAYOUT(File_Icon_Info))
.cmd (BITMAP_SIZE (File_Icon_Info)) .cmd (BITMAP_SIZE (File_Icon_Info))
.icon(ICON_POS(x, y, w, h), File_Icon_Info, icon_scale); .icon(ICON_POS(x, y, w, h), File_Icon_Info, icon_scale);
}
if (what & FOREGROUND) { if (!isMediaInserted())
cmd.cmd(COLOR_RGB(bg_text_enabled));
if(!isMediaInserted())
draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No media present"), OPT_CENTERY, font_small); draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No media present"), OPT_CENTERY, font_small);
else if(isFileSelected()) { else if (isFileSelected()) {
FileList list; FileList list;
draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), list.filename(), OPT_CENTERY, font_small); draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), list.filename(), OPT_CENTERY, font_small);
} else }
else
draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No file selected"), OPT_CENTERY, font_small); draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No file selected"), OPT_CENTERY, font_small);
} }
} }
// The message will be drawn on the background and may be obscured by
// the filename.
void StatusScreen::draw_message(draw_mode_t what, const char *message) {
if (what & BACKGROUND) {
int16_t x, y, w, h;
CommandProcessor cmd;
PolyUI ui(cmd, what);
ui.bounds(POLY(file_name), x, y, w, h);
cmd.cmd(COLOR_RGB(bg_text_enabled));
draw_text_box(cmd, TEXT_POS(x, y, w, h), message, OPT_CENTERY, font_small);
}
}
bool StatusScreen::isFileSelected() { bool StatusScreen::isFileSelected() {
if(!isMediaInserted()) return false; if (!isMediaInserted()) return false;
FileList list; FileList list;
if(list.isDir()) return false; if (list.isDir()) return false;
const char *filename = list.filename(); const char *filename = list.filename();
if(filename[0] == '\0') return false; if (filename[0] == '\0') return false;
return true; return true;
} }
void StatusScreen::onRedraw(draw_mode_t what) { void StatusScreen::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) { if (what & FOREGROUND) {
CommandProcessor cmd; draw_bkgnd(what);
cmd.cmd(CLEAR_COLOR_RGB(bg_color))
.cmd(CLEAR(true,true,true))
.tag(0);
}
draw_file(what); draw_file(what);
draw_time(what); draw_time(what);
draw_progress(what); draw_percent(what);
draw_temperature(what); draw_temperature(what);
draw_buttons(what); draw_buttons(what);
} }
bool StatusScreen::onTouchStart(uint8_t) {
increment = 0;
return true;
} }
bool StatusScreen::onTouchEnd(uint8_t tag) { bool StatusScreen::onTouchEnd(uint8_t tag) {
@@ -352,24 +372,61 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
bool StatusScreen::onTouchHeld(uint8_t tag) { bool StatusScreen::onTouchHeld(uint8_t tag) {
if (tag == 2 && !ExtUI::isMoving()) { if (tag == 2 && !ExtUI::isMoving()) {
LoadChocolateScreen::setManualFeedrateAndIncrement(1, increment); float increment;
LoadChocolateScreen::setManualFeedrateAndIncrement(0.25, increment);
UI_INCREMENT(AxisPosition_mm, E0); UI_INCREMENT(AxisPosition_mm, E0);
current_screen.onRefresh();
} }
return false; return false;
} }
void StatusScreen::setStatusMessage(FSTR_P) { void StatusScreen::setStatusMessage(FSTR_P message) {
char buff[strlen_P((const char * const)message)+1];
strcpy_P(buff, (const char * const) message);
setStatusMessage((const char *) buff);
} }
void StatusScreen::setStatusMessage(const char * const) { void StatusScreen::setStatusMessage(const char * const message) {
if (CommandProcessor::is_processing()) {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_MSG("Cannot update status message, command processor busy");
#endif
return;
}
CommandProcessor cmd;
cmd.cmd(CMD_DLSTART)
.cmd(CLEAR_COLOR_RGB(bg_color))
.cmd(CLEAR(true,true,true));
const draw_mode_t what = BACKGROUND;
draw_bkgnd(what);
draw_message(what, message);
draw_time(what);
draw_percent(what);
draw_temperature(what);
draw_buttons(what);
storeBackground();
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_MSG("New status message: ", message);
#endif
mydata.gotMessage = true;
if (AT_SCREEN(StatusScreen))
current_screen.onRefresh();
}
void StatusScreen::onEntry() {
mydata.gotMessage = false;
load_background(cocoa_press_ui, sizeof(cocoa_press_ui));
} }
void StatusScreen::onIdle() { void StatusScreen::onIdle() {
reset_menu_timeout(); reset_menu_timeout();
if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
if (!EventLoop::is_touch_held()) if (!EventLoop::is_touch_held()) onRefresh();
onRefresh();
refresh_timer.start(); refresh_timer.start();
} }
} }

View File

@@ -26,31 +26,35 @@
#define COCOA_STATUS_SCREEN #define COCOA_STATUS_SCREEN
#define COCOA_STATUS_SCREEN_CLASS StatusScreen #define COCOA_STATUS_SCREEN_CLASS StatusScreen
class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE> { struct StatusScreenData {
bool gotMessage;
};
class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE, STATUS_SCREEN_DL_SIZE> {
private: private:
static void _format_time(char *outstr, uint32_t time); static void _format_time(char *outstr, uint32_t time);
static float increment;
static bool jog_xy;
static bool fine_motion;
static void draw_time(draw_mode_t what); static void draw_time(draw_mode_t what);
static void draw_progress(draw_mode_t what); static void draw_percent(draw_mode_t what);
static void draw_temperature(draw_mode_t what); static void draw_temperature(draw_mode_t what);
static void draw_buttons(draw_mode_t what); static void draw_buttons(draw_mode_t what);
static void draw_file(draw_mode_t what); static void draw_file(draw_mode_t what);
static void draw_message(draw_mode_t what, const char *message);
static void draw_bkgnd(draw_mode_t what);
static void send_buffer(CommandProcessor &cmd, const void *data, uint16_t len);
static void load_background(const void *data, uint16_t len);
static bool isFileSelected(); static bool isFileSelected();
public: public:
static void loadBitmaps(); static void loadBitmaps();
static void unlockMotors();
static void setStatusMessage(const char *); static void setStatusMessage(const char *);
static void setStatusMessage(FSTR_P); static void setStatusMessage(FSTR_P);
static void onRedraw(draw_mode_t); static void onRedraw(draw_mode_t);
static bool onTouchStart(uint8_t tag); static void onEntry();
static bool onTouchHeld(uint8_t tag); static bool onTouchHeld(uint8_t tag);
static bool onTouchEnd(uint8_t tag); static bool onTouchEnd(uint8_t tag);
static void onIdle(); static void onIdle();

View File

@@ -0,0 +1,59 @@
/***********************
* z_offset_screen.cpp *
***********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#include "../screens.h"
#include "../screen_data.h"
#ifdef COCOA_Z_OFFSET_SCREEN
#include "z_offset_wizard.h"
using namespace FTDI;
using namespace ExtUI;
using namespace Theme;
void ZOffsetScreen::onRedraw(draw_mode_t what) {
widgets_t w(what);
w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM));
w.heading( GET_TEXT_F(MSG_ZPROBE_ZOFFSET));
w.color(z_axis).adjuster(4, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), getZOffset_mm());
w.increments();
w.button(2, GET_TEXT_F(MSG_PROBE_WIZARD), !isPrinting());
}
bool ZOffsetScreen::onTouchHeld(uint8_t tag) {
const int16_t steps = TERN(BABYSTEPPING, mmToWholeSteps(getIncrement(), Z), 0);
const float increment = TERN(BABYSTEPPING, mmFromWholeSteps(steps, Z), getIncrement());
switch (tag) {
case 2: ZOffsetWizard::runWizard(); break;
case 4: UI_DECREMENT(ZOffset_mm); TERN(BABYSTEPPING, babystepAxis_steps(-steps, Z), UNUSED(steps)); break;
case 5: UI_INCREMENT(ZOffset_mm); TERN(BABYSTEPPING, babystepAxis_steps( steps, Z), UNUSED(steps)); break;
default:
return false;
}
SaveSettingsDialogBox::settingsChanged();
return true;
}
#endif // COCOA_Z_OFFSET_SCREEN

View File

@@ -0,0 +1,32 @@
/***********************
* z_offset_screen.h *
***********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#pragma once
#define COCOA_Z_OFFSET_SCREEN
#define COCOA_Z_OFFSET_SCREEN_CLASS ZOffsetScreen
class ZOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen<ZOFFSET_SCREEN_CACHE> {
public:
static void onRedraw(draw_mode_t);
static bool onTouchHeld(uint8_t tag);
};

View File

@@ -0,0 +1,162 @@
/***********************
* z_offset_screen.cpp *
***********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#include "../config.h"
#include "../screens.h"
#include "../screen_data.h"
#ifdef COCOA_Z_OFFSET_WIZARD
#include "cocoa_press_ui.h"
using namespace FTDI;
using namespace ExtUI;
using namespace Theme;
#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0]))
#define SHEET_THICKNESS 0.1
constexpr static ZOffsetWizardData &mydata = screen_data.ZOffsetWizard;
void ZOffsetWizard::onEntry() {
mydata.increment = 242;
mydata.softEndstopState = getSoftEndstopState();
BaseNumericAdjustmentScreen::onEntry();
setSoftEndstopState(false);
}
void ZOffsetWizard::onExit() {
setSoftEndstopState(mydata.softEndstopState);
}
void ZOffsetWizard::onRedraw(draw_mode_t what) {
int16_t x, y, w, h;
CommandProcessor cmd;
PolyUI ui(cmd, what);
cmd.cmd(CLEAR_COLOR_RGB(bg_color))
.cmd(CLEAR(true,true,true))
.tag(0)
.font(font_medium).colors(normal_btn);
char b[32];
dtostrf(getZOffset_mm(), 5, 2, b);
strcat_P(b, PSTR(" mm"));
ui.bounds(POLY(z_wizard_edit_box), x, y, w, h);
cmd.tag(0).fgcolor(z_axis).button(x, y, w, h, b);
#define PREAMBLE(TAG) cmd.tag(TAG).colors(mydata.increment == TAG ? action_btn : normal_btn)
ui.bounds(POLY(z_wizard_inc1_btn), x, y, w, h);
PREAMBLE(241).button(x, y, w, h, F("0.01"));
ui.bounds(POLY(z_wizard_inc2_btn), x, y, w, h);
PREAMBLE(242).button(x, y, w, h, F("0.1"));
ui.bounds(POLY(z_wizard_inc3_btn), x, y, w, h);
PREAMBLE(243).button(x, y, w, h, F("1.0"));
ui.bounds(POLY(z_wizard_neg_btn), x, y, w, h);
cmd.tag(4).colors(action_btn).button(x, y, w, h, F(""));
drawArrow(x, y, w, h, DOWN);
ui.bounds(POLY(z_wizard_plus_btn), x, y, w, h);
cmd.tag(5).colors(action_btn).button(x, y, w, h, F(""));
drawArrow(x, y, w, h, UP);
ui.bounds(POLY(z_wizard_done_btn), x, y, w, h);
cmd.tag(1).colors(action_btn).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_DONE));
cmd.tag(0);
ui.color(bg_text_enabled);
ui.fill(POLY(z_wizard_diagram));
ui.bounds(POLY(z_wizard_heading), x, y, w, h);
cmd.font(font_large)
.text(x, y, w, h, F("Z Probe Wizard"));
}
float ZOffsetWizard::getIncrement() {
switch (mydata.increment) {
case 241: return 0.01;
case 242: return 0.1;
case 243: return 1.0;
default: return 0.0;
}
}
void ZOffsetWizard::runWizard() {
// Restore the default Z offset
constexpr float offset[] = NOZZLE_TO_PROBE_OFFSET;
setZOffset_mm(offset[Z_AXIS]);
// Move above probe point
char cmd[64], str[10];
strcpy_P(cmd, PSTR("G28 Z\nG0 F1000 X"));
dtostrf(TERN(Z_SAFE_HOMING,Z_SAFE_HOMING_X_POINT,X_CENTER), 3, 1, str);
strcat(cmd, str);
strcat_P(cmd, PSTR("Y"));
dtostrf(TERN(Z_SAFE_HOMING,Z_SAFE_HOMING_Y_POINT,Y_CENTER), 3, 1, str);
strcat(cmd, str);
strcat_P(cmd, PSTR("Z"));
dtostrf(SHEET_THICKNESS, 3, 1, str);
strcat(cmd, str);
injectCommands(cmd);
// Show instructions for user.
AlertDialogBox::show(F("\nOn the next screen, adjust the Z Offset so that a sheet of paper can pass between the nozzle and bed with slight resistance.\n\nOnce the printer stops moving, press Okay to begin.\n"));
// Set the destination screen after the dialog box.
current_screen.forget();
PUSH_SCREEN(ZOffsetWizard);
}
bool ZOffsetWizard::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1:
GOTO_PREVIOUS();
break;
case 4:
case 5:
return onTouchHeld(tag);
case 241 ... 243:
mydata.increment = tag;
break;
default:
return false;
}
return true;
}
bool ZOffsetWizard::onTouchHeld(uint8_t tag) {
const float increment = TERN(BABYSTEPPING,
mmFromWholeSteps(mmToWholeSteps(getIncrement(), Z), Z), // Round increment to nearest steps
getIncrement()
);
switch (tag) {
case 4: UI_DECREMENT(ZOffset_mm); UI_DECREMENT(AxisPosition_mm, Z); break;
case 5: UI_INCREMENT(ZOffset_mm); UI_INCREMENT(AxisPosition_mm, Z); break;
default:
return false;
}
SaveSettingsDialogBox::settingsChanged();
return true;
}
#endif // COCOA_Z_OFFSET_WIZARD

View File

@@ -0,0 +1,43 @@
/***********************
* z_offset_screen.h *
***********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* To view a copy of the GNU General Public License, go to the following *
* location: <https://www.gnu.org/licenses/>. *
****************************************************************************/
#pragma once
#define COCOA_Z_OFFSET_WIZARD
#define COCOA_Z_OFFSET_WIZARD_CLASS ZOffsetWizard
struct ZOffsetWizardData : public BaseNumericAdjustmentScreenData {
uint8_t increment;
bool softEndstopState;
};
class ZOffsetWizard : public BaseScreen, public UncachedScreen {
private:
static float getIncrement();
public:
static void runWizard();
static void onEntry();
static void onExit();
static void onRedraw(draw_mode_t);
static bool onTouchHeld(uint8_t tag);
static bool onTouchEnd(uint8_t tag);
};

View File

@@ -97,7 +97,7 @@ namespace ExtUI {
void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); } void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); }
void onPostprocessSettings() {} // Called after loading or resetting stored settings void onPostprocessSettings() {} // Called after loading or resetting stored settings
void onSettingsStored(bool success) { void onSettingsStored(const bool success) {
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE #ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
if (success && InterfaceSettingsScreen::backupEEPROM()) { if (success && InterfaceSettingsScreen::backupEEPROM()) {
SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash"); SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash");
@@ -106,9 +106,9 @@ namespace ExtUI {
UNUSED(success); UNUSED(success);
#endif #endif
} }
void onSettingsLoaded(bool) {} void onSettingsLoaded(const bool) {}
void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); } void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { sound.play_tone(frequency, duration); }
void onUserConfirmRequired(const char * const msg) { void onUserConfirmRequired(const char * const msg) {
if (msg) if (msg)
@@ -117,15 +117,26 @@ namespace ExtUI {
ConfirmUserRequestAlertBox::hide(); ConfirmUserRequestAlertBox::hide();
} }
#if HAS_LEVELING && HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
#endif
#if HAS_MESH
void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) { BedMeshViewScreen::onMeshUpdate(x, y, val); } void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) { BedMeshViewScreen::onMeshUpdate(x, y, val); }
void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { BedMeshViewScreen::onMeshUpdate(x, y, state); } void onMeshUpdate(const int8_t x, const int8_t y, const ExtUI::probe_state_t state) { BedMeshViewScreen::onMeshUpdate(x, y, state); }
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() {} // Called on resume from power-loss void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() {
// Called on resume from power-loss
}
#endif #endif
#if HAS_PID_HEATING #if HAS_PID_HEATING

View File

@@ -177,6 +177,14 @@ void CLCD::mem_write_pgm(uint32_t reg_address, const void *data, uint16_t len, u
spi_ftdi_deselect(); spi_ftdi_deselect();
} }
// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images)
void CLCD::mem_write_xbm(uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) {
spi_ftdi_select();
spi_write_addr(reg_address);
spi_write_bulk<xbm_write>(data, len, padding);
spi_ftdi_deselect();
}
// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images)
void CLCD::mem_write_xbm(uint32_t reg_address, FSTR_P data, uint16_t len, uint8_t padding) { void CLCD::mem_write_xbm(uint32_t reg_address, FSTR_P data, uint16_t len, uint8_t padding) {
spi_ftdi_select(); spi_ftdi_select();

View File

@@ -118,6 +118,7 @@ class CLCD {
static void mem_write_fill (uint32_t reg_address, uint8_t w_data, uint16_t len); static void mem_write_fill (uint32_t reg_address, uint8_t w_data, uint16_t len);
static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0);
static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0);
static void mem_write_xbm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0);
static void mem_write_bulk (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0); static void mem_write_bulk (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0);
static void mem_write_xbm (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0); static void mem_write_xbm (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0);

View File

@@ -305,14 +305,11 @@
#define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1'
#define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B.
#define IF_ENABLED TERN_
#define IF_DISABLED(O,A) _TERN(_ENA_1(O),,A) #define IF_DISABLED(O,A) _TERN(_ENA_1(O),,A)
#define ANY(V...) !DISABLED(V) #define ANY(V...) !DISABLED(V)
#define NONE(V...) DISABLED(V) #define NONE DISABLED
#define ALL(V...) ENABLED(V) #define ALL ENABLED
#define BOTH(V1,V2) ALL(V1,V2)
#define EITHER(V1,V2) ANY(V1,V2)
// Remove compiler warning on an unused variable // Remove compiler warning on an unused variable
#ifndef UNUSED #ifndef UNUSED

View File

@@ -27,11 +27,11 @@
namespace FTDI { namespace FTDI {
void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, char *text, uint32_t bgcolor, uint32_t fgcolor) { void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, char *text, uint32_t bgcolor, uint32_t fgcolor) {
const float rim = 0.3; const float rim = 0.3;
const float a = percent/100.0*2.0*PI; const float a = percent/100.0*2.0*M_PI;
const float a1 = min(PI/2, a); const float a1 = min(M_PI/2, a);
const float a2 = min(PI/2, a-a1); const float a2 = min(M_PI/2, a-a1);
const float a3 = min(PI/2, a-a1-a2); const float a3 = min(M_PI/2, a-a1-a2);
const float a4 = min(PI/2, a-a1-a2-a3); const float a4 = min(M_PI/2, a-a1-a2-a3);
const int ro = min(w,h) * 8; const int ro = min(w,h) * 8;
const int rr = ro * rim; const int rr = ro * rim;
@@ -69,21 +69,21 @@ namespace FTDI {
cmd.cmd(VERTEX2F(cx + ro*sin(a1) + 16,cy - ro*cos(a1) + 8)); cmd.cmd(VERTEX2F(cx + ro*sin(a1) + 16,cy - ro*cos(a1) + 8));
// Paint lower-right quadrant // Paint lower-right quadrant
if (a > PI/2) { if (a > M_PI/2) {
cmd.cmd(BEGIN(EDGE_STRIP_R)); cmd.cmd(BEGIN(EDGE_STRIP_R));
cmd.cmd(VERTEX2F(cx, cy)); cmd.cmd(VERTEX2F(cx, cy));
cmd.cmd(VERTEX2F(cx + ro*cos(a2),cy + ro*sin(a2) + 16)); cmd.cmd(VERTEX2F(cx + ro*cos(a2),cy + ro*sin(a2) + 16));
} }
// Paint lower-left quadrant // Paint lower-left quadrant
if (a > PI) { if (a > M_PI) {
cmd.cmd(BEGIN(EDGE_STRIP_B)); cmd.cmd(BEGIN(EDGE_STRIP_B));
cmd.cmd(VERTEX2F(cx, cy)); cmd.cmd(VERTEX2F(cx, cy));
cmd.cmd(VERTEX2F(cx - ro*sin(a3) - 8,cy + ro*cos(a3))); cmd.cmd(VERTEX2F(cx - ro*sin(a3) - 8,cy + ro*cos(a3)));
} }
// Paint upper-left quadrant // Paint upper-left quadrant
if (a > 1.5*PI) { if (a > 1.5*M_PI) {
cmd.cmd(BEGIN(EDGE_STRIP_L)); cmd.cmd(BEGIN(EDGE_STRIP_L));
cmd.cmd(VERTEX2F(cx, cy)); cmd.cmd(VERTEX2F(cx, cy));
cmd.cmd(VERTEX2F(cx - ro*cos(a4),cy - ro*sin(a4))); cmd.cmd(VERTEX2F(cx - ro*cos(a4),cy - ro*sin(a4)));

View File

@@ -66,14 +66,6 @@
* character (this is not the unicode codepoint) * character (this is not the unicode codepoint)
*/ */
utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) {
utf8_char_t val = *(uint8_t*)c++;
if ((val & 0xC0) == 0xC0)
while ((*c & 0xC0) == 0x80)
val = (val << 8) | *(uint8_t*)c++;
return val;
}
utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) { utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) {
utf8_char_t val = *(uint8_t*)c++; utf8_char_t val = *(uint8_t*)c++;
if ((val & 0xC0) == 0xC0) if ((val & 0xC0) == 0xC0)

View File

@@ -47,7 +47,6 @@ namespace FTDI {
* pointer to the next character */ * pointer to the next character */
utf8_char_t get_utf8_char_and_inc(const char *&c); utf8_char_t get_utf8_char_and_inc(const char *&c);
utf8_char_t get_utf8_char_and_inc(char *&c);
/* Returns the next character in a UTF8 string, without incrementing */ /* Returns the next character in a UTF8 string, without incrementing */

View File

@@ -30,7 +30,7 @@ if __name__ == "__main__":
parser.add_argument("-d", "--deflate", action="store_true", help="Packs the data using the deflate algorithm") parser.add_argument("-d", "--deflate", action="store_true", help="Packs the data using the deflate algorithm")
args = parser.parse_args() args = parser.parse_args()
varname = os.path.splitext(os.path.basename(args.input))[0]; varname = os.path.splitext(os.path.basename(args.input))[0]
with open(args.input, "rb") as in_file: with open(args.input, "rb") as in_file:
data = in_file.read() data = in_file.read()

View File

@@ -77,7 +77,7 @@ class WriteSource:
if len(self.values): if len(self.values):
self.blocks.append(self.values) self.blocks.append(self.values)
block_strs = []; block_strs = []
for b in self.blocks: for b in self.blocks:
data = self.convert_to_4bpp(b) data = self.convert_to_4bpp(b)
data = ', '.join(data) data = ', '.join(data)

View File

@@ -44,12 +44,12 @@ class WriteSource:
def append_rgb565(self, color): def append_rgb565(self, color):
value = ((color[0] & 0xF8) << 8) + ((color[1] & 0xFC) << 3) + ((color[2] & 0xF8) >> 3) value = ((color[0] & 0xF8) << 8) + ((color[1] & 0xFC) << 3) + ((color[2] & 0xF8) >> 3)
self.values.append((value & 0x00FF) >> 0); self.values.append((value & 0x00FF) >> 0)
self.values.append((value & 0xFF00) >> 8); self.values.append((value & 0xFF00) >> 8)
def append_rgb332(self, color): def append_rgb332(self, color):
value = (color[0] & 0xE0) + ((color[1] & 0xE0) >> 3) + ((color[2] & 0xC0) >> 6) value = (color[0] & 0xE0) + ((color[1] & 0xE0) >> 3) + ((color[2] & 0xC0) >> 6)
self.values.append(value); self.values.append(value)
def append_grayscale(self, color, bits): def append_grayscale(self, color, bits):
luminance = int(0.2126 * color[0] + 0.7152 * color[1] + 0.0722 * color[2]) luminance = int(0.2126 * color[0] + 0.7152 * color[1] + 0.0722 * color[2])
@@ -99,7 +99,7 @@ if __name__ == "__main__":
parser.add_argument("-m", "--mode", default="l1", help="Mode, can be l1, l2, l4, l8, rgb332 or rgb565") parser.add_argument("-m", "--mode", default="l1", help="Mode, can be l1, l2, l4, l8, rgb332 or rgb565")
args = parser.parse_args() args = parser.parse_args()
varname = os.path.splitext(os.path.basename(args.input))[0]; varname = os.path.splitext(os.path.basename(args.input))[0]
writer = WriteSource(args.mode) writer = WriteSource(args.mode)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# Written By Marcio Teixeira 2018 - Aleph Objects, Inc. # Written By Marcio Teixeira 2018 - Aleph Objects, Inc.
# #
@@ -18,6 +18,8 @@
from __future__ import print_function from __future__ import print_function
import argparse,re,sys import argparse,re,sys
from html.parser import HTMLParser
usage = ''' usage = '''
This program extracts line segments from a SVG file and writes This program extracts line segments from a SVG file and writes
them as coordinates in a C array. The x and y values will be them as coordinates in a C array. The x and y values will be
@@ -107,10 +109,8 @@ class ComputeBoundingBox:
print("constexpr float y_max = %f;" % self.y_max) print("constexpr float y_max = %f;" % self.y_max)
print() print()
def from_svg_view_box(self, svg): def from_svg_view_box(self, viewbox):
s = re.search('<svg[^>]+>', svg); m = re.search('([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)', viewbox)
if s:
m = re.search('viewBox="([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)"', svg)
if m: if m:
self.x_min = float(m[1]) self.x_min = float(m[1])
self.y_min = float(m[2]) self.y_min = float(m[2])
@@ -119,7 +119,6 @@ class ComputeBoundingBox:
return True return True
return False return False
# op
class WriteDataStructure: class WriteDataStructure:
def __init__(self, bounding_box): def __init__(self, bounding_box):
self.bounds = bounding_box self.bounds = bounding_box
@@ -143,18 +142,28 @@ class WriteDataStructure:
print("const PROGMEM uint16_t", id + "[] = {" + ", ".join (self.hex_words) + "};") print("const PROGMEM uint16_t", id + "[] = {" + ", ".join (self.hex_words) + "};")
self.hex_words = [] self.hex_words = []
class Parser: class SVGParser(HTMLParser):
def __init__(self, op): def __init__(self, args):
self.op = op super().__init__()
self.reset() self.args = args
self.tags = []
self.groups = []
self.op = None
self.restart()
def reset(self): def set_consumer(self, op):
self.op = op
if self.op:
self.op.reset()
def restart(self):
self.last_x = 0 self.last_x = 0
self.last_y = 0 self.last_y = 0
self.initial_x = 0 self.initial_x = 0
self.initial_y = 0 self.initial_y = 0
def process_svg_path_L_or_M(self, cmd, x, y): def process_svg_path_L_or_M(self, cmd, x, y):
if self.op:
self.op.command(cmd, x, y) self.op.command(cmd, x, y)
self.last_x = x self.last_x = x
self.last_y = y self.last_y = y
@@ -239,42 +248,71 @@ class Parser:
print("Syntax error:", d, "in path", id, "\n", file=sys.stderr) print("Syntax error:", d, "in path", id, "\n", file=sys.stderr)
quit() quit()
def process_svg_paths(self, svg): def find_attr(attrs, what):
self.op.reset() for attr, value in attrs:
for path in re.findall('<path[^>]+>', svg): if attr == what:
id = "<none>" return value
m = re.search(' id="(.*)"', path)
if m:
id = m[1]
m = re.search(' transform="(.*)"', path) def layer_matches(self):
if m: """ Are we in the correct layer?"""
if not self.args.layer:
return True
for l in self.groups:
if l and l.find(self.args.layer) != -1:
return True
return False
def handle_starttag(self, tag, attrs):
self.tags.append(tag)
if tag == 'svg':
self.viewbox = SVGParser.find_attr(attrs, 'viewbox')
if tag == 'g':
label = SVGParser.find_attr(attrs, 'inkscape:label')
self.groups.append(label)
if label and self.layer_matches():
print("Reading layer:", label, file=sys.stderr)
if tag == 'path' and self.layer_matches():
id = SVGParser.find_attr(attrs, 'id')
transform = SVGParser.find_attr(attrs, 'transform')
if transform:
print("Found transform in path", id, "! Cannot process file!", file=sys.stderr) print("Found transform in path", id, "! Cannot process file!", file=sys.stderr)
quit() quit()
d = SVGParser.find_attr(attrs, 'd')
m = re.search(' d="(.*)"', path) if d:
if m: self.process_svg_path_data(id, d)
self.process_svg_path_data(id, m[1]) if self.op:
self.op.path_finished(id) self.op.path_finished(id)
self.reset() self.restart()
def handle_endtag(self, tag):
if tag == 'g':
self.groups.pop()
if tag != self.tags.pop():
print("Error popping tag off list")
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("filename") parser.add_argument("filename")
parser.add_argument('--layer', help='only include layers which have this string in their names')
args = parser.parse_args() args = parser.parse_args()
f = open(args.filename, "r") f = open(args.filename, "r")
data = f.read() data = f.read()
print(header) # First pass to grab viewbox
p = SVGParser(args)
p.feed(data)
b = ComputeBoundingBox() b = ComputeBoundingBox()
if not b.from_svg_view_box(data): if not b.from_svg_view_box(p.viewbox):
# Can't find the view box, so use the bounding box of the elements themselves. # Can't find the view box, so use the bounding box of the elements themselves.
p = Parser(b) p = SVGParser(args)
p.process_svg_paths(data) p.set_consumer(b)
p.feed(data)
b.write() b.write()
# Last pass to process paths
w = WriteDataStructure(b) w = WriteDataStructure(b)
p = Parser(w) p = SVGParser(args)
p.process_svg_paths(data) p.set_consumer(w)
p.feed(data)

View File

@@ -95,7 +95,7 @@ void BedMeshEditScreen::setHighlightedValue(float value) {
} }
void BedMeshEditScreen::moveToHighlightedValue() { void BedMeshEditScreen::moveToHighlightedValue() {
if (ExtUI::getMeshValid()) { if (ExtUI::getLevelingIsValid()) {
ExtUI::setLevelingActive(true); ExtUI::setLevelingActive(true);
ExtUI::setSoftEndstopState(false); ExtUI::setSoftEndstopState(false);
ExtUI::moveToMeshPoint(mydata.highlight, gaugeThickness + mydata.zAdjustment); ExtUI::moveToMeshPoint(mydata.highlight, gaugeThickness + mydata.zAdjustment);
@@ -174,11 +174,11 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) {
case 1: case 1:
// On Cancel, reload saved mesh, discarding changes // On Cancel, reload saved mesh, discarding changes
GOTO_PREVIOUS(); GOTO_PREVIOUS();
injectCommands(F("G29 L1")); injectCommands(F(TERN(AUTO_BED_LEVELING_UBL, "G29 L1", "M501")));
return true; return true;
case 2: case 2:
saveAdjustedHighlightedValue(); saveAdjustedHighlightedValue();
injectCommands(F("G29 S1")); injectCommands(F(TERN(AUTO_BED_LEVELING_UBL, "G29 S1", "M500")));
mydata.needSave = false; mydata.needSave = false;
return true; return true;
case 3: case 3:
@@ -191,7 +191,7 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) {
void BedMeshEditScreen::show() { void BedMeshEditScreen::show() {
// On entry, always home (to account for possible Z offset changes) and save current mesh // On entry, always home (to account for possible Z offset changes) and save current mesh
SpinnerDialogBox::enqueueAndWait(F("G28\nG29 S1")); SpinnerDialogBox::enqueueAndWait(F("G28\n" TERN(AUTO_BED_LEVELING_UBL, "G29 S1", "M500")));
// After the spinner, go to this screen. // After the spinner, go to this screen.
current_screen.forget(); current_screen.forget();
PUSH_SCREEN(BedMeshEditScreen); PUSH_SCREEN(BedMeshEditScreen);

View File

@@ -53,10 +53,7 @@ constexpr static float gaugeThickness = 0.25;
#endif #endif
static float meshGetter(uint8_t x, uint8_t y, void*) { static float meshGetter(uint8_t x, uint8_t y, void*) {
xy_uint8_t pos; return ExtUI::getMeshPoint(xy_uint8_t({ x, y }));
pos.x = x;
pos.y = y;
return ExtUI::getMeshPoint(pos);
} }
void BedMeshViewScreen::onEntry() { void BedMeshViewScreen::onEntry() {
@@ -125,7 +122,7 @@ void BedMeshViewScreen::onMeshUpdate(const int8_t x, const int8_t y, const ExtUI
mydata.count = 0; mydata.count = 0;
break; break;
case ExtUI::G29_FINISH: case ExtUI::G29_FINISH:
if (mydata.count == GRID_MAX_POINTS && ExtUI::getMeshValid()) if (mydata.count == GRID_MAX_POINTS && ExtUI::getLevelingIsValid())
mydata.message = GET_TEXT_F(MSG_BED_MAPPING_DONE); mydata.message = GET_TEXT_F(MSG_BED_MAPPING_DONE);
else else
mydata.message = GET_TEXT_F(MSG_BED_MAPPING_INCOMPLETE); mydata.message = GET_TEXT_F(MSG_BED_MAPPING_INCOMPLETE);
@@ -158,7 +155,7 @@ void BedMeshViewScreen::doProbe() {
} }
void BedMeshViewScreen::show() { void BedMeshViewScreen::show() {
injectCommands(F("G29 L1")); TERN_(AUTO_BED_LEVELING_UBL, injectCommands(F("G29 L1")));
GOTO_SCREEN(BedMeshViewScreen); GOTO_SCREEN(BedMeshViewScreen);
} }

View File

@@ -26,7 +26,7 @@
struct BedMeshViewScreenData { struct BedMeshViewScreenData {
FSTR_P message; FSTR_P message;
uint8_t count; grid_count_t count;
xy_uint8_t highlight; xy_uint8_t highlight;
}; };

View File

@@ -30,7 +30,7 @@
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN) #if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
#if ENABLED(TOUCH_UI_PORTRAIT) #if ENABLED(TOUCH_UI_PORTRAIT)
#include "../theme/bootscreen_logo_portrait.h" #include "../theme/_bootscreen_portrait.h"
#else #else
#include "../theme/_bootscreen_landscape.h" #include "../theme/_bootscreen_landscape.h"
#endif #endif

View File

@@ -41,7 +41,7 @@ void EndstopStatesScreen::onExit() {
#define GRID_ROWS 7 #define GRID_ROWS 7
#define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL) #define PIN_BTN(X,Y,PIN,LABEL) button(BTN_POS(X,Y), BTN_SIZE(2,1), LABEL)
#define PIN_ENABLED(X,Y,LABEL,PIN,INV) cmd.enabled(1).colors(READ(PIN##_PIN) != INV ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL); #define PIN_ENABLED(X,Y,LABEL,PIN,ST) cmd.enabled(1).colors(READ(PIN##_PIN) == ST ? action_btn : normal_btn).PIN_BTN(X,Y,PIN,LABEL);
#define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL); #define PIN_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL);
void EndstopStatesScreen::onRedraw(draw_mode_t) { void EndstopStatesScreen::onRedraw(draw_mode_t) {
@@ -54,32 +54,32 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
cmd.font(TERN(TOUCH_UI_PORTRAIT, font_large, font_medium)) cmd.font(TERN(TOUCH_UI_PORTRAIT, font_large, font_medium))
.text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS)) .text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
.font(font_tiny); .font(font_tiny);
#if HAS_X_MAX #if USE_X_MAX
PIN_ENABLED (1, 2, PSTR(STR_X_MAX), X_MAX, X_MAX_ENDSTOP_INVERTING) PIN_ENABLED (1, 2, PSTR(STR_X_MAX), X_MAX, X_MAX_ENDSTOP_INVERTING)
#else #else
PIN_DISABLED(1, 2, PSTR(STR_X_MAX), X_MAX) PIN_DISABLED(1, 2, PSTR(STR_X_MAX), X_MAX)
#endif #endif
#if HAS_Y_MAX #if USE_Y_MAX
PIN_ENABLED (3, 2, PSTR(STR_Y_MAX), Y_MAX, Y_MAX_ENDSTOP_INVERTING) PIN_ENABLED (3, 2, PSTR(STR_Y_MAX), Y_MAX, Y_MAX_ENDSTOP_INVERTING)
#else #else
PIN_DISABLED(3, 2, PSTR(STR_Y_MAX), Y_MAX) PIN_DISABLED(3, 2, PSTR(STR_Y_MAX), Y_MAX)
#endif #endif
#if HAS_Z_MAX #if USE_Z_MAX
PIN_ENABLED (5, 2, PSTR(STR_Z_MAX), Z_MAX, Z_MAX_ENDSTOP_INVERTING) PIN_ENABLED (5, 2, PSTR(STR_Z_MAX), Z_MAX, Z_MAX_ENDSTOP_INVERTING)
#else #else
PIN_DISABLED(5, 2, PSTR(STR_Z_MAX), Z_MAX) PIN_DISABLED(5, 2, PSTR(STR_Z_MAX), Z_MAX)
#endif #endif
#if HAS_X_MIN #if USE_X_MIN
PIN_ENABLED (1, 3, PSTR(STR_X_MIN), X_MIN, X_MIN_ENDSTOP_INVERTING) PIN_ENABLED (1, 3, PSTR(STR_X_MIN), X_MIN, X_MIN_ENDSTOP_INVERTING)
#else #else
PIN_DISABLED(1, 3, PSTR(STR_X_MIN), X_MIN) PIN_DISABLED(1, 3, PSTR(STR_X_MIN), X_MIN)
#endif #endif
#if HAS_Y_MIN #if USE_Y_MIN
PIN_ENABLED (3, 3, PSTR(STR_Y_MIN), Y_MIN, Y_MIN_ENDSTOP_INVERTING) PIN_ENABLED (3, 3, PSTR(STR_Y_MIN), Y_MIN, Y_MIN_ENDSTOP_INVERTING)
#else #else
PIN_DISABLED(3, 3, PSTR(STR_Y_MIN), Y_MIN) PIN_DISABLED(3, 3, PSTR(STR_Y_MIN), Y_MIN)
#endif #endif
#if HAS_Z_MIN #if USE_Z_MIN
PIN_ENABLED (5, 3, PSTR(STR_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_INVERTING) PIN_ENABLED (5, 3, PSTR(STR_Z_MIN), Z_MIN, Z_MIN_ENDSTOP_INVERTING)
#else #else
PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN)

View File

@@ -46,7 +46,9 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) { bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) {
using namespace ExtUI; using namespace ExtUI;
#if HAS_FILAMENT_RUNOUT_DISTANCE
const float increment = getIncrement(); const float increment = getIncrement();
#endif
switch (tag) { switch (tag) {
case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break; case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break;
#if HAS_FILAMENT_RUNOUT_DISTANCE #if HAS_FILAMENT_RUNOUT_DISTANCE

View File

@@ -53,6 +53,8 @@ void LanguageMenu::onRedraw(draw_mode_t) {
#endif #endif
} }
extern uint8_t ftdi_language;
bool LanguageMenu::onTouchEnd(uint8_t tag) { bool LanguageMenu::onTouchEnd(uint8_t tag) {
if (tag > 0 && tag <= NUM_LANGUAGES) { if (tag > 0 && tag <= NUM_LANGUAGES) {

View File

@@ -25,7 +25,7 @@
#ifdef FTDI_LEVELING_MENU #ifdef FTDI_LEVELING_MENU
#if ALL(HAS_BED_PROBE,BLTOUCH) #if ALL(HAS_BED_PROBE, BLTOUCH)
#include "../../../../feature/bltouch.h" #include "../../../../feature/bltouch.h"
#endif #endif
@@ -81,7 +81,7 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
.text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH))
#endif #endif
.font(font_medium).colors(normal_btn) .font(font_medium).colors(normal_btn)
.enabled(ANY(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)) .enabled(ANY(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION))
.tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_LEVEL_X_AXIS)) .tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_LEVEL_X_AXIS))
.enabled(ENABLED(HAS_BED_PROBE)) .enabled(ENABLED(HAS_BED_PROBE))
.tag(3).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) .tag(3).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED))
@@ -103,7 +103,7 @@ void LevelingMenu::onRedraw(draw_mode_t what) {
bool LevelingMenu::onTouchEnd(uint8_t tag) { bool LevelingMenu::onTouchEnd(uint8_t tag) {
switch (tag) { switch (tag) {
case 1: GOTO_PREVIOUS(); break; case 1: GOTO_PREVIOUS(); break;
#if ANY(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION) #if ANY(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)
case 2: SpinnerDialogBox::enqueueAndWait(F("G34")); break; case 2: SpinnerDialogBox::enqueueAndWait(F("G34")); break;
#endif #endif
#if HAS_BED_PROBE #if HAS_BED_PROBE

View File

@@ -106,10 +106,18 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break; case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break;
#if ENABLED(NOZZLE_CLEAN_FEATURE) #if ENABLED(NOZZLE_CLEAN_FEATURE)
case 3: injectCommands(F("G12")); GOTO_SCREEN(StatusScreen); break; case 3:
injectCommands(F("G12"));
GOTO_SCREEN(StatusScreen); break;
#endif #endif
case 4: GOTO_SCREEN(MoveAxisScreen); break; case 4: GOTO_SCREEN(MoveAxisScreen); break;
case 5: injectCommands(F("M84")); break; case 5:
injectCommands(F("M84 E"
TERN_(DISABLE_IDLE_X, " X")
TERN_(DISABLE_IDLE_Y, " Y")
TERN_(DISABLE_IDLE_Z, " Z")
));
break;
case 6: GOTO_SCREEN(TemperatureScreen); break; case 6: GOTO_SCREEN(TemperatureScreen); break;
case 7: GOTO_SCREEN(ChangeFilamentScreen); break; case 7: GOTO_SCREEN(ChangeFilamentScreen); break;
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;

View File

@@ -72,13 +72,15 @@ void MoveAxisScreen::onRedraw(draw_mode_t what) {
w.increments(); w.increments();
} }
bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) { bool BaseMoveAxisScreen::onTouchHeld(const uint8_t tag) {
#define UI_INCREMENT_AXIS(axis) setManualFeedrate(axis, increment); UI_INCREMENT(AxisPosition_mm, axis); #define UI_INCREMENT_AXIS(axis) setManualFeedrate(axis, increment); UI_INCREMENT(AxisPosition_mm, axis);
#define UI_DECREMENT_AXIS(axis) setManualFeedrate(axis, increment); UI_DECREMENT(AxisPosition_mm, axis); #define UI_DECREMENT_AXIS(axis) setManualFeedrate(axis, increment); UI_DECREMENT(AxisPosition_mm, axis);
const float increment = getIncrement(); const float increment = getIncrement();
switch (tag) { switch (tag) {
#if HAS_X_AXIS
case 2: UI_DECREMENT_AXIS(X); break; case 2: UI_DECREMENT_AXIS(X); break;
case 3: UI_INCREMENT_AXIS(X); break; case 3: UI_INCREMENT_AXIS(X); break;
#endif
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
// For extruders, also update relative distances. // For extruders, also update relative distances.
case 8: UI_DECREMENT_AXIS(E0); mydata.e_rel[0] -= increment; break; case 8: UI_DECREMENT_AXIS(E0); mydata.e_rel[0] -= increment; break;
@@ -120,20 +122,20 @@ void BaseMoveAxisScreen::raiseZtoTop() {
setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate.z); setAxisPosition_mm(Z_MAX_POS - 5, Z, homing_feedrate.z);
} }
float BaseMoveAxisScreen::getManualFeedrate(uint8_t axis, float increment_mm) { float BaseMoveAxisScreen::getManualFeedrate(const uint8_t axis, const_float_t increment_mm) {
// Compute feedrate so that the tool lags the adjuster when it is // Compute feedrate so that the tool lags the adjuster when it is
// being held down, this allows enough margin for the planner to // being held down, this allows enough margin for the planner to
// connect segments and even out the motion. // connect segments and even out the motion.
constexpr xyze_feedrate_t max_manual_feedrate = MANUAL_FEEDRATE; constexpr xyze_feedrate_t max_manual_feedrate = MANUAL_FEEDRATE;
return min(max_manual_feedrate[axis] / 60.0f, ABS(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f)); return min(MMM_TO_MMS(max_manual_feedrate[axis]), ABS(increment_mm * (TOUCH_REPEATS_PER_SECOND) * 0.80f));
} }
void BaseMoveAxisScreen::setManualFeedrate(ExtUI::axis_t axis, float increment_mm) { void BaseMoveAxisScreen::setManualFeedrate(const ExtUI::axis_t axis, const_float_t increment_mm) {
ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm)); ExtUI::setFeedrate_mm_s(getManualFeedrate(X_AXIS + (axis - ExtUI::X), increment_mm));
} }
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
void BaseMoveAxisScreen::setManualFeedrate(ExtUI::extruder_t, float increment_mm) { void BaseMoveAxisScreen::setManualFeedrate(const ExtUI::extruder_t, const_float_t increment_mm) {
ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm)); ExtUI::setFeedrate_mm_s(getManualFeedrate(E_AXIS, increment_mm));
} }
#endif #endif

View File

@@ -32,14 +32,14 @@ struct MoveAxisScreenData {
class BaseMoveAxisScreen : public BaseNumericAdjustmentScreen { class BaseMoveAxisScreen : public BaseNumericAdjustmentScreen {
private: private:
static float getManualFeedrate(uint8_t axis, float increment_mm); static float getManualFeedrate(const uint8_t axis, const_float_t increment_mm);
public: public:
static void raiseZtoTop(); static void raiseZtoTop();
static void setManualFeedrate(ExtUI::axis_t, float increment_mm); static void setManualFeedrate(const ExtUI::axis_t, const_float_t increment_mm);
static void setManualFeedrate(ExtUI::extruder_t, float increment_mm); static void setManualFeedrate(const ExtUI::extruder_t, const_float_t increment_mm);
static void onEntry(); static void onEntry();
static bool onTouchHeld(uint8_t tag); static bool onTouchHeld(const uint8_t tag);
}; };
class MoveAxisScreen : public BaseMoveAxisScreen, public CachedScreen<MOVE_AXIS_SCREEN_CACHE> { class MoveAxisScreen : public BaseMoveAxisScreen, public CachedScreen<MOVE_AXIS_SCREEN_CACHE> {

View File

@@ -376,10 +376,10 @@ void StatusScreen::loadBitmaps() {
// Load the bitmaps for the status screen // Load the bitmaps for the status screen
using namespace Theme; using namespace Theme;
constexpr uint32_t base = ftdi_memory_map::RAM_G; constexpr uint32_t base = ftdi_memory_map::RAM_G;
CLCD::mem_write_pgm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); CLCD::mem_write_xbm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon));
CLCD::mem_write_pgm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); CLCD::mem_write_xbm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon));
CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); CLCD::mem_write_xbm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon));
CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); CLCD::mem_write_xbm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon));
// Load fonts for internationalization // Load fonts for internationalization
#if ENABLED(TOUCH_UI_USE_UTF8) #if ENABLED(TOUCH_UI_USE_UTF8)

View File

@@ -66,7 +66,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) {
#if HAS_HEATED_CHAMBER #if HAS_HEATED_CHAMBER
w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER)); w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER));
#endif #endif
#if HAS_FAN #if HAS_FAN0
w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT)); w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT));
w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0)); w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0));
#endif #endif

View File

@@ -91,7 +91,6 @@ namespace Language_en {
LSTR MSG_IDLE = u8"idle"; LSTR MSG_IDLE = u8"idle";
LSTR MSG_SET_MAXIMUM = u8"Set Maximum"; LSTR MSG_SET_MAXIMUM = u8"Set Maximum";
LSTR MSG_PRINT_SPEED = u8"Print Speed"; LSTR MSG_PRINT_SPEED = u8"Print Speed";
LSTR MSG_LINEAR_ADVANCE = u8"Linear Advance";
LSTR MSG_LINEAR_ADVANCE_K = u8"K"; LSTR MSG_LINEAR_ADVANCE_K = u8"K";
LSTR MSG_LINEAR_ADVANCE_K1 = u8"K E1"; LSTR MSG_LINEAR_ADVANCE_K1 = u8"K E1";
LSTR MSG_LINEAR_ADVANCE_K2 = u8"K E2"; LSTR MSG_LINEAR_ADVANCE_K2 = u8"K E2";
@@ -148,6 +147,8 @@ namespace Language_en {
LSTR MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top"; LSTR MSG_MOVE_Z_TO_TOP = u8"Raise Z to Top";
LSTR MSG_MAX_SPEED_NO_UNITS = u8"Max Speed"; LSTR MSG_MAX_SPEED_NO_UNITS = u8"Max Speed";
//LSTR MSG_FTDI_HEATER_TIMEOUT = u8"Idle timeout, temperature decreased. Press Okay to reheat and again to resume.";
#if ENABLED(TOUCH_UI_LULZBOT_BIO) #if ENABLED(TOUCH_UI_LULZBOT_BIO)
LSTR MSG_MOVE_TO_HOME = u8"Move to Home"; LSTR MSG_MOVE_TO_HOME = u8"Move to Home";
LSTR MSG_RAISE_PLUNGER = u8"Raise Plunger"; LSTR MSG_RAISE_PLUNGER = u8"Raise Plunger";
@@ -170,8 +171,6 @@ namespace Language_en {
LSTR MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; LSTR MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate";
LSTR MSG_PREHEAT_FINISHED = u8"Preheat finished"; LSTR MSG_PREHEAT_FINISHED = u8"Preheat finished";
LSTR MSG_PREHEAT = u8"Preheat"; LSTR MSG_PREHEAT = u8"Preheat";
LSTR MSG_BUTTON_PAUSE = u8"Pause";
LSTR MSG_BUTTON_RESUME = u8"Resume";
LSTR MSG_ELAPSED_PRINT = u8"Elapsed Print"; LSTR MSG_ELAPSED_PRINT = u8"Elapsed Print";
LSTR MSG_XYZ_MOVE = u8"XYZ Move"; LSTR MSG_XYZ_MOVE = u8"XYZ Move";
LSTR MSG_E_MOVE = u8"Extrusion Move"; LSTR MSG_E_MOVE = u8"Extrusion Move";

View File

@@ -62,9 +62,11 @@ union screen_data_t {
DECL_DATA_IF_INCLUDED(FTDI_Z_OFFSET_SCREEN) DECL_DATA_IF_INCLUDED(FTDI_Z_OFFSET_SCREEN)
DECL_DATA_IF_INCLUDED(FTDI_BASE_NUMERIC_ADJ_SCREEN) DECL_DATA_IF_INCLUDED(FTDI_BASE_NUMERIC_ADJ_SCREEN)
DECL_DATA_IF_INCLUDED(FTDI_ALERT_DIALOG_BOX) DECL_DATA_IF_INCLUDED(FTDI_ALERT_DIALOG_BOX)
DECL_DATA_IF_INCLUDED(COCOA_STATUS_SCREEN)
DECL_DATA_IF_INCLUDED(COCOA_PREHEAT_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_PREHEAT_SCREEN)
DECL_DATA_IF_INCLUDED(COCOA_LOAD_CHOCOLATE_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_LOAD_CHOCOLATE_SCREEN)
DECL_DATA_IF_INCLUDED(COCOA_FILES_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_FILES_SCREEN)
DECL_DATA_IF_INCLUDED(COCOA_Z_OFFSET_WIZARD)
}; };
extern screen_data_t screen_data; extern screen_data_t screen_data;

View File

@@ -117,6 +117,10 @@ SCREEN_TABLE {
DECL_SCREEN_IF_INCLUDED(COCOA_MOVE_E_SCREEN) DECL_SCREEN_IF_INCLUDED(COCOA_MOVE_E_SCREEN)
DECL_SCREEN_IF_INCLUDED(COCOA_CONFIRM_START_PRINT) DECL_SCREEN_IF_INCLUDED(COCOA_CONFIRM_START_PRINT)
DECL_SCREEN_IF_INCLUDED(COCOA_FILES_SCREEN) DECL_SCREEN_IF_INCLUDED(COCOA_FILES_SCREEN)
DECL_SCREEN_IF_INCLUDED(COCOA_Z_OFFSET_SCREEN)
DECL_SCREEN_IF_INCLUDED(COCOA_Z_OFFSET_WIZARD)
DECL_SCREEN_IF_INCLUDED(COCOA_ABOUT_SCREEN)
DECL_SCREEN_IF_INCLUDED(COCOA_STATISTICS_SCREEN)
}; };
SCREEN_TABLE_POST SCREEN_TABLE_POST

View File

@@ -37,25 +37,25 @@ namespace Theme {
}; };
constexpr PROGMEM unsigned char Extruder_Icon[69] = { constexpr PROGMEM unsigned char Extruder_Icon[69] = {
0x3F, 0xFF, 0xFC, 0xFC, 0xFF, 0x3F,
0x7F, 0xFF, 0xFE, 0xFE, 0xFF, 0x7F,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0x7F, 0xFF, 0xFE, 0xFE, 0xFF, 0x7F,
0x3F, 0xFF, 0xFC, 0xFC, 0xFF, 0x3F,
0x3F, 0xFF, 0xFC, 0xFC, 0xFF, 0x3F,
0x7F, 0xFF, 0xFE, 0xFE, 0xFF, 0x7F,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0xC0, 0x00, 0x03, 0x03, 0x00, 0xC0,
0x7F, 0xFF, 0xFE, 0xFE, 0xFF, 0x7F,
0x7F, 0xFF, 0xFE, 0xFE, 0xFF, 0x7F,
0x07, 0xFF, 0xE0, 0xE0, 0xFF, 0x07,
0x03, 0xFF, 0xC0, 0xC0, 0xFF, 0x03,
0x01, 0x81, 0x80, 0x80, 0x81, 0x01,
0x00, 0xC3, 0x00, 0x00, 0xC3, 0x00,
0x00, 0x66, 0x00, 0x00, 0x66, 0x00,
0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00,
@@ -74,28 +74,28 @@ namespace Theme {
}; };
constexpr PROGMEM unsigned char Bed_Heat_Icon[92] = { constexpr PROGMEM unsigned char Bed_Heat_Icon[92] = {
0x01, 0x81, 0x81, 0x80, 0x80, 0x81, 0x81, 0x01,
0x01, 0x81, 0x81, 0x80, 0x80, 0x81, 0x81, 0x01,
0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x03, 0x03, 0x03,
0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x03, 0x03, 0x03,
0x00, 0x60, 0x60, 0x60, 0x00, 0x06, 0x06, 0x06,
0x00, 0x60, 0x60, 0x60, 0x00, 0x06, 0x06, 0x06,
0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x03, 0x03, 0x03,
0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x03, 0x03, 0x03,
0x01, 0x81, 0x81, 0x80, 0x80, 0x81, 0x81, 0x01,
0x01, 0x81, 0x81, 0x80, 0x80, 0x81, 0x81, 0x01,
0x03, 0x03, 0x03, 0x00, 0xC0, 0xC0, 0xC0, 0x00,
0x03, 0x03, 0x03, 0x00, 0xC0, 0xC0, 0xC0, 0x00,
0x06, 0x06, 0x06, 0x00, 0x60, 0x60, 0x60, 0x00,
0x06, 0x06, 0x06, 0x00, 0x60, 0x60, 0x60, 0x00,
0x03, 0x03, 0x03, 0x00, 0xC0, 0xC0, 0xC0, 0x00,
0x03, 0x03, 0x03, 0x00, 0xC0, 0xC0, 0xC0, 0x00,
0x01, 0x81, 0x81, 0x80, 0x80, 0x81, 0x81, 0x01,
0x01, 0x81, 0x81, 0x80, 0x80, 0x81, 0x81, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xC0, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0xC0,
0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF
}; };
@@ -113,34 +113,34 @@ namespace Theme {
constexpr PROGMEM unsigned char Fan_Icon[128] = { constexpr PROGMEM unsigned char Fan_Icon[128] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF8, 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00, 0xF8,
0xF0, 0x03, 0xF8, 0x0F, 0x0F, 0xC0, 0x1F, 0xF0,
0xE0, 0x07, 0xF0, 0x07, 0x07, 0xE0, 0x0F, 0xE0,
0xC0, 0x0F, 0xE0, 0x03, 0x03, 0xF0, 0x07, 0xC0,
0xC0, 0x1F, 0xE0, 0x03, 0x03, 0xF8, 0x07, 0xC0,
0xC0, 0x1F, 0xE0, 0x03, 0x03, 0xF8, 0x07, 0xC0,
0xC0, 0x0F, 0xE0, 0x03, 0x03, 0xF0, 0x07, 0xC0,
0xC0, 0x07, 0xE0, 0x03, 0x03, 0xE0, 0x07, 0xC0,
0xC0, 0x03, 0xC0, 0x03, 0x03, 0xC0, 0x03, 0xC0,
0xD0, 0x00, 0x00, 0xC3, 0x0B, 0x00, 0x00, 0xC3,
0xD8, 0x03, 0xC1, 0xE3, 0x1B, 0xC0, 0x83, 0xC7,
0xDF, 0xC7, 0xE3, 0xF3, 0xFB, 0xE3, 0xC7, 0xCF,
0xDF, 0xEF, 0xF7, 0xFB, 0xFB, 0xF7, 0xEF, 0xDF,
0xDF, 0xEF, 0xF7, 0xFB, 0xFB, 0xF7, 0xEF, 0xDF,
0xDF, 0xEF, 0xF7, 0xFB, 0xFB, 0xF7, 0xEF, 0xDF,
0xDF, 0xEF, 0xF7, 0xFB, 0xFB, 0xF7, 0xEF, 0xDF,
0xCF, 0xC7, 0xE3, 0xFB, 0xF3, 0xE3, 0xC7, 0xDF,
0xC7, 0x83, 0xC0, 0x1B, 0xE3, 0xC1, 0x03, 0xD8,
0xC3, 0x00, 0x00, 0x0B, 0xC3, 0x00, 0x00, 0xD0,
0xC0, 0x03, 0xC0, 0x03, 0x03, 0xC0, 0x03, 0xC0,
0xC0, 0x07, 0xE0, 0x03, 0x03, 0xE0, 0x07, 0xC0,
0xC0, 0x07, 0xF0, 0x03, 0x03, 0xE0, 0x0F, 0xC0,
0xC0, 0x07, 0xF8, 0x03, 0x03, 0xE0, 0x1F, 0xC0,
0xC0, 0x07, 0xF8, 0x03, 0x03, 0xE0, 0x1F, 0xC0,
0xC0, 0x07, 0xF0, 0x03, 0x03, 0xE0, 0x0F, 0xC0,
0xE0, 0x0F, 0xE0, 0x07, 0x07, 0xF0, 0x07, 0xE0,
0xF0, 0x1F, 0xC0, 0x0F, 0x0F, 0xF8, 0x03, 0xF0,
0xF8, 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00, 0xF8,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF
}; };
@@ -157,26 +157,26 @@ namespace Theme {
}; };
constexpr PROGMEM unsigned char TD_Icon[140] = { constexpr PROGMEM unsigned char TD_Icon[140] = {
0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, // Thumb Drive Widget 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, // Thumb Drive Widget
0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01,
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03,
0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03,
0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01,
0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, 0x00
}; };
constexpr PROGMEM bitmap_info_t File_Icon_Info = { constexpr PROGMEM bitmap_info_t File_Icon_Info = {
@@ -191,17 +191,17 @@ namespace Theme {
}; };
const unsigned char File_Icon[128] PROGMEM = { const unsigned char File_Icon[128] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x02, 0xC0, 0x00, 0x00,
0x40, 0x02, 0x80, 0x00, 0x40, 0x02, 0x40, 0x00, 0x40, 0x02, 0x20, 0x00, 0x02, 0x40, 0x01, 0x00, 0x02, 0x40, 0x02, 0x00, 0x02, 0x40, 0x04, 0x00,
0x40, 0x02, 0x10, 0x00, 0x40, 0x02, 0x08, 0x00, 0x40, 0x02, 0x04, 0x00, 0x02, 0x40, 0x08, 0x00, 0x02, 0x40, 0x10, 0x00, 0x02, 0x40, 0x20, 0x00,
0x40, 0x02, 0x02, 0x00, 0x40, 0x03, 0xFF, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x40, 0x40, 0x00, 0x02, 0xC0, 0xFF, 0x00, 0x02, 0x00, 0x80, 0x00,
0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00,
0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00,
0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00,
0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00,
0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00,
0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00,
0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
constexpr PROGMEM bitmap_info_t Clock_Icon_Info = { constexpr PROGMEM bitmap_info_t Clock_Icon_Info = {
@@ -216,17 +216,17 @@ namespace Theme {
}; };
const unsigned char Clock_Icon[128] PROGMEM = { const unsigned char Clock_Icon[128] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x7E, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x7E, 0x7E, 0x00,
0x00, 0xE0, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x07, 0x01, 0x00, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0xC0, 0x01, 0x80, 0x03, 0xE0, 0x80, 0x00, 0x07,
0x0C, 0x01, 0x80, 0x70, 0x0C, 0x01, 0x80, 0x30, 0x18, 0x01, 0x80, 0x18, 0x30, 0x80, 0x01, 0x0E, 0x30, 0x80, 0x01, 0x0C, 0x18, 0x80, 0x01, 0x18,
0x30, 0x01, 0x80, 0x08, 0x30, 0x01, 0x80, 0x0C, 0x20, 0x01, 0x80, 0x0C, 0x0C, 0x80, 0x01, 0x10, 0x0C, 0x80, 0x01, 0x30, 0x04, 0x80, 0x01, 0x30,
0x60, 0x01, 0x80, 0x04, 0x60, 0x01, 0x80, 0x06, 0x60, 0x01, 0x80, 0x06, 0x06, 0x80, 0x01, 0x20, 0x06, 0x80, 0x01, 0x60, 0x06, 0x80, 0x01, 0x60,
0x60, 0x01, 0xFF, 0x06, 0x60, 0x01, 0xFF, 0x06, 0x60, 0x00, 0x00, 0x06, 0x06, 0x80, 0xFF, 0x60, 0x06, 0x80, 0xFF, 0x60, 0x06, 0x00, 0x00, 0x60,
0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x0C, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x30,
0x30, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x30, 0x0C, 0x00, 0x00, 0x10, 0x18, 0x00, 0x00, 0x18,
0x0C, 0x00, 0x00, 0x30, 0x0E, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0xE0, 0x30, 0x00, 0x00, 0x0C, 0x70, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x07,
0x03, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFE, 0x7F, 0x00,
0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
constexpr PROGMEM bitmap_info_t Light_Bulb_Info = { constexpr PROGMEM bitmap_info_t Light_Bulb_Info = {
@@ -241,17 +241,42 @@ namespace Theme {
}; };
const unsigned char Light_Bulb[128] PROGMEM = { const unsigned char Light_Bulb[128] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02,
0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, 0x40, 0x00, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01, 0x40, 0x00,
0x00, 0x0F, 0xE0, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x36, 0x18, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x6C, 0x18, 0x00,
0x00, 0x2C, 0x08, 0x00, 0x00, 0x58, 0x04, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0x34, 0x10, 0x00, 0x00, 0x1A, 0x20, 0x00, 0x00, 0x0A, 0x20, 0x00,
0x7C, 0x50, 0x04, 0x7C, 0x00, 0x40, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, 0x3E, 0x0A, 0x20, 0x3E, 0x00, 0x02, 0x20, 0x00, 0x00, 0x02, 0x20, 0x00,
0x00, 0x60, 0x0C, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00,
0x00, 0x10, 0x10, 0x00, 0x00, 0x88, 0x22, 0x00, 0x01, 0x08, 0x21, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x11, 0x44, 0x00, 0x80, 0x10, 0x84, 0x00,
0x02, 0x08, 0x20, 0x80, 0x04, 0x0F, 0xE0, 0x40, 0x00, 0x07, 0xC0, 0x00, 0x40, 0x10, 0x04, 0x01, 0x20, 0xF0, 0x07, 0x02, 0x00, 0xE0, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
};
constexpr PROGMEM bitmap_info_t Chamber_Icon_Info = {
.format = L1,
.linestride = 4,
.filter = BILINEAR,
.wrapx = BORDER,
.wrapy = BORDER,
.RAMG_offset = 8813,
.width = 32,
.height = 32,
};
const unsigned char Chamber_Icon[128] PROGMEM = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8,
0x0F, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xC0,
0x03, 0x00, 0x00, 0xC0, 0x83, 0x81, 0x81, 0xC1, 0x83, 0x81, 0x81, 0xC1,
0x03, 0x03, 0x03, 0xC3, 0x03, 0x03, 0x03, 0xC3, 0x03, 0x06, 0x06, 0xC6,
0x03, 0x06, 0x06, 0xC6, 0x03, 0x03, 0x03, 0xC3, 0x03, 0x03, 0x03, 0xC3,
0x83, 0x81, 0x81, 0xC1, 0x83, 0x81, 0x81, 0xC1, 0xC3, 0xC0, 0xC0, 0xC0,
0xC3, 0xC0, 0xC0, 0xC0, 0x63, 0x60, 0x60, 0xC0, 0x63, 0x60, 0x60, 0xC0,
0xC3, 0xC0, 0xC0, 0xC0, 0xC3, 0xC0, 0xC0, 0xC0, 0x83, 0x81, 0x81, 0xC1,
0x83, 0x81, 0x81, 0xC1, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0,
0x07, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0xF8,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
}; };
constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000; constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000;

File diff suppressed because one or more lines are too long

View File

@@ -299,6 +299,44 @@ namespace Theme {
{SILENCE, END_SONG, 0} {SILENCE, END_SONG, 0}
}; };
const PROGMEM SoundPlayer::sound_t flagpole[] = {
{TRIANGLE_WAVE, NOTE_G3, 2},
{TRIANGLE_WAVE, NOTE_C4, 2},
{TRIANGLE_WAVE, NOTE_E4, 2},
{TRIANGLE_WAVE, NOTE_G4, 2},
{TRIANGLE_WAVE, NOTE_C5, 2},
{TRIANGLE_WAVE, NOTE_E5, 2},
{TRIANGLE_WAVE, NOTE_G5, 5},
{TRIANGLE_WAVE, NOTE_E5, 2},
{TRIANGLE_WAVE, NOTE_G3S, 2},
{TRIANGLE_WAVE, NOTE_C4, 2},
{TRIANGLE_WAVE, NOTE_D4S, 2},
{TRIANGLE_WAVE, NOTE_G4S, 2},
{TRIANGLE_WAVE, NOTE_C5, 2},
{TRIANGLE_WAVE, NOTE_D5S, 2},
{TRIANGLE_WAVE, NOTE_G5S, 5},
{TRIANGLE_WAVE, NOTE_D5S, 5},
{TRIANGLE_WAVE, NOTE_A3S, 2},
{TRIANGLE_WAVE, NOTE_D4, 2},
{TRIANGLE_WAVE, NOTE_F4, 2},
{TRIANGLE_WAVE, NOTE_A4S, 2},
{TRIANGLE_WAVE, NOTE_D5, 2},
{TRIANGLE_WAVE, NOTE_F5, 2},
{TRIANGLE_WAVE, NOTE_A5S, 5},
{SILENCE, REST, 1},
{TRIANGLE_WAVE, NOTE_A5S, 1},
{SILENCE, REST, 1},
{TRIANGLE_WAVE, NOTE_A5S, 1},
{SILENCE, REST, 1},
{TRIANGLE_WAVE, NOTE_A5S, 1},
{SILENCE, REST, 1},
{TRIANGLE_WAVE, NOTE_A5S, 8},
{SILENCE, END_SONG, 0}
};
const PROGMEM SoundPlayer::sound_t big_band[] = { const PROGMEM SoundPlayer::sound_t big_band[] = {
{XYLOPHONE, NOTE_F4, 3}, {XYLOPHONE, NOTE_F4, 3},
{XYLOPHONE, NOTE_G4, 3}, {XYLOPHONE, NOTE_G4, 3},
@@ -401,7 +439,8 @@ const SoundList::list_t SoundList::list[] = {
{"Carousel", Theme::carousel}, {"Carousel", Theme::carousel},
{"Beats", Theme::beats}, {"Beats", Theme::beats},
{"Bach Joy", Theme::js_bach_joy}, {"Bach Joy", Theme::js_bach_joy},
{"Bach Toccata", Theme::js_bach_toccata} {"Bach Toccata", Theme::js_bach_toccata},
{"Flagpole", Theme::flagpole}
}; };
const uint8_t SoundList::n = N_ELEMENTS(SoundList::list); const uint8_t SoundList::n = N_ELEMENTS(SoundList::list);

View File

@@ -137,7 +137,7 @@ namespace ExtUI {
void onMediaInserted() {} void onMediaInserted() {}
void onMediaError() {} void onMediaError() {}
void onMediaRemoved() {} void onMediaRemoved() {}
void onPlayTone(const uint16_t, const uint16_t) {} void onPlayTone(const uint16_t, const uint16_t/*=0*/) {}
void onFilamentRunout(const extruder_t extruder) {} void onFilamentRunout(const extruder_t extruder) {}
void onUserConfirmRequired(const char * const) {} void onUserConfirmRequired(const char * const) {}
void onHomingStart() {} void onHomingStart() {}
@@ -147,18 +147,29 @@ namespace ExtUI {
void onStoreSettings(char*) {} void onStoreSettings(char*) {}
void onLoadSettings(const char*) {} void onLoadSettings(const char*) {}
void onPostprocessSettings() {} void onPostprocessSettings() {}
void onSettingsStored(bool) {} void onSettingsStored(const bool) {}
void onSettingsLoaded(bool) {} void onSettingsLoaded(const bool) {}
#if HAS_MESH #if HAS_LEVELING
void onLevelingStart() {} void onLevelingStart() {}
void onLevelingDone() {} void onLevelingDone() {}
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {} #endif
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {}
#if HAS_MESH
void onMeshUpdate(const int8_t, const int8_t, const_float_t) {}
void onMeshUpdate(const int8_t, const int8_t, const ExtUI::probe_state_t) {}
#endif #endif
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() {} void onSetPowerLoss(const bool onoff) {
// Called when power-loss is enabled/disabled
}
void onPowerLoss() {
// Called when power-loss state is detected
}
void onPowerLossResume() {
// Called on resume from power-loss
}
#endif #endif
void onSteppersDisabled() {} void onSteppersDisabled() {}

View File

@@ -37,11 +37,11 @@
TFT SPI_TFT; TFT SPI_TFT;
// use SPI1 for the spi tft. // use SPI1 for the spi tft.
void TFT::spi_init(uint8_t spiRate) { void TFT::spiInit(uint8_t spiRate) {
tftio.Init(); tftio.Init();
} }
void TFT::SetPoint(uint16_t x, uint16_t y, uint16_t point) { void TFT::setPoint(uint16_t x, uint16_t y, uint16_t point) {
if ((x > 480) || (y > 320)) return; if ((x > 480) || (y > 320)) return;
setWindow(x, y, 1, 1); setWindow(x, y, 1, 1);
@@ -52,32 +52,30 @@ void TFT::setWindow(uint16_t x, uint16_t y, uint16_t with, uint16_t height) {
tftio.set_window(x, y, (x + with - 1), (y + height - 1)); tftio.set_window(x, y, (x + with - 1), (y + height - 1));
} }
void TFT::LCD_init() { void TFT::lcdInit() {
tftio.InitTFT(); tftio.InitTFT();
#if PIN_EXISTS(TFT_BACKLIGHT) #if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, LOW); OUT_WRITE(TFT_BACKLIGHT_PIN, LOW);
#endif #endif
delay(100); delay(100);
LCD_clear(0x0000); lcdClear(0x0000);
LCD_Draw_Logo(); lcdDrawLogo();
#if PIN_EXISTS(TFT_BACKLIGHT) #if PIN_EXISTS(TFT_BACKLIGHT)
OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH);
#endif #endif
#if HAS_LOGO_IN_FLASH TERN_(HAS_LOGO_IN_FLASH, delay(2000));
delay(2000);
#endif
} }
void TFT::LCD_clear(uint16_t color) { void TFT::lcdClear(uint16_t color) {
setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT); setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT);
tftio.WriteMultiple(color, uint32_t(TFT_WIDTH) * uint32_t(TFT_HEIGHT)); tftio.WriteMultiple(color, uint32_t(TFT_WIDTH) * uint32_t(TFT_HEIGHT));
} }
void TFT::LCD_Draw_Logo() { void TFT::lcdDrawLogo() {
#if HAS_LOGO_IN_FLASH #if HAS_LOGO_IN_FLASH
setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT); setWindow(0, 0, TFT_WIDTH, TFT_HEIGHT);
for (uint16_t i = 0; i < (TFT_HEIGHT); i++) { for (uint16_t i = 0; i < (TFT_HEIGHT); i++) {
Pic_Logo_Read((uint8_t *)"", (uint8_t *)bmp_public_buf, (TFT_WIDTH) * 2); picLogoRead((uint8_t *)"", (uint8_t *)bmp_public_buf, (TFT_WIDTH) * 2);
tftio.WriteSequence((uint16_t *)bmp_public_buf, TFT_WIDTH); tftio.WriteSequence((uint16_t *)bmp_public_buf, TFT_WIDTH);
} }
#endif #endif

Some files were not shown because too many files have changed in this diff Show More