summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--mainsail-klipper.cfg79
3 files changed, 51 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5d69a52e289..8a0226e78d1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mainsail-git
pkgdesc = Klipper web frontend
pkgver = r1087.61232df
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/meteyou/mainsail
arch = any
license = GPLv3
@@ -14,7 +14,7 @@ pkgbase = mainsail-git
source = mainsail-klipper.cfg
source = mainsail-nginx.conf
sha256sums = SKIP
- sha256sums = 8cc7f8e97459cc9e529363f63151a205d4a3702a1d20ce864d9f7d7b51a4e1cf
+ sha256sums = 3eca6e0cb002cb7def79ed41d81c734f12c5f365dee43f1fad38b0a7ae7a30dc
sha256sums = 7c86d687ac7b1fb84fc04d1ffcd468a05767a9c9d880ad6d666b2527523495ec
pkgname = mainsail-git
diff --git a/PKGBUILD b/PKGBUILD
index 36048525b71..f1df5394b5d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=mainsail-git
_pkgname="${pkgname%-git}"
pkgver=r1087.61232df
-pkgrel=1
+pkgrel=2
pkgdesc="Klipper web frontend"
arch=(any)
url="https://github.com/meteyou/mainsail"
@@ -15,7 +15,7 @@ provides=("$_pkgname")
conflicts=("$_pkgname")
source=('git+https://github.com/meteyou/mainsail.git#branch=develop' 'mainsail-klipper.cfg' 'mainsail-nginx.conf')
sha256sums=('SKIP'
- '8cc7f8e97459cc9e529363f63151a205d4a3702a1d20ce864d9f7d7b51a4e1cf'
+ '3eca6e0cb002cb7def79ed41d81c734f12c5f365dee43f1fad38b0a7ae7a30dc'
'7c86d687ac7b1fb84fc04d1ffcd468a05767a9c9d880ad6d666b2527523495ec')
pkgver() {
diff --git a/mainsail-klipper.cfg b/mainsail-klipper.cfg
index 1d00bb593d3..072d2521c06 100644
--- a/mainsail-klipper.cfg
+++ b/mainsail-klipper.cfg
@@ -5,49 +5,64 @@ path: /var/opt/moonraker/gcode
[display_status]
-[gcode_macro CANCEL_PRINT]
-rename_existing: BASE_CANCEL_PRINT
-gcode:
- TURN_OFF_HEATERS
- CLEAR_PAUSE
- SDCARD_RESET_FILE
- BASE_CANCEL_PRINT
-
[gcode_macro PAUSE]
-rename_existing: BASE_PAUSE
-# change this if you need more or less extrusion
-variable_extrude: 1.0
+description: Pause the actual running print
+rename_existing: PAUSE_BASE
gcode:
- ##### read E from pause macro #####
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
- ##### set park positon for x and y #####
- # default is your max posion from your printer.cfg
- {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
- {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
+ ##### set defaults #####
+ {% set x = params.X|default(230) %} #edit to your park position
+ {% set y = params.Y|default(230) %} #edit to your park position
+ {% set z = params.Z|default(10)|float %} #edit to your park position
+ {% set e = params.E|default(1) %} #edit to your retract length
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
- {% if act_z < (max_z - 2.0) %}
- {% set z_safe = 2.0 %}
+ {% set lift_z = z|abs %}
+ {% if act_z < (max_z - lift_z) %}
+ {% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
- SAVE_GCODE_STATE NAME=PAUSE_state
- BASE_PAUSE
+ PAUSE_BASE
G91
- G1 E-{E} F2100
- G1 Z{z_safe} F900
- G90
- G1 X{x_park} Y{y_park} F6000
-
+ {% if printer.extruder.can_extrude|lower == 'true' %}
+ G1 E-{e} F2100
+ {% else %}
+ {action_respond_info("Extruder not hot enough")}
+ {% endif %}
+ {% if "xyz" in printer.toolhead.homed_axes %}
+ G1 Z{z_safe}
+ G90
+ G1 X{x} Y{y} F6000
+ {% else %}
+ {action_respond_info("Printer not homed")}
+ {% endif %}
+
[gcode_macro RESUME]
-rename_existing: BASE_RESUME
+description: Resume the actual running print
+rename_existing: RESUME_BASE
gcode:
- ##### read E from pause macro #####
- {% set E = printer["gcode_macro PAUSE"].extrude|float %}
+ ##### set defaults #####
+ {% set e = params.E|default(1) %} #edit to your retract length
+ #### get VELOCITY parameter if specified ####
+ {% if 'VELOCITY' in params|upper %}
+ {% set get_params = ('VELOCITY=' + params.VELOCITY) %}
+ {%else %}
+ {% set get_params = "" %}
+ {% endif %}
##### end of definitions #####
G91
- G1 E{E} F2100
- RESTORE_GCODE_STATE NAME=PAUSE_state
- BASE_RESUME
+ {% if printer.extruder.can_extrude|lower == 'true' %}
+ G1 E{e} F2100
+ {% else %}
+ {action_respond_info("Extruder not hot enough")}
+ {% endif %}
+ RESUME_BASE {get_params}
+
+[gcode_macro CANCEL_PRINT]
+description: Cancel the actual running print
+rename_existing: CANCEL_PRINT_BASE
+gcode:
+ TURN_OFF_HEATERS
+ CANCEL_PRINT_BASE