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

split of unit types #144

Merged
merged 7 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
23 changes: 23 additions & 0 deletions extras/AFC_BoxTurtle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class afcBoxTurtle:
def __init__(self, config):
self.printer = config.get_printer()
self.reactor = self.printer.get_reactor()
self.gcode = self.printer.lookup_object('gcode')

firstLeg = '<span class=warning--text>|</span><span class=error--text>_</span>'
secondLeg = firstLeg + '<span class=warning--text>|</span>'
self.logo ='<span class=success--text>R _____ ____\n'
self.logo+='E / \ | </span><span class=info--text>o</span><span class=success--text> | \n'
self.logo+='A | |/ ___/ \n'
self.logo+='D |_________/ \n'
self.logo+='Y {first}{second} {first}{second}\n'.format(first=firstLeg, second=secondLeg)

self.logo_error ='<span class=error--text>E _ _ _ _\n'
self.logo_error+='R |_|_|_|_|_|\n'
self.logo_error+='R | \____\n'
self.logo_error+='O | \ \n'
self.logo_error+='R | |\ <span class=secondary--text>X</span> |\n'
self.logo_error+='! \_________/ |___|</error>\n'

def load_config(config):
return afcBoxTurtle(config)
18 changes: 18 additions & 0 deletions extras/AFC_NightOwl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class afcNightOwl:
def __init__(self, config):
self.printer = config.get_printer()
self.reactor = self.printer.get_reactor()
self.gcode = self.printer.lookup_object('gcode')

self.logo = 'Night Owl Ready'
self.logo ='R , ,\n'
self.logo+='E )\___/(\n'
self.logo+='A {(@)v(@)}\n'
self.logo+='D {|~~~|}\n'
self.logo+='Y {/^^^\}\n'
self.logo+='! `m-m`\n'

self.logo_error = 'Night Owl Not Ready\n'

def load_config(config):
return afcNightOwl(config)
4 changes: 4 additions & 0 deletions extras/AFC_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def __init__(self, config):

self.AFC = self.printer.lookup_object('AFC')
self.type = config.get('type', None)
if self.type =='Box_Turtle':
self.ERROR = self.printer.load_object(config, 'AFC_BoxTurtle')
if self.type =='Night_Owl':
self.ERROR = self.printer.load_object(config, 'AFC_NightOwl')

# HUB Cut variables
# Next two variables are used in AFC
Expand Down
29 changes: 7 additions & 22 deletions extras/AFC_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,33 +117,18 @@ def PREP(self, gcmd):
self.gcode.respond_info(CUR_HUB.type + ' ' + UNIT +' Prepping lanes')

if CUR_HUB.type == 'Box_Turtle':
firstLeg = '<span class=warning--text>|</span><span class=error--text>_</span>'
secondLeg = firstLeg + '<span class=warning--text>|</span>'
logo ='<span class=success--text>R _____ ____\n'
logo+='E / \ | </span><span class=info--text>o</span><span class=success--text> | \n'
logo+='A | |/ ___/ \n'
logo+='D |_________/ \n'
logo+='Y {first}{second} {first}{second}\n'.format(first=firstLeg, second=secondLeg)
self.BoxTurtle = self.printer.lookup_object('AFC_BoxTurtle')
logo=self.BoxTurtle.logo
logo+=' ' + UNIT + '\n'

logo_error ='<span class=error--text>E _ _ _ _\n'
logo_error+='R |_|_|_|_|_|\n'
logo_error+='R | \____\n'
logo_error+='O | \ \n'
logo_error+='R | |\ <span class=secondary--text>X</span> |\n'
logo_error+='! \_________/ |___|</error>\n'
logo_error=self.BoxTurtle.logo_error
logo_error+=' ' + UNIT + '\n'

if CUR_HUB.type == 'Night_Owl':
logo = 'Night Owl Ready'
logo_error = 'Night Owl Not Ready'
logo ='R , ,\n'
logo+='E )\___/(\n'
logo+='A {(@)v(@)}\n'
logo+='D {|~~~|}\n'
logo+='Y {/^^^\}\n'
logo+='! `m-m`\n'
self.NightOwl = self.printer.lookup_object('AFC_NightOwl')
logo=self.NightOwl.logo
logo+=' ' + UNIT + '\n'
logo_error=self.NightOwl.logo_error
logo_error+=' ' + UNIT + '\n'

for LANE in self.AFC.lanes[UNIT].keys():
check_success = True
Expand Down
2 changes: 1 addition & 1 deletion extras/AFC_spool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
except:
# Python 2.7 support
from urllib2 import urlopen
from configparser import Error as error

class afcSpool:
def __init__(self, config):
Expand All @@ -24,6 +23,7 @@ def handle_connect(self):
and assigns it to the instance variable `self.AFC`.
"""
self.AFC = self.printer.lookup_object('AFC')
self.ERROR = self.printer.lookup_object('AFC_error')

cmd_SET_COLOR_help = "change filaments color"
def cmd_SET_COLOR(self, gcmd):
Expand Down