diff --git a/src/plotmanager.h b/src/plotmanager.h --- a/src/plotmanager.h +++ b/src/plotmanager.h @@ -26,12 +26,24 @@ #include #include #include +#include +#include #include #include "plot.h" #include "framebufferseries.h" #include "channelinfomodel.h" +struct PlotViewSettings +{ + bool showGrid; + bool showMinorGrid; + bool darkBackground; + bool showLegend; + bool showMulti; + Plot::ShowSymbols showSymbols; +}; + class PlotManager : public QObject { Q_OBJECT @@ -52,6 +64,10 @@ public: unsigned numOfCurves(); /// Returns the list of actions to be inserted into the `View` menu QList menuActions(); + /// Returns current status of menu actions + PlotViewSettings viewSettings() const; + /// Set the current state of view + void setViewSettings(const PlotViewSettings& settings); /// Stores plot settings into a `QSettings`. void saveSettings(QSettings* settings); /// Loads plot settings from a `QSettings`. @@ -71,7 +87,7 @@ public slots: /// Display an animation for snapshot void flashSnapshotOverlay(); /// Should be called to update zoom base - void onNumOfSamplesChanged(unsigned value); + void setNumOfSamples(unsigned value); private: bool isMulti; @@ -89,6 +105,7 @@ private: double _xMin; double _xMax; unsigned _numOfSamples; + Plot::ShowSymbols showSymbols; // menu actions QAction showGridAction; @@ -97,6 +114,11 @@ private: QAction darkBackgroundAction; QAction showLegendAction; QAction showMultiAction; + QAction setSymbolsAction; + QMenu setSymbolsMenu; + QAction* setSymbolsAutoAct; + QAction* setSymbolsShowAct; + QAction* setSymbolsHideAct; void setupLayout(bool multiPlot); /// Inserts a new plot widget to the current layout. @@ -105,6 +127,7 @@ private: Plot* plotWidget(unsigned curveIndex); /// Common part of overloaded `addCurve` functions void _addCurve(QwtPlotCurve* curve); + void setSymbols(Plot::ShowSymbols shown); private slots: void showGrid(bool show = true);