Пример #1
0
    def run(self, PeripheryClass, GUI_Class):
        log.log(99, "Startup '%s' machine...", self.cfg.MACHINE_NAME)

        log.critical("init GUI")
        # e.g. TkInter GUI
        gui = GUI_Class(
            self.cfg,
            self.user_input_queue
        )

        log.critical("init machine")
        # start CPU+Memory+Periphery in a separate thread
        machine = Machine(
            self.cfg,
            PeripheryClass,
            gui.display_callback,
            self.user_input_queue
        )

        try:
            gui.mainloop(machine)
        except Exception as err:
            log.critical("GUI exception: %s", err)
            print_exc_plus()
        machine.quit()

        log.log(99, " --- END ---")
Пример #2
0
 def run(self):
     log.critical(" *** MachineThread.run() start *** ")
     try:
         self.machine.run()
     except Exception as err:
         log.critical("MachineThread exception: %s", err)
         print_exc_plus()
         _thread.interrupt_main()
         raise
     log.critical(" *** MachineThread.run() stopped. *** ")
Пример #3
0
 def run(self):
     log.critical(" *** MachineThread.run() start *** ")
     try:
         self.machine.run()
     except Exception as err:
         log.critical("MachineThread exception: %s", err)
         print_exc_plus()
         _thread.interrupt_main()
         raise
     log.critical(" *** MachineThread.run() stopped. *** ")
Пример #4
0
    def run(self, PeripheryClass, GUI_Class):
        log.log(99, "Startup '%s' machine...", self.cfg.MACHINE_NAME)

        log.critical("init GUI")
        # e.g. TkInter GUI
        gui = GUI_Class(self.cfg, self.user_input_queue)

        log.critical("init machine")
        # start CPU+Memory+Periphery in a separate thread
        machine = Machine(self.cfg, PeripheryClass, gui.display_callback,
                          self.user_input_queue)

        try:
            gui.mainloop(machine)
        except Exception as err:
            log.critical("GUI exception: %s", err)
            print_exc_plus()
        machine.quit()

        log.log(99, " --- END ---")