OpenCurves
0.9
|
The data model for loaded plots and curves. More...
#include <curves.h>
Classes | |
class | CurveList |
A thread safe capture of a list of curves internal to a Curves object. More... | |
Public Slots | |
void | newCurve (PlotInstance *curve) |
Add a new curve to the list of curves. More... | |
void | completeLoading (PlotInstance *curve) |
Signals successful completion of curve . It is no longer in the loading state. | |
bool | removeCurve (const PlotInstance *curve) |
Removes and deletes curve . More... | |
void | invalidate (const PlotInstance *curve) |
Invalidates curve by raising the curveDataChanged() signal. More... | |
void | invalidate (const PlotSource *source, bool invalidateCurves=false) |
Invalidates source by raising the curveSourceDataChanged() signal. More... | |
void | clearCurves () |
Clears all curve data. | |
bool | migrateLoadingData () |
Migrates data from the back buffer of loading curves into the main display buffer. More... | |
Signals | |
void | curveAdded (PlotInstance *curve) |
Signals a curve is added (in the loading state). More... | |
void | curveComplete (PlotInstance *curve) |
Signals that loading of a curve has finished. More... | |
void | curveDataChanged (const PlotInstance *curve) |
Signals that a curve has changed its data content. More... | |
void | curveRemoved (const PlotInstance *curve) |
Signals removal of a curve (and deletion). More... | |
void | sourceDataChanged (const PlotSource *source) |
Signals that a PlotSource has changed its data content - generally it's timing data. More... | |
void | curvesCleared () |
Signals all curve data has been cleared. | |
void | loadingComplete () |
Signals that all loading curves have completed loading. | |
Public Member Functions | |
Curves (QObject *parent=nullptr) | |
Create a curves data model. More... | |
~Curves () | |
Destructor. Cleans up all owned curves. | |
CurveList | curves () const |
Retrieve the complete list of curves, loading or loaded. More... | |
CurveList | loadingCurves () const |
Retrieve the complete list of loading curves. More... | |
CurveList | realTimeCurves () const |
Retrieve the complete list of real-time curves. More... | |
unsigned | removeUsingExpression (const PlotExpression *expression) |
Remove all the curves which where generated from expression . More... | |
void | enumerateFileSources (QStringList &filePaths) const |
Enumerates the source files from which curves have been loaded. | |
void | enumerateSources (QList< PlotSource * > &sources, unsigned type) const |
Enumerates all sources of the requested type . More... | |
const VariantMap & | curvePropertiesMap () const |
Retrieve the curve properties map for pending curves. More... | |
void | setCurvePropertiesMap (VariantMap &map) |
Set the curve properties map. More... | |
bool | isLoading (const PlotInstance *curve) const |
Checks if the given curve is loading. More... | |
The data model for loaded plots and curves.
Curves are added in the loading state via newCurve()
and are considered to be loading. Loading curves are expected to be populated in the background and data are migrated via PlotInstance::migrateBuffer()
.
Once loaded, a curve no longer has data migrated.
The Curves
object is designed to be thread safe to support background loading. This includes delayed destruction of PlotInstance
objects as they may be accessed from different threads.
Curves::Curves | ( | QObject * | parent = nullptr | ) |
Create a curves data model.
parent | The owning object. |
|
signal |
Signals a curve is added (in the loading state).
curve | Curve of interest. |
|
signal |
Signals that loading of a curve has finished.
curve | Curve of interest. |
|
signal |
Signals that a curve has changed its data content.
curve | Curve of interest. |
|
inline |
Retrieve the curve properties map for pending curves.
This is as a direct consequence of supporting the potential loading delay in bookmarks::restoreBookmark()
. See that function for details.
|
signal |
Signals removal of a curve (and deletion).
curve | The removed and deleted curve. |
CurveList Curves::curves | ( | ) | const |
Retrieve the complete list of curves, loading or loaded.
void Curves::enumerateSources | ( | QList< PlotSource * > & | sources, |
unsigned | type | ||
) | const |
Enumerates all sources of the requested type
.
sources | List to append to. |
type | Source type to match. |
|
slot |
Invalidates curve
by raising the curveDataChanged()
signal.
curve | The curve to invalidate. |
|
slot |
Invalidates source
by raising the curveSourceDataChanged()
signal.
May also invalidate the assocaited PlotInstance
objects by calling invalidate(const PlotInstance *)
for each one.
source | The source to invalidate. Exits if null. |
invalidateCurves | True to invalidate each associated PlotInstance . |
bool Curves::isLoading | ( | const PlotInstance * | curve | ) | const |
Checks if the given curve is loading.
curve | The curve of interest. Handles null. |
curve
is loading. CurveList Curves::loadingCurves | ( | ) | const |
Retrieve the complete list of loading curves.
|
slot |
Migrates data from the back buffer of loading curves into the main display buffer.
Invokes PlotInstance::migrateBuffer()
for each loading curve.
|
slot |
Add a new curve to the list of curves.
The curve is considered to be in the loading state.
The curve is added to the curves()
and loadingCurves() lists. This call must be followed by either by a call to curveComplete()
or to removeCurve()
.
CurveList Curves::realTimeCurves | ( | ) | const |
Retrieve the complete list of real-time curves.
|
slot |
Removes and deletes curve
.
curve | The curve to remove. |
unsigned Curves::removeUsingExpression | ( | const PlotExpression * | expression | ) |
Remove all the curves which where generated from expression
.
expression | The expression to look for. |
void Curves::setCurvePropertiesMap | ( | VariantMap & | map | ) |
Set the curve properties map.
Affects existing and future curves.
This is as a direct consequence of supporting the potential loading delay in bookmarks::restoreBookmark()
. See that function for details.
map | The properties map. |
|
signal |
Signals that a PlotSource
has changed its data content - generally it's timing data.
source | Plot source of interest. |