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

Infi spool corrections #202

Merged
merged 3 commits into from
Dec 20, 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
2 changes: 1 addition & 1 deletion extras/AFC_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
if LANE.unit not in self.AFC.units: self.AFC.units[LANE.unit] = {}
if LANE.unit not in self.AFC.lanes: self.AFC.lanes[LANE.unit] = {}
if LANE.name not in self.AFC.units[LANE.unit]: self.AFC.units[LANE.unit][LANE.name]={}
if LANE.name not in self.AFC.lanes[LANE.unit]: self.AFC.lanes[LANE.unit][LANE.name] = {}
if 'spool_id' in self.AFC.lanes[LANE.unit][LANE.name]: LANE.spool_id = self.AFC.lanes[LANE.unit][LANE.name]['spool_id']

Check failure on line 81 in extras/AFC_prep.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (W291)

extras/AFC_prep.py:81:136: W291 Trailing whitespace
if self.AFC.spoolman_ip !=None and LANE.spool_id != None:
try:
url = 'http://' + self.AFC.spoolman_ip + ':'+ self.AFC.spoolman_port +"/api/v1/spool/" + self.AFC.lanes[LANE.unit][LANE.name]['spool_id']
Expand All @@ -95,6 +94,7 @@
if 'weight' in self.AFC.lanes[LANE.unit][LANE.name]: LANE.weight=self.AFC.lanes[LANE.unit][LANE.name]['weight']

if 'runout_lane' in self.AFC.lanes[LANE.unit][LANE.name]: LANE.runout_lane = self.AFC.lanes[LANE.unit][LANE.name]['runout_lane']
if LANE.runout_lane == '': LANE.runout_lane='NONE'
if 'map' in self.AFC.lanes[LANE.unit][LANE.name]: LANE.map = self.AFC.lanes[LANE.unit][LANE.name]['map']
if LANE.map != 'NONE':
self.AFC.tool_cmds[LANE.map] = LANE.name
Expand Down
7 changes: 5 additions & 2 deletions extras/AFC_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
self.material = None
self.color = None
self.weight = None
self.runout_lane = None
self.runout_lane = 'NONE'
self.status = None
unit = config.get('unit', None)
if unit != None:
Expand All @@ -85,7 +85,7 @@
self.stepper_kinematics = ffi_main.gc(
ffi_lib.cartesian_stepper_alloc(b'x'), ffi_lib.free)
self.assist_activate=False

Check failure on line 88 in extras/AFC_stepper.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (W293)

extras/AFC_stepper.py:88:1: W293 Blank line contains whitespace
self.hub_dist = config.getfloat('hub_dist',20)
self.dist_hub = config.getfloat('dist_hub', 60)
# distance to retract filament from the hub
Expand Down Expand Up @@ -250,16 +250,19 @@
self.AFC.afc_led(self.AFC.led_ready, led)
elif self.name == self.AFC.current and self.AFC.IDLE.state == 'Printing' and self.load_state and self.status != 'ejecting':
# Checking to make sure runout_lane is set and does not equal 'NONE'
if self.runout_lane and self.runout_lane != 'NONE':
if self.runout_lane != 'NONE':
self.status = None
self.AFC.afc_led(self.AFC.led_not_ready, led)
self.AFC.gcode.respond_info("Infinite Spool triggered for {}".format(self.name))
empty_LANE = self.AFC.stepper(self.AFC.current)
change_LANE = self.AFC.stepper(self.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)
self.gcode.run_script_from_command('LANE_UNLOAD LANE=' + empty_LANE.name)
else:
# Pause print
self.status = None
self.AFC.afc_led(self.AFC.led_not_ready, led)
self.AFC.gcode.respond_info("Runout triggered for lane {} and runout lane is not setup to switch to another lane".format(self.name))
self.AFC.ERROR.pause_print()
else:
Expand Down
Loading