diff --git a/extras/AFC_prep.py b/extras/AFC_prep.py index 1ac6eb5..14a9a0f 100644 --- a/extras/AFC_prep.py +++ b/extras/AFC_prep.py @@ -78,7 +78,6 @@ def PREP(self, gcmd): 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'] if self.AFC.spoolman_ip !=None and LANE.spool_id != None: @@ -89,6 +88,7 @@ def PREP(self, gcmd): 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 diff --git a/extras/AFC_stepper.py b/extras/AFC_stepper.py index c53ac55..eff2a51 100644 --- a/extras/AFC_stepper.py +++ b/extras/AFC_stepper.py @@ -63,7 +63,7 @@ def __init__(self, config): 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: @@ -250,7 +250,7 @@ def prep_callback(self, eventtime, state): 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)) @@ -258,8 +258,11 @@ def prep_callback(self, eventtime, state): 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: