Skip to content

Commit e493c2d

Browse files
authored
Reset infinite spool with afc reset (#450)
Enhances the RESET_AFC_MAPPING macro to reset infinite spool mapping, added in ability to not reset infinite spool mapping with addition parameter.
1 parent a8db76e commit e493c2d

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [2025-06-15]
99
### Added
10-
- Added support for the AFC-Pro board in the installer to install an 8-Lane Boxturtle.
10+
- Added support for the AFC-Pro board in the installer to install an 8-Lane Boxturtle.
11+
- The `RESET_AFC_MAPPING` macro will now also reset any runout lane configurations.
1112

1213
## [2025-06-10]
1314
### Added

extras/AFC_spool.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,19 @@ def cmd_SET_RUNOUT(self, gcmd):
320320
cmd_RESET_AFC_MAPPING_help = "Resets all lane mapping in AFC"
321321
def cmd_RESET_AFC_MAPPING(self, gcmd):
322322
"""
323-
This commands resets all tool lane mapping to the order that is setup in configuration. Useful to put in your PRINT_END macro to reset mapping
323+
Resets all tool lane mapping to the order set up in the configuration.
324+
Optionally resets runout lanes unless RUNOUT=no is specified.
325+
326+
Useful to put in your PRINT_END macro to reset mapping
324327
325328
Usage
326329
-----
327-
`RESET_AFC_MAPPING`
330+
`RESET_AFC_MAPPING [RUNOUT=yes|no]`
328331
329332
Example
330333
-----
331334
```
332-
RESET_AFC_MAPPING
335+
RESET_AFC_MAPPING RUNOUT=no
333336
```
334337
"""
335338
t_index = 0
@@ -340,8 +343,14 @@ def cmd_RESET_AFC_MAPPING(self, gcmd):
340343
self.afc.lanes[lane].map = map_cmd
341344
t_index += 1
342345

346+
# Resetting runout lanes to None
347+
runout_opt = gcmd.get('RUNOUT', 'yes').lower()
348+
if runout_opt != 'no':
349+
for lane in self.afc.lanes.values():
350+
lane.runout_lane = None
351+
343352
self.afc.save_vars()
344-
self.logger.info("Tool mappings reset")
353+
self.logger.info("Tool mappings reset" + ("" if runout_opt == "no" else " and runout lanes reset"))
345354

346355
def load_config(config):
347356
return AFCSpool(config)

0 commit comments

Comments
 (0)