def setupGUI(self): pg.setConfigOption('background', (255, 255, 255)) pg.setConfigOption('foreground', (0, 0, 0)) # layout is the main layout widget self.layout = QtGui.QVBoxLayout() # sublayout is a widget we add plot window to self.sublayout = pg.GraphicsLayoutWidget() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) self.setLayout(self.layout) # split window into two halfs self.splitter = QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) self.partree = ParameterTree(showHeader=False) self.splitter.addWidget(self.partree) self.splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setup_plot(self.plt) pg.setConfigOptions(antialias=True) self.envelopeParameters = Parameter.create(name='params', type='group', children=EnvelopeParameters) self.partree.setParameters(self.envelopeParameters, showTop=False) self.envelopeParameters.sigTreeStateChanged.connect( self.generateEnvelopeArray)
def setupGUI(self): self.setWindowTitle("Calculator plot") self.setGeometry(80, 50, 800, 600) self.setWindowIcon(QtGui.QIcon('../images/Logo.png')) pg.setConfigOption('background', (255,255,255)) pg.setConfigOption('foreground',(0,0,0)) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0,0,0,0) self.layout.setSpacing(0) self.setLayout(self.layout) # split window into two halfs self.splitter = QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) self.tree = pg.TreeWidget() self.sublayout = pg.GraphicsLayoutWidget() self.splitter.addWidget(self.tree) self.splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setup_plot(self.plt) pg.setConfigOptions(antialias=True) self.tree.setHeaderHidden(True) self.tree.setDragEnabled(False) self.tree.setIndentation(10) self.tree.setColumnCount(3) self.tree.setColumnWidth(0, 110) self.tree.setColumnWidth(1, 90) self.tree.setColumnWidth(2, 5) optItem = pg.TreeWidgetItem(['Options']) xNameItem = pg.TreeWidgetItem(['x title']) yNameItem = pg.TreeWidgetItem(['y title']) optItem.addChild(xNameItem) optItem.addChild(yNameItem) addPlotItem = pg.TreeWidgetItem() self.addPlotButton = QtGui.QPushButton('Add') self.enterAction = QtGui.QAction('',self,shortcut='Return') self.addAction(self.enterAction) self.applyButton = QtGui.QPushButton('Apply') self.applyButton.setDisabled(True) addPlotItem.setWidget(0,self.applyButton) addPlotItem.setWidget(1,self.addPlotButton) self.items = pg.TreeWidgetItem(['Items']) self.tree.addTopLevelItem(optItem) self.tree.addTopLevelItem(self.items) self.tree.addTopLevelItem(pg.TreeWidgetItem()) self.tree.addTopLevelItem(addPlotItem) optItem.setExpanded(True) self.xNameEdit = QtGui.QLineEdit('X') self.yNameEdit = QtGui.QLineEdit('Y') xNameItem.setWidget(1,self.xNameEdit) yNameItem.setWidget(1,self.yNameEdit) self.plt.setLabel('bottom', 'X',**LabelStyle) self.plt.setLabel('left', 'Y',**LabelStyle)
def setupPlotWindow(self): pg.setConfigOption('background', (255, 255, 255)) pg.setConfigOption('foreground', (0, 0, 0)) pg.setConfigOptions(antialias=True) self.plotWindow = QtGui.QWidget() self.plotWindow.setWindowTitle("Combo Plot") layout = QtGui.QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) sublayout = pg.GraphicsLayoutWidget() self.plotWindow.setLayout(layout) layout.addWidget(sublayout) self.plt = sublayout.addPlot() setup_plot(self.plt) self.plt.showGrid(x=True, y=True) # self.plotWindow.show() self.legend = None
def setupPlotWindow(self): pg.setConfigOption('background', (255,255,255)) pg.setConfigOption('foreground',(0,0,0)) pg.setConfigOptions(antialias=True) self.plotWindow = QtGui.QWidget() self.plotWindow.setWindowTitle("Combo Plot") layout = QtGui.QVBoxLayout() layout.setContentsMargins(0,0,0,0) sublayout = pg.GraphicsLayoutWidget() self.plotWindow.setLayout(layout) layout.addWidget(sublayout) self.plt = sublayout.addPlot() setup_plot(self.plt) self.plt.showGrid(x=True, y=True) # self.plotWindow.show() self.legend = None
def setupGUI(self): pg.setConfigOption('background', (255, 255, 255)) pg.setConfigOption('foreground', (0, 0, 0)) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.layout) # menu self.menuBar = QtGui.QMenuBar() self.layout.setMenuBar(self.menuBar) # menu actions self.viewMenu = self.menuBar.addMenu('View') self.parMenu = self.viewMenu.addMenu('Parameter') self.plotVsMenu = self.viewMenu.addMenu('Plot versus') self.plotVsXAction = QtGui.QAction('x', self, checkable=True) self.plotVsYAction = QtGui.QAction('y', self, checkable=True) self.plotVsGroup = QtGui.QActionGroup(self) self.plotVsXAction.setActionGroup(self.plotVsGroup) self.plotVsYAction.setActionGroup(self.plotVsGroup) self.plotVsMenu.addAction(self.plotVsXAction) self.plotVsMenu.addAction(self.plotVsYAction) self.plotVsXAction.setChecked(True) self.autoScaleAction = QtGui.QAction('Auto scale', self, checkable=True) self.autoScaleAction.setChecked(True) self.viewMenu.addAction(self.autoScaleAction) self.parameterGroup = QtGui.QActionGroup(self) # widgets splitter = QtGui.QSplitter() splitter.setOrientation(QtCore.Qt.Horizontal) self.tree = CParameterTree(name='Elastic moduli') self.sublayout = pg.GraphicsLayoutWidget() # self.layout.addWidget(splitter) splitter.addWidget(self.tree) splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setupPlot.setup_plot(self.plt) # self.tree.setGeometry(0, 0, 200, 15) splitter.setSizes([ int(self.width() * 0.4), int(self.width() * 0.6), ]) splitter.setStretchFactor(0, 0) splitter.setStretchFactor(1, 1)
def setupGUI(self): pg.setConfigOption('background', (255,255,255)) pg.setConfigOption('foreground',(0,0,0)) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0,0,0,0) self.setLayout(self.layout) # menu self.menuBar = QtGui.QMenuBar() self.layout.setMenuBar(self.menuBar) # menu actions self.viewMenu = self.menuBar.addMenu('View') self.parMenu = self.viewMenu.addMenu('Parameter') self.plotVsMenu = self.viewMenu.addMenu('Plot versus') self.plotVsXAction = QtGui.QAction('x',self,checkable=True) self.plotVsYAction = QtGui.QAction('y',self,checkable=True) self.plotVsGroup = QtGui.QActionGroup(self) self.plotVsXAction.setActionGroup(self.plotVsGroup) self.plotVsYAction.setActionGroup(self.plotVsGroup) self.plotVsMenu.addAction(self.plotVsXAction) self.plotVsMenu.addAction(self.plotVsYAction) self.plotVsXAction.setChecked(True) self.autoScaleAction = QtGui.QAction('Auto scale',self,checkable=True) self.autoScaleAction.setChecked(True) self.viewMenu.addAction(self.autoScaleAction) self.parameterGroup = QtGui.QActionGroup(self) # widgets splitter = QtGui.QSplitter() splitter.setOrientation(QtCore.Qt.Horizontal) self.tree = CParameterTree(name='Elastic moduli') self.sublayout = pg.GraphicsLayoutWidget() # self.layout.addWidget(splitter) splitter.addWidget(self.tree) splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setupPlot.setup_plot(self.plt) # self.tree.setGeometry(0,0,200,15) splitter.setSizes([int(self.width()*0.4), int(self.width()*0.6), ]) splitter.setStretchFactor(0, 0) splitter.setStretchFactor(1, 1)
def setupGUI(self): pg.setConfigOption("background", (255, 255, 255)) pg.setConfigOption("foreground", (0, 0, 0)) self.setWindowIcon(QtGui.QIcon("../images/Logo.png")) self.setGeometry(80, 30, 1000, 700) # layout is the main layout widget self.layout = QtGui.QVBoxLayout() # sublayout is a widget we add plot window to self.sublayout = pg.GraphicsLayoutWidget() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) self.setLayout(self.layout) # split window into two halfs self.splitter = QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) self.tree = pg.TreeWidget() self.splitter.addWidget(self.tree) self.splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setup_plot(self.plt) pg.setConfigOptions(antialias=True) self.tree.setHeaderHidden(True) self.tree.setDragEnabled(False) self.tree.setIndentation(10) self.tree.setColumnCount(4) self.tree.setColumnWidth(0, 150) self.tree.setColumnWidth(1, 20) self.tree.setColumnWidth(2, 90) self.tree.setColumnWidth(3, 50) # self.tree.setColumnWidth(3, 50) self.fpoints = pg.TreeWidgetItem(["Failure Points"]) self.envelopes = pg.TreeWidgetItem(["Failure Envelopes"]) self.tree.addTopLevelItem(self.fpoints) self.tree.addTopLevelItem(self.envelopes) self.tree.setDragEnabled(False) self.fpoints.setExpanded(True) self.envelopes.setExpanded(True) addEnvelopeItem = pg.TreeWidgetItem([""]) self.tree.addTopLevelItem(addEnvelopeItem) self.addEnvelopeButton = QtGui.QPushButton("Add Envelope") addEnvelopeItem.setWidget(0, self.addEnvelopeButton)
def setupGUI(self): pg.setConfigOption('background', (255,255,255)) pg.setConfigOption('foreground',(0,0,0)) self.setWindowIcon(QtGui.QIcon('../images/Logo.png')) self.setGeometry(80, 30, 1000, 700) # layout is the main layout widget self.layout = QtGui.QVBoxLayout() # sublayout is a widget we add plot window to self.sublayout = pg.GraphicsLayoutWidget() self.layout.setContentsMargins(0,0,0,0) self.layout.setSpacing(0) self.setLayout(self.layout) # split window into two halfs self.splitter = QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) self.tree = pg.TreeWidget() self.splitter.addWidget(self.tree) self.splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setup_plot(self.plt) pg.setConfigOptions(antialias=True) self.tree.setHeaderHidden(True) self.tree.setDragEnabled(False) self.tree.setIndentation(10) self.tree.setColumnCount(4) self.tree.setColumnWidth(0, 150) self.tree.setColumnWidth(1, 20) self.tree.setColumnWidth(2, 90) self.tree.setColumnWidth(3, 50) # self.tree.setColumnWidth(3, 50) self.fpoints = pg.TreeWidgetItem(['Failure Points']) self.envelopes = pg.TreeWidgetItem(['Failure Envelopes']) self.tree.addTopLevelItem(self.fpoints) self.tree.addTopLevelItem(self.envelopes) self.tree.setDragEnabled(False) self.fpoints.setExpanded(True) self.envelopes.setExpanded(True) addEnvelopeItem = pg.TreeWidgetItem(['']) self.tree.addTopLevelItem(addEnvelopeItem) self.addEnvelopeButton = QtGui.QPushButton('Add Envelope') addEnvelopeItem.setWidget(0,self.addEnvelopeButton)
def setupGUI(self): # self.setWindowTitle("Fourrier Transforms") pg.setConfigOption('background', (255,255,255)) pg.setConfigOption('foreground',(0,0,0)) self.layout = QtGui.QVBoxLayout() self.sublayout = pg.GraphicsLayoutWidget() self.setLayout(self.layout) self.layout.addWidget(self.sublayout) self.layout.setContentsMargins(0,0,0,0) self.plots = {} for wave in WaveTypes: # self.plots[wave] = self.sublayout.addPlot() self.plots[wave] = PlotItem() self.sublayout.addItem(self.plots[wave]) self.sublayout.nextRow() setup_plot(self.plots[wave]) self.plots['P'].setXLink(self.plots['Sx']) self.plots['P'].setYLink(self.plots['Sx']) self.plots['Sy'].setXLink(self.plots['Sx']) self.plots['Sy'].setYLink(self.plots['Sx'])
def setupGUI(self): pg.setConfigOption("background", (255, 255, 255)) pg.setConfigOption("foreground", (0, 0, 0)) # layout is the main layout widget self.layout = QtGui.QVBoxLayout() # sublayout is a widget we add plot window to self.sublayout = pg.GraphicsLayoutWidget() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) self.setLayout(self.layout) # split window into two halfs self.splitter = QtGui.QSplitter() self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) self.partree = ParameterTree(showHeader=False) self.splitter.addWidget(self.partree) self.splitter.addWidget(self.sublayout) self.plt = self.sublayout.addPlot() setup_plot(self.plt) pg.setConfigOptions(antialias=True) self.envelopeParameters = Parameter.create(name="params", type="group", children=EnvelopeParameters) self.partree.setParameters(self.envelopeParameters, showTop=False) self.envelopeParameters.sigTreeStateChanged.connect(self.generateEnvelopeArray)
def setupGUI(self): self.setWindowTitle("Color Map Widget") # self.setGeometry(500, 300, 350, 200) self.plt = self.addPlot() setup_plot(self.plt) # self.plt.setLabel('left', yname) # self.plt.setLabel('bottom', xname) self.img = pg.ImageItem() # self.plt.addItem(self.img) self.axis = pg.AxisItem('left') self.addItem(self.axis) self.gw = pg.GradientEditorItem(orientation='right') self.addItem(self.gw) GradiendMode = Gradients['hot'] self.gw.restoreState(GradiendMode) def update(): img = self.img.image lut = self.gw.getLookupTable(len(img), alpha=None) self.img.setLookupTable(lut, update=True) self.gw.sigGradientChanged.connect(update)
def setupGUI(self): self.setWindowTitle("Sonic Viewer") self.setWindowIcon(QtGui.QIcon('../images/Logo.png')) pg.setConfigOption('background', (255, 255, 255)) pg.setConfigOption('foreground', (0, 0, 0)) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) self.setLayout(self.layout) ## setting up the menu bar self.menuBar = QtGui.QMenuBar() self.layout.setMenuBar(self.menuBar) self.viewMenu = self.menuBar.addMenu('View') self.modeMenu = self.menuBar.addMenu('Mode') self.autoScaleButton = QtGui.QAction('Auto scale', self) self.viewMenu.addAction(self.autoScaleButton) self.autoScaleButton.triggered.connect(self.autoScalePlots) self.yAxisMenu = self.viewMenu.addMenu('y axis') # 'Number of sonic track' self.waveFormButton = QtGui.QAction('Wave Forms', self) self.contourButton = QtGui.QAction('Contours', self) self.modeMenu.addAction(self.waveFormButton) self.modeMenu.addAction(self.contourButton) self.modeMenu.setDefaultAction(self.waveFormButton) # dict to store actions for y Axis self.yAxisButtons = {} self.yAxisButtons['Number of sonic track'] = QtGui.QAction( 'Number of sonic track', self) self.yAxisMenu.addAction(self.yAxisButtons['Number of sonic track']) self.yAxisMenu.setDefaultAction( self.yAxisButtons['Number of sonic track']) # for wave in WaveTypes: # split main widget into plotting area and parameters area self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) # split parameter area into 3 for each wave self.treeSplitter = QtGui.QSplitter() self.treeSplitter.setOrientation(QtCore.Qt.Vertical) self.splitter.addWidget(self.treeSplitter) # create parameter trees self.trees = {} for wave in WaveTypes: self.trees[wave] = ParameterTree(showHeader=False) self.treeSplitter.addWidget(self.trees[wave]) # create layout for the plotting area self.sublayout = pg.GraphicsLayoutWidget() self.splitter.addWidget(self.sublayout) self.params = {} self.plots = {} for wave in WaveTypes: # create parameter instances self.params[wave] = Parameter.create(name=wave + ' wave', type='group', children=Parameters) self.trees[wave].setParameters(self.params[wave], showTop=True) # fill plotting area with 3 plots self.plots[wave] = self.sublayout.addPlot() setup_plot(self.plots[wave]) self.sublayout.nextRow() self.splitter.setSizes( [int(self.width() * 0.20), int(self.width() * 0.80), 20]) self.splitter.setStretchFactor(0, 0) self.splitter.setStretchFactor(1, 1)
def setupGUI(self): self.setWindowTitle("Sonic Viewer") pg.setConfigOption('background', (255,255,255)) pg.setConfigOption('foreground',(0,0,0)) self.layout = QtGui.QVBoxLayout() self.layout.setContentsMargins(0,0,0,0) self.layout.setSpacing(0) self.setLayout(self.layout) ## setting up the menu bar self.menuBar = QtGui.QMenuBar() self.layout.setMenuBar(self.menuBar) self.viewMenu = self.menuBar.addMenu('View') self.modeMenu = self.menuBar.addMenu('Mode') self.transformMenu = self.menuBar.addMenu('Transform') self.intMenu = self.menuBar.addMenu('Interpretation') # VIEW MENU self.autoScaleButton = QtGui.QAction('Auto scale',self,checkable=True) self.autoScaleButton.setChecked(True) self.showArrivalsButton = QtGui.QAction('Arrivals',self,checkable=True) self.showArrivalsButton.setDisabled(True) self.showTableButton = QtGui.QAction('Table',self) self.yAxisMenu = self.viewMenu.addMenu('y axis') self.editGradientsButton = QtGui.QAction('Edit Gradients',self) self.invertYButton = QtGui.QAction('Invert y axis',self,checkable=True) self.viewMenu.addAction(self.autoScaleButton) self.viewMenu.addAction(self.showArrivalsButton) self.viewMenu.addAction(self.showTableButton) self.viewMenu.addAction(self.editGradientsButton) self.viewMenu.addAction(self.invertYButton) # MODE MENU self.modeGroup = QtGui.QActionGroup(self) self.waveFormButton = QtGui.QAction('Wave Forms',self,checkable=True) self.contourButton = QtGui.QAction('Contours',self,checkable=True) self.waveFormButton.setActionGroup(self.modeGroup) self.contourButton.setActionGroup(self.modeGroup) self.contourButton.setChecked(True) self.modeMenu.addAction(self.waveFormButton) self.modeMenu.addAction(self.contourButton) # INTERPRETATION MENU self.pickArrivalsButton = QtGui.QAction('Pick arrivals',self) self.handPickArrivalsButton = QtGui.QAction('Hand pick',self,checkable=True) self.moduliButton = QtGui.QAction('Elastic moduli',self) self.moduliButton.setDisabled(True) self.handPickArrivalsButton.setDisabled(True) self.intMenu.addAction(self.pickArrivalsButton) self.intMenu.addAction(self.handPickArrivalsButton) self.intMenu.addAction(self.moduliButton) # TRANSFORM MENU self.showForrierMagnitudeButton = QtGui.QAction('Fourrier magnitude',self) self.showForrierPhasesButton = QtGui.QAction('Fourrier phases',self) self.filteringButton = QtGui.QAction('Frequency filtering',self,checkable=True) self.transformMenu.addAction(self.showForrierMagnitudeButton) self.transformMenu.addAction(self.showForrierPhasesButton) self.transformMenu.addAction(self.filteringButton) # dict to store actions for y Axis self.yAxisButtons = {} self.yAxisGroup = QtGui.QActionGroup(self) self.yAxisButtons['Track #'] = QtGui.QAction('Track #',self,checkable=True) self.yAxisButtons['Track #'].setActionGroup(self.yAxisGroup) self.yAxisMenu.addAction(self.yAxisButtons['Track #']) self.yAxisButtons['Track #'].setChecked(True) # for wave in WaveTypes: # split main widget into plotting area and parameters area self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.layout.addWidget(self.splitter) # split parameter area into 3 for each wave self.treeSplitter = QtGui.QSplitter() self.treeSplitter.setOrientation(QtCore.Qt.Vertical) self.splitter.addWidget(self.treeSplitter) # create parameter trees self.trees={} for wave in WaveTypes: self.trees[wave] = ParameterTree(showHeader=False) self.treeSplitter.addWidget(self.trees[wave]) # create layout for the plotting area self.sublayout = pg.GraphicsLayoutWidget() self.splitter.addWidget(self.sublayout) self.params = {} self.plots = {} for wave in WaveTypes: # create parameter instances self.params[wave] = Parameter.create(name=wave + ' wave', type='group',children=Parameters) self.trees[wave].setParameters(self.params[wave],showTop=True) # fill plotting area with 3 plots # self.plots[wave] = self.sublayout.addPlot() self.plots[wave] = self.sublayout.addPlot(viewBox=ViewBox()) setup_plot(self.plots[wave]) self.sublayout.nextRow() self.params['Sx'].param('Arrival times').param('BTA').setValue(36) self.params['Sx'].param('Arrival times').param('ATA').setValue(5) self.params['Sx'].param('Arrival times').param('DTA').setValue(20) self.params['Sy'].param('Arrival times').param('BTA').setValue(100) self.params['Sy'].param('Arrival times').param('ATA').setValue(5) self.params['Sy'].param('Arrival times').param('DTA').setValue(30) # create table widget to show arrival times self.QTable = TableWidget(['Number P','Number Sx','Number Sy','P','Sx','Sy']) # self.splitter.addWidget(self.QTable) self.QTable.setColumnCount(6) self.QTable.hide() self.splitter.setSizes([int(self.width()*0.30), int(self.width()*0.35), int(self.width()*0.35) ]) self.splitter.setStretchFactor(0, 0) self.splitter.setStretchFactor(1, 1) self.splitter.setStretchFactor(2, 0)