Ejemplo n.º 1
0
def MainLoop():
    if settings.node_only:
        from bluesky.sim.qtgl import nodemanager as manager
        manager.run()

    else:
        # ======================================================================
        # Create gui and simulation objects
        # ======================================================================
        global gui
        manager = MainManager()
        gui = Gui()
        telnet_in = StackTelnetServer()

        # Initialize the gui (loading graphics data, etc.)
        gui.init()

        # Connect gui stack command to telnet_in
        telnet_in.connect(gui.win.console.stack)

        # Start the node manager
        manager.start()

        # Start the telnet input server for stack commands
        telnet_in.listen(port=settings.telnet_port)

        # Start the gui
        gui.start()

        print('Stopping telnet server.')
        telnet_in.close()

        # Close the manager, stop all nodes
        manager.stop()

        # ======================================================================
        # Clean up before exit. Comment this out when debugging for checking
        # variables in the shell.
        # ======================================================================
        del gui
        print('BlueSky normal end.')
Ejemplo n.º 2
0
def MainLoop():
    if settings.node_only:
        from bluesky.sim.qtgl import nodemanager as manager
        manager.run()

    else:
        # ======================================================================
        # Create gui and simulation objects
        # ======================================================================
        global gui
        manager   = MainManager()
        gui       = Gui()
        telnet_in = StackTelnetServer()

        # Initialize the gui (loading graphics data, etc.)
        gui.init()

        # Connect gui stack command to telnet_in
        telnet_in.connect(gui.win.console.stack)

        # Start the node manager
        manager.start()

        # Start the telnet input server for stack commands
        telnet_in.listen(port=settings.telnet_port)

        # Start the gui
        gui.start()

        print('Stopping telnet server.')
        telnet_in.close()

        # Close the manager, stop all nodes
        manager.stop()

        # ======================================================================
        # Clean up before exit. Comment this out when debugging for checking
        # variables in the shell.
        # ======================================================================
        del gui
        print('BlueSky normal end.')
Ejemplo n.º 3
0
def start():
    """
    Start BlueSky: Create gui and simulation objects
    """
    global gui
    telnet_in = StackTelnetServer()
    manager = MainManager(telnet_in)
    gui = Gui()

    # Initialize the gui (loading graphics data, etc.)
    gui.init()

    # Connect gui stack command to telnet_in
    telnet_in.connect(gui.win.console.stack)

    # Start the node manager
    manager.start()

    # Start the telnet input server for stack commands
    telnet_in.listen(port=bs.settings.telnet_port)

    return telnet_in, manager