Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mg longshot #174

Merged
merged 7 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion extras/AFC.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


import json

from configparser import Error as error

class afc:
Expand All @@ -16,7 +15,9 @@ def __init__(self, config):
self.printer.register_event_handler("klippy:connect",self.handle_connect)
self.SPOOL = self.printer.load_object(config,'AFC_spool')
self.ERROR = self.printer.load_object(config,'AFC_error')
self.IDLE = self.printer.load_object(config,'idle_timeout')
self.gcode = self.printer.lookup_object('gcode')
self.STATUS= self.IDLE.state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this will always return the same state and not update, this line can be removed


self.gcode_move = self.printer.load_object(config, 'gcode_move')
self.VarFile = config.get('VarFile')
Expand Down
3 changes: 3 additions & 0 deletions extras/AFC_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
self.delay = config.getfloat('delay_time', 0.1, minval=0.0)
self.enable = config.getboolean("enable", False)


# Flag to set once resume rename as occured for the first time
self.rename_occured = False

Expand All @@ -30,6 +31,7 @@
"""
self.AFC = self.printer.lookup_object('AFC')
self.AFC.gcode.register_command('PREP', self.PREP, desc=None)

Check failure on line 34 in extras/AFC_prep.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (W293)

extras/AFC_prep.py:34:1: W293 Blank line contains whitespace

def _rename_resume(self):
"""
Expand Down Expand Up @@ -69,6 +71,7 @@
self.AFC.extruders={}

temp=[]

Check failure on line 74 in extras/AFC_prep.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (W293)

extras/AFC_prep.py:74:1: W293 Blank line contains whitespace
self.AFC.tool_cmds={}
for PO in self.printer.objects:
if 'AFC_stepper' in PO and 'tmc' not in PO:
Expand Down
10 changes: 9 additions & 1 deletion extras/AFC_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,18 @@
if self.load_state == True and self.prep_state == True:
self.status = 'Loaded'
self.AFC.afc_led(self.AFC.led_ready, led)
elif self.name == self.AFC.current and self.IDLE.state == 'Printing' and self.AFC.lanes[self.unit][self.name]['runout_lane'] != 'NONE':
self.status = None
self.AFC.afc_led(self.AFC.led_not_ready, led)
self.AFC.gcode.respond_info("Infinete Spool triggered")
empty_LANE = self.printer.lookup_object('AFC_stepper ' + self.AFC.current)
change_LANE = self.printer.lookup_object('AFC_stepper ' + self.AFC.lanes[self.unit][self.name]['runout_lane'])
self.gcode.run_script_from_command(change_LANE.map)
self.gcode.run_script_from_command('SET_MAP LANE=' + change_LANE.name + ' MAP=' + empty_LANE.map)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This else statement need to stay, if a lane is ejected the led stays green

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

self.status = None
self.AFC.afc_led(self.AFC.led_not_ready, led)

Check failure on line 252 in extras/AFC_stepper.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (W293)

extras/AFC_stepper.py:252:1: W293 Blank line contains whitespace
def do_enable(self, enable):
self.sync_print_time()
stepper_enable = self.printer.lookup_object('stepper_enable')
Expand Down
Loading