OpenCurves  0.9
OCurvesUI Class Reference

The main Open Curves UI window. More...

#include <ocurvesui.h>

Inheritance diagram for OCurvesUI:

Public Slots

void load (const QString &plotFile, bool append=false)
 Request loading of the given file. More...
 
void load (const QStringList &plotFiles, bool append=false, QVector< TimeSampling > *plotTiming=nullptr)
 Request loading of the given list of files. More...
 
void openDataFiles ()
 Show a dialog allowing the user to select data files to open. More...
 
void connectToRealtimeSource ()
 Show a dialog allowing the user to select a real time source XML file to load. More...
 
void reloadPlots ()
 Trigger a reload of a currently loaded sources. Does not include ones pending load.
 
void clearPlots ()
 Clears the display, removing all sources.
 
void sourceSelectOnlyIndex (const QModelIndex &index)
 Handler for selecting a single source by model index. More...
 
void sourceSelectOnly (int row)
 Select only the source at row. More...
 
void plotsSelectOnlyIndex (const QModelIndex &index)
 Handler for selecting a single curve name by model index. More...
 
void plotsSelectOnly (int row)
 Select only the curve name at row. More...
 
void copyActiveView ()
 Copy the active view content to the system clipboard (if available). More...
 
void editColours ()
 Shows the colour set editing dialog.
 

Public Member Functions

 OCurvesUI (QWidget *parent=nullptr)
 Constructor. More...
 
 ~OCurvesUI ()
 Destructor.
 
Curvescurves () const
 Access the primary Curves data. More...
 
Expressionsexpressions () const
 Access the Expressions data. More...
 
ExpressionsViewexpressionsView () const
 Access the view for expressions. More...
 
SplitPlotViewsplitPlotView () const
 Access the main plot view. More...
 
void loadSettings (QSettings &settings, bool loadGeometry=true)
 Loads saved settings saved by saveSettings() and applies them. More...
 
void loadWindowsSettings ()
 Loads and restores window geometry and other settings from the default settings.
 
void loadWindowsSettings (QSettings &settings)
 Loads and restores window geometry and other settings. More...
 
void saveSettings (QSettings &settings, bool bookmarkCurrent=false)
 Saves the application state and settings including both UI and data settings. More...
 

Protected Member Functions

void removeCurvesWithSource (const QString &sourceName)
 Removes all curves which have a PlotSource::name() mathcing sourceName. More...
 
void updateColours (const QStringList &activeSources, const QStringList &activeCurves)
 Recolours all visible PlotInstance objects by cycling through the colour set. More...
 
virtual void timerEvent (QTimerEvent *) override
 Periodic event used to migrate background loaded data. More...
 
virtual void showEvent (QShowEvent *) override
 Handles reveling the window by restoring stored settings.
 
virtual void closeEvent (QCloseEvent *) override
 Ensures loading is stopped and settings are saved.
 

Detailed Description

The main Open Curves UI window.

The main UI holds the major UI components as well as the main data model classes. It also manages background loading and progressive plotting data sets.

The main UI consists of the following components:

The data components are:

Constructor & Destructor Documentation

OCurvesUI::OCurvesUI ( QWidget *  parent = nullptr)
explicit

Constructor.

Parameters
parentThe widget parent.

Member Function Documentation

void OCurvesUI::connectToRealtimeSource ( )
slot

Show a dialog allowing the user to select a real time source XML file to load.

Aborts current loading.

Todo:
Add a reference to the real time source specifications here.
void OCurvesUI::copyActiveView ( )
slot

Copy the active view content to the system clipboard (if available).

Invokes PlotView::copyToClipboard()

Curves* OCurvesUI::curves ( ) const
inline

Access the primary Curves data.

Returns
The complete Curves set
Expressions* OCurvesUI::expressions ( ) const
inline

Access the Expressions data.

Returns
The complete Expressions set.
ExpressionsView* OCurvesUI::expressionsView ( ) const
inline

Access the view for expressions.

Returns
The ExpressionsView.
void OCurvesUI::load ( const QString &  plotFile,
bool  append = false 
)
slot

Request loading of the given file.

May optionally append to any currently loading file list when append is true. When false (default), any current load process is aborted.

Parameters
plotFileThe file to load.
appendTrue to append to the active list of files to load.
void OCurvesUI::load ( const QStringList &  plotFiles,
bool  append = false,
QVector< TimeSampling > *  plotTiming = nullptr 
)
slot

Request loading of the given list of files.

May optionally append to any currently loading file list when append is true. When false (default), any current load process is aborted.

Parameters
plotFilesList of files to load.
appendTrue to append to the active list of files to load.
plotTimingOptionally provides TimeSampling control on a per file basis. For each element in plotFiles, the corresponding plotTiming entry overrides the time column, scale base and flags. May be null, and insufficient entries are handled. Additional entries are ignored.
void OCurvesUI::loadSettings ( QSettings &  settings,
bool  loadGeometry = true 
)

Loads saved settings saved by saveSettings() and applies them.

Geometry settings may be excluded as they cannot be properly restored from the constructor. Use loadWindowSettings() to do so manually.

Parameters
settingsThe settings object to load from.
loadGeometryRestore geometry settings?
void OCurvesUI::loadWindowsSettings ( QSettings &  settings)

Loads and restores window geometry and other settings.

This cannot be done from the constructor.

Parameters
settingsThe settings object to load from.
void OCurvesUI::openDataFiles ( )
slot

Show a dialog allowing the user to select data files to open.

Aborts current loading.

void OCurvesUI::plotsSelectOnly ( int  row)
slot

Select only the curve name at row.

Parameters
rowThe row of the curve name to select. Range checked.
void OCurvesUI::plotsSelectOnlyIndex ( const QModelIndex &  index)
slot

Handler for selecting a single curve name by model index.

Parameters
indexIndex into the plot list view model for the source to select.
void OCurvesUI::removeCurvesWithSource ( const QString &  sourceName)
protected

Removes all curves which have a PlotSource::name() mathcing sourceName.

This function does not perform UI cleanup and UI components may need to be further updated to reflect the removal of curves.

Loading will be stopped if the source is curently being loaded.

Parameters
sourceNameThe source name to match.
void OCurvesUI::saveSettings ( QSettings &  settings,
bool  bookmarkCurrent = false 
)

Saves the application state and settings including both UI and data settings.

The UI state for all windows and children is saved. It serialises the current colour set and makes calls to save the state of the SplitPlotView and Expressions.

The current state may be optionally bookmarked as "bookmark0" which allows the user to restore the last session.

Parameters
settingsThe settings object to save to.
bookmarkCurrentTrue to bookmark the currently open files, selections, etc as bookmark0.
void OCurvesUI::sourceSelectOnly ( int  row)
slot

Select only the source at row.

Parameters
rowThe row of the source to select. Range checked.
void OCurvesUI::sourceSelectOnlyIndex ( const QModelIndex &  index)
slot

Handler for selecting a single source by model index.

Parameters
indexIndex into the source list view model for the source to select.
SplitPlotView* OCurvesUI::splitPlotView ( ) const
inline

Access the main plot view.

Supports splitting.

Returns
The SplitPlotView.
virtual void OCurvesUI::timerEvent ( QTimerEvent *  )
overrideprotectedvirtual

Periodic event used to migrate background loaded data.

Calls Curves::migrateLoadingData().

void OCurvesUI::updateColours ( const QStringList &  activeSources,
const QStringList &  activeCurves 
)
protected

Recolours all visible PlotInstance objects by cycling through the colour set.

This affects all visible PlotInstance objects in all views. Colours are assigned in turn from the current colour set, cycling back to the beginning of the set if there are more curves than colours.

To be visible, a PlotInstance must have a PlotSource::name() which is present in the activeSources list and its own PlotInstance::name() must be in activeCurves.

Curves with an explicit colour set are skipped.

Parameters
activeSourcesThe list of sources from which to display curves.
activeCurvesThe list of curves to show.

The documentation for this class was generated from the following file: