128 lines
5.4 KiB
INI
128 lines
5.4 KiB
INI
[idle_timeout]
|
|
timeout: 120
|
|
gcode:
|
|
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
|
|
gcode:
|
|
M119
|
|
|
|
[delayed_gcode _FIRST_STAGE_IDLE]
|
|
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 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=_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 %}
|
|
{% 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
|
|
{% else %}
|
|
UPDATE_DELAYED_GCODE ID=_FIRST_STAGE_IDLE DURATION={printer["gcode_macro RatOS"].idle_delay}
|
|
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
|
{% if printer["gcode_macro RatOS"].chamber_temp_enabled|lower == 'true' %}
|
|
RESPOND PREFIX=tgnotify MSG="Хозяина, я тут греюсь стою. Температура камеры {printer['temperature_sensor Chamber'].temperature}"
|
|
{% else %}
|
|
RESPOND PREFIX=tgnotify MSG="Хозяина, я тут греюсь стою. Температура стола {printer.heater_bed.temperature}"
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% else %}
|
|
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
|
{% endif %}
|
|
|
|
[delayed_gcode _POWER_OFF_PRINTER_CHECK]
|
|
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 %}
|
|
{% else %}
|
|
SET_GCODE_VARIABLE MACRO=_POWER_OFF_PRINTER VARIABLE=first_stage_active VALUE=False
|
|
{% endif %}
|
|
|
|
[delayed_gcode _IDLE_HEATER_SHUTDOWN]
|
|
gcode:
|
|
{% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %}
|
|
{% if printer.heater_bed.target == 0.0 %}
|
|
UPDATE_DELAYED_GCODE ID=_IDLE_HEATER_SHUTDOWN DURATION=0
|
|
RESPOND MSG="Грелка выключена"
|
|
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
|
RESPOND PREFIX=tgnotify MSG="Грелка выключена"
|
|
{% endif %}
|
|
M104 S0
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
[delayed_gcode _EXHAUST_FAN_DELAYED]
|
|
gcode:
|
|
SET_FAN_SPEED FAN=Exhaust_fan SPEED=0
|
|
RESPOND MSG="Вытяжка остановлена"
|
|
{% if printer["gcode_macro RatOS"].tgbot_enabled|lower == 'true' %}
|
|
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=_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")}
|