переделка idle, теперь работает
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
[idle_timeout]
|
||||
timeout: 120
|
||||
gcode:
|
||||
RESPOND MSG="Idle start"
|
||||
RESPOND MSG="Idle check"
|
||||
{% if printer["gcode_macro _POWER_OFF_PRINTER"].first_stage_active|lower == 'false' %}
|
||||
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION={printer["gcode_macro RatOS"].idle_delay}
|
||||
RESPOND MSG="Idle start"
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=True
|
||||
{% endif %}
|
||||
|
||||
[delayed_gcode set_idle_work]
|
||||
initial_duration: 1
|
||||
@@ -10,27 +14,28 @@ gcode:
|
||||
M119
|
||||
|
||||
[delayed_gcode _FIRST_STAGE_IDLE]
|
||||
variable_first_stage_active: False
|
||||
gcode:
|
||||
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
|
||||
{% if printer.heater_bed.temperature < 50.0 %}
|
||||
{% if printer.heater_bed.target == 0.0 %}
|
||||
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0
|
||||
{% if printer["gcode_macro _FIRST_STAGE_IDLE"].first_stage_active|lower == 'false' %}
|
||||
#{% if printer["gcode_macro _FIRST_STAGE_IDLE"].first_stage_active|lower == 'false' %}
|
||||
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
||||
RESPOND PREFIX=tgnotify MSG="Моторы погашены"
|
||||
{% endif %}
|
||||
M84
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION={printer["gcode_macro RatOS"].poweroff_delay}
|
||||
SET_GCODE_VARIABLE MACRO=_FIRST_STAGE_IDLE VARIABLE=first_stage_active VALUE=True
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=True
|
||||
UPDATE_DELAYED_GCODE ID=_RESET_IDLE_VARIABLE DURATION={printer["gcode_macro RatOS"].poweroff_delay + 30}
|
||||
M104 S0
|
||||
{% endif %}
|
||||
#{% endif %}
|
||||
{% else %}
|
||||
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=2
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if printer.idle_timeout.state == "Printing" %}
|
||||
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=0
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
||||
{% else %}
|
||||
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
||||
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION=2
|
||||
@@ -53,22 +58,31 @@ gcode:
|
||||
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
|
||||
{% if printer.extruder.temperature < 50.0 and printer.heater_bed.temperature < 50.0 %}
|
||||
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
||||
{% if printer.toolhead.homed_axes|length > 0 %}
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
||||
M119
|
||||
{% else %}
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
||||
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
||||
RESPOND PREFIX=tgnotify MSG="Питание принтера выключено"
|
||||
{% endif %}
|
||||
_POWER_OFF_PRINTER
|
||||
{% endif %}
|
||||
{% else %}
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=2
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if printer.idle_timeout.state == "Printing" %}
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
||||
{% else %}
|
||||
{% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %}
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=2
|
||||
{% else %}
|
||||
UPDATE_DELAYED_GCODE ID=_POWER_OFF_PRINTER_CHECK DURATION=0
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -95,10 +109,15 @@ gcode:
|
||||
RESPOND PREFIX=tgnotify MSG="Вытяжка остановлена"
|
||||
{% endif %}
|
||||
|
||||
[delayed_gcode _RESET_IDLE_VARIABLE]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
||||
|
||||
|
||||
[gcode_macro _POWER_OFF_PRINTER]
|
||||
variable_first_stage_active: False
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=_FIRST_STAGE_IDLE VARIABLE=first_stage_active VALUE=False
|
||||
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
||||
{action_call_remote_method("set_device_power",
|
||||
device=printer["gcode_macro RatOS"].power_device,
|
||||
state="off")}
|
||||
|
||||
Reference in New Issue
Block a user