コード例 #1
0
ファイル: qt_mainwindow.py プロジェクト: aniket11bh/auvpysim
    def __init__(self,parent=None):
        QtGui.QMainWindow.__init__(self,parent)
        self.setWindowTitle("QtSimiam")
        self.setWindowIcon(QtGui.QIcon("./res/image/appicon.png"))
        self.resize(700,700)
        
        self.create_actions()
        self.create_toolbars()
        self.create_menu()
        self.create_statusbar()
        # Set intro message
        self.status_label.setText("Welcome to QtSimiam")
        
        # create XML file dialog
        self.world_dialog = QtGui.QFileDialog(self,
                                "Select World File",
                                "worlds", 
                                "WorldFile (*.xml)")
        self.world_dialog.setAcceptMode(QtGui.QFileDialog.AcceptOpen)
        self.world_dialog.setFileMode(QtGui.QFileDialog.ExistingFile)     

        # create supervisor file dialog
        self.supervisor_dialog = QtGui.QFileDialog(self,
                                     "Select Supervisor File",
                                     "supervisors", 
                                     "Supervisor (*.py)")
        self.supervisor_dialog.setAcceptMode(QtGui.QFileDialog.AcceptOpen)
        self.supervisor_dialog.setFileMode(QtGui.QFileDialog.ExistingFile)     
        
        scrollArea = QtGui.QScrollArea(self)
        self.setCentralWidget(scrollArea)
        self.viewer = SimulatorViewer()
        self.viewer.resized.connect(self.refresh_view)
        scrollArea.setWidget(self.viewer)
        scrollArea.setWidgetResizable(True)
        
        self.__clear_graph_on_start = False
        self.plots = []

        #self.setDockOptions(QtGui.QMainWindow.AllowNestedDocks)
        self.setDockOptions(QtGui.QMainWindow.DockOptions())
        
        self.coursera_dock = None
        self.logdock = None
        self.add_logdock()

        self.dockmanager = DockManager(self)
        self.dockmanager.apply_request.connect(self.apply_parameters)

        self.sim_timer = QtCore.QTimer(self)
        self.sim_timer.setInterval(10)
        self.sim_timer.timeout.connect(self.update_time)
        
        SimUI.__init__(self,self.viewer.renderer)

        self.sim_timer.start()
コード例 #2
0
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setWindowTitle("QtSimiam")
        self.setWindowIcon(QtGui.QIcon("./res/image/appicon.png"))
        self.resize(700, 700)

        self.create_actions()
        self.create_toolbars()
        self.create_menu()
        self.create_statusbar()
        # Set intro message
        self.status_label.setText("Welcome to QtSimiam")

        # create XML file dialog
        self.world_dialog = QtGui.QFileDialog(self, "Select World File",
                                              "worlds", "WorldFile (*.xml)")
        self.world_dialog.setAcceptMode(QtGui.QFileDialog.AcceptOpen)
        self.world_dialog.setFileMode(QtGui.QFileDialog.ExistingFile)

        # create supervisor file dialog
        self.supervisor_dialog = QtGui.QFileDialog(self,
                                                   "Select Supervisor File",
                                                   "supervisors",
                                                   "Supervisor (*.py)")
        self.supervisor_dialog.setAcceptMode(QtGui.QFileDialog.AcceptOpen)
        self.supervisor_dialog.setFileMode(QtGui.QFileDialog.ExistingFile)

        scrollArea = QtGui.QScrollArea(self)
        self.setCentralWidget(scrollArea)
        self.viewer = SimulatorViewer()
        self.viewer.resized.connect(self.refresh_view)
        scrollArea.setWidget(self.viewer)
        scrollArea.setWidgetResizable(True)

        self.__clear_graph_on_start = False
        self.plots = []

        #self.setDockOptions(QtGui.QMainWindow.AllowNestedDocks)
        self.setDockOptions(QtGui.QMainWindow.DockOptions())

        self.coursera_dock = None
        self.logdock = None
        self.add_logdock()

        self.dockmanager = DockManager(self)
        self.dockmanager.apply_request.connect(self.apply_parameters)

        self.sim_timer = QtCore.QTimer(self)
        self.sim_timer.setInterval(10)
        self.sim_timer.timeout.connect(self.update_time)

        SimUI.__init__(self, self.viewer.renderer, PCLoop)

        self.sim_timer.start()
コード例 #3
0
    def __init__(self, parent=None):
        QtWidgets.QMainWindow.__init__(self, parent)
        self.setWindowTitle("QtSimiam")
        self.setWindowIcon(QtGui.QIcon("./res/image/appicon.png"))
        self.resize(700, 700)

        self.create_actions()
        self.create_toolbars()
        self.create_menu()
        self.create_statusbar()
        # Set intro message
        self.status_label.setText("Welcome to QtSimiam")

        # create XML file dialog
        self.world_dialog = QtWidgets.QFileDialog(self, "Select World File",
                                                  "worlds",
                                                  "WorldFile (*.xml)")
        self.world_dialog.setAcceptMode(QtWidgets.QFileDialog.AcceptOpen)
        self.world_dialog.setFileMode(QtWidgets.QFileDialog.ExistingFile)

        # create supervisor file dialog

        if sys.version_info.major == 3:
            formats = [
                bytes(fmt).decode('utf-8')
                for fmt in QtGui.QImageWriter.supportedImageFormats()
            ]
        else:
            formats = [
                str(fmt) for fmt in QtGui.QImageWriter.supportedImageFormats()
            ]

        fmtstring = "All supported image formats ({});;{}".format( \
                    " ".join('*.' + fmt for fmt in formats), \
                    ";;".join( "{} files (*.{})".format(fmt.upper(), fmt) for fmt in formats ))

        self.screenshot_dialog = QtWidgets.QFileDialog(self, "Export view",
                                                       ".", fmtstring)
        self.screenshot_dialog.setAcceptMode(QtWidgets.QFileDialog.AcceptSave)
        self.screenshot_dialog.setFileMode(QtWidgets.QFileDialog.AnyFile)

        scrollArea = QtWidgets.QScrollArea(self)
        self.setCentralWidget(scrollArea)
        self.viewer = SimulatorViewer()
        self.viewer.resized.connect(self.refresh_view)
        scrollArea.setWidget(self.viewer)
        scrollArea.setWidgetResizable(True)

        self.__screenshot_filename = ""
        self.__clear_graph_on_start = False
        self.plots = []

        #self.setDockOptions(QtWidgets.QMainWindow.AllowNestedDocks)
        self.setDockOptions(QtWidgets.QMainWindow.DockOptions())

        self.coursera_dock = None
        self.logdock = None
        self.add_logdock()

        self.dockmanager = DockManager(self)
        self.dockmanager.apply_request.connect(self.apply_parameters)

        self.sim_timer = QtCore.QTimer(self)
        self.sim_timer.setInterval(10)
        self.sim_timer.timeout.connect(self.update_time)

        SimUI.__init__(self, self.viewer.renderer, Simulator)

        self.sim_timer.start()
コード例 #4
0
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setWindowTitle("QtSimiam")
        self.setWindowIcon(QtGui.QIcon("./res/image/appicon.png"))
        self.resize(700, 700)

        self.create_actions()
        self.create_toolbars()
        self.create_menu()
        self.create_statusbar()
        # Set intro message
        self.status_label.setText("Welcome to QtSimiam")

        # create XML file dialog
        self.world_dialog = QtGui.QFileDialog(self, "Select World File", "worlds", "WorldFile (*.xml)")
        self.world_dialog.setAcceptMode(QtGui.QFileDialog.AcceptOpen)
        self.world_dialog.setFileMode(QtGui.QFileDialog.ExistingFile)

        # create supervisor file dialog

        if sys.version_info.major == 3:
            formats = [bytes(fmt).decode("utf-8") for fmt in QtGui.QImageWriter.supportedImageFormats()]
        else:
            formats = [str(fmt) for fmt in QtGui.QImageWriter.supportedImageFormats()]

        fmtstring = "All supported image formats ({});;{}".format(
            " ".join("*." + fmt for fmt in formats),
            ";;".join("{} files (*.{})".format(fmt.upper(), fmt) for fmt in formats),
        )

        self.screenshot_dialog = QtGui.QFileDialog(self, "Export view", ".", fmtstring)
        self.screenshot_dialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
        self.screenshot_dialog.setFileMode(QtGui.QFileDialog.AnyFile)

        scrollArea = QtGui.QScrollArea(self)
        self.setCentralWidget(scrollArea)
        self.viewer = SimulatorViewer()
        self.viewer.resized.connect(self.refresh_view)
        scrollArea.setWidget(self.viewer)
        scrollArea.setWidgetResizable(True)

        self.__screenshot_filename = ""
        self.__clear_graph_on_start = False
        self.plots = []

        # self.setDockOptions(QtGui.QMainWindow.AllowNestedDocks)
        self.setDockOptions(QtGui.QMainWindow.DockOptions())

        self.coursera_dock = None
        self.logdock = None
        self.add_logdock()

        self.dockmanager = DockManager(self)
        self.dockmanager.apply_request.connect(self.apply_parameters)

        self.sim_timer = QtCore.QTimer(self)
        self.sim_timer.setInterval(10)
        self.sim_timer.timeout.connect(self.update_time)

        SimUI.__init__(self, self.viewer.renderer)

        self.sim_timer.start()