Touch UI updates for Cocoa Press (#15986)

This commit is contained in:
Scott Lahteine 2019-11-24 06:08:05 -06:00 committed by GitHub
parent 441e822fb3
commit b11551c767
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
149 changed files with 638 additions and 271 deletions

View file

@ -92,6 +92,9 @@ U8GLIB ?= 1
# this defines whether to include the Trinamic TMCStepper library
TMC ?= 1
# this defines whether to include the AdaFruit NeoPixel library
NEOPIXEL ?= 0
############
# Try to automatically determine whether RELOC_WORKAROUND is needed based
# on GCC versions:

View file

@ -444,8 +444,8 @@ typedef struct
#define ENABLE 1
#ifndef __cplusplus
#ifndef __bool_true_false_are_defined
#define false 0
#define true 1
#define false (1==0)
#define true (1==1)
#endif
#endif
#ifndef PASS

View file

@ -720,7 +720,6 @@ void kill(PGM_P const lcd_error/*=nullptr*/, PGM_P const lcd_component/*=nullptr
SERIAL_ERROR_MSG(MSG_ERR_KILLED);
#if HAS_DISPLAY
extern const char NUL_STR[];
ui.kill_screen(lcd_error ?: GET_TEXT(MSG_KILLED), lcd_component ?: NUL_STR);
#else
UNUSED(lcd_error);

View file

@ -100,9 +100,6 @@ void GcodeSuite::M0_M1() {
#if ENABLED(HOST_PROMPT_SUPPORT)
host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), PSTR("Continue"));
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onUserConfirmRequired_P(PSTR("M0/1 Break Called"));
#endif
if (ms > 0) {
ms += millis(); // wait until this time for a click

View file

@ -132,7 +132,7 @@ class CommandProcessor : public CLCD::CommandFifo {
inline CommandProcessor& font (int16_t font) {_font = font; return *this;}
inline CommandProcessor& enabled (bool enabled) {
inline CommandProcessor& enabled (bool enabled=false) {
if (enabled)
_style &= ~STYLE_DISABLED;
else

View file

@ -23,10 +23,11 @@
/* This function draws a circular progress "ring" */
void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, uint8_t percent, uint32_t bgcolor, uint32_t fgcolor, float rim = 0.3) {
void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, char *text, uint32_t bgcolor, uint32_t fgcolor) {
using namespace FTDI;
const float a = float(percent)/100.0*2.0*PI;
const float rim = 0.3;
const float a = percent/100.0*2.0*PI;
const float a1 = min(PI/2, a);
const float a2 = min(PI/2, a-a1);
const float a3 = min(PI/2, a-a1-a2);
@ -90,11 +91,15 @@ void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, u
cmd.cmd(RESTORE_CONTEXT());
// Draw the text
char str[5];
sprintf(str,"%d\%%",percent);
cmd.cmd(SAVE_CONTEXT());
cmd.cmd(COLOR_RGB(fgcolor));
cmd.text(x,y,w,h,str, OPT_CENTERX | OPT_CENTERY);
cmd.text(x,y,w,h,text, OPT_CENTERX | OPT_CENTERY);
cmd.cmd(RESTORE_CONTEXT());
}
void draw_circular_progress(CommandProcessor& cmd, int x, int y, int w, int h, float percent, uint32_t bgcolor, uint32_t fgcolor) {
char str[5];
sprintf(str,"%d\%%",int(percent));
draw_circular_progress(cmd, x, y, w, h, percent, str, bgcolor, fgcolor);
}

View file

@ -70,7 +70,8 @@ namespace Language_en {
PROGMEM Language_Str MSG_PRINT_FINISHED = u8"Print finished";
PROGMEM Language_Str MSG_PRINT_ERROR = u8"Print error";
PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_1 = u8"Color Touch Panel";
PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2 = u8"Portions " COPYRIGHT_SIGN " 2019 Aleph Objects, Inc.";
PROGMEM Language_Str MSG_ABOUT_TOUCH_PANEL_2 = u8"Portions " COPYRIGHT_SIGN " 2019 Aleph Objects, Inc.\n"
"Portions " COPYRIGHT_SIGN " 2019 Cocoa Press";
PROGMEM Language_Str MSG_FIRMWARE_FOR_TOOLHEAD = u8"Firmware for toolhead:\n%s\n\n";
PROGMEM Language_Str MSG_RUNOUT_1 = u8"Runout 1";
PROGMEM Language_Str MSG_RUNOUT_2 = u8"Runout 2";
@ -157,5 +158,7 @@ namespace Language_en {
#ifdef TOUCH_UI_COCOA_PRESS
PROGMEM Language_Str MSG_ZONE_1 = u8"Zone 1:";
PROGMEM Language_Str MSG_ZONE_2 = u8"Zone 2:";
PROGMEM Language_Str MSG_ZONE_3 = u8"Zone 3:";
PROGMEM Language_Str MSG_PREHEAT_FINISHED = u8"Preheat finished";
#endif
}; // namespace Language_en

View file

@ -42,44 +42,49 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
cmd.colors(normal_btn)
.font(Theme::font_medium)
#ifdef TOUCH_UI_PORTRAIT
#define GRID_ROWS 9
#define GRID_ROWS 10
#define GRID_COLS 2
.enabled(
#if HAS_BED_PROBE
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
.enabled(1)
.enabled(
#if HAS_CASE_LIGHT
1
#endif
)
.tag(16).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
.tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
.enabled(
#if HAS_TRINAMIC
.enabled(1)
#else
.enabled(0)
1
#endif
.tag(13).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
)
.tag(13).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
.enabled(
#if HAS_TRINAMIC
.enabled(1)
#else
.enabled(0)
1
#endif
.tag(14).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
)
.tag(14).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
.enabled(
#if HOTENDS > 1
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
.enabled(
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
.tag(12).button( BTN_POS(1,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
.tag(12).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
.tag(15).button( BTN_POS(2,6), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
.tag(9) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
.tag(10).button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE))
.tag(9) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
.tag(10).button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE))
.tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
.tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
#if DISABLED(CLASSIC_JERK)
@ -87,51 +92,57 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#else
.tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
#endif
.enabled(
#if ENABLED(BACKLASH_GCODE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(8).button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
.colors(action_btn)
.tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
.tag(1) .button( BTN_POS(1,10), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
#undef GRID_COLS
#undef GRID_ROWS
#else
#define GRID_ROWS 6
#define GRID_COLS 3
.enabled(
#if HAS_BED_PROBE
.enabled(1)
#else
.enabled(0)
1
#endif
.tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,2), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
)
.tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
.enabled(
#if HAS_CASE_LIGHT
1
#endif
)
.tag(16).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
.enabled(1)
.tag(3) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_STEPS_PER_MM))
.enabled(
#if HAS_TRINAMIC
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(13).button( BTN_POS(3,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
.enabled(
#if HAS_TRINAMIC
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(14).button( BTN_POS(3,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
.enabled(
#if ENABLED(BACKLASH_GCODE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(8).button( BTN_POS(3,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
.enabled(
#if HOTENDS > 1
.enabled(1)
#else
.enabled(0)
1
#endif
.tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
)
.tag(4) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
.tag(12).button( BTN_POS(3,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
.tag(5) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_VELOCITY))
.tag(6) .button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_ACCELERATION))
@ -140,7 +151,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#else
.tag(7) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
#endif
.tag(11).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
.tag(11).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
.tag(15).button( BTN_POS(3,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
.tag(9) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
.tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE))
@ -183,6 +194,9 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
#endif
case 15: GOTO_SCREEN(DisplayTuningScreen); break;
#if HAS_CASE_LIGHT
case 16: GOTO_SCREEN(CaseLightScreen); break;
#endif
default: return false;
}
return true;

View file

@ -40,9 +40,11 @@ void BacklashCompensationScreen::onRedraw(draw_mode_t what) {
#if ENABLED(CALIBRATION_GCODE)
w.button(12, GET_TEXT_F(MSG_MEASURE_AUTOMATICALLY));
#endif
w.color(other).adjuster(8, GET_TEXT_F(MSG_SMOOTHING), getBacklashSmoothing_mm());
#ifdef BACKLASH_SMOOTHING_MM
w.color(other).adjuster(8, GET_TEXT_F(MSG_BACKLASH_SMOOTHING), getBacklashSmoothing_mm());
#endif
w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT))
.adjuster(10, GET_TEXT_F(MSG_CORRECTION), getBacklashCorrection_percent());
.adjuster(10, GET_TEXT_F(MSG_BACKLASH_CORRECTION), getBacklashCorrection_percent());
w.precision(2).increments();
}
@ -55,8 +57,10 @@ bool BacklashCompensationScreen::onTouchHeld(uint8_t tag) {
case 5: UI_INCREMENT(AxisBacklash_mm, Y); break;
case 6: UI_DECREMENT(AxisBacklash_mm, Z); break;
case 7: UI_INCREMENT(AxisBacklash_mm, Z); break;
#ifdef BACKLASH_SMOOTHING_MM
case 8: UI_DECREMENT(BacklashSmoothing_mm); break;
case 9: UI_INCREMENT(BacklashSmoothing_mm); break;
#endif
case 10: UI_DECREMENT_BY(BacklashCorrection_percent, increment*100); break;
case 11: UI_INCREMENT_BY(BacklashCorrection_percent, increment*100); break;
#if ENABLED(CALIBRATION_GCODE)

View file

@ -44,24 +44,24 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#define GRID_COLS 2
.tag(2) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISPLAY_MENU))
.enabled(
#if HAS_TRINAMIC
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(3) .button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_CURRENT))
.enabled(
#if HAS_TRINAMIC
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(4) .button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TMC_HOMING_THRS))
.tag(5) .button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
.enabled(
#if HOTENDS > 1
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(6) .button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_OFFSETS_MENU))
@ -73,17 +73,17 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#else
.tag(10) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_JERK))
#endif
.enabled(
#if ENABLED(BACKLASH_GCODE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(11) .button( BTN_POS(2,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACKLASH))
.enabled(
#if ENABLED(LIN_ADVANCE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(12) .button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE))
.tag(13) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INTERFACE_SETTINGS))
.tag(14) .button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_RESTORE_FAILSAFE))

View file

@ -40,16 +40,20 @@ const PROGMEM uint16_t syringe[] = {0xB8AD, 0x6BB1, 0xB8AD, 0x6E0C, 0xBE02, 0x6E
const PROGMEM uint16_t syringe_outline[] = {0xB396, 0x110A, 0xB396, 0x1818, 0xB995, 0x1818, 0xB995, 0x22AD, 0xB396, 0x22AD, 0xB396, 0x7ADA, 0xB995, 0x7E61, 0xB995, 0x88F5, 0xBB95, 0x88F5, 0xBB95, 0xA8B4, 0xBD94, 0xAC3B, 0xBD94, 0x88F5, 0xBF94, 0x88F5, 0xBF94, 0x7E61, 0xC593, 0x7ADA, 0xC593, 0x22AD, 0xBF94, 0x22AD, 0xBF94, 0x1818, 0xC593, 0x1818, 0xC593, 0x110A, 0xB396, 0x110A};
const PROGMEM uint16_t padlock[] = {0x3FE3, 0x2A04, 0x3D34, 0x2AF9, 0x3AFF, 0x2D93, 0x397D, 0x316D, 0x38E8, 0x3626, 0x38E8, 0x3A14, 0x39B3, 0x3C8F, 0x3B50, 0x3C8F, 0x3C1C, 0x3A14, 0x3C1C, 0x363C, 0x3C6B, 0x33A9, 0x3D3A, 0x3193, 0x3E6C, 0x302D, 0x3FE3, 0x2FAA, 0x415A, 0x302D, 0x428C, 0x3192, 0x435B, 0x33A8, 0x43AB, 0x363C, 0x43AB, 0x4492, 0x38C3, 0x4492, 0x3741, 0x45AC, 0x36A1, 0x4856, 0x36A1, 0x5C41, 0x3741, 0x5EEC, 0x38C3, 0x6005, 0x4703, 0x6005, 0x4886, 0x5EEC, 0x4925, 0x5C41, 0x4925, 0x4856, 0x4886, 0x45AC, 0x4703, 0x4492, 0x46DE, 0x362B, 0x4649, 0x316D, 0x44C7, 0x2D92, 0x4292, 0x2AF9};
const PROGMEM uint16_t home_z[] = {0x80BB, 0x2B43, 0x712C, 0x46B9, 0x750F, 0x46B9, 0x750F, 0x622F, 0x7CD7, 0x622F, 0x7CD7, 0x5474, 0x849F, 0x5474, 0x849F, 0x622F, 0x8C67, 0x622F, 0x8C67, 0x46B9, 0x904B, 0x46B9, 0x8A48, 0x3C1D, 0x8A48, 0x2ECD, 0x8664, 0x2ECD, 0x8664, 0x3540};
const PROGMEM uint16_t usb_btn[] = {0x0558, 0xC0D6, 0x44A4, 0xC0D6, 0x44A4, 0xF431, 0x0558, 0xF431, 0x0558, 0xC0D6};
const PROGMEM uint16_t menu_btn[] = {0x4B18, 0xC0D6, 0x8A64, 0xC0D6, 0x8A64, 0xF431, 0x4B18, 0xF431, 0x4B18, 0xC0D6};
const PROGMEM uint16_t usb_btn[] = {0x0558, 0xC0D6, 0x3BDB, 0xC0D6, 0x3BDB, 0xF431, 0x0558, 0xF431, 0x0558, 0xC0D6};
const PROGMEM uint16_t menu_btn[] = {0x416B, 0xC0D6, 0x77EE, 0xC0D6, 0x77EE, 0xF431, 0x416B, 0xF431, 0x416B, 0xC0D6};
const PROGMEM uint16_t e_pos[] = {0xE04E, 0x5E7B, 0xE94C, 0x5E7B, 0xE94C, 0x7E74, 0xEDCB, 0x7E74, 0xE4CD, 0x8E70, 0xDBCF, 0x7E74, 0xE04E, 0x7E74, 0xE04E, 0x5E7B};
const PROGMEM uint16_t e_neg[] = {0xE04E, 0x4E7F, 0xE94C, 0x4E7F, 0xE94C, 0x2E87, 0xEDCB, 0x2E87, 0xE4CD, 0x1E8A, 0xDBCF, 0x2E87, 0xE04E, 0x2E87, 0xE04E, 0x4E7F};
const PROGMEM uint16_t home_e[] = {0xD705, 0x3885, 0xC775, 0x53FB, 0xCB59, 0x53FB, 0xCB59, 0x6F71, 0xD321, 0x6F71, 0xD321, 0x61B6, 0xDAE9, 0x61B6, 0xDAE9, 0x6F71, 0xE2B1, 0x6F71, 0xE2B1, 0x53FB, 0xE695, 0x53FB, 0xE092, 0x495F, 0xE092, 0x3C0E, 0xDCAE, 0x3C0E, 0xDCAE, 0x4281};
const PROGMEM uint16_t fine_label[] = {0x0D92, 0x9444, 0x5211, 0x9444, 0x5211, 0xA9EA, 0x0D92, 0xA9EA};
const PROGMEM uint16_t fine_toggle[] = {0x56E7, 0x9444, 0x8007, 0x9444, 0x8007, 0xA9EA, 0x56E7, 0xA9EA};
const PROGMEM uint16_t zone2_temp[] = {0xC620, 0xD35A, 0xFD0E, 0xD35A, 0xFD0E, 0xF075, 0xC620, 0xF075};
const PROGMEM uint16_t zone1_temp[] = {0x8E04, 0xD35A, 0xC4F3, 0xD35A, 0xC4F3, 0xF075, 0x8E04, 0xF075};
const PROGMEM uint16_t zone2_label[] = {0xC620, 0xB4AD, 0xFD0A, 0xB4AD, 0xFD0A, 0xD1C8, 0xC620, 0xD1C8};
const PROGMEM uint16_t zone1_label[] = {0x8E04, 0xB4AD, 0xC4F3, 0xB4AD, 0xC4F3, 0xD1C8, 0x8E04, 0xD1C8};
const PROGMEM uint16_t h1_temp[] = {0x9C2B, 0xDD3B, 0xBBDE, 0xDD3B, 0xBBDE, 0xFA57, 0x9C2B, 0xFA57};
const PROGMEM uint16_t h1_label[] = {0x9C2B, 0xBE8F, 0xBBDC, 0xBE8F, 0xBBDC, 0xDBAA, 0x9C2B, 0xDBAA};
const PROGMEM uint16_t h0_temp[] = {0x7BD0, 0xDD3B, 0x9B83, 0xDD3B, 0x9B83, 0xFA57, 0x7BD0, 0xFA57};
const PROGMEM uint16_t h0_label[] = {0x7BD0, 0xBE8F, 0x9B83, 0xBE8F, 0x9B83, 0xDBAA, 0x7BD0, 0xDBAA};
const PROGMEM uint16_t h2_temp[] = {0xBC86, 0xDD3B, 0xDC39, 0xDD3B, 0xDC39, 0xFA57, 0xBC86, 0xFA57};
const PROGMEM uint16_t h2_label[] = {0xBC86, 0xBE8F, 0xDC37, 0xBE8F, 0xDC37, 0xDBAA, 0xBC86, 0xDBAA};
const PROGMEM uint16_t h3_temp[] = {0xDCE2, 0xDD0D, 0xFC95, 0xDD0D, 0xFC95, 0xFA28, 0xDCE2, 0xFA28};
const PROGMEM uint16_t h3_label[] = {0xDCE2, 0xBE60, 0xFC92, 0xBE60, 0xFC92, 0xDB7C, 0xDCE2, 0xDB7C};
const PROGMEM uint16_t actual_temp[] = {0xCDF6, 0xD037, 0xF7CA, 0xD037, 0xF7CA, 0xF424, 0xCDF6, 0xF424};
const PROGMEM uint16_t bed_icon[] = {0xCDF6, 0xA5CC, 0xF7CA, 0xA5CC, 0xF7CA, 0xC9B9, 0xCDF6, 0xC9B9};

View file

@ -23,7 +23,7 @@
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && (ENABLED(TOUCH_UI_LULZBOT_BIO) || ENABLED(TOUCH_UI_COCOA_PRESS))
#if ENABLED(TOUCH_UI_FTDI_EVE) && ANY(TOUCH_UI_LULZBOT_BIO, TOUCH_UI_COCOA_PRESS)
#include "screens.h"
@ -95,20 +95,29 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
.icon (x + 2, y + 2, h, v, Bed_Heat_Icon_Info, icon_scale * 2)
.cmd(COLOR_RGB(bg_text_enabled))
.icon (x, y, h, v, Bed_Heat_Icon_Info, icon_scale * 2);
#endif
#if ENABLED(TOUCH_UI_COCOA_PRESS)
#elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT)
// The CocoaPress shows the temperature for two
// heating zones, but has no bed temperature
cmd.cmd(COLOR_RGB(bg_text_enabled));
cmd.font(font_medium);
ui.bounds(POLY(zone1_label), x, y, h, v);
ui.bounds(POLY(h0_label), x, y, h, v);
cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_1));
ui.bounds(POLY(zone2_label), x, y, h, v);
ui.bounds(POLY(h1_label), x, y, h, v);
cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_2));
ui.bounds(POLY(h2_label), x, y, h, v);
cmd.text(x, y, h, v, GET_TEXT_F(MSG_ZONE_3));
ui.bounds(POLY(h3_label), x, y, h, v);
cmd.text(x, y, h, v, GET_TEXT_F(MSG_CHAMBER));
#else
UNUSED(x);
UNUSED(y);
UNUSED(h);
UNUSED(v);
#endif
#ifdef TOUCH_UI_USE_UTF8
@ -143,9 +152,8 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
ui.bounds(POLY(bed_temp), x, y, h, v);
cmd.text(x, y, h, v, str);
#endif
#endif
#if ENABLED(TOUCH_UI_COCOA_PRESS)
#elif ENABLED(TOUCH_UI_COCOA_PRESS) && DISABLED(TOUCH_UI_PORTRAIT)
// The CocoaPress shows the temperature for two
// heating zones, but has no bed temperature
@ -156,7 +164,7 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
else
format_temp_and_idle(str, getActualTemp_celsius(E0));
ui.bounds(POLY(zone1_temp), x, y, h, v);
ui.bounds(POLY(h0_temp), x, y, h, v);
cmd.text(x, y, h, v, str);
if (!isHeaterIdle(E1) && getTargetTemp_celsius(E1) > 0)
@ -164,8 +172,26 @@ void StatusScreen::draw_temperature(draw_mode_t what) {
else
format_temp_and_idle(str, getActualTemp_celsius(E1));
ui.bounds(POLY(zone2_temp), x, y, h, v);
ui.bounds(POLY(h1_temp), x, y, h, v);
cmd.text(x, y, h, v, str);
if (!isHeaterIdle(E2) && getTargetTemp_celsius(E2) > 0)
format_temp_and_temp(str, getActualTemp_celsius(E2), getTargetTemp_celsius(E2));
else
format_temp_and_idle(str, getActualTemp_celsius(E2));
ui.bounds(POLY(h2_temp), x, y, h, v);
cmd.text(x, y, h, v, str);
if (!isHeaterIdle(CHAMBER) && getTargetTemp_celsius(CHAMBER) > 0)
format_temp_and_temp(str, getActualTemp_celsius(CHAMBER), getTargetTemp_celsius(CHAMBER));
else
format_temp_and_idle(str, getActualTemp_celsius(CHAMBER));
ui.bounds(POLY(h3_temp), x, y, h, v);
cmd.text(x, y, h, v, str);
#else
UNUSED(str);
#endif
}
}
@ -238,7 +264,9 @@ void StatusScreen::draw_arrows(draw_mode_t what) {
}
if ((what & BACKGROUND) || e_homed) {
#if DISABLED(TOUCH_UI_COCOA_PRESS)
ui.button(7, POLY(e_neg));
#endif
ui.button(8, POLY(e_pos));
}
}

View file

@ -50,11 +50,11 @@ void TuneMenu::onRedraw(draw_mode_t what) {
.font(font_medium)
.enabled( isPrinting()).tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED))
.tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_BED_TEMPERATURE))
.enabled(
#if ENABLED(BABYSTEPPING)
.enabled(true)
#else
.enabled(false)
true
#endif
)
.tag(4).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE))
.enabled(!isPrinting()).tag(5).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_MOVE_TO_HOME))
.enabled(!isPrinting()).tag(6).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_RAISE_PLUNGER))

View file

@ -0,0 +1,62 @@
/*************************
* case_light_screen.cpp *
*************************/
/****************************************************************************
* Written By Marcio Teixeira 2019 - Cocoa Press *
* *
* 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/>. *
****************************************************************************/
#include "../config.h"
#if BOTH(TOUCH_UI_FTDI_EVE, CASE_LIGHT_ENABLE)
#include "screens.h"
using namespace FTDI;
using namespace ExtUI;
using namespace Theme;
void CaseLightScreen::onRedraw(draw_mode_t what) {
widgets_t w(what);
w.heading( GET_TEXT_F(MSG_CASE_LIGHT));
w.toggle( 2, GET_TEXT_F(MSG_LEDS), getCaseLightState());
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
w.precision(0).units(GET_TEXT_F(MSG_UNITS_PERCENT))
.adjuster(10, GET_TEXT_F(MSG_CASE_LIGHT_BRIGHTNESS), getCaseLightBrightness_percent());
w.precision(0).increments();
#endif
}
bool CaseLightScreen::onTouchHeld(uint8_t tag) {
using namespace ExtUI;
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
const float increment = getIncrement();
#endif
switch (tag) {
case 2: setCaseLightState(!getCaseLightState()); break;
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
case 10: UI_DECREMENT(CaseLightBrightness_percent); break;
case 11: UI_INCREMENT(CaseLightBrightness_percent); break;
#endif
default:
return false;
}
SaveSettingsDialogBox::settingsChanged();
return true;
}
#endif // TOUCH_UI_FTDI_EVE

View file

@ -195,11 +195,14 @@ void ChangeFilamentScreen::onRedraw(draw_mode_t what) {
const bool tog8 = screen_data.ChangeFilamentScreen.repeat_tag == 8;
cmd.font(
#ifdef TOUCH_UI_PORTRAIT
cmd.font(font_large);
font_large
#else
cmd.font(font_small);
font_small
#endif
);
{
char str[30];

View file

@ -52,11 +52,13 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
#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_DISABLED(X,Y,LABEL,PIN) cmd.enabled(0).PIN_BTN(X,Y,PIN,LABEL);
cmd.font(
#ifdef TOUCH_UI_PORTRAIT
cmd.font(font_large)
font_large
#else
cmd.font(font_medium)
font_medium
#endif
)
.text(BTN_POS(1,1), BTN_SIZE(6,1), GET_TEXT_F(MSG_LCD_ENDSTOPS))
.font(font_tiny);
#if PIN_EXISTS(X_MAX)

View file

@ -46,17 +46,17 @@ void FilamentMenu::onRedraw(draw_mode_t what) {
#define GRID_COLS 2
.text ( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENT))
.font(font_medium).colors(normal_btn)
.enabled(
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(2).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_RUNOUT_SENSOR))
.enabled(
#if ENABLED(LIN_ADVANCE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(3).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_LINEAR_ADVANCE))
.colors(action_btn)
.tag(1) .button( BTN_POS(1,9), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
@ -67,17 +67,17 @@ void FilamentMenu::onRedraw(draw_mode_t what) {
#define GRID_COLS 3
.text ( BTN_POS(1,1), BTN_SIZE(3,1), GET_TEXT_F(MSG_FILAMENT))
.font(font_medium).colors(normal_btn)
.enabled(
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(2).button( BTN_POS(1,2), BTN_SIZE(3,1), GET_TEXT_F(MSG_RUNOUT_SENSOR))
.enabled(
#if ENABLED(LIN_ADVANCE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(3).button( BTN_POS(1,3), BTN_SIZE(3,1), GET_TEXT_F(MSG_LINEAR_ADVANCE))
.colors(action_btn)
.tag(1) .button( BTN_POS(1,6), BTN_SIZE(3,1), GET_TEXT_F(MSG_BACK));

View file

@ -41,7 +41,7 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
w.units(GET_TEXT_F(MSG_UNITS_MM));
w.precision(0);
w.color(e_axis);
w.adjuster( 10, NUL_STR, getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled());
w.adjuster( 10, progmem_str(NUL_STR), getFilamentRunoutDistance_mm(), getFilamentRunoutEnabled());
w.increments();
#endif
}

View file

@ -45,27 +45,27 @@ void MainMenu::onRedraw(draw_mode_t what) {
#define GRID_ROWS 8
#define GRID_COLS 2
.tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME))
.enabled(
#if ENABLED(NOZZLE_CLEAN_FEATURE)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE))
.tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS))
.tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
.tag(6).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE))
.enabled(
#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(7).button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
.tag(8).button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
.enabled(
#ifdef PRINTCOUNTER
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(9).button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
.tag(10).button( BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_MENU))
.colors(action_btn)
@ -76,27 +76,35 @@ void MainMenu::onRedraw(draw_mode_t what) {
#define GRID_ROWS 5
#define GRID_COLS 2
.tag(2).button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_AUTO_HOME))
#if ENABLED(NOZZLE_CLEAN_FEATURE)
.enabled(1)
#if ENABLED(TOUCH_UI_COCOA_PRESS)
.tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_PREHEAT_1))
#else
.enabled(0)
.enabled(
#if ENABLED(NOZZLE_CLEAN_FEATURE)
1
#endif
)
.tag(3).button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_CLEAN_NOZZLE))
#endif
.tag(4).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_MOVE_AXIS))
.tag(5).button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_DISABLE_STEPPERS))
.tag(6).button( BTN_POS(1,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE))
#if DISABLED(TOUCH_UI_LULZBOT_BIO) && DISABLED(TOUCH_UI_COCOA_PRESS)
.enabled(1)
#if ENABLED(TOUCH_UI_COCOA_PRESS)
.tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_CASE_LIGHT))
#else
.enabled(0)
.enabled(
#if DISABLED(TOUCH_UI_LULZBOT_BIO)
1
#endif
)
.tag(7).button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
.tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
#ifdef PRINTCOUNTER
.enabled(1)
#else
.enabled(0)
#endif
.tag(8).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_ADVANCED_SETTINGS))
.enabled(
#ifdef PRINTCOUNTER
1
#endif
)
.tag(9).button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_STATS_MENU))
.tag(10).button( BTN_POS(1,5), BTN_SIZE(1,1), GET_TEXT_F(MSG_INFO_MENU))
.colors(action_btn)
@ -111,15 +119,21 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
using namespace ExtUI;
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break;
#if ENABLED(NOZZLE_CLEAN_FEATURE)
#if ENABLED(TOUCH_UI_COCOA_PRESS)
case 3: GOTO_SCREEN(PreheatTimerScreen); break;
#elif ENABLED(NOZZLE_CLEAN_FEATURE)
case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
#endif
case 4: GOTO_SCREEN(MoveAxisScreen); break;
case 5: injectCommands_P(PSTR("M84")); break;
case 6: GOTO_SCREEN(TemperatureScreen); break;
#if ENABLED(TOUCH_UI_COCOA_PRESS)
case 7: GOTO_SCREEN(CaseLightScreen); break;
#else
case 7: GOTO_SCREEN(ChangeFilamentScreen); break;
#endif
case 8: GOTO_SCREEN(AdvancedSettingsMenu); break;
#if ENABLED(PRINTCOUNTER)
case 9: GOTO_SCREEN(StatisticsScreen); break;

View file

@ -39,15 +39,16 @@ void MaxAccelerationScreen::onRedraw(draw_mode_t what) {
w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_AMAX_Y), getAxisMaxAcceleration_mm_s2(Y) );
w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_AMAX_Z), getAxisMaxAcceleration_mm_s2(Z) );
#if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AMAX_E0), getAxisMaxAcceleration_mm_s2(E0) );
w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AMAX_E), getAxisMaxAcceleration_mm_s2(E0) );
#elif EXTRUDERS > 1
w.color(e_axis).adjuster( 8, GET_TEXT_F(MSG_AMAX_E0), getAxisMaxAcceleration_mm_s2(E0) );
w.color(e_axis).adjuster(10, GET_TEXT_F(MSG_AMAX_E1), getAxisMaxAcceleration_mm_s2(E1) );
w.heading(GET_TEXT_F(MSG_AMAX_E));
w.color(e_axis).adjuster( 8, F(LCD_STR_E0), getAxisMaxAcceleration_mm_s2(E0) );
w.color(e_axis).adjuster(10, F(LCD_STR_E1), getAxisMaxAcceleration_mm_s2(E1) );
#if EXTRUDERS > 2
w.color(e_axis).adjuster(12, GET_TEXT_F(MSG_AMAX_E2), getAxisMaxAcceleration_mm_s2(E2) );
w.color(e_axis).adjuster(12, F(LCD_STR_E2), getAxisMaxAcceleration_mm_s2(E2) );
#endif
#if EXTRUDERS > 3
w.color(e_axis).adjuster(14, GET_TEXT_F(MSG_AMAX_E3), getAxisMaxAcceleration_mm_s2(E3) );
w.color(e_axis).adjuster(14, F(LCD_STR_E3), getAxisMaxAcceleration_mm_s2(E3) );
#endif
#endif
w.increments();

View file

@ -40,15 +40,16 @@ void MaxVelocityScreen::onRedraw(draw_mode_t what) {
w.color(y_axis) .adjuster( 4, GET_TEXT_F(MSG_VMAX_Y), getAxisMaxFeedrate_mm_s(Y) );
w.color(z_axis) .adjuster( 6, GET_TEXT_F(MSG_VMAX_Z), getAxisMaxFeedrate_mm_s(Z) );
#if EXTRUDERS == 1 || DISABLED(DISTINCT_E_FACTORS)
w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E1), getAxisMaxFeedrate_mm_s(E0) );
w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E), getAxisMaxFeedrate_mm_s(E0) );
#elif EXTRUDERS > 1
w.color(e_axis) .adjuster( 8, GET_TEXT_F(MSG_VMAX_E1), getAxisMaxFeedrate_mm_s(E0) );
w.color(e_axis) .adjuster( 10, GET_TEXT_F(MSG_VMAX_E2), getAxisMaxFeedrate_mm_s(E1) );
w.heading(GET_TEXT_F(MSG_VMAX_E));
w.color(e_axis) .adjuster( 8, F(LCD_STR_E0), getAxisMaxFeedrate_mm_s(E0) );
w.color(e_axis) .adjuster( 10, F(LCD_STR_E1), getAxisMaxFeedrate_mm_s(E1) );
#if EXTRUDERS > 2
w.color(e_axis).adjuster( 12, GET_TEXT_F(MSG_VMAX_E3), getAxisMaxFeedrate_mm_s(E2) );
w.color(e_axis).adjuster( 12, F(LCD_STR_E2), getAxisMaxFeedrate_mm_s(E2) );
#endif
#if EXTRUDERS > 3
w.color(e_axis).adjuster( 14, GET_TEXT_F(MSG_VMAX_E4), getAxisMaxFeedrate_mm_s(E3) );
w.color(e_axis).adjuster( 14, F(LCD_STR_E3), getAxisMaxFeedrate_mm_s(E3) );
#endif
#endif
w.increments();

View file

@ -68,7 +68,7 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
#if HAS_BED_PROBE
dtostrf(getZOffset_mm(), 4, 2, str);
strcat(str, " ");
strcat_P(str, GET_TEXT(UNITS_MM));
strcat_P(str, GET_TEXT(MSG_UNITS_MM));
w.text_field (0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str);
#endif

View file

@ -0,0 +1,115 @@
/****************************
* preheat_timer_screen.cpp *
****************************/
/****************************************************************************
* Written By Marcio Teixeira 2019 - Cocoa Press *
* *
* 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/>. *
****************************************************************************/
#include "../config.h"
#if ENABLED(TOUCH_UI_FTDI_EVE) && defined(TOUCH_UI_COCOA_PRESS)
#include "screens.h"
#include "screen_data.h"
#include "../ftdi_eve_lib/extras/circular_progress.h"
using namespace FTDI;
using namespace ExtUI;
using namespace Theme;
#define GRID_COLS 2
#define GRID_ROWS 5
void PreheatTimerScreen::draw_message(draw_mode_t what) {
if (what & BACKGROUND) {
CommandProcessor cmd;
cmd.cmd(CLEAR_COLOR_RGB(bg_color))
.cmd(CLEAR(true,true,true))
.cmd(COLOR_RGB(bg_text_enabled))
.tag(0);
draw_text_box(cmd, BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_HEATING), OPT_CENTER, font_large);
}
}
uint16_t PreheatTimerScreen::secondsRemaining() {
const uint32_t elapsed_sec = (millis() - screen_data.PreheatTimerScreen.start_ms) / 1000;
return (COCOA_PRESS_PREHEAT_SECONDS > elapsed_sec) ? COCOA_PRESS_PREHEAT_SECONDS - elapsed_sec : 0;
}
void PreheatTimerScreen::draw_time_remaining(draw_mode_t what) {
if (what & FOREGROUND) {
const uint16_t elapsed_sec = secondsRemaining();
const uint8_t min = elapsed_sec / 60,
sec = elapsed_sec % 60;
char str[10];
sprintf_P(str, PSTR("%02d:%02d"), min, sec);
CommandProcessor cmd;
cmd.font(font_xlarge);
draw_circular_progress(cmd, BTN_POS(1,1), BTN_SIZE(1,5), float(secondsRemaining()) * 100 / COCOA_PRESS_PREHEAT_SECONDS, str, theme_dark, theme_darkest);
}
}
void PreheatTimerScreen::draw_interaction_buttons(draw_mode_t what) {
if (what & FOREGROUND) {
CommandProcessor cmd;
cmd.colors(normal_btn)
.font(font_medium)
.tag(1).button( BTN_POS(2,5), BTN_SIZE(1,1), F("Cancel"));
}
}
void PreheatTimerScreen::onEntry() {
screen_data.PreheatTimerScreen.start_ms = millis();
#ifdef COCOA_PRESS_PREHEAT_SCRIPT
injectCommands_P(PSTR(COCOA_PRESS_PREHEAT_SCRIPT));
#endif
}
void PreheatTimerScreen::onRedraw(draw_mode_t what) {
draw_message(what);
draw_time_remaining(what);
draw_interaction_buttons(what);
}
bool PreheatTimerScreen::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); return true;
default: break;
}
return false;
}
void PreheatTimerScreen::onIdle() {
if (secondsRemaining() == 0) {
AlertDialogBox::show(GET_TEXT_F(MSG_PREHEAT_FINISHED));
// Remove SaveSettingsDialogBox from the stack
// so the alert box doesn't return to me.
current_screen.forget();
}
reset_menu_timeout();
if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) {
onRefresh();
refresh_timer.start();
}
BaseScreen::onIdle();
}
#endif // TOUCH_UI_FTDI_EVE

View file

@ -66,6 +66,11 @@ union screen_data_t {
const char* message;
} StressTestScreen;
#endif
#if ENABLED(TOUCH_UI_COCOA_PRESS)
struct {
uint32_t start_ms;
} PreheatTimerScreen;
#endif
#if ENABLED(BABYSTEPPING)
struct {
struct base_numeric_adjustment_t placeholder;

View file

@ -80,6 +80,9 @@ SCREEN_TABLE {
#else
DECL_SCREEN(JerkScreen),
#endif
#if HAS_CASE_LIGHT
DECL_SCREEN(CaseLightScreen),
#endif
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
DECL_SCREEN(FilamentMenu),
#endif
@ -96,11 +99,14 @@ SCREEN_TABLE {
DECL_SCREEN(LockScreen),
DECL_SCREEN(FilesScreen),
DECL_SCREEN(EndstopStatesScreen),
#ifdef TOUCH_UI_LULZBOT_BIO
#if ENABLED(TOUCH_UI_LULZBOT_BIO)
DECL_SCREEN(BioPrintingDialogBox),
DECL_SCREEN(BioConfirmHomeXYZ),
DECL_SCREEN(BioConfirmHomeE),
#endif
#if ENABLED(TOUCH_UI_COCOA_PRESS)
DECL_SCREEN(PreheatTimerScreen),
#endif
#if ENABLED(TOUCH_UI_DEVELOPER_MENU)
DECL_SCREEN(DeveloperMenu),
DECL_SCREEN(ConfirmEraseFlashDialogBox),

View file

@ -60,6 +60,9 @@ enum {
#else
JERK_SCREEN_CACHE,
#endif
#if HAS_CASE_LIGHT
CASE_LIGHT_SCREEN_CACHE,
#endif
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
FILAMENT_MENU_CACHE,
#endif
@ -69,8 +72,11 @@ enum {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
FILAMENT_RUNOUT_SCREEN_CACHE,
#endif
#ifdef TOUCH_UI_LULZBOT_BIO
#if ENABLED(TOUCH_UI_LULZBOT_BIO)
PRINTING_SCREEN_CACHE,
#endif
#if ENABLED(TOUCH_UI_COCOA_PRESS)
PREHEAT_TIMER_SCREEN_CACHE,
#endif
CHANGE_FILAMENT_SCREEN_CACHE,
INTERFACE_SETTINGS_SCREEN_CACHE,
@ -307,6 +313,23 @@ class StatusScreen : public BaseScreen, public CachedScreen<STATUS_SCREEN_CACHE,
};
#endif
#if ENABLED(TOUCH_UI_COCOA_PRESS)
class PreheatTimerScreen : public BaseScreen, public CachedScreen<PREHEAT_TIMER_SCREEN_CACHE> {
private:
static uint16_t secondsRemaining();
static void draw_message(draw_mode_t);
static void draw_time_remaining(draw_mode_t);
static void draw_interaction_buttons(draw_mode_t);
public:
static void onRedraw(draw_mode_t);
static void onEntry();
static void onIdle();
static bool onTouchEnd(uint8_t tag);
};
#endif
class MainMenu : public BaseScreen, public CachedScreen<MENU_SCREEN_CACHE> {
public:
static void onRedraw(draw_mode_t);
@ -520,6 +543,14 @@ class DefaultAccelerationScreen : public BaseNumericAdjustmentScreen, public Cac
};
#endif
#if HAS_CASE_LIGHT
class CaseLightScreen : public BaseNumericAdjustmentScreen, public CachedScreen<CASE_LIGHT_SCREEN_CACHE> {
public:
static void onRedraw(draw_mode_t);
static bool onTouchHeld(uint8_t tag);
};
#endif
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
class FilamentMenu : public BaseNumericAdjustmentScreen, public CachedScreen<FILAMENT_MENU_CACHE> {
public:

View file

@ -41,6 +41,7 @@ void StatisticsScreen::onRedraw(draw_mode_t what) {
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)

View file

@ -32,26 +32,34 @@ using namespace ExtUI;
void TemperatureScreen::onRedraw(draw_mode_t what) {
widgets_t w(what);
w.precision(0).color(temp).units(GET_TEXT_F(MSG_UNITS_C));
#if TOUCH_UI_LCD_TEMP_SCALING == 10
w.precision(1)
#else
w.precision(0)
#endif
.color(temp).units(GET_TEXT_F(MSG_UNITS_C));
w.heading(GET_TEXT_F(MSG_TEMPERATURE));
w.button(30, GET_TEXT_F(MSG_COOLDOWN));
#ifndef NO_TOOLHEAD_HEATER_GCODE
#if HOTENDS == 1
w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0));
#else
w.adjuster( 2, GET_TEXT_F(MSG_NOZZLE_0), getTargetTemp_celsius(E0));
w.adjuster( 4, GET_TEXT_F(MSG_NOZZLE_1), getTargetTemp_celsius(E1));
w.adjuster( 2, F(LCD_STR_E0), getTargetTemp_celsius(E0));
w.adjuster( 4, F(LCD_STR_E1), getTargetTemp_celsius(E1));
#if HOTENDS > 2
w.adjuster( 6, GET_TEXT_F(MSG_NOZZLE_2), getTargetTemp_celsius(E2));
w.adjuster( 6, F(LCD_STR_E2), getTargetTemp_celsius(E2));
#endif
#if HOTENDS > 3
w.adjuster( 8, GET_TEXT_F(MSG_NOZZLE_3), getTargetTemp_celsius(E3));
w.adjuster( 8, F(LCD_STR_E3), getTargetTemp_celsius(E3));
#endif
#endif
#endif
#if HAS_HEATED_BED
w.adjuster( 20, GET_TEXT_F(MSG_BED), getTargetTemp_celsius(BED));
#endif
#if HAS_HEATED_CHAMBER
w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER));
#endif
#if FAN_COUNT > 0
w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT));
w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0));
@ -64,6 +72,8 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) {
switch (tag) {
case 20: UI_DECREMENT(TargetTemp_celsius, BED); break;
case 21: UI_INCREMENT(TargetTemp_celsius, BED); break;
case 22: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break;
case 23: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break;
#ifndef NO_TOOLHEAD_HEATER_GCODE
case 2: UI_DECREMENT(TargetTemp_celsius, E0); break;
case 3: UI_INCREMENT(TargetTemp_celsius, E0); break;
@ -90,6 +100,9 @@ bool TemperatureScreen::onTouchHeld(uint8_t tag) {
#if HAS_HEATED_BED
setTargetTemp_celsius(0,BED);
#endif
#if HAS_HEATED_CHAMBER
setTargetTemp_celsius(0,CHAMBER);
#endif
#if FAN_COUNT > 0
setTargetFan_percent(0,FAN0);
#endif

View file

@ -53,75 +53,75 @@ void TuneMenu::onRedraw(draw_mode_t what) {
#ifdef TOUCH_UI_PORTRAIT
.tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_TEMPERATURE))
.tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
.enabled(
#if EITHER(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(9).button( BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_FILAMENT))
#if ENABLED(BABYSTEPPING)
.tag(4).enabled(1) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_NUDGE_NOZZLE))
#else
.enabled(
#if HAS_BED_PROBE
.enabled(1)
#else
.enabled(0)
1
#endif
)
.tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
#endif
.tag(5).enabled(1) .button( BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_PRINT_SPEED))
.tag(isPrintingFromMediaPaused() ? 7 : 6)
.enabled(
#if ENABLED(SDSUPPORT)
.enabled(isPrintingFromMedia())
#else
.enabled(0)
isPrintingFromMedia()
#endif
)
.button( BTN_POS(1,6), BTN_SIZE(2,1), isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT))
.enabled(
#if ENABLED(SDSUPPORT)
.enabled(isPrintingFromMedia())
#else
.enabled(0)
isPrintingFromMedia()
#endif
)
.tag(8) .button( BTN_POS(1,7), BTN_SIZE(2,1), GET_TEXT_F(MSG_STOP_PRINT))
.tag(1).colors(action_btn)
.button( BTN_POS(1,8), BTN_SIZE(2,1), GET_TEXT_F(MSG_BACK));
#else // TOUCH_UI_PORTRAIT
.tag(2).enabled(1) .button( BTN_POS(1,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_TEMPERATURE))
.tag(3).enabled(!isPrinting()).button( BTN_POS(1,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENTCHANGE))
.enabled(
#if ENABLED(BABYSTEPPING)
.enabled(1)
#else
.enabled(0)
isPrintingFromMedia()
#endif
)
#if ENABLED(BABYSTEPPING)
.tag(4) .button( BTN_POS(2,1), BTN_SIZE(1,1), GET_TEXT_F(MSG_NUDGE_NOZZLE))
#else
.enabled(
#if HAS_BED_PROBE
.enabled(1)
#else
.enabled(0)
isPrintingFromMedia()
#endif
)
.tag(4) .button( BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_ZPROBE_ZOFFSET))
#endif
.tag(5).enabled(1) .button( BTN_POS(2,2), BTN_SIZE(1,1), GET_TEXT_F(MSG_PRINT_SPEED))
.tag(isPrintingFromMediaPaused() ? 7 : 6)
.enabled(
#if ENABLED(SDSUPPORT)
.enabled(isPrintingFromMedia())
#else
.enabled(0)
isPrintingFromMedia()
#endif
)
.button( BTN_POS(1,3), BTN_SIZE(1,1), isPrintingFromMediaPaused() ? GET_TEXT_F(MSG_RESUME_PRINT) : GET_TEXT_F(MSG_PAUSE_PRINT))
.enabled(
#if ENABLED(SDSUPPORT)
.enabled(isPrintingFromMedia())
#else
.enabled(0)
isPrintingFromMedia()
#endif
)
.tag(8). button( BTN_POS(2,3), BTN_SIZE(1,1), GET_TEXT_F(MSG_STOP_PRINT))
#if ENABLED(LIN_ADVANCE) || ENABLED(FILAMENT_RUNOUT_SENSOR)
.enabled(1)
#else
.enabled(0)
.enabled(
#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
1
#endif
)
.tag(9).button( BTN_POS(1,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_FILAMENT))
.tag(1).colors(action_btn) .button( BTN_POS(2,4), BTN_SIZE(1,1), GET_TEXT_F(MSG_BACK));
#endif

View file

@ -30,6 +30,7 @@ constexpr float y_min = 0.000000;
constexpr float y_max = 272.000000;
const PROGMEM uint16_t logo_fill[] = {0x419D, 0x546F, 0x3D05, 0x5615, 0x3942, 0x5A92, 0x36B7, 0x6136, 0x35C8, 0x6950, 0x35C8, 0x96B0, 0x36B7, 0x9ECA, 0x3942, 0xA56E, 0x3D05, 0xA9EB, 0x419D, 0xAB91, 0xBE60, 0xAB91, 0xC2F8, 0xA9EB, 0xC6BB, 0xA56E, 0xC946, 0x9ECA, 0xCA35, 0x96B0, 0xCA32, 0x546C, 0x419D, 0x546F};
const PROGMEM uint16_t logo_stroke[] = {0xADF3, 0x546C, 0x419D, 0x546F, 0x3D05, 0x5615, 0x3942, 0x5A92, 0x36B7, 0x6136, 0x35C8, 0x6950, 0x35C8, 0x96B0, 0x36B7, 0x9ECA, 0x3942, 0xA56E, 0x3D05, 0xA9EB, 0x419D, 0xAB91, 0xBE60, 0xAB91, 0xC2F8, 0xA9EB, 0xC6BB, 0xA56E, 0xC946, 0x9ECA, 0xCA35, 0x96B0, 0xCA32, 0x546C, 0xADF3, 0x546C, 0xFFFF, 0x419D, 0x5913, 0xB08C, 0x5913, 0xC794, 0x8250, 0xC794, 0x96B0, 0xC6DA, 0x9CFF, 0xC4E1, 0xA229, 0xC1F4, 0xA5A5, 0xBE60, 0xA6ED, 0x419D, 0xA6ED, 0x3E09, 0xA5A5, 0x3B1C, 0xA229, 0x3923, 0x9CFF, 0x3869, 0x96B0, 0x3869, 0x6950, 0x3923, 0x6301, 0x3B1C, 0x5DD7, 0x3E09, 0x5A5B, 0x419D, 0x5913, 0xFFFF, 0xAC7A, 0x8620, 0xAC7A, 0x9373, 0xA767, 0x9373, 0xA767, 0x75CB, 0xA1C6, 0x75CB, 0xA1C6, 0x9373, 0xA1C6, 0x9C8E, 0xA767, 0x9C8E, 0xAC7A, 0x9C8E, 0xB21C, 0x9C8E, 0xB21C, 0x9373, 0xB21C, 0x85E7, 0xB350, 0x8093, 0xB65F, 0x7E86, 0xB9D5, 0x8165, 0xBA83, 0x85E7, 0xBA83, 0x9C8E, 0xBEFE, 0x9C8E, 0xC024, 0x99E1, 0xC024, 0x8620, 0xBF7B, 0x7F22, 0xBD8F, 0x79A9, 0xBA7E, 0x7617, 0xB65F, 0x74D0, 0xB24F, 0x7622, 0xAF30, 0x79C6, 0xAD2F, 0x7F43, 0xAC7A, 0x8620, 0xAC7A, 0x8620, 0xAC7A, 0x8620, 0xFFFF, 0x8179, 0x9C8E, 0x7CE9, 0x9C8E, 0x7747, 0x9C8E, 0x7747, 0x92EC, 0x7747, 0x8949, 0x75A2, 0x81A3, 0x71A6, 0x7E73, 0x6DAB, 0x818B, 0x6C05, 0x88FC, 0x6DAF, 0x9019, 0x71C7, 0x92EC, 0x7505, 0x92EC, 0x7505, 0x9C8E, 0x7118, 0x9C8E, 0x6CD3, 0x9B06, 0x696B, 0x96D6, 0x6729, 0x909E, 0x6658, 0x88FC, 0x672D, 0x8133, 0x6980, 0x7AC7, 0x6D13, 0x766C, 0x71A6, 0x74D0, 0x7632, 0x766D, 0x79C2, 0x7AD1, 0x7C14, 0x8153, 0x7CE9, 0x8949, 0x7CE9, 0x92EC, 0x8179, 0x92EC, 0x8179, 0x8620, 0x822E, 0x7F43, 0x842E, 0x79C6, 0x874E, 0x7622, 0x8B5E, 0x74D0, 0x8F7C, 0x7617, 0x928E, 0x79A9, 0x9479, 0x7F22, 0x9523, 0x8620, 0x9523, 0x87DB, 0x8F81, 0x87DB, 0x8F81, 0x85E7, 0x8ED4, 0x8165, 0x8B5E, 0x7E86, 0x884F, 0x8093, 0x871A, 0x85E7, 0x871A, 0x92EC, 0x871A, 0x9C8F, 0x8179, 0x9C8F, 0x8179, 0x9C8E, 0x8179, 0x9C8E, 0xFFFF, 0x6515, 0x79DB, 0x644C, 0x7281, 0x6218, 0x6C86, 0x5EB2, 0x6882, 0x5A56, 0x670A, 0x55D9, 0x68E0, 0x5272, 0x6DD0, 0x4F0B, 0x68E0, 0x4A8E, 0x670A, 0x4638, 0x6882, 0x42D5, 0x6C86, 0x40A2, 0x7281, 0x3FD9, 0x79DB, 0x3FD9, 0x9AC9, 0x40E4, 0x9C8E, 0x456F, 0x9C8E, 0x456F, 0x79B5, 0x46D4, 0x735D, 0x4A8E, 0x70C0, 0x4E3E, 0x735D, 0x4FA1, 0x79B5, 0x4FA1, 0x9C8E, 0x554D, 0x9C8E, 0x554D, 0x79B5, 0x56A7, 0x735D, 0x5A56, 0x70C0, 0x5E0C, 0x735D, 0x5F74, 0x79B5, 0x5F74, 0x9C8E, 0x6515, 0x9C8E, 0x6515, 0x79DB, 0x6515, 0x79DB, 0x6515, 0x79DB, 0xFFFF, 0x9672, 0x8C4C, 0x9714, 0x9379, 0x98F5, 0x98D2, 0x9C0B, 0x9BF4, 0xA04C, 0x9C7B, 0xA04C, 0x9373, 0x9D2B, 0x920C, 0x9C1E, 0x8C4C, 0x9C1E, 0x648E, 0x9672, 0x648E, 0x9672, 0x8C4C, 0x9672, 0x8C4C, 0x9672, 0x8C4C, 0xFFFF, 0xA767, 0x7194, 0xA767, 0x6C02, 0xA692, 0x687A, 0xA496, 0x670A, 0xA291, 0x687A, 0xA1BB, 0x6C02, 0xA1BB, 0x7194, 0xA767, 0x7194, 0xA767, 0x7194, 0xA767, 0x7194};
#define LOGO_BACKGROUND logo_bg_rgb

View file

@ -94,6 +94,10 @@
#include "../../feature/runout.h"
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
#include "../../feature/caselight.h"
#endif
#if ENABLED(BABYSTEPPING)
#include "../../feature/babystep.h"
#endif
@ -263,36 +267,42 @@ namespace ExtUI {
#endif
}
#ifdef TOUCH_UI_LCD_TEMP_SCALING
#define GET_TEMP_ADJUSTMENT(A) float(A)/TOUCH_UI_LCD_TEMP_SCALING
#else
#define GET_TEMP_ADJUSTMENT(A) A
#endif
float getActualTemp_celsius(const heater_t heater) {
switch (heater) {
#if HAS_HEATED_BED
case BED: return thermalManager.degBed();
case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degBed());
#endif
#if HAS_HEATED_CHAMBER
case CHAMBER: return thermalManager.degChamber();
case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degChamber());
#endif
default: return thermalManager.degHotend(heater - H0);
default: return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(heater - H0));
}
}
float getActualTemp_celsius(const extruder_t extruder) {
return thermalManager.degHotend(extruder - E0);
return GET_TEMP_ADJUSTMENT(thermalManager.degHotend(extruder - E0));
}
float getTargetTemp_celsius(const heater_t heater) {
switch (heater) {
#if HAS_HEATED_BED
case BED: return thermalManager.degTargetBed();
case BED: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetBed());
#endif
#if HAS_HEATED_CHAMBER
case CHAMBER: return thermalManager.degTargetChamber();
case CHAMBER: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetChamber());
#endif
default: return thermalManager.degTargetHotend(heater - H0);
default: return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(heater - H0));
}
}
float getTargetTemp_celsius(const extruder_t extruder) {
return thermalManager.degTargetHotend(extruder - E0);
return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(extruder - E0));
}
float getTargetFan_percent(const fan_t fan) {
@ -613,6 +623,22 @@ namespace ExtUI {
#endif
#endif
#if HAS_CASE_LIGHT
bool getCaseLightState() { return case_light_on; }
void setCaseLightState(const bool value) {
case_light_on = value;
update_case_light();
}
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
float getCaseLightBrightness_percent() { return ui8_to_percent(case_light_brightness); }
void setCaseLightBrightness_percent(const float value) {
case_light_brightness = map(constrain(value, 0, 100), 0, 100, 0, 255);
update_case_light();
}
#endif
#endif
#if ENABLED(LIN_ADVANCE)
float getLinearAdvance_mm_mm_s(const extruder_t extruder) {
return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder - E0] : 0;
@ -865,27 +891,38 @@ namespace ExtUI {
}
void setTargetTemp_celsius(float value, const heater_t heater) {
#ifdef TOUCH_UI_LCD_TEMP_SCALING
value *= TOUCH_UI_LCD_TEMP_SCALING;
#endif
enableHeater(heater);
#if HAS_HEATED_CHAMBER
if (heater == CHAMBER)
thermalManager.setTargetChamber(LROUND(constrain(value, 0, CHAMBER_MAXTEMP - 10)));
else
#endif
#if HAS_HEATED_BED
if (heater == BED)
thermalManager.setTargetBed(constrain(value, 0, BED_MAXTEMP - 10));
thermalManager.setTargetBed(LROUND(constrain(value, 0, BED_MAXTEMP - 10)));
else
#endif
{
#if HOTENDS
static constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP);
const int16_t e = heater - H0;
thermalManager.setTargetHotend(constrain(value, 0, heater_maxtemp[e] - 15), e);
thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e);
#endif
}
}
void setTargetTemp_celsius(float value, const extruder_t extruder) {
#ifdef TOUCH_UI_LCD_TEMP_SCALING
value *= TOUCH_UI_LCD_TEMP_SCALING;
#endif
#if HOTENDS
constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP);
const int16_t e = extruder - E0;
enableHeater(extruder);
thermalManager.setTargetHotend(constrain(value, 0, heater_maxtemp[e] - 15), e);
thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e);
#endif
}

View file

@ -231,6 +231,16 @@ namespace ExtUI {
#endif
#endif
#if ENABLED(CASE_LIGHT_ENABLE)
bool getCaseLightState();
void setCaseLightState(const bool);
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
float getCaseLightBrightness_percent();
void setCaseLightBrightness_percent(const float);
#endif
#endif
/**
* Delay and timing routines
* Should be used by the EXTENSIBLE_UI to safely pause or measure time

View file

@ -214,6 +214,10 @@
#define GPIO_PA18_J20_21 71 // D71 PA17 (Header J20 21)
#define GPIO_PA17_J20_22 70 // D70 PA17 (Header J20 22)
// Case Light
#define CASE_LIGHT_PIN GPIO_PB1_J20_5
// 2MB SPI Flash
#define SPI_FLASH_SS 52 // D52 PB21

View file

@ -360,7 +360,11 @@
#endif // HOTENDS > 1
#endif // HOTENDS
#define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
#define _BED_PINS
#if PIN_EXISTS(HEATER_BED) && PIN_EXISTS(TEMP_BED)
#undef _BED_PINS
#define _BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
#endif
//
// Dual X, Dual Y, Multi-Z