Followup to Menu Refactor (#12275)

This commit is contained in:
Scott Lahteine
2018-10-30 16:34:45 -05:00
committed by GitHub
parent 5536228359
commit 3583e2b449
45 changed files with 244 additions and 273 deletions

View File

@ -156,7 +156,7 @@ int16_t g26_bed_temp,
int8_t g26_prime_flag;
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
/**
* If the LCD is clicked, cancel, wait for release, return true
@ -164,7 +164,7 @@ int8_t g26_prime_flag;
bool user_canceled() {
if (!is_lcd_clicked()) return false; // Return if the button isn't pressed
lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_quick_feedback(true);
#endif
wait_for_release();
@ -327,7 +327,7 @@ inline bool look_for_lines_to_connect() {
for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation
#endif
@ -418,14 +418,14 @@ inline bool turn_on_heaters() {
if (g26_bed_temp > 25) {
lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
lcd_quick_feedback(true);
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_external_control = true;
#endif
#endif
thermalManager.setTargetBed(g26_bed_temp);
while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) {
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
if (is_lcd_clicked()) return exit_from_g26();
#endif
@ -448,7 +448,7 @@ inline bool turn_on_heaters() {
thermalManager.setTargetHotend(g26_hotend_temp, 0);
while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) {
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
if (is_lcd_clicked()) return exit_from_g26();
#endif
@ -474,7 +474,7 @@ inline bool turn_on_heaters() {
*/
inline bool prime_nozzle() {
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
float Total_Prime = 0.0;
#endif
@ -619,7 +619,7 @@ void GcodeSuite::G26() {
if (parser.seen('P')) {
if (!parser.has_value()) {
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
g26_prime_flag = -1;
#else
SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD.");
@ -664,7 +664,7 @@ void GcodeSuite::G26() {
}
int16_t g26_repeats;
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1);
#else
if (!parser.seen('R')) {
@ -723,7 +723,7 @@ void GcodeSuite::G26() {
move_to(destination, 0.0);
move_to(destination, g26_ooze_amount);
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_external_control = true;
#endif
@ -831,7 +831,7 @@ void GcodeSuite::G26() {
plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc
feedrate_mm_s = save_feedrate;
set_destination_from_current();
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation
#endif
@ -857,7 +857,7 @@ void GcodeSuite::G26() {
for (int8_t ind = start_ind; ind <= end_ind; ind++) {
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation
#endif
@ -906,7 +906,7 @@ void GcodeSuite::G26() {
move_to(destination, 0); // Move back to the starting position
//debug_current_and_destination(PSTR("done doing X/Y move."));
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_external_control = false; // Give back control of the LCD Panel!
#endif

View File

@ -204,7 +204,7 @@ static float calibration_probe(const float &nx, const float &ny, const bool stow
#endif
}
#if HAS_BED_PROBE && ENABLED(ULTIPANEL)
#if HAS_BED_PROBE && HAS_LCD_MENU
static float probe_z_shift(const float center) {
STOW_PROBE();
endstops.enable_z_probe(false);
@ -588,7 +588,7 @@ void GcodeSuite::G33() {
switch (probe_points) {
case -1:
#if HAS_BED_PROBE && ENABLED(ULTIPANEL)
#if HAS_BED_PROBE && HAS_LCD_MENU
zprobe_zoffset += probe_z_shift(z_at_pt[CEN]);
#endif

View File

@ -60,7 +60,7 @@ void GcodeSuite::M18_M84() {
#endif
}
#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD
#if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
#endif
}

View File

@ -27,7 +27,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#include "../../lcd/ultralcd.h"
#endif
@ -82,7 +82,7 @@
restore_stepper_drivers();
#endif
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_reset_status();
#endif
}
@ -115,7 +115,7 @@ void GcodeSuite::M81() {
PSU_OFF();
#endif
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF ".");
#endif
}

View File

@ -33,7 +33,7 @@
#include "../../../module/tool_change.h"
#endif
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#include "../../../lcd/ultralcd.h"
#endif
@ -70,7 +70,7 @@ void GcodeSuite::M600() {
#endif
// Show initial "wait for start" message
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder);
#endif

View File

@ -34,7 +34,7 @@
#include "../../../module/tool_change.h"
#endif
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#include "../../../lcd/ultralcd.h"
#endif
@ -61,7 +61,7 @@ void GcodeSuite::M701() {
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
// Show initial "wait for load" message
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder);
#endif
@ -98,7 +98,7 @@ void GcodeSuite::M701() {
#endif
// Show status screen
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif
}
@ -127,7 +127,7 @@ void GcodeSuite::M702() {
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
// Show initial "wait for unload" message
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder);
#endif
@ -171,7 +171,7 @@ void GcodeSuite::M702() {
#endif
// Show status screen
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif
}

View File

@ -427,7 +427,7 @@ void GcodeSuite::process_parsed_command(
case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
case 145: M145(); break; // M145: Set material heatup parameters
#endif

View File

@ -571,7 +571,7 @@ private:
static void M190();
#endif
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
static void M145();
#endif

View File

@ -27,7 +27,7 @@
#include "../gcode.h"
#include "../../module/stepper.h"
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#include "../../lcd/ultralcd.h"
#endif
@ -59,7 +59,7 @@ void GcodeSuite::M0_M1() {
planner.synchronize();
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
if (has_message)
lcd_setstatus(args, true);
@ -93,7 +93,7 @@ void GcodeSuite::M0_M1() {
printerEventLEDs.onResumeAfterWait();
#endif
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
lcd_reset_status();
#endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
#include "../gcode.h"
#include "../../lcd/ultralcd.h"
@ -60,4 +60,4 @@ void GcodeSuite::M145() {
}
}
#endif // ULTIPANEL
#endif // HAS_LCD_MENU

View File

@ -273,7 +273,7 @@ public:
static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; }
#if ENABLED(ULTIPANEL) && DISABLED(DISABLE_M503)
#if HAS_LCD_MENU && DISABLED(DISABLE_M503)
FORCE_INLINE static char temp_units_code() {
return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C';
@ -293,7 +293,7 @@ public:
}
}
#endif // ULTIPANEL && !DISABLE_M503
#endif // HAS_LCD_MENU && !DISABLE_M503
static inline float value_celsius() {
const float f = value_float();

View File

@ -387,7 +387,7 @@ inline void get_serial_commands() {
// Process critical commands early
if (strcmp(command, "M108") == 0) {
wait_for_heatup = false;
#if ENABLED(ULTIPANEL)
#if HAS_LCD_MENU
wait_for_user = false;
#endif
}

View File

@ -97,7 +97,7 @@ void enqueue_and_echo_commands_P(PGM_P const pgcode);
*/
bool enqueue_and_echo_command(const char* cmd);
#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (HAS_LCD_MENU && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
#if HAS_QUEUE_NOW