Skip to content

Commit

Permalink
Merge branch 'DEV' into error_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjon711 committed Dec 20, 2024
2 parents 577ac29 + 9c9f557 commit ce7edd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extras/AFC_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
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 @@ 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:
Expand Down Expand Up @@ -250,16 +250,19 @@ 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))
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

0 comments on commit ce7edd3

Please sign in to comment.