From 1495c1e5e58f10a7feedf3ed7c46370d1746d12c Mon Sep 17 00:00:00 2001 From: jimmyjon711 Date: Tue, 10 Dec 2024 20:03:15 -0700 Subject: [PATCH] Adding logic so that printer does not pause when ejecting filament --- extras/AFC.py | 5 ++++- extras/AFC_stepper.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extras/AFC.py b/extras/AFC.py index aa729e5..9fdf215 100644 --- a/extras/AFC.py +++ b/extras/AFC.py @@ -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) @@ -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, "") diff --git a/extras/AFC_stepper.py b/extras/AFC_stepper.py index 89d6356..dc19be6 100644 --- a/extras/AFC_stepper.py +++ b/extras/AFC_stepper.py @@ -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