Пример #1
0
def set_solution_field():
    s = getfile()
    if s:
        gui.set_field(1, s)


if __name__ == "__main__":
    instance = ""
    solution = ""
    if len(sys.argv) > 1:
        instance = sys.argv[1]
    if len(sys.argv) > 2:
        solution = sys.argv[2]
    app = QtWidgets.QApplication(sys.argv)
    gui = GUI()
    gui.set_program_name("CMP simulation")
    gui.set_logic(0, set_up_scene)
    gui.set_logic(1, run_simulation)
    gui.set_logic(2, set_scene_field)
    gui.set_logic(3, set_solution_field)
    gui.set_button_text(0, "Initialize")
    gui.set_button_text(1, "Run")
    gui.set_button_text(2, "...")
    gui.set_button_text(3, "...")
    gui.set_field(0, instance)
    gui.set_field(1, solution)
    gui.set_label(0, "Input file:")
    gui.set_label(1, "Solution file:")
    gui.set_animation_finished_action(lambda: None)
    gui.MainWindow.show()
    sys.exit(app.exec_())
Пример #2
0
    t = None
    timer = QTimer()
    game_over = False
    app = QtWidgets.QApplication(sys.argv)
    gui = GUI()
    scene = Scene(gui)
    gui.set_program_name("Multi-robot Motion Planning Game")
    gui.set_field(0, scene_file)
    gui.set_field(1, red_file)
    gui.set_field(2, blue_file)
    gui.set_logic(0, set_up_scene)
    gui.set_logic(3, set_scene_file)
    gui.set_logic(4, set_red_file)
    gui.set_logic(5, set_blue_file)
    gui.set_button_text(0, "Load scene")
    gui.set_button_text(1, "Unavailable")
    gui.set_button_text(2, "Unavailable")
    gui.set_button_text(3, "...")
    gui.set_button_text(4, "...")
    gui.set_button_text(5, "...")
    gui.set_label(0, "Turn: -")
    gui.set_label(1, "Red team score: 0")
    gui.set_label(2, "Blue team score: 0")
    gui.set_label(3, "Remaining game time: ")
    gui.set_label(4, "Remaining turn time: ")
    gui.set_label(5, "Remaining travel distance: ")
    # gui.set_animation_finished_action(lambda: None)
    threadpool = QtCore.QThreadPool()
    gui.MainWindow.show()
    sys.exit(app.exec_())