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