Пример #1
0
    def __init__(self):
        QtWidgets.QMainWindow.__init__(self)
        uic.loadUi('ui/mainwindow.ui', self)
        self.menuDevice.aboutToShow.connect(self.handleUpdateDevices)
        self.menuPort.triggered.connect(self.selectPort)
        self.actionConnect.triggered.connect(self.connect)
        self.actionDisconnect.triggered.connect(self.disconnect)
        self.actionCommand.triggered.connect(self.command)
        self.actionConnect.setEnabled(False)
        self.actionDisconnect.setEnabled(False)
        self.actionCommand.setEnabled(False)
        self.ports = {}
        self.device = None
        self.connectTimer = QtCore.QTimer(self)
        self.connectTimer.timeout.connect(self.updateStatus)
        self.settings = QtCore.QSettings('uArm', 'uArmUI')
        self.port = self.settings.value("Port")
        self.handleUpdateDevices()
        self.selectPort()
        self.documentCount = 0

        self.actionNew.triggered.connect(self.newDocument)
        self.actionLoad.triggered.connect(self.openDocument)
        self.actionSave.triggered.connect(self.saveDocument)
        self.actionSaveAs.triggered.connect(self.saveDocumentAs)
Пример #2
0
    def __init__(self):
        super(MainWindow, self).__init__()
        uic.loadUi('MainWindow.ui', self)

        #creating an instance of each object
        self.mpl = MplCanvasStatic()

        mpl_vbox = QtGui.QVBoxLayout()
        mpl_vbox.addWidget(self.mpl)
        mpl_vbox.addStretch(1)
        self.mpl_widget.setLayout(mpl_vbox)

        self.show()
        self.updating = False
Пример #3
0
    def __init__(self):
        super(MainWindow, self).__init__()
        uic.loadUi('MainWindow.ui',self)

        #creating an instance of each object
        self.mpl = MplCanvasStatic()

        mpl_vbox = QtGui.QVBoxLayout()
        mpl_vbox.addWidget(self.mpl)
        mpl_vbox.addStretch(1)
        self.mpl_widget.setLayout(mpl_vbox)

        self.show()
        self.updating = False
Пример #4
0
 def __init__(self, parent=None, doc=None, device=None):
     self.doc = doc
     self.device = device
     super(CommandDialog, self).__init__(parent)
     uic.loadUi('ui/command.ui', self)
     self.updateTimer = QtCore.QTimer(self)
     self.updateTimer.timeout.connect(self.updateStatus)
     self.updateStatus()
     self.device.progress = 0.0
     self.device.running = False
     self.device.pause = False
     self.device.stop = False
     self.updateTimer.start(100)
     self.pushStop.setEnabled(False)
     self.pushPause.setEnabled(False)
     self.pushStart.clicked.connect(self.commandStart)
     self.pushPause.clicked.connect(self.commandPause)
     self.pushStop.clicked.connect(self.commandStop)
Пример #5
0
    def __init__(self, doc, parent=None, mdi=None):
        QtWidgets.QMainWindow.__init__(self, parent)
        uic.loadUi('ui/document.ui', self)

        self.mdi = mdi
        self.parent = parent
        self.fig = Figure((400, 400))
        self.canvas = FigureCanvas(self.fig)
        self.canvas.setParent(self.centralwidget)
        self.canvas.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.canvas.setFocus()
        self.canvas.updateGeometry()
        self.grid = [0, 0, 20, 20]

        self.mpl_toolbar = NavigationToolbar(self.canvas, self.centralwidget)

        self.verticalLayout.addWidget(self.canvas)
        self.verticalLayout.addWidget(self.mpl_toolbar)

        self.plt = self.fig.gca()
        self.doc = doc
        self.updatePlot()

        self.actionProperties.triggered.connect(self.updateProperties)
        self.actionImport.triggered.connect(self.importObject)

        #self.cur = Cursor(self.plt, useblit=True)
        self.cursor = SnaptoCursor(self, useblit=True)
        self.selector = RectangleSelector(self.plt,
                                          self.onselect,
                                          drawtype='box',
                                          rectprops=dict(facecolor='white',
                                                         edgecolor='black',
                                                         alpha=0.5,
                                                         fill=False,
                                                         linestyle='--'),
                                          useblit=True,
                                          button=3,
                                          state_modifier_keys={
                                              'center': 'None',
                                              'None': 'space',
                                              'clear': 'escape',
                                              'square': 'shift'
                                          })
Пример #6
0
    def init_gui_layout(self):
        gui_fname = pkg_resources.resource_filename(
            'circus', os.path.join('qt_GUI', 'qt_launcher.ui'))
        self.ui = uic.loadUi(gui_fname)
        self.task_comboboxes = [
            cb for cb in self.ui.grp_tasks.children()
            if isinstance(cb, QCheckBox)
        ]

        logo = pkg_resources.resource_filename(
            'circus', os.path.join('icons', 'icon.png'))
        self.ui.setWindowIcon(QtGui.QIcon(logo))

        try:
            import cudamat as cmt
            cmt.init()
            self.HAVE_CUDA = True
        except Exception:
            self.HAVE_CUDA = False

        self.ui.btn_run.clicked.connect(self.run)
        self.ui.btn_plots.clicked.connect(self.open_plot_folder)
        self.ui.btn_param.clicked.connect(self.view_param)
        self.ui.btn_phy.clicked.connect(self.help_phy)
        self.ui.btn_matlab.clicked.connect(self.help_matlab)
        self.ui.btn_help_cpus.clicked.connect(self.help_cpus)
        self.ui.btn_help_gpus.clicked.connect(self.help_gpus)
        self.ui.btn_help_file_format.clicked.connect(self.help_file_format)
        self.ui.tabWidget.currentChanged.connect(self.changing_tab)
        self.ui.btn_stop.clicked.connect(self.stop)
        self.ui.btn_file.clicked.connect(self.update_data_file)
        self.ui.btn_about.clicked.connect(self.show_about)
        self.ui.rb_gui_matlab.clicked.connect(self.update_gui_command)
        self.ui.rb_gui_python.clicked.connect(self.update_gui_command)
        self.ui.btn_output.clicked.connect(self.update_output_file)
        self.ui.btn_hostfile.clicked.connect(self.update_host_file)
        self.ui.btn_log.clicked.connect(self.open_log_file)
        self.ui.cb_batch.toggled.connect(self.update_batch_mode)
        self.ui.cb_preview.toggled.connect(self.update_preview_mode)
        self.ui.cb_results.toggled.connect(self.update_results_mode)
        self.ui.cb_benchmarking.toggled.connect(self.update_benchmarking)
        self.ui.cb_merging.toggled.connect(self.update_extension)
        self.ui.cb_converting.toggled.connect(self.update_extension)
        self.update_benchmarking()
        self.update_extension()
        for cb in self.task_comboboxes:
            cb.toggled.connect(self.store_tasks)
            cb.toggled.connect(self.update_command)
        self.ui.edit_file.textChanged.connect(self.update_command)
        self.ui.edit_output.textChanged.connect(self.update_command)
        self.ui.edit_hostfile.textChanged.connect(self.update_command)
        self.ui.edit_extension.textChanged.connect(self.update_command)
        self.ui.gui_extension.textChanged.connect(self.update_gui_command)
        self.ui.spin_cpus.valueChanged.connect(self.update_command)
        if not self.HAVE_CUDA:
            self.ui.spin_gpus.setEnabled(False)
        self.ui.spin_gpus.valueChanged.connect(self.update_command)
        self.store_tasks()
        self.process = None
        self.ui.closeEvent = self.closeEvent
        self.last_log_file = None
        try:
            import sklearn
        except ImportError:
            self.ui.cb_validating.setEnabled(False)
        self.ui.show()
Пример #7
0
 def __init__(self, parent=None, doc=None):
     self.doc = doc
     super(DocumentPropertiesDialog, self).__init__(parent)
     uic.loadUi('ui/documentproperties.ui', self)
     self.comboMode.currentIndexChanged.connect(self.modeChanged)
     self.loadProperties()