コード例 #1
0
    def clear_bed(self, callback):
        pos = pconsole.get_position()
        while not pos:
            pos = pconsole.get_position()

        drop = self.mode['drop_amount'] - float(pos[2]) 
        Logger.info("Dropping to: " + str(drop))

        #################################################################################################################
                                    #Get off of the endstop so the Z axis works...
        #get bed dimensions
        bed_x = roboprinter.printer_instance._settings.global_get(['printerProfiles','defaultProfile', 'volume','width'])
        bed_y = roboprinter.printer_instance._settings.global_get(['printerProfiles','defaultProfile', 'volume','depth'])

        #calculate final positions
        bed_x = float(bed_x) / 2.0
        bed_y = float(bed_y) / 2.0

        roboprinter.printer_instance._printer.commands('G1 X' + str(bed_x) + ' Y' + str(bed_y) +' F3000')
        #################################################################################################################
        roboprinter.printer_instance._printer.commands('G1 Z'+ str(drop) + ' F3000')
        from functools import partial
        c = partial(callback[0], callback=callback[1])
        layout = Button_Screen(roboprinter.lang.pack['FT_ZOffset_Wizard']['Warn_Restart']['Body'] , c)
        title = roboprinter.lang.pack['FT_ZOffset_Wizard']['Warn_Restart']['Title']

        self.bb.make_screen(layout,
                                                title,
                                                option_function='no_option')
コード例 #2
0
    def warn_and_restart(self):
        Logger.info("Unlocked!")
        self.line_lock = False    
        pos = pconsole.get_position()
        while not pos:
            pos = pconsole.get_position()

        drop = self.drop_amount - float(pos[2]) 
        Logger.info("Dropping to: " + str(drop))

        #################################################################################################################
                                    #Get off of the endstop so the Z axis works...
        #get bed dimensions
        bed_x = roboprinter.printer_instance._settings.global_get(['printerProfiles','defaultProfile', 'volume','width'])
        bed_y = roboprinter.printer_instance._settings.global_get(['printerProfiles','defaultProfile', 'volume','depth'])

        #calculate final positions
        bed_x = float(bed_x) / 2.0
        bed_y = float(bed_y) / 2.0

        roboprinter.printer_instance._printer.commands('G1 X' + str(bed_x) + ' Y' + str(bed_y) +' F3000')
        #################################################################################################################
        
        roboprinter.printer_instance._printer.commands('G1 Z'+ str(drop) + ' F3000')
        roboprinter.printer_instance._printer.commands('G1 X'+ str(self.start_pos_x) + ' Y'+ str(self.start_pos_y) + ' F3000') # go to first corner
        self.warning_screen = Button_Screen(roboprinter.lang.pack['FT_ZOffset_Wizard']['Warn_Restart']['Body'] , self.restart)
        title = roboprinter.lang.pack['FT_ZOffset_Wizard']['Warn_Restart']['Title']

        self.bb.make_screen(self.warning_screen,
                            title,
                            option_function='no_option')
コード例 #3
0
    def instruction1(self):
        layout = Button_Screen(roboprinter.lang.pack['FT_ZOffset_Wizard']['Instruction']['Body'],
                               self.instruction2)
        title = roboprinter.lang.pack['FT_ZOffset_Wizard']['Instruction']['Title']

        self.bb.make_screen(layout,
                            title,
                            option_function='no_option'
                            )
コード例 #4
0
    def welcome_screen(self):
        self.welcome = Button_Screen(roboprinter.lang.pack['FT_ZOffset_Wizard']['Welcome']['Body'],
                               self.process_machine_state,
                               button_text=roboprinter.lang.pack['FT_ZOffset_Wizard']['Welcome']['Button_Text'])
        title = roboprinter.lang.pack['FT_ZOffset_Wizard']['Welcome']['Title']
        self.welcome.change_screen_actions = self.cleanup

        self.bb.make_screen(self.welcome,
                            title,
                            option_function='no_option')
コード例 #5
0
 def change_shape(self, shape):
     if shape == "CIRCLE":
         self.set_mode("CIRCLE")
         layout = Button_Screen(roboprinter.lang.pack['FT_ZOffset_Wizard']['Change_Pattern']['Body_Text'], self.go_back_to_FTZO)
         title = roboprinter.lang.pack['FT_ZOffset_Wizard']['Change_Pattern']['Title']
         self.bb.make_screen(layout,
                                                 title,
                                                 option_function='no_option')
     else:
         #if we arent setting the shape to circle we are going back to lines. Ask the user to clear the bed then continue
         self.user_set_mode()
コード例 #6
0
 def welcome_screen(self):
     #Make screen content
     self.welcome = Button_Screen(
         lang.pack['ZOffset_Wizard']['Wizard_Description'],
         self.process_state,
         button_text=lang.pack['ZOffset_Wizard']['Start'])
     self.welcome.change_screen_actions = self.cleanup
     #populate screen
     self.bb.make_screen(self.welcome,
                         roboprinter.lang.pack['ZOffset_Wizard']['Welcome'],
                         option_function='no_option')
コード例 #7
0
    def welcome_page(self):

        self.welcome = Button_Screen(
            lang.pack['PID_Tool']['Welcome_Screen']['Body'],
            self.select_extruder,
            button_text=lang.pack['PID_Tool']['Welcome_Screen']['Button_Text'])

        title = lang.pack['PID_Tool']['Welcome_Screen']['Title']
        self.welcome.change_screen_actions = self.cleanup

        self.bb.make_screen(self.welcome, title, option_function='no_option')
コード例 #8
0
    def failure_callback(self):
        self.autotune_complete = True

        def cancel():
            roboprinter.robosm.go_back_to_main('printer_status_tab')

        layout = Button_Screen(lang.pack['PID_Tool']['Failure_Screen']['Body'],
                               cancel)

        title = lang.pack['PID_Tool']['Failure_Screen']['Title']
        self.bb.make_screen(layout, title, option_function='no_option')
コード例 #9
0
 def welcome_screen(self):
     self.welcome = Button_Screen(
         roboprinter.lang.pack['Bed_Cal_Wizard']['Welcome']['Body'],
         self.tighten_all_screw_instructions,
         button_text=roboprinter.lang.pack['Bed_Cal_Wizard']['Welcome']
         ['Button'])
     title = roboprinter.lang.pack['Bed_Cal_Wizard']['Welcome']['Title']
     name = 'welcome_bed_calibration'
     back_destination = roboprinter.robo_screen()
     self.welcome.change_screen_actions = self.cleanup
     self.bb.make_screen(self.welcome, title, option_function='no_option')
コード例 #10
0
    def finish_screws_instructions(self):
        layout = Button_Screen(
            roboprinter.lang.pack['Bed_Cal_Wizard']['Tilt_Instructions']
            ['Body'],
            self.finish_bed_cal_wizard,
            button_text=roboprinter.lang.pack['Bed_Cal_Wizard']
            ['Tilt_Instructions']['Button'])
        title = roboprinter.lang.pack['Bed_Cal_Wizard']['Tilt_Instructions'][
            'Title']
        name = 'tilt2'
        back_destination = 'guided_or_manual'

        self.bb.make_screen(layout, title, option_function='no_option')
コード例 #11
0
    def tighten_all_screw_instructions(self):
        layout = Button_Screen(
            roboprinter.lang.pack['Bed_Cal_Wizard']['Tilt_Instructions']
            ['Body'],
            self.check_for_valid_start,
            button_text=roboprinter.lang.pack['Bed_Cal_Wizard']
            ['Tilt_Instructions']['Button'])
        title = roboprinter.lang.pack['Bed_Cal_Wizard']['Tilt_Instructions'][
            'Title']
        name = 'tilt1'
        back_destination = roboprinter.robo_screen()

        self.bb.make_screen(layout, title, option_function='no_option')
コード例 #12
0
    def save_PID(self, PID):
        #construct PID save command
        pid_command = ''
        if self.selected_tool == "-1":
            pid_command = 'M304 P' + str(PID['P']) + " I" + str(
                PID['I']) + " D" + str(PID['D'])
        else:
            pid_command = 'M301 P' + str(PID['P']) + " I" + str(
                PID['I']) + " D" + str(PID['D'])

        #save PID
        roboprinter.printer_instance._printer.commands(pid_command)
        roboprinter.printer_instance._printer.commands("M500")  #save

        #create a button screen
        layout = Button_Screen(lang.pack['PID_Tool']['Save_Screen']['Body'],
                               self.goto_main)

        title = lang.pack['PID_Tool']['Save_Screen']['Title']
        self.bb.make_screen(layout, title, option_function='no_option')
コード例 #13
0
        def reset():
            roboprinter.printer_instance._printer.commands("M502")
            roboprinter.printer_instance._printer.commands("M500")
            roboprinter.printer_instance._printer.commands("M501")

            #make screen to say that the variables have been reset

            #body_text, button_function, button_text = roboprinter.lang.pack['Button_Screen']['Default_Button']
            content = Button_Screen(roboprinter.lang.pack['EEPROM']
                                    ['Acknowledge_Reset']['Body_Text'],
                                    roboprinter.robosm.go_back_to_main,
                                    button_text=roboprinter.lang.pack['EEPROM']
                                    ['Acknowledge_Reset']['Button'])

            #make screen
            roboprinter.robosm._generate_backbutton_screen(
                name='ack_reset_eeprom',
                title=roboprinter.lang.pack['EEPROM']['Acknowledge_Reset']
                ['Title'],
                back_destination=back_screen,
                content=content)