Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

MonitorDataset Class Reference

#include <MonitorDataset.h>

List of all members.

Public Member Functions

void addPoint (double xVal, double yVal)
QwtDoubleRect boundingRect () const
QwtDoubleRect * boundingRectRef () const
void cleanUp ()
MonitorDatasetcopy () 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


Detailed Description

Holds the data for the graphs of neuron and synapse data that are displayed by the NeuronMonitor and SynapseMonitor. Implements scrolling of the data so that latest elements overwrite earlier ones.

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.


Constructor & Destructor Documentation

MonitorDataset::MonitorDataset int  bufSize,
double  rangeL,
double  rangeH
 

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.

MonitorDataset::MonitorDataset  ) 
 

Constructor that does not initialise - used by copy().

Definition at line 73 of file MonitorDataset.cpp.

Referenced by copy().

MonitorDataset::~MonitorDataset  ) 
 

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.

MonitorDataset::MonitorDataset const MonitorDataset  )  [private]
 

Declare copy constructor private so it cannot be used inadvertently.


Member Function Documentation

void MonitorDataset::addPoint double  xVal,
double  yVal
 

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.

QwtDoubleRect MonitorDataset::boundingRect  )  const
 

Returns the bounding rectangle of the dataset.

Definition at line 138 of file MonitorDataset.cpp.

References bndRect.

QwtDoubleRect * MonitorDataset::boundingRectRef  )  const
 

Returns a reference to the bounding rectangle of the dataset.

Definition at line 144 of file MonitorDataset.cpp.

References bndRect.

void MonitorDataset::cleanUp  ) 
 

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.

MonitorDataset * MonitorDataset::copy  )  const
 

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.

MonitorDataset MonitorDataset::operator= const MonitorDataset  )  [private]
 

Declare assignment private so it cannot be used inadvertently.

size_t MonitorDataset::size  )  const
 

Returns the number of data points held by this class.

Definition at line 193 of file MonitorDataset.cpp.

References bufferSize.

double MonitorDataset::x size_t  i  )  const
 

Returns the x value at position i.

Definition at line 199 of file MonitorDataset.cpp.

References bufferSize, insertPos, and xArray.

double MonitorDataset::y size_t  i  )  const
 

Returns the y value at position i.

Definition at line 206 of file MonitorDataset.cpp.

References bufferSize, insertPos, and yArray.


Member Data Documentation

QwtDoubleRect* MonitorDataset::bndRect [private]
 

The bounds of the data.

Definition at line 89 of file MonitorDataset.h.

Referenced by addPoint(), boundingRect(), boundingRectRef(), cleanUp(), copy(), and MonitorDataset().

bool* MonitorDataset::bufferFull [private]
 

When the buffer is full start scrolling behaviour.

Definition at line 86 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset().

int* MonitorDataset::bufferSize [private]
 

Size of the circular buffer.

Definition at line 70 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), size(), x(), and y().

int* MonitorDataset::insertPos [private]
 

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().

double* MonitorDataset::xArray [private]
 

Array holding the X data.

Definition at line 61 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), and x().

double* MonitorDataset::xIncrement [private]
 

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().

double* MonitorDataset::xOld [private]
 

Previous X value.

Definition at line 77 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset().

double* MonitorDataset::yArray [private]
 

Array holding the Y data.

Definition at line 64 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), MonitorDataset(), and y().

double* MonitorDataset::yMax [private]
 

Maximum Y value.

Definition at line 83 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset().

double* MonitorDataset::yMin [private]
 

Minimum Y value.

Definition at line 80 of file MonitorDataset.h.

Referenced by addPoint(), cleanUp(), copy(), and MonitorDataset().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:29:05 2007 for SpikeStream Application by  doxygen 1.4.4