Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Aug 7, 2024
2 parents 1467b20 + 0ec1a54 commit bd363b3
Show file tree
Hide file tree
Showing 68 changed files with 1,496 additions and 748 deletions.
5 changes: 4 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,9 @@
*/
#if ENABLED(MPCTEMP)
#define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~6.3K bytes of flash)
#if ENABLED(MPC_AUTOTUNE)
//#define MPC_AUTOTUNE_DEBUG // Enable MPC debug logging (~870 bytes of flash)
#endif
#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash)
#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)

Expand Down Expand Up @@ -1484,7 +1487,7 @@
* A lightweight, solenoid-driven probe.
* For information about this sensor https://github.com/bigtreetech/MicroProbe
*
* Also requires: PROBE_ENABLE_DISABLE
* Also requires: PROBE_ENABLE_DISABLE, ENDSTOP_INTERRUPTS_FEATURE if FT_MOTION is enabled.
*/
//#define BIQU_MICROPROBE_V1 // Triggers HIGH
//#define BIQU_MICROPROBE_V2 // Triggers LOW
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,10 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "BIQU MicroProbe requires a PROBE_ENABLE_PIN."
#endif

#if ENABLED(FT_MOTION) && DISABLED(ENDSTOP_INTERRUPTS_FEATURE)
#error "BIQU Microprobe requires ENDSTOP_INTERRUPTS_FEATURE with FT_MOTION."
#endif

#if ENABLED(BIQU_MICROPROBE_V1)
#if ENABLED(INVERTED_PROBE_STATE)
#if Z_MIN_PROBE_ENDSTOP_HIT_STATE != LOW
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3271,7 +3271,7 @@ void Draw_Control_Menu() {
MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, Draw_LedControl_Menu);
#endif
#if ENABLED(PRINTCOUNTER)
MENU_ITEM(ICON_PrintStats, MSG_INFO_STATS_MENU, onDrawSubMenu, gotoPrintStats);
MENU_ITEM(ICON_PrintStats, MSG_INFO_PRINTER_STATS_MENU, onDrawSubMenu, gotoPrintStats);
#endif
MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawSubMenu, Goto_Info_Menu);
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/printstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void PrintStats::draw() {
char str[30] = "";
constexpr int8_t MRG = 30;

Title.ShowCaption(GET_TEXT_F(MSG_INFO_STATS_MENU));
Title.ShowCaption(GET_TEXT_F(MSG_INFO_PRINTER_STATS_MENU));
DWINUI::ClearMainArea();
Draw_Popup_Bkgd();
DWINUI::Draw_Button(BTN_Continue, 86, 250, true);
Expand Down
33 changes: 14 additions & 19 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,17 @@ void FilesScreen::drawFileButton(int x, int y, int w, int h, const char *filenam
cmd.cmd(COLOR_RGB(is_highlighted ? fg_action : bg_color));
cmd.font(font_medium).rectangle(bx, by, bw, bh);
cmd.cmd(COLOR_RGB(is_highlighted ? normal_btn.rgb : bg_text_enabled));
#if ENABLED(SCROLL_LONG_FILENAMES)
if (is_highlighted) {
cmd.cmd(SAVE_CONTEXT());
cmd.cmd(SCISSOR_XY(x,y));
cmd.cmd(SCISSOR_SIZE(w,h));
cmd.cmd(MACRO(0));
cmd.text(bx, by, bw, bh, filename, OPT_CENTERY | OPT_NOFIT);
} else
#endif
draw_text_with_ellipsis(cmd, bx,by, bw - (is_dir ? 20 : 0), bh, filename, OPT_CENTERY, font_medium);
if (is_dir && !is_highlighted) cmd.text(bx, by, bw, bh, F("> "), OPT_CENTERY | OPT_RIGHTX);
#if ENABLED(SCROLL_LONG_FILENAMES)
if (is_highlighted) cmd.cmd(RESTORE_CONTEXT());
#endif
if (TERN0(SCROLL_LONG_FILENAMES, is_highlighted)) {
cmd.cmd(SAVE_CONTEXT());
cmd.cmd(SCISSOR_XY(x,y));
cmd.cmd(SCISSOR_SIZE(w,h));
cmd.cmd(MACRO(0));
cmd.text(bx, by, bw, bh, filename, OPT_CENTERY | OPT_NOFIT);
}
else
draw_text_with_ellipsis(cmd, bx, by, bw - (is_dir ? 20 : 0), bh, filename, OPT_CENTERY, font_medium);
if (is_dir && !is_highlighted) cmd.text(bx, by, bw, bh, F("> "), OPT_CENTERY | OPT_RIGHTX);
if (TERN0(SCROLL_LONG_FILENAMES, is_highlighted)) cmd.cmd(RESTORE_CONTEXT());
}

void FilesScreen::drawFileList() {
Expand All @@ -136,11 +133,9 @@ void FilesScreen::drawFileList() {

uint16_t fileIndex = mydata.cur_page * FILES_PER_PAGE;
for (uint8_t i = 0; i < FILES_PER_PAGE; i++, fileIndex++) {
if (files.seek(fileIndex)) {
drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false);
mydata.flags.is_empty = false;
} else
break;
if (!files.seek(fileIndex)) break;
drawFileButton(files.filename(), getTagForLine(i), files.isDir(), false);
mydata.flags.is_empty = false;
}
}

Expand Down
13 changes: 12 additions & 1 deletion Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ namespace ExtUI {

void onPrintTimerStarted() {
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_STARTED);
current_screen.forget();
PUSH_SCREEN(StatusScreen);
}
void onPrintTimerStopped() {
InterfaceSoundsScreen::playEventSound(InterfaceSoundsScreen::PRINTING_FINISHED);
Expand Down Expand Up @@ -118,9 +120,18 @@ namespace ExtUI {
if (msg)
ConfirmUserRequestAlertBox::show(msg);
else
ConfirmUserRequestAlertBox::hide();
ConfirmUserRequestAlertBox::show("Press Resume to Continue");
}

#if ENABLED(ADVANCED_PAUSE_FEATURE)
void filament_load_prompt(const char * const msg) {
if (msg)
FilamentPromptBox::show();
else
FilamentPromptBox::hide();
}
#endif

// For fancy LCDs include an icon ID, message, and translated button title
void onUserConfirmRequired(const int icon, const char * const cstr, FSTR_P const fBtn) {
onUserConfirmRequired(cstr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
****************************************************************************/

#include "ftdi_extended.h"
#include "../../screens.h"

#if ENABLED(FTDI_EXTENDED)
using namespace FTDI;
Expand All @@ -32,6 +33,7 @@ enum {
tiny_timer_t touch_timer;
UIData::flags_t UIData::flags;
uint8_t pressed_tag = UNPRESSED;
uint8_t lastPauseMsgState = 0;

uint8_t UIData::get_persistent_data_mask() {
// A bit mask for flags that should be stored to the EEPROM.
Expand Down Expand Up @@ -117,6 +119,31 @@ namespace FTDI {
return;
}

#if ENABLED(ADVANCED_PAUSE_FEATURE)
if (ExtUI::awaitingUserConfirm() && (lastPauseMsgState != ExtUI::pauseModeStatus)) {
//SERIAL_ECHOLNPGM("Calling Pause Screen : ", lastPauseMsgState);
switch (ExtUI::pauseModeStatus) {
case PAUSE_MESSAGE_PARKING: ExtUI::onStatusChanged(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break;
case PAUSE_MESSAGE_CHANGING: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break;
case PAUSE_MESSAGE_UNLOAD: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break;
case PAUSE_MESSAGE_WAITING: ExtUI::onStatusChanged(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING)); break;
case PAUSE_MESSAGE_INSERT: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break;
case PAUSE_MESSAGE_LOAD: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break;
case PAUSE_MESSAGE_PURGE: ExtUI::onStatusChanged(GET_TEXT_F(TERN(ADVANCED_PAUSE_CONTINUOUS_PURGE, MSG_FILAMENT_CHANGE_CONT_PURGE, MSG_FILAMENT_CHANGE_PURGE))); break;
case PAUSE_MESSAGE_RESUME: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_RESUME)); break;
case PAUSE_MESSAGE_HEAT: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEAT)); break;
case PAUSE_MESSAGE_HEATING: ExtUI::onStatusChanged(GET_TEXT_F(MSG_FILAMENT_CHANGE_HEATING)); break;
case PAUSE_MESSAGE_OPTION: FilamentPromptBox::show(); break;
case PAUSE_MESSAGE_STATUS: break;
default: ExtUI::onUserConfirmRequired(PSTR("Confirm Continue")); break;
}
}
else if (!ExtUI::awaitingUserConfirm() && !ExtUI::isPrintingPaused() && !ExtUI::getHostKeepaliveIsPaused()) {
ConfirmUserRequestAlertBox::hide();
FilamentPromptBox::hide();
}
#endif // ADVANCED_PAUSE_FEATURE

const uint8_t tag = CLCD::get_tag();

switch (pressed_tag) {
Expand Down
103 changes: 47 additions & 56 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
* Written By Brian Kahl 2023 - FAME3D *
* *
* 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 *
Expand All @@ -22,11 +23,12 @@

#include "../config.h"
#include "../screens.h"
#include "../../ui_api.h"

#ifdef FTDI_ABOUT_SCREEN

#define GRID_COLS 4
#define GRID_ROWS 8
#define GRID_ROWS 30

using namespace FTDI;
using namespace Theme;
Expand All @@ -43,74 +45,63 @@ void AboutScreen::onRedraw(draw_mode_t) {
.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));
#ifdef LULZBOT_LCD_MACHINE_NAME
draw_text_box(cmd, BTN_POS(1,1), BTN_SIZE(4,6), F(
#if ENABLED(LULZBOT_LONG_BED)
"" LULZBOT_LCD_MACHINE_NAME " \nWith Long Bed"
#elif ENABLED(LULZBOT_LONG_BED_V2)
"" LULZBOT_LCD_MACHINE_NAME " \nWith Long Bed V2"
#elif ENABLED(LULZBOT_BLTouch) && NONE(LULZBOT_LONG_BED_V2, TAZProV2)
"" LULZBOT_LCD_MACHINE_NAME " \nWith BLTouch"
#else
"" LULZBOT_LCD_MACHINE_NAME "\n"
#endif
), OPT_CENTER, font_xxlarge);
#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)
#ifdef LULZBOT_LCD_MACHINE_NAME
cmd.tag(3);
draw_text_box(cmd, BTN_POS(1,7), BTN_SIZE(4,3), F(
"Firmware:"
), OPT_CENTER, font_xlarge);

draw_text_box(cmd, BTN_POS(1,10), BTN_SIZE(4,2), F(
"" LULZBOT_M115_EXTRUDER_TYPE ""
), OPT_CENTER, font_xlarge);
#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 ALL(PRINTCOUNTER, FTDI_STATISTICS_SCREEN)
cmd.colors(normal_btn)
.tag(2).button(STATS_POS, GET_TEXT_F(MSG_INFO_STATS_MENU));

#if ENABLED(SHOW_TOOL_HEAD_ID)
draw_text_box(cmd, BTN_POS(1,13), BTN_SIZE(4,3), F(
"Tool Head:"
), OPT_CENTER, font_xlarge);
#endif
cmd.colors(action_btn)
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE));

draw_text_box(cmd, BTN_POS(1,19), BTN_SIZE(4,3), F(
"Version:"
), OPT_CENTER, font_xlarge);

draw_text_box(cmd, BTN_POS(1,22), BTN_SIZE(4,2), F(
"Marlin " SHORT_BUILD_VERSION ""
), OPT_CENTER, font_xlarge);


cmd.font(font_medium).colors(normal_btn).tag(1).button(BTN_POS(1,24), BTN_SIZE(4,3), GET_TEXT_F(MSG_INFO_PRINTER_STATS_MENU));

cmd.font(font_medium).colors(action_btn).tag(2).button(BTN_POS(1,27), BTN_SIZE(4,3), GET_TEXT_F(MSG_BUTTON_DONE));

}

bool AboutScreen::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
switch(tag) {
default: return false;
#if ALL(PRINTCOUNTER, FTDI_STATISTICS_SCREEN)
case 2: GOTO_SCREEN(StatisticsScreen); break;
case 1: GOTO_SCREEN(StatisticsScreen); break;
#endif
case 2: GOTO_PREVIOUS(); return true;
#if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU)
case 3: GOTO_SCREEN(DeveloperMenu); break;
#endif
default: return false;
}
return true;
}

#endif // FTDI_ABOUT_SCREEN
#endif // EXTENSIBLE_UI
Loading

0 comments on commit bd363b3

Please sign in to comment.