Data storage
HDF5 data management: subscription, scheduled/manual saving and history read-back, with integrated plotting panels.
Overview
quatm/GUI/h5storage/ provides the HDF5 data storage GUI (a package split out of the former
single file, with its public symbols re-exported at package level): three kinds of data manager —
aggregate, single-stream and image — subscribe to data and save it automatically at a scheduled
time, periodically, or on a Looper command; the current snapshot can also be written to an .h5
file in the background, and historical measurements read back from a file.
Components
| Component | Module | Description |
|---|---|---|
H5StorageGui | main_window.py | Main window: data tabs, save/scheduled-save controls and plot management |
H5StorageDataMgr | data_manager.py | Host for the three data managers: subscription management, save/read-back, clearing |
H5SaveWorker | workers.py | Worker thread that writes the .h5 file, keeping disk I/O off the Qt event loop |
H5DataPlotter / EventPlotter | plotters.py | Plotting tabs for measurement data / event data |
XAxisWidget / YAxisWidget | axes.py | Data selection and filter-chain configuration for the x axis and each y axis |
BinningWidget / FilterWidget / FittingWidget | widgets.py / fitting.py | binning, filtering and ODR fitting processing chain |
Saving modes (H5StorageDataMgr)
| Method | Description |
|---|---|
toggle_scheduled_save | Toggles saving at a scheduled time (saves automatically and notifies when the time arrives) |
toggle_regular_save | Toggles periodic automatic saving every N hours |
scheduled_save_by_looper | Responds to save commands from the Looper (final / intermittent) |
savetoFile | Writes the current data snapshot to an .h5 file in the background |
loadFromFile | Loads historical measurements from an existing .h5 file and refreshes the interface |
selectDatadir | Chooses the target h5 file manually (to avoid falling back to the daily default name) |
clear | Clears the entire cache of the three data managers |
Usage
from quatm.GUI.h5storage import H5StorageGui # package-level re-export
win = H5StorageGui(parent=parent)
win.show()
Data saving is performed by the background H5SaveWorker: the GUI thread copies the data snapshot
first and then hands it to the worker, so writing to HDF5 on disk never blocks the interface.