OpenCurves
0.9
|
This expression class binds and references an existing curve. More...
#include <plotsample.h>
Public Member Functions | |
PlotSample (const QString &curveName, bool curveRegularExpression=false) | |
Create a PlotSample which matches just a curve name in binding. More... | |
PlotSample (const QString &curveName, const QString &fileName, bool curveRegularExpression=false, bool fileRegularExpression=false) | |
Create a PlotSample which matches a curve name and file name in binding. More... | |
PlotSample (const PlotSampleId &curveId, const PlotSampleId &fileId=PlotSampleId()) | |
Create a PlotSample which matches a curve name and file name in binding. More... | |
PlotSample (const PlotSample &other) | |
Copy constructor, including copying the current binding. More... | |
~PlotSample () | |
Destructor. | |
virtual double | sample (double sampleTime) const |
Called to generate a sample at sampleTime . More... | |
virtual BindResult | bind (const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &info, bool repeatLastBinding=false) |
Attempts to bind to a curve mathcing curveName() . More... | |
virtual void | unbind () |
Releases the current binding (if any). | |
virtual PlotExpression * | clone () const |
Creates a deep copy of this object. More... | |
![]() | |
PlotExpression () | |
Empty constructor. | |
virtual | ~PlotExpression () |
Empty, virtual destructor. | |
QString | toString () const |
Converts the PlotExpression into a parseable string form. More... | |
virtual bool | explicitTime () const |
Is the curve generated with explicit time values? More... | |
This expression class binds and references an existing curve.
This is the primary data source in the PlotExpression
trees, where most other expressions modify existing expressions. This class binds and samples a PlotInstance
.
The bind()
method is implemented to bind the next appropriate PlotInstance
and report its domain in a PlotExpressionBindDomain
. Repeated binding is supported through the PlotBindTracker
. The sample()
method then returns data sampled from the currently bound PlotInstance
object.
The binding logic may match just the curve name or the curve and source names. Source names will only match file sources. The binding logic may optionally use regular expression binding for either name or source. The minimal binding identification requires just the curve name match.
Uses PlotInstanceSampler
for sampling.
A PlotSample
object can only be bound to a single PlotInstance
at a time.
PlotSample::PlotSample | ( | const QString & | curveName, |
bool | curveRegularExpression = false |
||
) |
Create a PlotSample
which matches just a curve name in binding.
curveName | The curve name to match. |
curveRegularExpression | True if curveName is a regular expression. |
PlotSample::PlotSample | ( | const QString & | curveName, |
const QString & | fileName, | ||
bool | curveRegularExpression = false , |
||
bool | fileRegularExpression = false |
||
) |
Create a PlotSample
which matches a curve name and file name in binding.
curveName | The curve name to match. |
fileName | The source name to match against available file sources. |
curveRegularExpression | True if curveName is a regular expression. |
fileRegularExpression | True if fileName is a regular expression. |
PlotSample::PlotSample | ( | const PlotSampleId & | curveId, |
const PlotSampleId & | fileId = PlotSampleId() |
||
) |
Create a PlotSample
which matches a curve name and file name in binding.
curveId | The curve ID to match. |
fileId | The source ID to match against available file sources. |
PlotSample::PlotSample | ( | const PlotSample & | other | ) |
Copy constructor, including copying the current binding.
other | The object to copy. |
|
virtual |
Attempts to bind to a curve mathcing curveName()
.
The binding supports regular expressions in both source and curve names, or exact matches, with the source name optional. In either case, only PlotSource::File
type sources are accepted with sources of all other types ignored.
Repeated bindings are managed via the bindTracker
.
sample()
unless binding succeeds. Implements PlotExpression.
|
virtual |
|
virtual |
Called to generate a sample at sampleTime
.
The implementation is optimised for sequential sampling and provides linearly interpolated points between true sample points.
sampleTime | The time to sample the expression at. |
sampleTime
. Implements PlotExpression.