Live scroll plot

Live scrolling plots: ring buffers, running averages and data-stream subscription.

Overview

quatm/GUI/entries/live_plot.py provides live scrolling plots: ScrollWindow is a multi-subplot main window in which each ScrollPlot subplot subscribes to several channels of one data stream, maintains a ring buffer and scrolls scatter/curve data and a running average; PlotDataEditor provides the data-source drop-down panel.

Components

ComponentDescription
ScrollWindowMulti-subplot scrolling main window: restores or creates subplots from the properties; the toolbar can append subplots
ScrollPlotScrolling subplot: ring buffer, scatter and running-average curves, context-menu operations
PlotDataEditorData-source selection panel: drop-down candidates written back to the properties/parent plot

Key methods (ScrollPlot)

MethodDescription
feedDataPushes a new data block into the buffer array
setnewDataPeriodically pulls new data into the buffer and refreshes the curves
updatePlotFlushes the valid data in the buffer to the scatter and running-average curves
running_meanComputes an N-point running average efficiently from cumulative sums and differences
dataSelectDialogSelects the data channels displayed in this plot
subscribe_windowOpens the subscription editor to resubscribe the data stream
configureWindowPauses refreshing and edits this plot’s properties inline
deletePlotRemoves this plot from the parent window and clears its properties

Usage

from quatm.GUI.entries.live_plot import ScrollWindow

host = ScrollWindow(name="PMT scroll monitor", parent=parent)
host.addPlot()   # append a scrolling subplot

Afterwards, subscribe to data streams, select channels and adjust the display from the context menu of a subplot. Configurations such as the buffer length, the running-average switch and the window size are stored in the properties and restored automatically after a restart.