export plot/data
This covers both plot image and data export, since the UI should be fairly unified for both. We now have basic PNG export, but also want to support SVG, PDF, and HDF5 export as well.
I've experimented with the pyqtgraph exporter, and it has some nice features, such as ability to specify the background color, invert colors, antialias, specify size, etc. But it's not tuned enough for the specific needs of ndscope, so I don't think we can use it directly.. That said, we may be able to leverage some of the pyqtgraph Exporters:
At the very least we can look at their code to see what they're doing.
Note: to get SVG export working from the pyqtgraph exporter install the python3-pyqt5.qtsvg
package.
I've determined we could move the t0 label back into the GraphicsView so that the pyqtgraph Exporters would include it.
- We should be able to leverage the pyqtgraph SVGExporter fairly easily.
- Once we have SVG we should be abl to convert to PDF fairly easily.
- The HDF5 Exporter is not well suited for our needs. It takes the data from the curves being displayed in the plots, but there are plot curves that we don't want to export. We also want the HDF5 file to be keyed by the channel names. The data can instead just be extracted from the DataSource directly, and we can create our own output file.
- Export type can probably just be determined by the extension, with no other input required.