9 #include "ocurvesconfig.h"
22 typedef QHash<QString, QVariant> VariantMap;
50 typedef QList<PlotInstance *>::iterator
iterator;
68 inline const_iterator
begin()
const {
return _curves->begin(); }
72 inline const_iterator
end()
const {
return _curves->end(); }
79 const QList<PlotInstance *> &
list()
const {
return *_curves; }
83 const QList<PlotInstance *> *_curves;
88 Curves(QObject *parent =
nullptr);
217 void clearDeathRow();
220 QList<PlotInstance *> _curves;
221 QList<PlotInstance *> _loadingCurves;
222 QList<PlotInstance *> _realTimeCurves;
223 QList<PlotInstance *> _completedCurves;
224 QList<const PlotInstance *> _deathRow;
225 mutable QMutex *_curvesMutex;
226 mutable QMutex *_loadingMutex;
227 mutable QMutex *_realTimeMutex;
228 mutable QMutex *_deathRowMutex;
229 VariantMap _curvePropertiesMap;
const VariantMap & curvePropertiesMap() const
Retrieve the curve properties map for pending curves.
Definition: curves.h:123
const_iterator end() const
End iterator.
Definition: curves.h:72
Curves(QObject *parent=nullptr)
Create a curves data model.
~CurveList()
Destructor: releases the mutex.
void curveComplete(PlotInstance *curve)
Signals that loading of a curve has finished.
void sourceDataChanged(const PlotSource *source)
Signals that a PlotSource has changed its data content - generally it's timing data.
CurveList realTimeCurves() const
Retrieve the complete list of real-time curves.
void enumerateFileSources(QStringList &filePaths) const
Enumerates the source files from which curves have been loaded.
void newCurve(PlotInstance *curve)
Add a new curve to the list of curves.
Holds data for a single curve.
Definition: plotinstance.h:43
void enumerateSources(QList< PlotSource * > &sources, unsigned type) const
Enumerates all sources of the requested type.
The data model for loaded plots and curves.
Definition: curves.h:36
CurveList curves() const
Retrieve the complete list of curves, loading or loaded.
A thread safe capture of a list of curves internal to a Curves object.
Definition: curves.h:46
void curvesCleared()
Signals all curve data has been cleared.
QList< PlotInstance * >::const_iterator const_iterator
The const_iterator type.
Definition: curves.h:53
bool removeCurve(const PlotInstance *curve)
Removes and deletes curve.
CurveList loadingCurves() const
Retrieve the complete list of loading curves.
void curveRemoved(const PlotInstance *curve)
Signals removal of a curve (and deletion).
Provides details about a source from which PlotInstance objects have been generated.
Definition: plotsource.h:28
void invalidate(const PlotInstance *curve)
Invalidates curve by raising the curveDataChanged() signal.
~Curves()
Destructor. Cleans up all owned curves.
void loadingComplete()
Signals that all loading curves have completed loading.
void clearCurves()
Clears all curve data.
void curveAdded(PlotInstance *curve)
Signals a curve is added (in the loading state).
QList< PlotInstance * >::iterator iterator
The iterator type.
Definition: curves.h:50
bool isLoading(const PlotInstance *curve) const
Checks if the given curve is loading.
const QList< PlotInstance * > & list() const
Direct access to the underlying list (thread-safe).
Definition: curves.h:79
void release()
Releases the curve list and lock allowing other threads to access the data. The object becomes invali...
void setCurvePropertiesMap(VariantMap &map)
Set the curve properties map.
A PlotExpression represents an operation in a plot equation.
Definition: plotexpression.h:91
void curveDataChanged(const PlotInstance *curve)
Signals that a curve has changed its data content.
CurveList(QMutex &mutex, const QList< PlotInstance * > &curves)
Constructor: internal use only.
const_iterator begin() const
Begin iteration of the curves.
Definition: curves.h:68
bool migrateLoadingData()
Migrates data from the back buffer of loading curves into the main display buffer.
unsigned removeUsingExpression(const PlotExpression *expression)
Remove all the curves which where generated from expression.
void completeLoading(PlotInstance *curve)
Signals successful completion of curve. It is no longer in the loading state.