コード例 #1
0
ファイル: Gui.py プロジェクト: bogini/Brickalicious
    def Printing_Screen(self):
        self.scrollbar = Scrollbar(self.frame)
        self.scrollbar.grid(row=0, column=2, sticky=N+S)
        
        self.printing_l = Text(self.frame)
        self.printing_l.grid(row=0, column = 0)
        self.scrollbar.config(command=self.printing_l.yview)

        self.pause_b = Button(self.frame, text="Pause Printing", font=("Helvetica", 14),command= self.Pause_Screen)
        self.pause_b.grid(row=1, column = 0, pady=10)
        
        self.quit_b = Button(self.frame, text= "Quit Printing", font=("Helvetica", 14),command= self.to_quit)
        self.quit_b.grid(row=2, column = 0, pady=10)
        
        # Interpreter
        self.display_message("Reading file...")
        bricks = Interpreter.parsing(self.file.name)
        Interpreter.translation(bricks)
        self.display_message("Parsing file...")
        build_order = Interpreter.generate_build_order(bricks)
        self.display_message("Generating build order...")
        #build_list = Interpreter.generate_build_list(build_order)
        
        # Communication
        self.display_message("Opening communication channel...")
        com = Communicator()
        com.setup_connection()
        self.display_message("Communication established.")
        self.display_message("Printing...")
        bricks = com.print_bricks(build_order)
        for instruction in bricks:
    		  com.send_message(instruction[0], instruction[1])
        com.close_connection()