Since the advance factor is computed per-segment in LA15, there's no
need to stop the planner. Allow changing K freely at each segment.
This allows varying quality factors for different filling roles, see:
https://github.com/supermerill/Slic3r/issues/108
During pause/resume/crashdetect or powerpanic K might temporarily be out
of sync when used this way. If this becomes an issue, we might need to
store K for each block, as done for the feedrate.
Also check for fan_check_error == EFCE_OK in addition to EFCE_FIXED.
Reorganize the check in order to fix both #if[n]def FANCHECK cases,
as similarly done in the SDSUPPORT case a few lines below.
Allow existing gcode using LA10 to transparently take advantage of LA15
by using a simple linear conversion function based on experimental
results with the MK3 implementation of linear advance.
Autodetect LA10 values based on the first M900 instruction contained in
the print. In order to support printing mixed files without resetting
the printer we also reset the autodetection status when starting a new
SD print and/or when explicitly disabling LA.
Since we cannot reliably detect whether a new print is started when
printing via USB, also reset the detection status when homing in G28,
which is generally performed once at each print. Note that this doesn't
clear the previous K value, it only allows a subsequent M900 to provide
LA10 values when printed after a LA15 file.
axis_relative_modes can cleanly handle G90/G91 and M82/M83 without the
need of "relative_mode" entirely.
Change G90/G91 to simply reset all axes according to the requested
state, which avoids to check two variables in get_coordinates(),
fixing the following incorrect handling:
G91 ; all axis relative
M83 ; set extruder absolute
G1 E1 ; should be an absolute move, but still relative
Correctly cleanup the printer state when stopping the current print:
- Disable interrupts while aborting the planner/queue to ensure
new serial commands are not inserted while aborting
- _Always_ call planner_abort_hard() to interrupt any pending move!
- Clear the saved_target, which might be set when calling stop
from within a paused state. Create a new function to clear the
paused state for future use.
- Do not disable/reset the MBL: doing so will destroy the ability to
restart correctly using M999.
After calling stop_and_save_print_to_ram, perform the parking moves
within the main loop as done before PR#1899 to avoid planning within
an interrupted move (which would clear the abort flag too soon).
Similarly to resume_print_from_ram_and_continue, abort any
planning in mesh_plan_buffer_line already in stop_and_save_print_to_ram
in case it is called for pausing only.