本文整理汇总了Python中pyqtgraph.dockarea.DockArea类的典型用法代码示例。如果您正苦于以下问题:Python DockArea类的具体用法?Python DockArea怎么用?Python DockArea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DockArea类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup_widgets
def setup_widgets(self, parent, name):
dock_area = DockArea()
parent.addTab(dock_area, name)
dock_position = Dock("Position")
dock_area.addDock(dock_position)
# Position 2d plot
position_graphics = pg.GraphicsLayoutWidget()
position_graphics.show()
view = position_graphics.addViewBox()
self.position_img = pg.ImageItem(border='w')
view.addItem(self.position_img)
dock_position.addWidget(position_graphics)
# Status widget
dock_status = Dock("Status", size=(800, 1))
dock_area.addDock(dock_status, 'top')
cw = QtGui.QWidget()
cw.setStyleSheet("QWidget {background-color:white}")
layout = QtGui.QGridLayout()
cw.setLayout(layout)
self.spin_box = Qt.QSpinBox(value=1)
self.spin_box.setMaximum(10)
self.spin_box.setSuffix(" Threshold")
layout.addWidget(self.spin_box, 0, 6, 0, 1)
dock_status.addWidget(cw)
self.spin_box.valueChanged.connect(lambda value: self.send_command(str(value)))
开发者ID:SiLab-Bonn,项目名称:online_monitor,代码行数:30,代码来源:bidirectional_receiver.py
示例2: addTempArea
def addTempArea(self):
if self.home is None:
area = DockArea(temporary=True, home=self)
self.tempAreas.append(area)
win = TempAreaWindow(area, self)
area.win = win
win.show()
else:
area = self.home.addTempArea()
#print 'added temp area', area, area.window()
return area
开发者ID:eagonmeng,项目名称:Bamboo,代码行数:11,代码来源:graph_area.py
示例3: addTempArea
def addTempArea(self):
if self.home is None:
area = DockArea(temporary=True, home=self)
self.tempAreas.append(area)
win = TempAreaWindow(area)
win.setWindowFlags(Qt.Qt.WindowMinimizeButtonHint)
area.win = win
win.show()
else:
area = self.home.addTempArea()
#print "added temp area", area, area.window()
return area
开发者ID:jhennies,项目名称:orthos,代码行数:12,代码来源:dockArea_nonClosableDocks.py
示例4: MainWindow
class MainWindow(QMainWindow, Ui_MainWindow):
"""The only window of the application."""
def __init__(self, settings):
super(MainWindow, self).__init__()
self.settings = settings
self.setupUi(self)
self.dock_area = DockArea()
self.setCentralWidget(self.dock_area)
self.createDocks()
self.loadSettings()
def createDocks(self):
self.zmq_subscriber = ZMQSubscriber(self.settings, self)
self.zmq_subscriber_dock = Dock('Subscriber',
widget=self.zmq_subscriber)
self.dock_area.addDock(self.zmq_subscriber_dock)
def loadSettings(self):
"""Load window state from self.settings"""
self.settings.beginGroup('mainwindow')
geometry = self.settings.value('geometry').toByteArray()
state = self.settings.value('windowstate').toByteArray()
dock_string = str(self.settings.value('dockstate').toString())
if dock_string is not "":
dock_state = eval(dock_string)
self.dock_area.restoreState(dock_state)
self.settings.endGroup()
self.restoreGeometry(geometry)
self.restoreState(state)
def saveSettings(self):
"""Save window state to self.settings."""
self.settings.beginGroup('mainwindow')
self.settings.setValue('geometry', self.saveGeometry())
self.settings.setValue('windowstate', self.saveState())
dock_state = self.dock_area.saveState()
# dock_state returned here is a python dictionary. Coundn't find a good
# way to save dicts in QSettings, hence just using representation
# of it.
self.settings.setValue('dockstate', repr(dock_state))
self.settings.endGroup()
def closeEvent(self, event):
self.zmq_subscriber.saveSettings()
self.saveSettings()
开发者ID:shreyaspotnis,项目名称:streamlogger,代码行数:52,代码来源:MainWindow.py
示例5: setup_plots
def setup_plots(self, parent, name):
dock_area = DockArea()
parent.addTab(dock_area, name)
dock_position = Dock("Position Correlation")
dock_area.addDock(dock_position)
# Position 2d plot
position_graphics = pg.GraphicsLayoutWidget()
position_graphics.show()
view = position_graphics.addViewBox()
self.position_img = pg.ImageItem(border='w')
view.addItem(self.position_img)
dock_position.addWidget(position_graphics)
开发者ID:leloup314,项目名称:online_monitor,代码行数:14,代码来源:position_correlator_receiver.py
示例6: __init__
def __init__(self, settings):
super(MainWindow, self).__init__()
self.settings = settings
self.setupUi(self)
# MainWindow is a collection of widgets in their respective docks.
# We make DockArea our central widget
self.dock_area = DockArea()
self.setCentralWidget(self.dock_area)
self.createDocks()
self.initAfterCreatingDockWidgets()
self.loadSettings()
self.connectSignalsToSlots()
# all signals in place, send out the first image
# self.image_browser.populateAndEmitImageInfo()
self.image_browser.initialEmit()
self.roi_editor_h.initialEmit()
self.roi_editor_v.initialEmit()
self.roi_editor_int.initialEmit()
self.roi_editor_err.initialEmit()
self.loadPlugins()
开发者ID:shreyaspotnis,项目名称:ipbec,代码行数:25,代码来源:MainWindow.py
示例7: initDialog
def initDialog(self,results=None,KData=None,bDrawText=False):
# 1) creates layouts
dialog = QtGui.QDialog()
mainLayout = QtGui.QHBoxLayout()
rightLayout = QtGui.QVBoxLayout()
mainLayout.addLayout(rightLayout)
dialog.setLayout(mainLayout)
dialog.setWindowTitle(('Strategy Results'))
# 2) creates widgets
from Widgets.pgCandleWidgetCross import pgCandleWidgetCross
from Widgets.pgCrossAddition import pgCrossAddition
from pyqtgraph.dockarea import DockArea,Dock
area = DockArea()
## Create docks, place them into the window one at a time.
## Note that size arguments are only a suggestion; docks will still have to
## fill the entire dock area and obey the limits of their internal widgets.
d1 = Dock("price", size=(200,100))
d2 = Dock("position", size=(200,100))
area.addDock(d1, 'bottom')
area.addDock(d2, 'bottom')
rightLayout.addWidget(area)
pgCandleView = pgCandleWidgetCross(dataForCandle=KData)
PyqtGraphindicators = pgCrossAddition()
toShow = pgCandleView
self.pricePlot(toShow)
d1.addWidget(toShow)
PyqtGraphPosition = pgCrossAddition()
self.positionPlot(PyqtGraphPosition)
d2.addWidget(PyqtGraphPosition)
PyqtGraphPosition.showGrid(x=True, y=True)
PyqtGraphPosition.setXLink(toShow)
return dialog
开发者ID:UpSea,项目名称:ZipLineMid,代码行数:44,代码来源:PriceScatter.py
示例8: __init__
def __init__(self):
logging.debug('Creating main window.')
QtGui.QMainWindow.__init__(self)
self.setWindowTitle("colorgraphs dock")
self.dockarea = DockArea()
self.setCentralWidget(self.dockarea)
self.resize(*_MAIN_WINDOW_SIZE)
self.initUI()
self.show()
self.raise_()
开发者ID:guenp,项目名称:colorgraphs,代码行数:10,代码来源:dockwin.py
示例9: __init__
def __init__(self):
DockArea.__init__(self)
self.project_tree_dock = Dock(u"Project Tree", hideTitle=True)
self.addDock(self.project_tree_dock,
'top') #'above', self.flowcharts_dock)
self.project_tree = SegmentTreeWidget()
self.project_tree_dock.addWidget(self.project_tree)
self.properties_table = TableWidget(sortable=False, editable=False)
self.properties_table.setFormat("%.3f",1)
self.properties_table.setColumnCount(1)
self.properties_table.contextMenu.clear()
self.properties_table.horizontalHeader().hide()
self.properties_dock = Dock("Selected Object Properties",
widget=self.properties_table,
hideTitle=True)
self.addDock(self.properties_dock, 'bottom')
MarkWriteMainWindow.instance().sigProjectChanged.connect(
self.handleProjectChange)
MarkWriteMainWindow.instance().sigSegmentCreated.connect(
self.handleSegmentCreated)
MarkWriteMainWindow.instance().sigSegmentRemoved.connect(
self.handleSegmentRemoved)
MarkWriteMainWindow.instance().sigActiveObjectChanged.connect(
self.handleActiveObjectChanged)
self.project_tree.currentItemChanged.connect(
self.currentTreeItemChangedEvent)
self.project_tree.itemDoubleClicked.connect(
self.treeItemDoubleClickedEvent)
self.project_tree.customContextMenuRequested.connect(
self.rightClickTreeEvent)
# self.project_tree.itemSelectionChanged.connect(self.handleItemSelectionChanged)
self.project_tree.setExpandsOnDoubleClick(False)
self.doNotSetActiveObject=False
开发者ID:isolver,项目名称:OpenHandWrite,代码行数:42,代码来源:segmenttree.py
示例10: __init__
def __init__(self, settings):
super(MainWindow, self).__init__()
self.settings = settings
self.setupUi(self)
self.dock_area = DockArea()
self.setCentralWidget(self.dock_area)
self.createDocks()
self.loadSettings()
开发者ID:shreyaspotnis,项目名称:streamlogger,代码行数:12,代码来源:MainWindow.py
示例11: __init__
def __init__(self, deviceClass, config, parent=None):
Base.__init__(self, parent)
Form.__init__(self)
Form.setupUi(self, self)
self.config = config
self.configname = "AWGOptimizer"
self.setWindowTitle("AWG Optimizer")
guiState = self.config.get(self.configname+".guiState")
state = self.config.get(self.configname+'.state')
pos = self.config.get(self.configname+'.pos')
size = self.config.get(self.configname+'.size')
isMaximized = self.config.get(self.configname+'.isMaximized')
restoreGuiState(self, self.config.get(self.configname+".guiState"))
if state: self.restoreState(state)
if pos: self.move(pos)
if size: self.resize(size)
if isMaximized: self.showMaximized()
self.show()
self.awgUi = AWGUi(deviceClass, config, dict())
self.awgUi.setupUi(self.awgUi)
self.splitter.insertWidget(1, self.awgUi)
#oscilloscope plot window
name = "Oscilloscope Trace"
self.scopeDock = Dock(name)
self.scopePlot = CoordinatePlotWidget(self, name=name)
self.scopeView = self.scopePlot._graphicsView
self.scopeDock.addWidget(self.scopePlot)
self.area = DockArea()
self.area.addDock(self.scopeDock)
self.plotDict ={name: {"dock":self.scopeDock, "widget":self.scopePlot, "view":self.scopeView}}
self.verticalLayout.insertWidget(0, self.area)
#trace ui
self.penicons = pens.penicons().penicons()
self.traceui = Traceui.Traceui(self.penicons, self.config, self.configname, self.plotDict, hasMeasurementLog=False, highlightUnsaved=False)
self.traceui.setupUi(self.traceui)
traceDock = Dock("Traces")
traceDock.addWidget(self.traceui)
self.area.addDock(traceDock, 'left')
self.device = self.awgUi.device
self.measureWaveformButton.clicked.connect(self.onMeasureWaveform)
self.optimizeButton.clicked.connect(self.onOptimize)
dockAreaState = self.config.get(self.configname+'.dockAreaState')
try:
if dockAreaState: self.area.restoreState(dockAreaState)
except Exception as e:
print(e)
开发者ID:pyIonControl,项目名称:IonControl,代码行数:51,代码来源:AWGOptimizer.py
示例12: setup_status_widget
def setup_status_widget(self, parent): # Visualizes the nodes + their connections + CPU usage
# Status dock area showing setup
dock_area = DockArea()
parent.addTab(dock_area, 'Status')
self.status_dock = Dock("Status")
dock_area.addDock(self.status_dock)
# GraphicsLayout to align graphics
status_graphics_widget = pg.GraphicsLayoutWidget()
status_graphics_widget.show()
self.status_dock.addWidget(status_graphics_widget)
try:
self.configuration['receiver']
except KeyError:
return
# Create nodes with links from configuration file for converter/receiver
for receiver_index, (receiver_name, receiver_settings) in enumerate(self.configuration['receiver'].items()):
# Add receiver info
view = status_graphics_widget.addViewBox(row=receiver_index, col=5, lockAspect=True, enableMouse=False)
text = pg.TextItem('Receiver\n%s' % receiver_name, border='b', fill=(0, 0, 255, 100), anchor=(0.5, 0.5), color=(0, 0, 0, 200))
text.setPos(0.5, 0.5)
view.addItem(text)
# Add corresponding producer info
try:
if self.configuration['converter']:
try:
actual_converter = self.configuration['converter'][receiver_name]
view = status_graphics_widget.addViewBox(row=receiver_index, col=1, lockAspect=True, enableMouse=False)
text = pg.TextItem('Producer\n%s' % receiver_name, border='b', fill=(0, 0, 255, 100), anchor=(0.5, 0.5), color=(0, 0, 0, 200))
text.setPos(0.5, 0.5)
view.addItem(text)
view = status_graphics_widget.addViewBox(row=receiver_index, col=3, lockAspect=True, enableMouse=False)
text = pg.TextItem('Converter\n%s' % receiver_settings, border='b', fill=(0, 0, 255, 100), anchor=(0.5, 0.5), color=(0, 0, 0, 200))
text.setPos(0.5, 0.5)
view.addItem(text)
except KeyError: # no converter for receiver
pass
except KeyError: # No converter defined in configruation
pass
开发者ID:SiLab-Bonn,项目名称:online_monitor,代码行数:38,代码来源:OnlineMonitor.py
示例13: _InitDocks
def _InitDocks(self):
# Define docking area
if hasattr(self, "_dockArea"):
self._dockArea.setParent(None)
self._dockArea = DockArea()
self._plotDocks = self._defaultDockPos.keys()
# Add dock to area
for dock, pos in self._defaultDockPos.iteritems():
self._dockArea.addDock(dock, *pos)
self._layout.addWidget(self._dockArea, 0, 0, 1, 1)
开发者ID:david-hoffman,项目名称:SMolPhot,代码行数:14,代码来源:Utils.py
示例14: setupPlots
def setupPlots(self):
self.area = DockArea()
self.setCentralWidget(self.area)
self.plotDict = dict()
# initialize all the plot windows we want
plotNames = self.config.get( 'PlotNames', ['Scan'] )
if len(plotNames)<1:
plotNames.append('Scan')
for name in plotNames:
dock = Dock(name)
widget = CoordinatePlotWidget(self)
view = widget._graphicsView
self.area.addDock(dock, "bottom")
dock.addWidget(widget)
self.plotDict[name] = {"dock":dock, "widget":widget, "view":view}
开发者ID:pyIonControl,项目名称:IonControl,代码行数:15,代码来源:PicoampMeterUi.py
示例15: setupPlots
def setupPlots(self):
self.area = DockArea()
self.setCentralWidget(self.area)
self.plotDict = SequenceDict()
# initialize all the plot windows we want
plotNames = self.config.get(self.configName+'.PlotNames', ['Plot'])
if len(plotNames) < 1:
plotNames.append('Plot')
if 'Autoload' not in plotNames:
plotNames.append('Autoload')
for name in plotNames:
dock = Dock(name)
widget = DateTimePlotWidget(self, name=name)
view = widget._graphicsView
self.area.addDock(dock, "bottom")
dock.addWidget(widget)
self.plotDict[name] = {"dock":dock, "widget":widget, "view":view}
开发者ID:pyIonControl,项目名称:IonControl,代码行数:17,代码来源:DedicatedCounters.py
示例16: __init__
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("Liveplot")
self.dockarea = DockArea()
self.setCentralWidget(self.dockarea)
self.namelist = NameList(self)
self.addDockWidget(QtConst.LeftDockWidgetArea, self.namelist)
self.ctx = zmq.Context()
sock = self.ctx.socket(zmq.SUB)
sock.bind('tcp://127.0.0.1:7755')
sock.setsockopt(zmq.SUBSCRIBE, '')
self.conn = ZMQSocket(sock)
self.conn.readyRead.connect(lambda: self.read_from(self.conn))
self.bytes = bytearray()
self.target_size = 0
self.meta = None
self.insert_dock_right = True
self.conns = []
开发者ID:episodeyang,项目名称:liveplot,代码行数:18,代码来源:window.py
示例17: add_widgets
def add_widgets(self):
# Main window with dock area
self.dock_area = DockArea()
self.setCentralWidget(self.dock_area)
# Docks
dock_waveform = Dock("Waveform", size=(600, 400))
dock_histogram = Dock("Histogram", size=(600, 400))
dock_status = Dock("Status", size=(1200, 40))
self.dock_area.addDock(dock_waveform, 'left')
self.dock_area.addDock(dock_histogram, 'right', dock_waveform)
self.dock_area.addDock(dock_status, 'top')
# Status widget
cw = QtGui.QWidget()
cw.setStyleSheet("QWidget {background-color:white}")
layout = QtGui.QGridLayout()
layout.setColumnStretch(2, 1)
cw.setLayout(layout)
self.event_rate_label = QtGui.QLabel("Event Rate\n0 Hz")
self.total_events_label = QtGui.QLabel("Total Events\n0")
self.spin_box = Qt.QSpinBox(value=20, maximum=1000)
self.reset_button = Qt.QPushButton('Reset', self)
self.reset_button.clicked.connect(self.reset_plots)
layout.addWidget(self.event_rate_label, 0, 1, 1, 1)
layout.addWidget(self.total_events_label, 1, 1, 1, 1)
layout.addWidget(self.spin_box, 0, 3, 1, 1)
layout.addWidget(self.reset_button, 1, 3, 1, 1)
dock_status.addWidget(cw)
# Different plot docks
waveform_widget = pg.PlotWidget(background="w")
self.waveform_plot = waveform_widget.plot(range(0, 200), np.zeros(shape=(200)))
self.thr_line = pg.InfiniteLine(pos=1000, angle=0, pen={'color':0.0, 'style':QtCore.Qt.DashLine})
waveform_widget.addItem(self.thr_line)
dock_waveform.addWidget(waveform_widget)
histogram_widget = pg.PlotWidget(background="w")
self.histogram_plot = histogram_widget.plot(range(0, 2**14 + 1), np.zeros(shape=(2**14)), stepMode=True)
histogram_widget.showGrid(y=True)
self.thr_line_hist = pg.InfiniteLine(pos=1000, angle=90, pen={'color':0.0, 'style':QtCore.Qt.DashLine})
histogram_widget.addItem(self.thr_line_hist)
dock_histogram.addWidget(histogram_widget)
开发者ID:SiLab-Bonn,项目名称:MCA,代码行数:44,代码来源:online_monitor.py
示例18: initDialogSummary
def initDialogSummary(self,result,KData=None):
# 1) creates layouts
dialog = QtGui.QDialog()
mainLayout = QtGui.QHBoxLayout()
rightLayout = QtGui.QVBoxLayout()
mainLayout.addLayout(rightLayout)
dialog.setLayout(mainLayout)
dialog.setWindowTitle(('Strategy Results'))
import os,sys
xpower = os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir,os.pardir,os.pardir,'midProjects','histdataUI'))
sys.path.append(xpower)
from Widgets.pgCandleWidgetCross import pgCandleWidgetCross
from Widgets.pgCrossAddition import pgCrossAddition
from pyqtgraph.dockarea import DockArea,Dock
area = DockArea()
rightLayout.addWidget(area)
# 2) creates widgets
# 2.1)candle
pgCandleView = pgCandleWidgetCross(dataForCandle=KData)
dCandle = Dock("candles",closable=True, size=(200,300)) ## give this dock the minimum possible size
area.addDock(dCandle, 'bottom')
dCandle.addWidget(pgCandleView)
# 2) creates widgets
# 2.3)position_cost
if(True):
PyqtGraphPositionCost = pgCrossAddition()
self.availableCashPlot(PyqtGraphPositionCost)
dAvailableCash = Dock("available_cash",closable=True, size=(200,100))
area.addDock(dAvailableCash, 'bottom')
dAvailableCash.addWidget(PyqtGraphPositionCost)
PyqtGraphPositionCost.setXLink(pgCandleView)
# 2.3)position_cost
if(True):
PyqtGraphPositionCost = pgCrossAddition()
self.portfolioPlot(PyqtGraphPositionCost)
dPortfolioValue = Dock("portfolio_value",closable=True, size=(200,100))
area.addDock(dPortfolioValue, 'bottom')
dPortfolioValue.addWidget(PyqtGraphPositionCost)
PyqtGraphPositionCost.setXLink(pgCandleView)
return dialog
开发者ID:UpSea,项目名称:PyAlgoTradeMid,代码行数:44,代码来源:midBaseAnalyzer.py
示例19: __init__
def __init__(self, file):
super(H5Plotter, self).__init__()
view_box = SearchableH5View(H5File(file))
self.view = view_box.tree_view
self.match_model = self.view.model()
self.model = self.match_model.sourceModel()
self.dock_area = DockArea()
self.layout = QtGui.QSplitter(Qt.Horizontal)
self.setCentralWidget(self.layout)
self.view.activated.connect(self.load_plot)
self.layout.addWidget(view_box)
self.layout.addWidget(self.dock_area)
self.layout.setStretchFactor(0, 0)
self.layout.setStretchFactor(1, 1)
self.setWindowIcon(QtGui.QIcon("icon.ico"))
QtGui.QShortcut(QtGui.QKeySequence(Qt.CTRL | Qt.Key_N), self,
lambda: self.move_view_cursor(QtGui.QAbstractItemView.MoveDown))
QtGui.QShortcut(QtGui.QKeySequence(Qt.CTRL | Qt.Key_P), self,
lambda: self.move_view_cursor(QtGui.QAbstractItemView.MoveUp))
QtGui.QShortcut(QtGui.QKeySequence(Qt.CTRL | Qt.Key_F), self,
lambda: self.move_view_cursor(QtGui.QAbstractItemView.MoveRight))
QtGui.QShortcut(QtGui.QKeySequence(Qt.CTRL | Qt.Key_B), self,
lambda: self.move_view_cursor(QtGui.QAbstractItemView.MoveLeft))
QtGui.QShortcut(QtGui.QKeySequence(Qt.CTRL | Qt.Key_S), self, view_box.search_box.setFocus)
view_menu = self.menuBar().addMenu("View")
toggle_attrs_action = QtGui.QAction("Attributes Visible", view_menu)
toggle_attrs_action.setCheckable(True)
toggle_attrs_action.triggered.connect(self.match_model.toggle_attrs_visible)
view_menu.addAction(toggle_attrs_action)
toggle_junk_action = QtGui.QAction("Junk Visible", view_menu)
toggle_junk_action.setCheckable(True)
toggle_junk_action.triggered.connect(self.match_model.toggle_junk_visible)
view_menu.addAction(toggle_junk_action)
开发者ID:PhilReinhold,项目名称:H5Explore,代码行数:39,代码来源:H5View.py
示例20: setup_widgets
def setup_widgets(self, parent, name):
dock_area = DockArea()
parent.addTab(dock_area, name)
# Docks
dock_occcupancy = Dock("Occupancy", size=(400, 400))
dock_run_config = Dock("Run configuration", size=(400, 400))
dock_global_config = Dock("Global configuration", size=(400, 400))
dock_tot = Dock("Time over threshold values (TOT)", size=(400, 400))
dock_tdc = Dock("Time digital converter values (TDC)", size=(400, 400))
dock_event_status = Dock("Event status", size=(400, 400))
dock_trigger_status = Dock("Trigger status", size=(400, 400))
dock_service_records = Dock("Service records", size=(400, 400))
dock_hit_timing = Dock("Hit timing (rel. BCID)", size=(400, 400))
dock_status = Dock("Status", size=(800, 40))
dock_area.addDock(dock_global_config, 'left')
dock_area.addDock(dock_run_config, 'above', dock_global_config)
dock_area.addDock(dock_occcupancy, 'above', dock_run_config)
dock_area.addDock(dock_tdc, 'right', dock_occcupancy)
dock_area.addDock(dock_tot, 'above', dock_tdc)
dock_area.addDock(dock_service_records, 'bottom', dock_occcupancy)
dock_area.addDock(dock_trigger_status, 'above', dock_service_records)
dock_area.addDock(dock_event_status, 'above', dock_trigger_status)
dock_area.addDock(dock_hit_timing, 'bottom', dock_tot)
dock_area.addDock(dock_status, 'top')
# Status dock on top
cw = QtGui.QWidget()
cw.setStyleSheet("QWidget {background-color:white}")
layout = QtGui.QGridLayout()
cw.setLayout(layout)
self.rate_label = QtGui.QLabel("Readout Rate\n0 Hz")
self.hit_rate_label = QtGui.QLabel("Hit Rate\n0 Hz")
self.event_rate_label = QtGui.QLabel("Event Rate\n0 Hz")
self.timestamp_label = QtGui.QLabel("Data Timestamp\n")
self.plot_delay_label = QtGui.QLabel("Plot Delay\n")
self.scan_parameter_label = QtGui.QLabel("Scan Parameters\n")
self.spin_box = Qt.QSpinBox(value=0)
self.spin_box.setMaximum(1000000)
self.spin_box.setSuffix(" Readouts")
self.reset_button = QtGui.QPushButton('Reset')
layout.addWidget(self.timestamp_label, 0, 0, 0, 1)
layout.addWidget(self.plot_delay_label, 0, 1, 0, 1)
layout.addWidget(self.rate_label, 0, 2, 0, 1)
layout.addWidget(self.hit_rate_label, 0, 3, 0, 1)
layout.addWidget(self.event_rate_label, 0, 4, 0, 1)
layout.addWidget(self.scan_parameter_label, 0, 5, 0, 1)
layout.addWidget(self.spin_box, 0, 6, 0, 1)
layout.addWidget(self.reset_button, 0, 7, 0, 1)
dock_status.addWidget(cw)
# Connect widgets
self.reset_button.clicked.connect(lambda: self.send_command('RESET'))
self.spin_box.valueChanged.connect(lambda value: self.send_command(str(value)))
# Run config dock
self.run_conf_list_widget = Qt.QListWidget()
dock_run_config.addWidget(self.run_conf_list_widget)
# Global config dock
self.global_conf_list_widget = Qt.QListWidget()
dock_global_config.addWidget(self.global_conf_list_widget)
# Different plot docks
occupancy_graphics = pg.GraphicsLayoutWidget()
occupancy_graphics.show()
view = occupancy_graphics.addViewBox()
self.occupancy_img = pg.ImageItem(border='w')
view.addItem(self.occupancy_img)
view.setRange(QtCore.QRectF(0, 0, 80, 336))
dock_occcupancy.addWidget(occupancy_graphics)
tot_plot_widget = pg.PlotWidget(background="w")
self.tot_plot = tot_plot_widget.plot(np.linspace(-0.5, 15.5, 17), np.zeros((16)), stepMode=True)
tot_plot_widget.showGrid(y=True)
dock_tot.addWidget(tot_plot_widget)
tdc_plot_widget = pg.PlotWidget(background="w")
self.tdc_plot = tdc_plot_widget.plot(np.linspace(-0.5, 4095.5, 4097), np.zeros((4096)), stepMode=True)
tdc_plot_widget.showGrid(y=True)
tdc_plot_widget.setXRange(0, 800, update=True)
dock_tdc.addWidget(tdc_plot_widget)
event_status_widget = pg.PlotWidget()
self.event_status_plot = event_status_widget.plot(np.linspace(-0.5, 15.5, 17), np.zeros((16)), stepMode=True)
event_status_widget.showGrid(y=True)
dock_event_status.addWidget(event_status_widget)
trigger_status_widget = pg.PlotWidget()
self.trigger_status_plot = trigger_status_widget.plot(np.linspace(-0.5, 7.5, 9), np.zeros((8)), stepMode=True)
trigger_status_widget.showGrid(y=True)
dock_trigger_status.addWidget(trigger_status_widget)
service_record_widget = pg.PlotWidget()
self.service_record_plot = service_record_widget.plot(np.linspace(-0.5, 31.5, 33), np.zeros((32)), stepMode=True)
service_record_widget.showGrid(y=True)
dock_service_records.addWidget(service_record_widget)
hit_timing_widget = pg.PlotWidget()
self.hit_timing_plot = hit_timing_widget.plot(np.linspace(-0.5, 15.5, 17), np.zeros((16)), stepMode=True)
#.........这里部分代码省略.........
开发者ID:SiLab-Bonn,项目名称:silab_online_monitor,代码行数:101,代码来源:pybar_fei4.py
注:本文中的pyqtgraph.dockarea.DockArea类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论