It shouldn't really be nescesary, but you _can_ put any gcode flavour in relative or absolute, so we should also deal with that in the pause-at-height script.
While testing I noticed that the movement after the pause will
first move the head down and then move to the position before
the pause. This could result in noticeable artifacts or
accidentally push thin towers from the bed.) See the code below.
```gcode
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current z: 5
;current height: 5.0
M83 ; switch to relative E values for any needed retraction
G1 F300 Z6 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
G1 F300 Z20.0
M84 E0
@pause now change filament and press ; Do the actual pause
G1 F300 Z5
G1 F9000 X30.759 Y30.759
G1 F1800 ; restore extrusion feedrate
```
I have switched the lines in the script such that it will first move to the correct X, Y and then move down
```python
prepend_gcode += self.putValue(G = 1, X = x, Y = y, F = 9000) + "\n"
prepend_gcode += self.putValue(G = 1, Z = current_z, F = 300) + "\n"
```
As shown in the code below
```gcode
;TYPE:CUSTOM
;added code by post processing
;script: PauseAtHeight.py
;current z: 5
;current height: 5.0
M83 ; switch to relative E values for any needed retraction
G1 F300 Z6 ; move up a millimeter to get out of the way
G1 F9000 X190 Y190
G1 F300 Z20.0
M84 E0
@pause now change filament and press ; Do the actual pause
G1 F9000 X30.759 Y30.759
G1 F300 Z5
G1 F1800 ; restore extrusion feedrate
```
Also, don't add it twice for the Repetier flavour.
This way the code is separated better into if-else cases to make it easier to read, even though it has this line in there 3 times.
Fixes issue CURA-8331.
Should fix#9752 aka internal ticket CURA-8246 -- This makes the repetier case completely analogous to the other 'not-griffin' flavours (at least what concerns retraction amounts), and also neatly dove-tails with the first point things start to go wrong in the bug-report.
This spelling is in Ultimaker's style guide.
We use g-code, and capitalise the G if it's at the start of a sentence or header.
Pretty good score, considering there are literally thousands of user- or log-visible strings mentioning g-code across Cura.
Conflicts:
plugins/PostProcessingPlugin/scripts/PauseAtHeight.py -> Merging other pausing scripts into this one
plugins/PostProcessingPlugin/scripts/PauseAtHeightforRepetier.py -> Has been removed upstream
We've deemed it irresponsible to redo multiple layers. This will dig the nozzle back down into the layers that were printed before the pause.
This doesn't include a version upgrade yet.
Contributes to issue CURA-7413.
The name wasn't really covering what it was doing. It wasn't setting the duration of the
pause, it was setting the timeout for the stepper disarm.
Also, ive set the defaults so that the behavior remains the same, unlesss a user
explicitly enables this
CURA-7331