示例#1
0
    def __init__(self, sources, sourceTree, sourceKeeper):
        print('in ApplicationWindow.__init__(self)')
        QtGui.QMainWindow.__init__(self)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.sourceKeeper = sourceKeeper
        #         self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        #         self.setWindowTitle('Visibilty plotter.')

        #         self.fileMenu = QtGui.QMenu('&File', self)
        #         self.fileMenu.addAction('&Quit', self.fileQuit, QtCore.Qt.CTRL+QtCore.Qt.Key_Q)
        #         self.menuBar().addMenu(self.fileMenu)

        #         self.main_widget = QtGui.QWidget(self)
        self.l = QtGui.QVBoxLayout(self.ui.visPlotCanvas)
        self.vp = VisibilityPlotCanvas(self,
                                       width=5,
                                       height=4,
                                       sources=sources,
                                       sourceKeeper=sourceKeeper,
                                       dpi=100)

        self.l.addWidget(self.vp)
        self.ui.sourceSelector.setModel(sourceTree)
        self.sourceKeeper.sourceSelector = self.ui.sourceSelector
        QtCore.QObject.connect(
            self.ui.sourceSelector.selectionModel(),
            QtCore.SIGNAL('selectionChanged(QItemSelection, QItemSelection)'),
            self.sourceKeeper.sourceSelected)
        QtCore.QObject.connect(self.ui.actionFlip_activity,
                               QtCore.SIGNAL(_fromUtf8("activated()")),
                               self.sourceKeeper.swapSelected)
示例#2
0
    def __init__(self, parent=None):
        QtWidgets.QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.dicomVisWidget = DicomVis()
        self.opened_list = []

        self.ui.verticalLayout.insertWidget(0, self.dicomVisWidget)
示例#3
0
    def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.dicomVisWidget = iDicom()
        self.ui.verticalLayout.insertWidget(0, self.dicomVisWidget)

        dir_path = os.path.dirname(os.path.realpath(__file__))
        studyPath = str(os.path.join(dir_path, 'images'))
        self.dicomVisWidget.load_study_from_path(studyPath)
示例#4
0
    def __init__(self):
        super(MainWindow, self).__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.manager = Manager(self)
        self.__threadRun = QThread()
        self.__threadRun.start()
        self.manager.moveToThread(self.__threadRun)

        self.ui.openFile_button.clicked.connect(self.openFileButtonClicked)
        self.ui.start_button.clicked.connect(self.startButtonClicked)
        self.startBut.connect(self.manager.startButtonClicked)

        self.manager.sendMessageConsole.connect(self.setMessage)
    def initUI(self):
        #Import ui file from designer
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        #initialize plot
        self.rGraph = self.ui.gResistance.plot(pen='k')
        #        self.ui.gResistance.setBackground('w')
        #        self.ui.gResistance.setForegroundBrush(pg.mkBrush('k'))
        #        self.ui.gResistance.setBackgroundBrush(pg.mkBrush('k'))
        self.p1 = self.ui.gResistance.plotItem
        self.p1.setLabel('top', text='Resistance')
        self.p1.setLabel('left', text='Resistance', units='O')
        self.p1.setLabel('bottom', text='voltage', units='V')

        #http://bazaar.launchpad.net/~luke-campagnola/pyqtgraph/inp/view/head:/examples/MultiplePlotAxes.py
        #Need to do all this nonsense to make it plot on two different axes.
        #Also note the self.updatePhase plot which shows how to update the data.
        self.p2 = pg.ViewBox()
        self.p1.showAxis('right')
        self.p1.scene().addItem(self.p2)
        self.p1.getAxis('right').linkToView(self.p2)
        self.p2.setXLink(self.p1)
        self.p1.getAxis('right').setLabel('Phase',
                                          units='deg',
                                          color='#ff0000')
        self.pGraph = pg.PlotCurveItem(pen='r')
        self.p2.addItem(self.pGraph)

        #need to set it up so that when the window (and thus main plotItem) is
        #resized, it informs the ViewBox for the second plot that it must update itself.
        self.p1.vb.sigResized.connect(
            lambda: self.p2.setGeometry(self.p1.vb.sceneBoundingRect()))

        #Connect all the things
        self.ui.bStartScan.clicked.connect(self.startScan)
        self.ui.bAbortScan.clicked.connect(self.abortScan)
        self.ui.bAbortScan.setEnabled(False)
        self.ui.bSaveData.clicked.connect(self.saveData)
        self.ui.bResetData.clicked.connect(self.resetData)

        self.ui.mFileExit.triggered.connect(self.closeEvent)
        self.ui.mFileSettings.triggered.connect(self.launchSettings)

        self.ui.tGateStart.textAccepted.connect(self.acceptTextChanges)
        self.ui.tGateStep.textAccepted.connect(self.acceptTextChanges)
        self.ui.tGateEnd.textAccepted.connect(self.acceptTextChanges)
        self.ui.tMeasureEvery.textAccepted.connect(self.acceptTextChanges)