#include <MonitorDataset.h>
Public Member Functions | |
| void | addPoint (double xVal, double yVal) |
| QwtDoubleRect | boundingRect () const |
| QwtDoubleRect * | boundingRectRef () const |
| void | cleanUp () |
| MonitorDataset * | copy () const |
| MonitorDataset () | |
| MonitorDataset (int bufSize, double rangeL, double rangeH) | |
| size_t | size () const |
| double | x (size_t i) const |
| double | y (size_t i) const |
| ~MonitorDataset () | |
Private Member Functions | |
| MonitorDataset (const MonitorDataset &) | |
| MonitorDataset | operator= (const MonitorDataset &) |
Private Attributes | |
| QwtDoubleRect * | bndRect |
| bool * | bufferFull |
| int * | bufferSize |
| int * | insertPos |
| double * | xArray |
| double * | xIncrement |
| double * | xOld |
| double * | yArray |
| double * | yMax |
| double * | yMin |
NOTE: All the data variables are pointers so that a copy can be made and the new class is updated in sync with the old one. It is done this way because QwtPlot calls copy method, but want to keep refernce to original class and update the original class before plotting.
Definition at line 42 of file MonitorDataset.h.
|
||||||||||||||||
|
Standard constructor that initialises everything. Definition at line 33 of file MonitorDataset.cpp. References bndRect, bufferFull, bufferSize, insertPos, xArray, xIncrement, xOld, yArray, yMax, and yMin. |
|
|
Constructor that does not initialise - used by copy(). Definition at line 73 of file MonitorDataset.cpp. Referenced by copy(). |
|
|
Destructor. This does not do any cleaning up because a reference copy is made of this class and so cleaning up might entail this destructor being called twice. Need to call cleanUp() explicitly to delete the data structures. Definition at line 80 of file MonitorDataset.cpp. |
|
|
Declare copy constructor private so it cannot be used inadvertently. |
|
||||||||||||
|
Adds a point to the dataset. This is added at insertPos, which is rotated so that the oldest point is overwritten. Definition at line 93 of file MonitorDataset.cpp. References bndRect, bufferFull, bufferSize, insertPos, xArray, xIncrement, xOld, yArray, yMax, and yMin. |
|
|
Returns the bounding rectangle of the dataset. Definition at line 138 of file MonitorDataset.cpp. References bndRect. |
|
|
Returns a reference to the bounding rectangle of the dataset. Definition at line 144 of file MonitorDataset.cpp. References bndRect. |
|
|
Deletes everything in the class. Carry this out here instead of the destructor because copy() returns a copy of the references and so the destructor could be invoked twice on the same objects. Definition at line 153 of file MonitorDataset.cpp. References bndRect, bufferFull, bufferSize, insertPos, xArray, xIncrement, xOld, yArray, yMax, and yMin. |
|
|
Copies references so that new class updates in sync with old. Copy all the references to data and arrays and the rectangle. Do it this way because QwtPlot uses a copy of this dataset and invokes methods on the copy. Definition at line 175 of file MonitorDataset.cpp. References bndRect, bufferFull, bufferSize, insertPos, MonitorDataset(), xArray, xIncrement, xOld, yArray, yMax, and yMin. |
|
|
Declare assignment private so it cannot be used inadvertently. |
|
|
Returns the number of data points held by this class. Definition at line 193 of file MonitorDataset.cpp. References bufferSize. |
|
|
Returns the x value at position i. Definition at line 199 of file MonitorDataset.cpp. References bufferSize, insertPos, and xArray. |
|
|
Returns the y value at position i. Definition at line 206 of file MonitorDataset.cpp. References bufferSize, insertPos, and yArray. |
|
|
The bounds of the data. Definition at line 89 of file MonitorDataset.h. Referenced by addPoint(), boundingRect(), boundingRectRef(), cleanUp(), copy(), and MonitorDataset(). |
|
|
When the buffer is full start scrolling behaviour. Definition at line 86 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset(). |
|
|
Size of the circular buffer. Definition at line 70 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), size(), x(), and y(). |
|
|
Position at which data is added in the array. It is a circular buffer. Definition at line 67 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), x(), and y(). |
|
|
Array holding the X data. Definition at line 61 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), and x(). |
|
|
How much the x axis increases with each additional point. This is to manage scrolling behaviour of the bounds rectangle. Definition at line 74 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset(). |
|
|
Previous X value. Definition at line 77 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset(). |
|
|
Array holding the Y data. Definition at line 64 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), and y(). |
|
|
Maximum Y value. Definition at line 83 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset(). |
|
|
Minimum Y value. Definition at line 80 of file MonitorDataset.h. Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset(). |
1.4.4