0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-22 17:52:57 +00:00

🚸 Fix/improve Sovol SV06 Plus (#27531)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
saddfox 2024-11-25 04:52:58 +01:00 committed by GitHub
parent a7bd35b993
commit eaab2dea92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 58 additions and 52 deletions

View file

@ -219,14 +219,14 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
while (wait_for_user) { while (wait_for_user) {
impatient_beep(max_beep_count); impatient_beep(max_beep_count);
#if ALL(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR) #if ALL(HAS_FILAMENT_SENSOR, FILAMENT_CHANGE_RESUME_ON_INSERT)
#if MULTI_FILAMENT_SENSOR #if MULTI_FILAMENT_SENSOR
#define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break; #define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
switch (active_extruder) { switch (active_extruder) {
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED) REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
} }
#else #else
if (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) wait_for_user = false; if (!FILAMENT_IS_OUT()) wait_for_user = false;
#endif #endif
#endif #endif
idle_no_sleep(); idle_no_sleep();

View file

@ -51,6 +51,8 @@
#define HAS_FILAMENT_SWITCH 1 #define HAS_FILAMENT_SWITCH 1
#endif #endif
#define FILAMENT_IS_OUT() (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_STATE)
typedef Flags< typedef Flags<
#if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS #if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS
NUM_MOTION_SENSORS NUM_MOTION_SENSORS

View file

@ -155,7 +155,7 @@ void GcodeSuite::M115() {
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL)); cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));
// RUNOUT (M412, M600) // RUNOUT (M412, M600)
cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR)); cap_line(F("RUNOUT"), ENABLED(HAS_FILAMENT_SENSOR));
// Z_PROBE (G30) // Z_PROBE (G30)
cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE)); cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE));

View file

@ -46,7 +46,7 @@
#include "../../../feature/pause.h" #include "../../../feature/pause.h"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "../../../feature/runout.h" #include "../../../feature/runout.h"
#endif #endif
@ -2857,7 +2857,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
#define ADVANCED_LOAD (ADVANCED_LA + ENABLED(ADVANCED_PAUSE_FEATURE)) #define ADVANCED_LOAD (ADVANCED_LA + ENABLED(ADVANCED_PAUSE_FEATURE))
#define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE)) #define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE))
#define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION)) #define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION))
#define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(FILAMENT_RUNOUT_SENSOR)) #define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(HAS_FILAMENT_SENSOR))
#define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE)) #define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE))
#define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY)) #define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY))
#define ADVANCED_TOTAL ADVANCED_POWER_LOSS #define ADVANCED_TOTAL ADVANCED_POWER_LOSS
@ -2953,7 +2953,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
break; break;
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
case ADVANCED_FILSENSORENABLED: case ADVANCED_FILSENSORENABLED:
if (draw) { if (draw) {
drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR)); drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR));
@ -2975,7 +2975,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
modifyValue(runout.runout_distance(), 0, 999, 10); modifyValue(runout.runout_distance(), 0, 999, 10);
break; break;
#endif #endif
#endif // FILAMENT_RUNOUT_SENSOR #endif // HAS_FILAMENT_SENSOR
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
case ADVANCED_POWER_LOSS: case ADVANCED_POWER_LOSS:
@ -3830,7 +3830,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
#define TUNE_LA (TUNE_ZDOWN + ENABLED(LIN_ADVANCE)) #define TUNE_LA (TUNE_ZDOWN + ENABLED(LIN_ADVANCE))
#define TUNE_CHANGEFIL (TUNE_LA + ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)) #define TUNE_CHANGEFIL (TUNE_LA + ENABLED(FILAMENT_LOAD_UNLOAD_GCODES))
#define TUNE_FWRETRACT (TUNE_CHANGEFIL + ENABLED(FWRETRACT)) #define TUNE_FWRETRACT (TUNE_CHANGEFIL + ENABLED(FWRETRACT))
#define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(FILAMENT_RUNOUT_SENSOR)) #define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(HAS_FILAMENT_SENSOR))
#define TUNE_BACKLIGHT_OFF (TUNE_FILSENSORENABLED + 1) #define TUNE_BACKLIGHT_OFF (TUNE_FILSENSORENABLED + 1)
#define TUNE_BACKLIGHT (TUNE_BACKLIGHT_OFF + 1) #define TUNE_BACKLIGHT (TUNE_BACKLIGHT_OFF + 1)
#define TUNE_TOTAL TUNE_BACKLIGHT #define TUNE_TOTAL TUNE_BACKLIGHT
@ -3950,7 +3950,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
break; break;
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
case TUNE_FILSENSORENABLED: case TUNE_FILSENSORENABLED:
if (draw) { if (draw) {
drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR)); drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR));
@ -4326,7 +4326,7 @@ void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/)
case Popup_FilLoad: drawPopup(option ? F("Unloading Filament") : F("Loading Filament"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; case Popup_FilLoad: drawPopup(option ? F("Unloading Filament") : F("Loading Filament"), PWID, F(""), Proc_Wait, ICON_BLTouch); break;
case Popup_FilChange: drawPopup(F("Filament Change"), F("Please wait for prompt."), F(""), Proc_Wait, ICON_BLTouch); break; case Popup_FilChange: drawPopup(F("Filament Change"), F("Please wait for prompt."), F(""), Proc_Wait, ICON_BLTouch); break;
case Popup_TempWarn: drawPopup(option ? F("Nozzle temp too low!") : F("Nozzle temp too high!"), F(""), F(""), Proc_Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break; case Popup_TempWarn: drawPopup(option ? F("Nozzle temp too low!") : F("Nozzle temp too high!"), F(""), F(""), Proc_Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break;
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
case Popup_Runout: drawPopup(F("Filament Runout"), F(""), F(""), Proc_Wait, ICON_BLTouch); break; case Popup_Runout: drawPopup(F("Filament Runout"), F(""), F(""), Proc_Wait, ICON_BLTouch); break;
#endif #endif
#if ANY(PIDTEMP, PIDTEMPBED) #if ANY(PIDTEMP, PIDTEMPBED)
@ -4953,7 +4953,7 @@ void JyersDWIN::stateUpdate() {
} }
} }
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
static bool ranout = false; static bool ranout = false;
if (runout.filament_ran_out != ranout) { if (runout.filament_ran_out != ranout) {
ranout = runout.filament_ran_out; ranout = runout.filament_ran_out;

View file

@ -89,7 +89,7 @@ void AnycubicTFT::onSetup() {
delay_ms(10); delay_ms(10);
// Init the state of the key pins running on the TFT // Init the state of the key pins running on the TFT
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
SET_INPUT_PULLUP(FIL_RUNOUT1_PIN); SET_INPUT_PULLUP(FIL_RUNOUT1_PIN);
#endif #endif
@ -894,7 +894,7 @@ void AnycubicTFT::doSDCardStateCheck() {
} }
void AnycubicTFT::doFilamentRunoutCheck() { void AnycubicTFT::doFilamentRunoutCheck() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
// NOTE: getFilamentRunoutState() only returns the runout state if the job is printing // NOTE: getFilamentRunoutState() only returns the runout state if the job is printing
// we want to actually check the status of the pin here, regardless of printstate // we want to actually check the status of the pin here, regardless of printstate
if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) { if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) {
@ -909,7 +909,7 @@ void AnycubicTFT::doFilamentRunoutCheck() {
SENDLINE_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15"); SENDLINE_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15");
} }
} }
#endif // FILAMENT_RUNOUT_SENSOR #endif // HAS_FILAMENT_SENSOR
} }
void AnycubicTFT::startPrint() { void AnycubicTFT::startPrint() {
@ -939,7 +939,7 @@ void AnycubicTFT::pausePrint() {
void AnycubicTFT::resumePrint() { void AnycubicTFT::resumePrint() {
#if HAS_MEDIA #if HAS_MEDIA
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) { if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) {
DEBUG_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); DEBUG_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... ");

View file

@ -45,6 +45,10 @@
#include "../../../feature/powerloss.h" #include "../../../feature/powerloss.h"
#endif #endif
#if HAS_FILAMENT_SENSOR
#include "../../../feature/runout.h"
#endif
#define DEBUG_OUT ACDEBUGLEVEL #define DEBUG_OUT ACDEBUGLEVEL
#include "../../../core/debug_out.h" #include "../../../core/debug_out.h"
@ -438,7 +442,7 @@ namespace Anycubic {
} }
} }
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
void DgusTFT::filamentRunout() { void DgusTFT::filamentRunout() {
#if ACDEBUG(AC_MARLIN) #if ACDEBUG(AC_MARLIN)
@ -453,7 +457,7 @@ namespace Anycubic {
pop_up_index = 15; // show filament lack. pop_up_index = 15; // show filament lack.
if (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_STATE) { if (FILAMENT_IS_OUT()) {
playTune(FilamentOut); playTune(FilamentOut);
feedrate_back = getFeedrate_percent(); feedrate_back = getFeedrate_percent();
@ -466,7 +470,7 @@ namespace Anycubic {
} }
} }
#endif // FILAMENT_RUNOUT_SENSOR #endif // HAS_FILAMENT_SENSOR
void DgusTFT::confirmationRequest(const char * const msg) { void DgusTFT::confirmationRequest(const char * const msg) {
// M108 continue // M108 continue
@ -598,7 +602,7 @@ namespace Anycubic {
printer_state = AC_printer_stopping_from_media_remove; printer_state = AC_printer_stopping_from_media_remove;
} }
else { else {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#if ACDEBUG(AC_MARLIN) #if ACDEBUG(AC_MARLIN)
DEBUG_ECHOLNPGM("setFilamentRunoutState: ", __LINE__); DEBUG_ECHOLNPGM("setFilamentRunoutState: ", __LINE__);
#endif #endif

View file

@ -102,7 +102,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#endif #endif
.enabled(ENABLED(HAS_MULTI_HOTEND)) .enabled(ENABLED(HAS_MULTI_HOTEND))
.tag(4) .button(OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU)) .tag(4) .button(OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU))
.enabled(ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) .enabled(ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR))
.tag(11).button(FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) .tag(11).button(FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT))
.tag(12).button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) .tag(12).button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS))
.tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) .tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU))
@ -122,29 +122,29 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
switch (tag) { switch (tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
#if HAS_BED_PROBE #if HAS_BED_PROBE
case 2: GOTO_SCREEN(ZOffsetScreen); break; case 2: GOTO_SCREEN(ZOffsetScreen); break;
#endif #endif
case 3: GOTO_SCREEN(StepsScreen); break; case 3: GOTO_SCREEN(StepsScreen); break;
#if HAS_MULTI_HOTEND #if HAS_MULTI_HOTEND
case 4: GOTO_SCREEN(NozzleOffsetScreen); break; case 4: GOTO_SCREEN(NozzleOffsetScreen); break;
#endif #endif
case 5: GOTO_SCREEN(MaxVelocityScreen); break; case 5: GOTO_SCREEN(MaxVelocityScreen); break;
case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; case 6: GOTO_SCREEN(DefaultAccelerationScreen); break;
case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break; case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break;
#if ENABLED(BACKLASH_GCODE) #if ENABLED(BACKLASH_GCODE)
case 8: GOTO_SCREEN(BacklashCompensationScreen); break; case 8: GOTO_SCREEN(BacklashCompensationScreen); break;
#endif #endif
case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break;
case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break; case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) #if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)
case 11: GOTO_SCREEN(FilamentMenu); break; case 11: GOTO_SCREEN(FilamentMenu); break;
#endif #endif
case 12: GOTO_SCREEN(EndstopStatesScreen); break; case 12: GOTO_SCREEN(EndstopStatesScreen); break;
#if HAS_TRINAMIC_CONFIG #if HAS_TRINAMIC_CONFIG
case 13: GOTO_SCREEN(StepperCurrentScreen); break; case 13: GOTO_SCREEN(StepperCurrentScreen); break;
#endif #endif
#if ENABLED(SENSORLESS_HOMING) #if ENABLED(SENSORLESS_HOMING)
case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break; case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
#endif #endif
case 15: GOTO_SCREEN(DisplayTuningScreen); break; case 15: GOTO_SCREEN(DisplayTuningScreen); break;
case 16: GOTO_SCREEN(FlowPercentScreen); break; case 16: GOTO_SCREEN(FlowPercentScreen); break;

View file

@ -84,12 +84,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
#else #else
PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN)
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) #if HAS_FILAMENT_SENSOR && PIN_EXISTS(FIL_RUNOUT)
PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE) PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE)
#else #else
PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT)
#endif #endif
#if ALL(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) #if ALL(HAS_MULTI_EXTRUDER, HAS_FILAMENT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2)
PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE) PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE)
#else #else
PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2)

View file

@ -58,7 +58,7 @@ void FilamentMenu::onRedraw(draw_mode_t what) {
cmd.font(font_large) cmd.font(font_large)
.text(TITLE_POS, GET_TEXT_F(MSG_FILAMENT)) .text(TITLE_POS, GET_TEXT_F(MSG_FILAMENT))
.font(font_medium).colors(normal_btn) .font(font_medium).colors(normal_btn)
.enabled(ENABLED(FILAMENT_RUNOUT_SENSOR)) .enabled(ENABLED(HAS_FILAMENT_SENSOR))
.tag(2).button(RUNOUT_SENSOR_POS, GET_TEXT_F(MSG_RUNOUT_SENSOR)) .tag(2).button(RUNOUT_SENSOR_POS, GET_TEXT_F(MSG_RUNOUT_SENSOR))
.enabled(ENABLED(LIN_ADVANCE)) .enabled(ENABLED(LIN_ADVANCE))
.tag(3).button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) .tag(3).button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE))
@ -69,12 +69,12 @@ void FilamentMenu::onRedraw(draw_mode_t what) {
bool FilamentMenu::onTouchEnd(uint8_t tag) { bool FilamentMenu::onTouchEnd(uint8_t tag) {
switch (tag) { switch (tag) {
case 1: GOTO_PREVIOUS(); break; case 1: GOTO_PREVIOUS(); break;
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
case 2: GOTO_SCREEN(FilamentRunoutScreen); break; case 2: GOTO_SCREEN(FilamentRunoutScreen); break;
#endif #endif
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
case 3: GOTO_SCREEN(LinearAdvanceScreen); break; case 3: GOTO_SCREEN(LinearAdvanceScreen); break;
#endif #endif
default: return false; default: return false;
} }

View file

@ -75,13 +75,13 @@ enum {
#if ENABLED(CASE_LIGHT_ENABLE) #if ENABLED(CASE_LIGHT_ENABLE)
CASE_LIGHT_SCREEN_CACHE, CASE_LIGHT_SCREEN_CACHE,
#endif #endif
#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) #if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)
FILAMENT_MENU_CACHE, FILAMENT_MENU_CACHE,
#endif #endif
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
LINEAR_ADVANCE_SCREEN_CACHE, LINEAR_ADVANCE_SCREEN_CACHE,
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
FILAMENT_RUNOUT_SCREEN_CACHE, FILAMENT_RUNOUT_SCREEN_CACHE,
#endif #endif
#if HAS_MEDIA #if HAS_MEDIA
@ -197,11 +197,11 @@ enum {
#include "case_light_screen.h" #include "case_light_screen.h"
#endif #endif
#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) #if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)
#include "filament_menu.h" #include "filament_menu.h"
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
#include "filament_runout_screen.h" #include "filament_runout_screen.h"
#endif #endif

View file

@ -374,9 +374,9 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
.button(TOOL_HEAD_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_BUTTON_PAUSE) : GET_TEXT_F(MSG_BUTTON_RESUME)) .button(TOOL_HEAD_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_BUTTON_PAUSE) : GET_TEXT_F(MSG_BUTTON_RESUME))
.tag(!ExtUI::isPrintingPaused() ? 7 : 14) .tag(!ExtUI::isPrintingPaused() ? 7 : 14)
.button(CHANGE_FILAMENT_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_SPEED) : F("")); .button(CHANGE_FILAMENT_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_SPEED) : F(""));
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
cmd.tag(8).button(PREHEAT_POS, GET_TEXT_F(MSG_SENSOR)); cmd.tag(8).button(PREHEAT_POS, GET_TEXT_F(MSG_SENSOR));
#endif #endif
if (ExtUI::isPrintingPaused()) if (ExtUI::isPrintingPaused())
draw_text_box(cmd, CHANGE_FILAMENT_POS, F("Change\nFilament"), OPT_CENTER, font_medium); draw_text_box(cmd, CHANGE_FILAMENT_POS, F("Change\nFilament"), OPT_CENTER, font_medium);
} }
@ -536,7 +536,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
} }
break; break;
case 7: GOTO_SCREEN(FeedratePercentScreen); break; case 7: GOTO_SCREEN(FeedratePercentScreen); break;
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
case 8: GOTO_SCREEN(FilamentRunoutScreen); break; case 8: GOTO_SCREEN(FilamentRunoutScreen); break;
#endif #endif
case 9: injectCommands(F("G28")); break; case 9: injectCommands(F("G28")); break;

View file

@ -171,7 +171,7 @@ void onUserConfirmRequired(const char *const msg) {
case PAUSE_MESSAGE_PURGE: { case PAUSE_MESSAGE_PURGE: {
rts.sendData(ExchangePageBase + 78, ExchangepageAddr); rts.sendData(ExchangePageBase + 78, ExchangepageAddr);
char newMsg[40] = "Yes to "; char newMsg[40] = "Yes to ";
strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); strcat_P(newMsg, TERN1(HAS_FILAMENT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable "));
strcat_P(newMsg, PSTR(" No to Purge")); strcat_P(newMsg, PSTR(" No to Purge"));
onStatusChanged(newMsg); onStatusChanged(newMsg);
break; break;
@ -181,7 +181,7 @@ void onUserConfirmRequired(const char *const msg) {
case PAUSE_MESSAGE_OPTION: { case PAUSE_MESSAGE_OPTION: {
rts.sendData(ExchangePageBase + 78, ExchangepageAddr); rts.sendData(ExchangePageBase + 78, ExchangepageAddr);
char newMsg[40] = "Yes to "; char newMsg[40] = "Yes to ";
strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); strcat_P(newMsg, TERN1(HAS_FILAMENT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable "));
strcat_P(newMsg, PSTR(" No to Purge")); strcat_P(newMsg, PSTR(" No to Purge"));
onStatusChanged(newMsg); onStatusChanged(newMsg);
break; break;

View file

@ -1435,7 +1435,7 @@ void RTS::handleData() {
// pause_resume_selected = true; // pause_resume_selected = true;
} }
else { else {
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
bool runouton = false; bool runouton = false;
if (getFilamentRunoutState()) { if (getFilamentRunoutState()) {
#if NUM_RUNOUT_SENSORS > 1 #if NUM_RUNOUT_SENSORS > 1

View file

@ -138,7 +138,7 @@ void menu_advanced_settings();
#if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING #if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING
__STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE); __STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE);
#endif #endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if HAS_FILAMENT_SENSOR
REPEAT_1(NUM_RUNOUT_SENSORS, FIL_ITEM) REPEAT_1(NUM_RUNOUT_SENSORS, FIL_ITEM)
#endif #endif

View file

@ -55,7 +55,7 @@ RTS rts;
#include "../../feature/tmc_util.h" #include "../../feature/tmc_util.h"
#include "../../gcode/queue.h" #include "../../gcode/queue.h"
#include "../../gcode/gcode.h" #include "../../gcode/gcode.h"
//#include "../marlinui.h" #include "../marlinui.h"
//#include "../utf8.h" //#include "../utf8.h"
#include "../../libs/BL24CXX.h" #include "../../libs/BL24CXX.h"
@ -118,7 +118,7 @@ char commandbuf[30];
static SovolPage change_page_number = ID_Startup; static SovolPage change_page_number = ID_Startup;
uint16_t remain_time = 0; uint32_t remain_time = 0;
static bool last_card_insert_st; static bool last_card_insert_st;
bool card_insert_st; bool card_insert_st;
@ -1365,7 +1365,7 @@ void RTS::handleData() {
#if HAS_FILAMENT_SENSOR #if HAS_FILAMENT_SENSOR
case FilamentChange: // Automatic material case FilamentChange: // Automatic material
switch (recdat.data[0]) { switch (recdat.data[0]) {
case 1: if (runout.filament_ran_out) break; case 1: if (FILAMENT_IS_OUT()) break;
case 2: case 2:
updateTempE0(); updateTempE0();
wait_for_heatup = wait_for_user = false; wait_for_heatup = wait_for_user = false;
@ -1530,7 +1530,7 @@ void RTS::handleData() {
updateFan0(); updateFan0();
job_percent = card.percentDone() + 1; job_percent = ui.get_progress_percent();
if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP); if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP);
sendData(uint8_t(card.percentDone()), PRINT_PROCESS_VP); sendData(uint8_t(card.percentDone()), PRINT_PROCESS_VP);
@ -1626,13 +1626,13 @@ void RTS::onIdle() {
if (card.isPrinting() && (last_cardpercentValue != card.percentDone())) { if (card.isPrinting() && (last_cardpercentValue != card.percentDone())) {
if (card.percentDone() > 0) { if (card.percentDone() > 0) {
job_percent = card.percentDone(); job_percent = ui.get_progress_percent();
if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP); if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP);
// Estimate remaining time every 20 seconds // Estimate remaining time every 20 seconds
static millis_t next_remain_time_update = 0; static millis_t next_remain_time_update = 0;
if (ELAPSED(ms, next_remain_time_update)) { if (ELAPSED(ms, next_remain_time_update)) {
if (thermalManager.degHotend(0) >= thermalManager.degTargetHotend(0) - 5) { if (thermalManager.degHotend(0) >= thermalManager.degTargetHotend(0) - 5) {
remain_time = elapsed.value / (job_percent * 0.01f) - elapsed.value; remain_time = ui.get_remaining_time();
next_remain_time_update += 20 * 1000UL; next_remain_time_update += 20 * 1000UL;
sendData(remain_time / 3600, PRINT_SURPLUS_TIME_HOUR_VP); sendData(remain_time / 3600, PRINT_SURPLUS_TIME_HOUR_VP);
sendData((remain_time % 3600) / 60, PRINT_SURPLUS_TIME_MIN_VP); sendData((remain_time % 3600) / 60, PRINT_SURPLUS_TIME_MIN_VP);