Skip to content

Commit 55a22c6

Browse files
authored
Logging and Door Panel Hotfix
Logging and Door Panel Hotfix
2 parents 5a8cdca + 9bea8dd commit 55a22c6

18 files changed

+456
-239
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<!--
2121
#####################################
2222
## Printcfg Documentation ##
23-
## Version 4.0.0 2023-6-1 ##
23+
## Version 4.0.0 2023-6-5 ##
2424
#####################################
2525
-->
2626

print_debug.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#####################################
1919
## Print Debugging ##
20-
## Version 4.0.0 2023-6-1 ##
20+
## Version 4.0.0 2023-6-5 ##
2121
#####################################
2222

2323
## This file contains optional macros

print_extras.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#####################################
1919
## Print Extras ##
20-
## Version 4.0.0 2023-6-1 ##
20+
## Version 4.0.0 2023-6-5 ##
2121
#####################################
2222

2323
## This file contains optional config

print_macros.cfg

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#####################################
1919
## Print Macros ##
20-
## Version 4.0.0 2023-6-1 ##
20+
## Version 4.0.0 2023-6-5 ##
2121
#####################################
2222

2323
[include logging.cfg]
@@ -1506,56 +1506,58 @@ gcode:
15061506
description: Door is opened
15071507
variable_door: 0
15081508
gcode:
1509-
{% set doorcfg = printer['gcode_macro _door_cfg'] %} ; get doorcfg variables
1510-
{% set printcfg = printer['gcode_macro _printcfg'] %} ; get printcfg variables
1511-
{% set door = params.DOOR|default(0) %} ; get door number
1512-
{% set door_name = printcfg['door' + door] %} ; set door name
1513-
SET_GCODE_VARIABLE MACRO=_open_door VARIABLE=door VALUE={door} ; store door
1514-
{% if doorcfg.debounce == 0 %} ; check debounce
1515-
M{printcfg.output|int} Door {door_name}: Open ; status output
1516-
{printcfg.status_door_open} ; open door LEDs
1517-
{% if custom_macro == True %} ; check for custom macro
1518-
{printer['gcode_macro _printcfg'][door_macro]} ; run custom macro
1519-
{% endif %}
1520-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=debounce VALUE=1 ; set debounce state
1521-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=state VALUE=1 ; set door state
1522-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=1 ; set door bounce
1523-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_door VALUE={door} ; set last door
1524-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE=open ; set last state
1525-
UPDATE_DELAYED_GCODE ID=door_debounce DURATION={(printcfg.door_debounce / 1000)|float} ; set debounce timer
1526-
{% else %} ; bounced
1527-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=1 ; set door bounce
1509+
{% set doorcfg = printer['gcode_macro _door_cfg'] %} ; get doorcfg variables
1510+
{% set printcfg = printer['gcode_macro _printcfg'] %} ; get printcfg variables
1511+
{% set door = params.DOOR|default(0) %} ; get door number
1512+
{% set door_name = printcfg['door' + door + '_name'] %} ; set door name
1513+
SET_GCODE_VARIABLE MACRO=_open_door VARIABLE=door VALUE={door} ; store door
1514+
logger title=Doors msg="Door: {door_name} opened" ; log door open
1515+
{% if doorcfg.debounce == 0 %} ; check debounce
1516+
M{printcfg.output|int} Door: {door_name} opened ; status output
1517+
{printcfg.status_door_open} ; open door LEDs
1518+
{% if custom_macro == True %} ; check for custom macro
1519+
{printer['gcode_macro _printcfg'][door_macro]} ; run custom macro
1520+
{% endif %}
1521+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=state VALUE=1 ; set door state
1522+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_door VALUE={door} ; set last door
1523+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE="'open'" ; set last state
1524+
# SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=debounce VALUE=1 ; set debounce state
1525+
# SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=1 ; set door bounce
1526+
# UPDATE_DELAYED_GCODE ID=door_debounce DURATION={(printcfg.door_debounce / 1000)|float} ; set debounce timer
1527+
#{% else %} ; bounced
1528+
# SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=1 ; set door bounce
15281529
{% endif %}
15291530

15301531
[gcode_macro _close_door]
15311532
description: Door is closed
15321533
variable_door: 0
15331534
gcode:
1534-
{% set doorcfg = printer['gcode_macro _door_cfg'] %} ; get doorcfg variables
1535-
{% set printcfg = printer['gcode_macro _printcfg'] %} ; get printcfg variables
1536-
{% set door = params.DOOR|default(0) %} ; get door number
1537-
{% set door_name = printcfg['door' + door] %} ; set door name
1538-
SET_GCODE_VARIABLE MACRO=_close_door VARIABLE=door VALUE={door} ; store door
1535+
{% set doorcfg = printer['gcode_macro _door_cfg'] %} ; get doorcfg variables
1536+
{% set printcfg = printer['gcode_macro _printcfg'] %} ; get printcfg variables
1537+
{% set door = params.DOOR|default(0) %} ; get door number
1538+
{% set door_name = printcfg['door' + door + '_name'] %} ; set door name
1539+
SET_GCODE_VARIABLE MACRO=_close_door VARIABLE=door VALUE={door} ; store door
1540+
logger title=Doors msg="Door: {door_name} closed" ; log door close
15391541
{% set door_macro = "door" + door|string + "_closed" %}
15401542
{% set custom_macro = True if printer['gcode_macro _printcfg'][door_macro] is defined else False %}
1541-
{% if doorcfg.debounce == 0 %} ; check debounce
1542-
M{printcfg.output|int} Door {door}: Closed ; status output
1543-
{% if printer.virtual_sdcard.is_active == True %} ; printing state
1544-
{printcfg.status_printing} ; closed door printing LEDs
1545-
{% else %} ; idle state
1546-
{printcfg.status_ready} ; closed door idle LEDs
1543+
{% if doorcfg.debounce == 0 %} ; check debounce
1544+
M{printcfg.output|int} Door: {door_name} closed ; status output
1545+
{% if printer.virtual_sdcard.is_active == True %} ; printing state
1546+
{printcfg.status_printing} ; closed door printing LEDs
1547+
{% else %} ; idle state
1548+
{printcfg.status_ready} ; closed door idle LEDs
15471549
{% endif %}
1548-
{% if custom_macro == True %} ; check for custom macro
1549-
{printer['gcode_macro _printcfg'][door_macro]} ; run custom macro
1550+
{% if custom_macro == True %} ; check for custom macro
1551+
{printer['gcode_macro _printcfg'][door_macro]} ; run custom macro
15501552
{% endif %}
1551-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=debounce VALUE=1 ; set debounce state
1552-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=state VALUE=0 ; set door state
1553-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=0 ; set door bounce
1554-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_door VALUE={door} ; set last door
1555-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE=closed ; set last state
1556-
UPDATE_DELAYED_GCODE ID=door_debounce DURATION={(printcfg.door_debounce / 1000)|float} ; set debounce timer
1557-
{% else %} ; bounced
1558-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=0 ; set door bounce
1553+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=state VALUE=0 ; set door state
1554+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_door VALUE={door} ; set last door
1555+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE="'closed'" ; set last state
1556+
# SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=debounce VALUE=1 ; set debounce state
1557+
# SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=0 ; set door bounce
1558+
# UPDATE_DELAYED_GCODE ID=door_debounce DURATION={(printcfg.door_debounce / 1000)|float} ; set debounce timer
1559+
#{% else %} ; bounced
1560+
# SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=0 ; set door bounce
15591561
{% endif %}
15601562

15611563

@@ -1570,7 +1572,7 @@ gcode:
15701572
{% if doorcfg.bounce == 1 %} ; bounced open
15711573
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=state VALUE=1 ; set door state
15721574
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=1 ; set door bounce
1573-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE=open ; set last state
1575+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE="'open'" ; set last state
15741576
M{printcfg.output|int} Door Open ; status output
15751577
{printcfg.status_door_open} ; open door LEDs
15761578
{% if custom_macro == True %} ; check for custom macro
@@ -1579,7 +1581,7 @@ gcode:
15791581
{% else %} ; bounced closed
15801582
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=state VALUE=0 ; set door state
15811583
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=bounce VALUE=0 ; set door bounce
1582-
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE=closed ; set last state
1584+
SET_GCODE_VARIABLE MACRO=_door_cfg VARIABLE=last_state VALUE="'closed'" ; set last state
15831585
M{printcfg.output|int} Door Closed ; status output
15841586
{% if printer.virtual_sdcard.is_active == True %} ; printing state
15851587
{printcfg.status_printing} ; closed door printing LEDs

profiles/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<!--
2121
#####################################
2222
## Profiles Index ##
23-
## Version 4.0.0 2023-6-1 ##
23+
## Version 4.0.0 2023-6-5 ##
2424
#####################################
2525
-->
2626

profiles/default/config.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#####################################
1919
## Print Configuration ##
20-
## Version 4.0.0 2023-6-1 ##
20+
## Version 4.0.0 2023-6-5 ##
2121
#####################################
2222
# Profile:default
2323
# Patch:4.0.0

profiles/default/variables.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#####################################
1919
## User Profile ##
20-
## Version 4.0.0 2023-6-1 ##
20+
## Version 4.0.0 2023-6-5 ##
2121
#####################################
2222
# Profile:default
2323
# Patch:4.0.0

0 commit comments

Comments
 (0)