Update
This commit is contained in:
parent
32c970116f
commit
70268f003f
17 changed files with 1007 additions and 247 deletions
|
@ -13,16 +13,20 @@ description: Saving Z-Offset
|
|||
rename_existing: _SET_GCODE_OFFSET
|
||||
gcode:
|
||||
{% if printer.save_variables.variables.zoffset %}
|
||||
{% set zoffset = printer.save_variables.variables.zoffset %}
|
||||
{% set zoffset = printer.save_variables.variables.zoffset %}
|
||||
{% else %}
|
||||
{% set zoffset = {'z': None} %}
|
||||
{% set zoffset = {'z': None} %}
|
||||
{% endif %}
|
||||
{% set ns = namespace(zoffset={'z': zoffset.z}) %}
|
||||
_SET_GCODE_OFFSET {% for p in params %}{'%s=%s '% (p, params[p])}{% endfor %}
|
||||
{%if 'Z' in params %}{% set null = ns.zoffset.update({'z': params.Z}) %}{% endif %}
|
||||
{%if 'Z' in params %}
|
||||
{% set null = ns.zoffset.update({'z': params.Z}) %}
|
||||
{% endif %}
|
||||
{%if 'Z_ADJUST' in params %}
|
||||
{%if ns.zoffset.z == None %}{% set null = ns.zoffset.update({'z': 0}) %}{% endif %}
|
||||
{% set null = ns.zoffset.update({'z': (ns.zoffset.z | float) + (params.Z_ADJUST | float)}) %}
|
||||
{%if ns.zoffset.z == None %}
|
||||
{% set null = ns.zoffset.update({'z': 0}) %}
|
||||
{% endif %}
|
||||
{% set null = ns.zoffset.update({'z': (ns.zoffset.z | float) + (params.Z_ADJUST | float)}) %}
|
||||
{% endif %}
|
||||
SAVE_VARIABLE VARIABLE=zoffset VALUE="{ns.zoffset}"
|
||||
|
||||
|
@ -31,8 +35,8 @@ gcode:
|
|||
initial_duration: 2
|
||||
gcode:
|
||||
{% if printer.save_variables.variables.zoffset %}
|
||||
{% set zoffset = printer.save_variables.variables.zoffset %}
|
||||
_SET_GCODE_OFFSET {% for axis, offset in zoffset.items() if zoffset[axis] %}{ "%s=%s " % (axis, offset) }{% endfor %}
|
||||
RESPOND TYPE=command MSG="Loaded Z-Offset from variables.cfg: {zoffset.z}mm"
|
||||
{% set zoffset = printer.save_variables.variables.zoffset %}
|
||||
_SET_GCODE_OFFSET {% for axis, offset in zoffset.items() if zoffset[axis] %}{ "%s=%s " % (axis, offset) }{% endfor %}
|
||||
RESPOND TYPE=command MSG="Loaded Z-Offset from variables.cfg: {zoffset.z}mm"
|
||||
{% endif %}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue