def __init__(self, config): self.printer = config.get_printer() self.reactor = self.printer.get_reactor() # Load low-level lcd handler self.lcd_chip = config.getchoice('lcd_type', LCD_chips)(config) # Load menu and display_status self.menu = None name = config.get_name() if name == 'display': # only load menu for primary display self.menu = menu.MenuManager(config, self.lcd_chip) self.printer.try_load_module(config, "display_status") # Configurable display self.display_templates = {} self.display_data_groups = {} self.load_config(config) dgroup = "_default_16x4" if self.lcd_chip.get_dimensions()[0] == 20: dgroup = "_default_20x4" dgroup = config.get('display_group', dgroup) self.show_data_group = self.display_data_groups.get(dgroup) if self.show_data_group is None: raise config.error("Unknown display_data group '%s'" % (dgroup, )) # Screen updating self.glyph_helpers = { 'animated_bed': self.animate_bed, 'animated_fan': self.animate_fan } self.printer.register_event_handler("klippy:ready", self.handle_ready) self.screen_update_timer = self.reactor.register_timer( self.screen_update_event)
def __init__(self, config): self.printer = config.get_printer() self.reactor = self.printer.get_reactor() # Load low-level lcd handler self.lcd_chip = config.getchoice('lcd_type', LCD_chips)(config) # Load menu and display_status self.menu = None name = config.get_name() if name == 'display': # only load menu for primary display self.menu = menu.MenuManager(config, self.lcd_chip) self.printer.load_object(config, "display_status") # Configurable display self.display_templates = {} self.display_data_groups = {} self.load_config(config) dgroup = "_default_16x4" if self.lcd_chip.get_dimensions()[0] == 20: dgroup = "_default_20x4" dgroup = config.get('display_group', dgroup) self.show_data_group = self.display_data_groups.get(dgroup) if self.show_data_group is None: raise config.error("Unknown display_data group '%s'" % (dgroup,)) self.printer.register_event_handler("klippy:ready", self.handle_ready) self.screen_update_timer = self.reactor.register_timer( self.screen_update_event) # Register g-code commands gcode = self.printer.lookup_object("gcode") gcode.register_mux_command('SET_DISPLAY_GROUP', 'DISPLAY', name, self.cmd_SET_DISPLAY_GROUP, desc=self.cmd_SET_DISPLAY_GROUP_help) if name == 'display': gcode.register_mux_command('SET_DISPLAY_GROUP', 'DISPLAY', None, self.cmd_SET_DISPLAY_GROUP)
def __init__(self, config): self.printer = config.get_printer() self.reactor = self.printer.get_reactor() self.lcd_chip = config.getchoice('lcd_type', LCD_chips)(config) self.lcd_type = config.get('lcd_type') # menu self.menu = menu.MenuManager(config, self.lcd_chip) # printer objects self.gcode = self.toolhead = self.sdcard = None self.fan = self.extruder0 = self.extruder1 = self.heater_bed = None # screen updating self.screen_update_timer = self.reactor.register_timer( self.screen_update_event)
def __init__(self, config): self.printer = config.get_printer() self.reactor = self.printer.get_reactor() self.lcd_chip = config.getchoice('lcd_type', LCD_chips)(config) self.lcd_type = config.get('lcd_type') # menu self.menu = menu.MenuManager(config, self.lcd_chip) # printer objects self.toolhead = self.sdcard = None self.fan = self.extruder0 = self.extruder1 = self.heater_bed = None self.printer.register_event_handler("klippy:ready", self.handle_ready) # screen updating self.screen_update_timer = self.reactor.register_timer( self.screen_update_event) # Register commands self.gcode = self.printer.lookup_object('gcode') self.gcode.register_command('M73', self.cmd_M73) self.gcode.register_command('M117', self.cmd_M117)