本文整理汇总了Python中pyqtgraph.dockarea.Dock类的典型用法代码示例。如果您正苦于以下问题:Python Dock类的具体用法?Python Dock怎么用?Python Dock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dock类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, *args, **kwargs):
self.tab = kwargs.pop("tab", None)
self.main = kwargs.pop("main", None)
self.automaticDraw = True
Dock.__init__(self, *args, **kwargs)
self.dockArea = GoodnessDock.GoodnessTab(main = self.main, tab = self, tabName = "goodnessTab")
self.addWidget(self.dockArea)
开发者ID:david-hoffman,项目名称:SMolPhot,代码行数:8,代码来源:ResultsTab.py
示例2: __init__
def __init__(self, *args, **kwargs):
self.tab = kwargs.pop("tab", None)
self.main = kwargs.pop("main", None)
self.automaticDraw = True
Dock.__init__(self, *args, **kwargs)
self._dockarea = IterationsDock.Tab(main = self.main, tab = self, tabName = "IterationsTab")
self.addWidget(self._dockarea)
开发者ID:david-hoffman,项目名称:SMolPhot,代码行数:9,代码来源:FramesTab.py
示例3: __init__
def __init__(self, *args, **kwargs):
self.tab = kwargs.pop("tab", None)
self.main = kwargs.pop("main", None)
self.automaticDraw = True
Dock.__init__(self, self.name(), **kwargs)
self.imv = MyImageView()
self.imv.setContentsMargins(2, 2, 2, 2)
self.addWidget(self.imv)
开发者ID:david-hoffman,项目名称:SMolPhot,代码行数:9,代码来源:Utils.py
示例4: onAddPlot
def onAddPlot(self):
name, ok = QtGui.QInputDialog.getText(self, 'Plot Name', 'Please enter a plot name: ')
if ok and name!= 'Autoload':
name = str(name)
dock = Dock(name)
widget = DateTimePlotWidget(self)
view = widget._graphicsView
self.area.addDock(dock, "bottom")
dock.addWidget(widget)
self.plotDict[name] = {"dock":dock, "widget":widget, "view":view}
开发者ID:pyIonControl,项目名称:IonControl,代码行数:10,代码来源:DedicatedCounters.py
示例5: onAddPlot
def onAddPlot(self):
name, ok = QtWidgets.QInputDialog.getText(self, 'Plot Name', 'Please enter a plot name: ')
if ok:
name = str(name)
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}
self.plotConfigurationChanged.emit( self.plotDict )
开发者ID:pyIonControl,项目名称:IonControl,代码行数:11,代码来源:PicoampMeterUi.py
示例6: __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
示例7: add_plot_dock
def add_plot_dock(self, depth, widget):
dock = Dock(depth, size=(1,1), closable=False, autoOrientation=False)
split_dock_widget = SplitDockWidget(widget)
### Connect signals ###
self.s.x_range_updated.connect(widget.set_x_range)
self.s.y_range_updated.connect(widget.set_y_range)
widget.s.title_updated.connect(dock.setTitle)
if settings.annotation_on:
self.toggle_annotation.toggled.connect(split_dock_widget.toggle_second_widget)
dock.addWidget(split_dock_widget)
self.selected_depths[depth] = dock
开发者ID:eagonmeng,项目名称:Bamboo,代码行数:14,代码来源:graph_area.py
示例8: 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
示例9: 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
示例10: 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
示例11: check_dock
def check_dock(self):
if self.plot is not None:
self.plot.setParent(None)
self.plot = self.plot_type()()
if self.dock is None:
self.dock = Dock(self.name(), widget=self.plot)
win.outputs_dock_area.addDock(self.dock)
else:
self.dock.addWidget(self.plot)
开发者ID:PhilReinhold,项目名称:qutip_explorer,代码行数:9,代码来源:qutip_explorer.py
示例12: 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
示例13: 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
示例14: 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
示例15: load_protocol
def load_protocol(self, path):
lua = lupa.LuaRuntime(attribute_handlers=(getter, setter))
self.lua = lua
lua.globals()["flow"] = flow
lua.globals()["channels"] = self.context.get_channels()
lua.globals()["context"] = self.context
source = open(path).read()
try:
lua.execute(source)
self.guiBlocks = lua.eval('setup()')
#lua.eval('gui()')
except Exception as e:
print ('Lua Exception occured: ', e, type(e))
raise
for block in self.guiBlocks:
dock = Dock(block.name)
dock.addWidget(block.widget())
self.dockarea.addDock(dock)
if 'doc_config' in lua.globals():
self.restore_layout()
开发者ID:abiggerhammer,项目名称:OpenNFB,代码行数:23,代码来源:launcher.py
示例16: __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
示例17: 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
示例18: 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
示例19: 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
示例20: add_widgets
def add_widgets(self):
# Main window with dock area
self.dock_area = DockArea()
self.setCentralWidget(self.dock_area)
# Docks
dock_occcupancy = Dock("Occupancy", size=(400, 400))
dock_run_config = Dock("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))
self.dock_area.addDock(dock_run_config, 'left')
self.dock_area.addDock(dock_occcupancy, 'above', dock_run_config)
self.dock_area.addDock(dock_tdc, 'right', dock_occcupancy)
self.dock_area.addDock(dock_tot, 'above', dock_tdc)
self.dock_area.addDock(dock_service_records, 'bottom', dock_occcupancy)
self.dock_area.addDock(dock_trigger_status, 'above', dock_service_records)
self.dock_area.addDock(dock_event_status, 'above', dock_trigger_status)
self.dock_area.addDock(dock_hit_timing, 'bottom', dock_tot)
self.dock_area.addDock(dock_status, 'top')
# Status widget
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=1)
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)
dock_status.addWidget(cw)
# Config dock
self.run_conf_list_widget = Qt.QListWidget()
dock_run_config.addWidget(self.run_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)
hit_timing_widget.showGrid(y=True)
dock_hit_timing.addWidget(hit_timing_widget)
开发者ID:CARIBOuSystem,项目名称:pyBAR,代码行数:90,代码来源:online_monitor.py
注:本文中的pyqtgraph.dockarea.Dock类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论