6 #ifndef PLOTINSTANCE_H_
7 #define PLOTINSTANCE_H_
9 #include "plotsconfig.h"
11 #include "plotsource.h"
22 class PointSeriesData;
97 inline QString
name()
const {
return _name; }
105 inline int style()
const {
return _style; }
113 inline unsigned width()
const {
return _width; }
121 inline int symbol()
const {
return _symbol; }
133 inline void setSymbolSize(
unsigned size) { _symbolSize = std::uint8_t(size); }
137 inline const std::vector<QPointF> &
data()
const {
return _data; }
141 inline const QRgb &
colour()
const {
return _colour; }
161 inline size_t ringHead()
const {
return _ringHead; }
165 inline std::uint16_t
flags()
const {
return _flags; }
223 QPointF
sample(
size_t index)
const;
232 void addPoints(
const QPointF *points,
size_t pointCount);
246 void setFlagsState(std::uint16_t
flags,
bool set);
248 std::vector<QPointF> _data;
255 std::uint16_t _flags;
259 std::uint8_t _symbolSize;
262 std::vector<QPointF> _buffer;
286 inline void PlotInstance::setFlagsState(std::uint16_t flags,
bool set)
288 _flags = (_flags & ~flags) | (!!set * flags);
291 #endif // PLOTINSTANCE_H_
Set to filter NaN values, replacing them with zero.
Definition: plotinstance.h:58
void addPoints(const QPointF *points, size_t pointCount)
Add multiple points to the back buffer.
bool explicitColour() const
Using an explicit colour?
Definition: plotinstance.h:191
Flag
Status, control and display flags.
Definition: plotinstance.h:47
QPointF sample(size_t index) const
Samples the point at the given index.
int style() const
Get the draw style: matches QwtPlotCurve::CurveStyle.
Definition: plotinstance.h:105
void setExplicitTime(bool explct)
Set the state of the ExplicitTime Flag.
Definition: plotinstance.h:215
void setFilterInf(bool filter)
Set or clear infinite value filtering.
Definition: plotinstance.h:207
const PlotExpression * expression() const
Get the expression which generated this plot (Expression source() only).
Definition: plotinstance.h:152
void setName(QString name)
Set the plot name.
Definition: plotinstance.h:101
bool filterNaN() const
Filter NaN values on display?
Definition: plotinstance.h:195
Set when all data have been loaded and the curve is complete.
Definition: plotinstance.h:51
~PlotInstance()
Destructor.
void setSymbolSize(unsigned size)
Set the symbol size: limited to 255.
Definition: plotinstance.h:133
PlotInstance(const PlotSource::Ptr &source)
Create a plot instance from the given source.
Set if the data member acts as a ring buffer. Affects sample(), addPoint(), addPoints().
Definition: plotinstance.h:53
void setDefaultProperties()
Restore the default style, colour, etc properties.
Set to filter infinite values, replacing them zero.
Definition: plotinstance.h:60
Holds data for a single curve.
Definition: plotinstance.h:43
const std::vector< QPointF > & data() const
Direct access to the data buffer.
Definition: plotinstance.h:137
void setFilterNaN(bool filter)
Set or clear NaN filtering.
Definition: plotinstance.h:199
Default size for displaying plot symbols.
Definition: plotinstance.h:71
PlotInstance & operator=(const PlotInstance &other)
Assignment operator.
bool explicitTime() const
Has the curve been generated with explicit time values?
Definition: plotinstance.h:211
bool migrateBuffer()
Migrate from the back buffer to data(). Main thread only.
PlotSource & source()
Access the plot source.
Definition: plotinstance.h:266
void addPoint(const QPointF &p)
Add a point to the back buffer (thread-safe).
void setComplete()
Marks data complete.
Definition: plotinstance.h:177
void makeRingBuffer(size_t bufferSize)
Converts the plot data to a ring buffer of the given size.
QString name() const
Get the plot name.
Definition: plotinstance.h:97
bool dataComplete() const
Is data loading complete?
Definition: plotinstance.h:174
std::uint16_t flags() const
Get the status, control and display Flag values.
Definition: plotinstance.h:165
A specialisation of QwtPlotCurve used to visualisation PlotInstanceData.
Definition: plotdatacurve.h:22
const QRgb & colour() const
Get the display colour for the plot.
Definition: plotinstance.h:141
Provides details about a source from which PlotInstance objects have been generated.
Definition: plotsource.h:28
unsigned symbolSize() const
Get the symbol size.
Definition: plotinstance.h:129
void setColour(const QRgb &colour, bool markExplicit=true)
Set the display colour, making it explicit unless requested otherwise.
Definition: plotinstance.h:278
Has the curve been generated with explicit time samples? Some generated curves have explicit times an...
Definition: plotinstance.h:65
void setSymbol(int symbol)
Set the draw symbol: matches QwtSymbol::Style.
Definition: plotinstance.h:125
unsigned width() const
Get the draw width.
Definition: plotinstance.h:113
int symbol() const
Get the draw symbol: matches QwtSymbol::Style.
Definition: plotinstance.h:121
void setStyle(unsigned style)
Set the draw style: matches QwtPlotCurve::CurveStyle.
Definition: plotinstance.h:109
void setExpression(const PlotExpression *expression)
Sets the expression which generated this plot.
Definition: plotinstance.h:157
Defaults
Some default values for plots.
Definition: plotinstance.h:69
size_t ringHead() const
The read head of the ring buffer.
Definition: plotinstance.h:161
A PlotExpression represents an operation in a plot equation.
Definition: plotexpression.h:91
Set if the graph has been assigned an explicit colour.
Definition: plotinstance.h:56
bool filterInf() const
Filter infinite values on display?
Definition: plotinstance.h:203
void setWidth(unsigned width)
Set the pen draw width: limited to 255.
Definition: plotinstance.h:117
bool isRingBuffer() const
Is this a ring buffer?
Definition: plotinstance.h:181
bool testFlags(std::uint16_t flags)
Sets that all flags are set in the flags() member.
Definition: plotinstance.h:169