Skip to content

Commit

Permalink
Merge pull request #184 from jimmyjon711/pause_fix
Browse files Browse the repository at this point in the history
Update so printer does not issue pause when ejecting filament
  • Loading branch information
MG-longshot authored Dec 11, 2024
2 parents 744ef2e + 1495c1e commit 9c860e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion extras/AFC.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,10 @@ def cmd_LANE_UNLOAD(self, gcmd):
CUR_LANE = self.printer.lookup_object('AFC_stepper '+ lane)
CUR_HUB = self.printer.lookup_object('AFC_hub '+ CUR_LANE.unit)
if CUR_LANE.name != self.current:
# Setting status as ejecting so if filament is removed and de-activates the prep sensor while
# extruder motors are still running it does not trigger infinite spool or pause logic
# once user removes filament lanes status will go to None
CUR_LANE.status = 'ejecting'
CUR_LANE.do_enable(True)
if CUR_LANE.hub_load:
CUR_LANE.move(CUR_LANE.dist_hub * -1, CUR_LANE.dist_hub_move_speed, CUR_LANE.dist_hub_move_accel, True if CUR_LANE.dist_hub > 200 else False)
Expand All @@ -478,7 +482,6 @@ def cmd_LANE_UNLOAD(self, gcmd):
CUR_LANE.do_enable(False)
self.lanes[CUR_LANE.unit][CUR_LANE.name]['hub_loaded'] = CUR_LANE.hub_load
self.save_vars()
CUR_LANE.status = None

# Removing spool from vars since it was ejected
self.SPOOL.set_spoolID( CUR_LANE, "")
Expand Down
2 changes: 1 addition & 1 deletion extras/AFC_stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def prep_callback(self, eventtime, state):
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.AFC.IDLE.state == 'Printing':
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.AFC.lanes[self.unit][self.name]['runout_lane'] and self.AFC.lanes[self.unit][self.name]['runout_lane'] != 'NONE':
self.status = None
Expand Down

0 comments on commit 9c860e6

Please sign in to comment.