9 #include "ocurvesconfig.h"
11 #include "timesampling.h"
13 #include <QMainWindow>
16 #include <QStringList>
46 #define REFERENCE_SETTINGS(s) QSettings s(QSettings::IniFormat, QSettings::UserScope, "ocurves");
70 explicit OCurvesUI(QWidget *parent =
nullptr);
98 void loadSettings(QSettings &settings,
bool loadGeometry =
true);
120 void saveSettings(QSettings &settings,
bool bookmarkCurrent =
false);
130 void load(
const QString &plotFile,
bool append =
false);
143 void load(
const QStringList &plotFiles,
bool append =
false, QVector<TimeSampling> *plotTiming =
nullptr);
189 void sourcesSelectionChanged();
193 void sourcesContextMenu(
const QPoint &where);
196 void plotsSelectionChanged();
200 void plotsContextMenu(
const QPoint &where);
207 void beginNewCurves();
217 void curveLoadingComplete();
222 void sourceDataChanged(
const PlotSource *source);
229 void loadComplete(
int curveCount);
242 void legendItemClicked(
const QVariant &itemInfo,
int index);
245 void sourcesSelectOnlyCurrent();
248 void sourcesReloadCurrent();
251 void sourcesRemoveCurrent();
254 void plotsSelectOnlyCurrent();
277 void viewLegendChanged(QwtLegend *legend,
int position);
286 void clearBookmark();
290 void clearBookmark(
int id);
293 void clearBookmarks();
298 void exportBookmarks();
303 void importBookmarks();
306 void restoreLastSession();
338 void updateColours(
const QStringList &activeSources,
const QStringList &activeCurves);
343 virtual void timerEvent(QTimerEvent *)
override;
346 virtual void showEvent(QShowEvent *)
override;
349 virtual void closeEvent(QCloseEvent *)
override;
353 enum PostLoaderAction
356 PLA_GenerateExpressions,
361 void setupToolbars();
364 void setupBookmarks();
369 QString bookmarkMenuName(
unsigned id,
const QString &name = QString());
374 QAction *findGotoBookmarkAction(
int id);
379 QAction *findSetBookmarkAction(
int id);
384 QAction *findClearBookmarkAction(
int id);
392 void replot(
bool force =
false);
413 bool addToSourceList(
const QString &displayName);
417 void recolourCurves();
422 void updateActivePlotView(
bool updateSources,
bool updatePlots);
425 void updateSelectedSources();
428 void populatePlotsList();
430 void updateSelectedPlots();
442 void activateLoader(
PlotGenerator *newLoader, PostLoaderAction nextAction);
451 void dragEnterEvent(QDragEnterEvent *event)
override;
455 void dropEvent(QDropEvent *event)
override;
462 bool canAcceptDrop(
const QMimeData &mimeData)
const;
467 QStringList extractDroppedFileList(
const QMimeData &mimeData)
const;
475 QVector<QRgb> _colours;
477 bool _suppressEvents;
478 PostLoaderAction _postLoaderAction;
480 QMenu *_sourcesContextMenu;
481 QMenu *_plotsContextMenu;
482 QPoint _lastContextPos;
484 QElapsedTimer *_timeSinceLastPlot;
488 QString _loadDirectory;
491 QString _streamDirectory;
492 QString _streamFilter;
494 QString _originalWindowTitle;
The main Open Curves UI window.
Definition: ocurvesui.h:63
void removeCurvesWithSource(const QString &sourceName)
Removes all curves which have a PlotSource::name() mathcing sourceName.
void plotsSelectOnly(int row)
Select only the curve name at row.
Definition: coloursview.h:16
Generates PlotInstance objects for plotting over real-time connections.
Definition: realtimeplot.h:112
void loadSettings(QSettings &settings, bool loadGeometry=true)
Loads saved settings saved by saveSettings() and applies them.
void sourceSelectOnly(int row)
Select only the source at row.
Expressions * expressions() const
Access the Expressions data.
Definition: ocurvesui.h:81
A widget for showing the progress of loading.
Definition: loadprogress.h:28
virtual void timerEvent(QTimerEvent *) override
Periodic event used to migrate background loaded data.
Curves * curves() const
Access the primary Curves data.
Definition: ocurvesui.h:77
An plot view viewing a Curves model.
Definition: plotview.h:36
void openDataFiles()
Show a dialog allowing the user to select data files to open.
virtual void showEvent(QShowEvent *) override
Handles reveling the window by restoring stored settings.
Holds data for a single curve.
Definition: plotinstance.h:43
The data model for loaded plots and curves.
Definition: curves.h:36
Manages and edits current expressions.
Definition: expressionsview.h:33
void reloadPlots()
Trigger a reload of a currently loaded sources. Does not include ones pending load.
void updateColours(const QStringList &activeSources, const QStringList &activeCurves)
Recolours all visible PlotInstance objects by cycling through the colour set.
virtual void closeEvent(QCloseEvent *) override
Ensures loading is stopped and settings are saved.
void loadWindowsSettings()
Loads and restores window geometry and other settings from the default settings.
Provides details about a source from which PlotInstance objects have been generated.
Definition: plotsource.h:28
void clearPlots()
Clears the display, removing all sources.
A special plotting view which can contain multiple splits, each with its own PlotView.
Definition: splitplotview.h:33
void sourceSelectOnlyIndex(const QModelIndex &index)
Handler for selecting a single source by model index.
void load(const QString &plotFile, bool append=false)
Request loading of the given file.
A curve generation thread.
Definition: plotgenerator.h:84
void copyActiveView()
Copy the active view content to the system clipboard (if available).
ExpressionsView * expressionsView() const
Access the view for expressions.
Definition: ocurvesui.h:85
OCurvesUI(QWidget *parent=nullptr)
Constructor.
Maintains the current expressions available for generation and plotting.
Definition: expressions.h:27
void plotsSelectOnlyIndex(const QModelIndex &index)
Handler for selecting a single curve name by model index.
void saveSettings(QSettings &settings, bool bookmarkCurrent=false)
Saves the application state and settings including both UI and data settings.
SplitPlotView * splitPlotView() const
Access the main plot view.
Definition: ocurvesui.h:89
A PlotExpression represents an operation in a plot equation.
Definition: plotexpression.h:91
UI for editing PlotSource and PlotInstance properties.
Definition: curveproperties.h:25
void editColours()
Shows the colour set editing dialog.
void connectToRealtimeSource()
Show a dialog allowing the user to select a real time source XML file to load.