[2.0.x] Use NOZZLE_PARK_FEATURE for ADVANCED_PAUSE_FEATURE (#8866)

* Use NOZZLE_PARK_FEATURE for ADVANCED_PAUSE_FEATURE
This commit is contained in:
Thomas Moore
2017-12-25 01:38:06 -06:00
committed by Scott Lahteine
parent 705ea98fd3
commit f0a8a1a853
91 changed files with 275 additions and 328 deletions

View File

@ -49,6 +49,7 @@
* Z = override Z raise
*/
void GcodeSuite::M125() {
point_t park_point = NOZZLE_PARK_POINT;
// Initial retract before move to filament change position
const float retract = parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0
@ -58,35 +59,26 @@ void GcodeSuite::M125() {
;
// Lift Z axis
const float z_lift = parser.linearval('Z')
#ifdef PAUSE_PARK_Z_ADD
+ PAUSE_PARK_Z_ADD
#endif
;
if (parser.seenval('Z'))
park_point.z = parser.linearval('Z');
// Move XY axes to filament change position or given position
const float x_pos = parser.linearval('X')
#ifdef PAUSE_PARK_X_POS
+ PAUSE_PARK_X_POS
#endif
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
+ (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0)
#endif
;
const float y_pos = parser.linearval('Y')
#ifdef PAUSE_PARK_Y_POS
+ PAUSE_PARK_Y_POS
#endif
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
+ (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0)
#endif
;
if (parser.seenval('X'))
park_point.x = parser.linearval('X');
if (parser.seenval('Y'))
park_point.y = parser.linearval('Y');
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
#endif
#if DISABLED(SDSUPPORT)
const bool job_running = print_job_timer.isRunning();
#endif
if (pause_print(retract, z_lift, x_pos, y_pos)) {
if (pause_print(retract, park_point)) {
#if DISABLED(SDSUPPORT)
// Wait for lcd click or M108
wait_for_filament_reload();

View File

@ -47,6 +47,7 @@
*
*/
void GcodeSuite::M600() {
point_t park_point = NOZZLE_PARK_POINT;
#if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
// Don't allow filament change without homing first
@ -61,23 +62,20 @@ void GcodeSuite::M600() {
;
// Lift Z axis
const float z_lift = parser.linearval('Z', 0
#ifdef PAUSE_PARK_Z_ADD
+ PAUSE_PARK_Z_ADD
#endif
);
if (parser.seenval('Z'))
park_point.z = parser.linearval('Z');
// Move XY axes to filament exchange position
const float x_pos = parser.linearval('X', 0
#ifdef PAUSE_PARK_X_POS
+ PAUSE_PARK_X_POS
#endif
);
const float y_pos = parser.linearval('Y', 0
#ifdef PAUSE_PARK_Y_POS
+ PAUSE_PARK_Y_POS
#endif
);
// Move XY axes to filament change position or given position
if (parser.seenval('X'))
park_point.x = parser.linearval('X');
if (parser.seenval('Y'))
park_point.y = parser.linearval('Y');
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
#endif
// Unload filament
const float unload_length = parser.seen('U') ? parser.value_axis_units(E_AXIS) : 0
@ -103,7 +101,7 @@ void GcodeSuite::M600() {
const bool job_running = print_job_timer.isRunning();
if (pause_print(retract, z_lift, x_pos, y_pos, unload_length, beep_count, true)) {
if (pause_print(retract, park_point, unload_length, beep_count, true)) {
wait_for_filament_reload(beep_count);
resume_print(load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, beep_count);
}