MAK RTIspy API Documentation for HLA 1.3
List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

A QwtPlot Widget customized for use in plotting GPS accuracies. More...

+ Inheritance diagram for DtAssistantPlot:
+ Collaboration diagram for DtAssistantPlot:

Classes

class  TimeScaleDraw
 Custom QwtScaleDraw for displaying x axis values as times. More...

Public Member Functions

virtual void initialize (bool showLegend, const QString &unitLabel)
 Applies styles to the plot.
virtual ~DtAssistantPlot ()
 Virtual DTOR.
virtual void setShowTimeLabels (bool show)
 Sets whether the X-Axis time labels are visible.
virtual void setLockUpdates (bool lock)
 Sets whether updates.
virtual DtAssistantPlotSeriescreatePlotSeries (const QColor &color, unsigned seriesId, Qt::PenStyle style, const QString &dispName=QString())
 Creates a new series to display on the plot.
virtual DtAssistantPlotSeriesfindSeries (unsigned seriesId)
 Finds the series with the given ID and returns it.
virtual QwtLegend * createLegend ()
virtual void updateSeries (unsigned seriesId, double t, double val)
 Updates the given series with the given values Updates the series with the given values, updates the plot's scaling, and performs a replot.
virtual void updateAxisScaling ()
 Updates the y axis scaling to show the most recent n seconds Updates the y axis scaling so the most recently plotted value is visible and only myNumSecondsVisible seconds are visible (earlier plotted values will be hidden).
virtual void updateAxisScalingIfNeeded ()
 Updates the y axis scaling to show the most recent n seconds Does not rescale if maximum value can still be displayed on the graph.
virtual float getMaxVal ()
virtual float getMaxVal (unsigned seriesId)
virtual float getMinVal ()
virtual float getMinVal (unsigned seriesId)
virtual void setBaseTime (double baseTime)
virtual void setSeriesEnabled (unsigned seriesId, bool enabled)
virtual void setSeriesEnabled (QwtPlotItem *item, bool enabled)
virtual void clear ()

Static Public Member Functions

static DtAssistantPlotcreate (const QString &unitLabel=QString())
 Instantiates and initializes a new DtAssistantPlot.
static DtAssistantPlotcreate (LegendPosition legendPos, const QString &unitLabel=QString())
 Instantiates and initializes a new DtAssistantPlot.

Protected Types

typedef std::map< unsigned,
DtAssistantPlotSeries * > 
SeriesMap
typedef std::map< unsigned, float > SeriesMaxValMap
typedef SeriesMaxValMap SeriesMinValMap

Protected Member Functions

 DtAssistantPlot (const QString &unitLabel=QString())
 Protected CTOR (use create(..)) This CTOR creates a plot with no legend.
 DtAssistantPlot (LegendPosition legendPos, const QString &unitLabel=QString())
 Protected CTOR (use create(..)) Instantiates a new plot with grid lines and scrolling.
virtual void connectToSignals ()
virtual QPen createPen (const QColor &color, Qt::PenStyle style=Qt::SolidLine, qreal width=0)
 Utility method for creating a pen with the given color and width.

Protected Attributes

SeriesMap mySeries
SeriesMaxValMap myMaxVals
float myMaxVal
SeriesMinValMap myMinVals
float myMinVal
LegendPosition myLegendPosition
bool myDirtyMaxValFlag
bool myDirtyMinValFlag
bool myLockUpdatesFlag
bool myDirtyPlotFlag

Static Protected Attributes

static const float theScaleFactor = 1.2f
 Constants used in scaling y axis.
static const float theIntervalFactor = 0.001f
 Constants used in scaling y axis.

Detailed Description

A QwtPlot Widget customized for use in plotting GPS accuracies.

Member Typedef Documentation

typedef std::map<unsigned,DtAssistantPlotSeries*> DtAssistantPlot::SeriesMap
protected
typedef std::map<unsigned,float> DtAssistantPlot::SeriesMaxValMap
protected

Constructor & Destructor Documentation

DtAssistantPlot::~DtAssistantPlot ( )
virtual

Virtual DTOR.

References mySeries.

DtAssistantPlot::DtAssistantPlot ( const QString &  unitLabel = QString())
protected

Protected CTOR (use create(..)) This CTOR creates a plot with no legend.

Instantiates a new plot with grid lines and scrolling

Parameters
unitLabellabel for the units of the y axis.

Referenced by create().

DtAssistantPlot::DtAssistantPlot ( LegendPosition  legendPos,
const QString &  unitLabel = QString() 
)
protected

Protected CTOR (use create(..)) Instantiates a new plot with grid lines and scrolling.

Parameters
legendPoswhere to position the legend relative to the plot.
unitLabellabel for the units of the y axis.

Member Function Documentation

void DtAssistantPlot::clear ( )
virtual
void DtAssistantPlot::connectToSignals ( )
protectedvirtual

References connect().

Referenced by initialize().

DtAssistantPlot * DtAssistantPlot::create ( const QString &  unitLabel = QString())
static

Instantiates and initializes a new DtAssistantPlot.

Parameters
unitLabellabel for the units of the y axis.

References DtAssistantPlot(), and initialize().

Referenced by DtAssistantPlotWidget::layoutTab().

DtAssistantPlot * DtAssistantPlot::create ( LegendPosition  legendPos,
const QString &  unitLabel = QString() 
)
static

Instantiates and initializes a new DtAssistantPlot.

Parameters
legendPoswhere to position the legend relative to the plot.
unitLabellabel for the units of the y axis.

References DtAssistantPlot(), and initialize().

QwtLegend * DtAssistantPlot::createLegend ( )
virtual

References myLegendPosition, mySeries, and setSeriesEnabled().

Referenced by initialize().

QPen DtAssistantPlot::createPen ( const QColor &  color,
Qt::PenStyle  style = Qt::SolidLine,
qreal  width = 0 
)
protectedvirtual

Utility method for creating a pen with the given color and width.

Parameters
colorthe color to make the pen
stylethe style of line to draw
widththe width of the pen

Referenced by createPlotSeries(), and initialize().

DtAssistantPlotSeries * DtAssistantPlot::createPlotSeries ( const QColor &  color,
unsigned  seriesId,
Qt::PenStyle  style,
const QString &  dispName = QString() 
)
virtual

Creates a new series to display on the plot.

Parameters
colorthe color of the series lines
seriesIdan integer ID uniquely identifying the series
dispNamea logical name for the series (to be displayed on the legend)

References createPen(), findSeries(), mySeries, DtAssistantPlotSeries::setEnabled(), and DtAssistantPlotSeries::updateLegend().

Referenced by DtAssistantPlotWidget::createNewSeries().

DtAssistantPlotSeries * DtAssistantPlot::findSeries ( unsigned  seriesId)
virtual

Finds the series with the given ID and returns it.

Returns
returns the series with the given ID or NULL if there wasn't one

References mySeries, and NULL.

Referenced by createPlotSeries(), DtAssistantPlotWidget::setSeriesData(), and updateSeries().

float DtAssistantPlot::getMaxVal ( )
virtual
float DtAssistantPlot::getMaxVal ( unsigned  seriesId)
virtual

References myMaxVals.

float DtAssistantPlot::getMinVal ( )
virtual
float DtAssistantPlot::getMinVal ( unsigned  seriesId)
virtual

References myMinVals.

void DtAssistantPlot::initialize ( bool  showLegend,
const QString &  unitLabel 
)
virtual

Applies styles to the plot.

Parameters
showLegendwhether the plot's legend should be visible.
legendPoswhere to position the legend relative to the plot.
unitLabellabel for the units of the y axis.

References connectToSignals(), createLegend(), createPen(), setShowTimeLabels(), and updateAxisScaling().

Referenced by create().

void DtAssistantPlot::setBaseTime ( double  baseTime)
virtual
void DtAssistantPlot::setLockUpdates ( bool  lock)
virtual
void DtAssistantPlot::setSeriesEnabled ( unsigned  seriesId,
bool  enabled 
)
virtual
void DtAssistantPlot::setSeriesEnabled ( QwtPlotItem *  item,
bool  enabled 
)
virtual
void DtAssistantPlot::setShowTimeLabels ( bool  show)
virtual

Sets whether the X-Axis time labels are visible.

Referenced by initialize().

void DtAssistantPlot::updateAxisScaling ( )
virtual

Updates the y axis scaling to show the most recent n seconds Updates the y axis scaling so the most recently plotted value is visible and only myNumSecondsVisible seconds are visible (earlier plotted values will be hidden).

References getMaxVal(), getMinVal(), interval, theIntervalFactor, and theScaleFactor.

Referenced by clear(), initialize(), setSeriesEnabled(), and updateAxisScalingIfNeeded().

void DtAssistantPlot::updateAxisScalingIfNeeded ( )
virtual

Updates the y axis scaling to show the most recent n seconds Does not rescale if maximum value can still be displayed on the graph.

References getMaxVal(), getMinVal(), and updateAxisScaling().

Referenced by setLockUpdates(), and updateSeries().

void DtAssistantPlot::updateSeries ( unsigned  seriesId,
double  t,
double  val 
)
virtual

Updates the given series with the given values Updates the series with the given values, updates the plot's scaling, and performs a replot.

Does nothing if the series ID is invalid.

Parameters
seriesIdthe id of the series to update
tthe time (x) value to update with
valthe value (y) value to update with

References DtAssistantPlotSeries::addDataPoint(), findSeries(), getMaxVal(), getMinVal(), myDirtyPlotFlag, myLockUpdatesFlag, myMaxVal, myMaxVals, myMinVal, myMinVals, and updateAxisScalingIfNeeded().

Referenced by DtAssistantPlotWidget::updateSeries().

Member Data Documentation

bool DtAssistantPlot::myDirtyMaxValFlag
protected

Referenced by clear(), getMaxVal(), and setSeriesEnabled().

bool DtAssistantPlot::myDirtyMinValFlag
protected

Referenced by clear(), getMinVal(), and setSeriesEnabled().

bool DtAssistantPlot::myDirtyPlotFlag
protected

Referenced by setLockUpdates(), and updateSeries().

LegendPosition DtAssistantPlot::myLegendPosition
protected

Referenced by createLegend().

bool DtAssistantPlot::myLockUpdatesFlag
protected

Referenced by setLockUpdates(), and updateSeries().

float DtAssistantPlot::myMaxVal
protected

Referenced by getMaxVal(), and updateSeries().

SeriesMaxValMap DtAssistantPlot::myMaxVals
protected

Referenced by getMaxVal(), and updateSeries().

float DtAssistantPlot::myMinVal
protected

Referenced by getMinVal(), and updateSeries().

SeriesMinValMap DtAssistantPlot::myMinVals
protected

Referenced by getMinVal(), and updateSeries().

SeriesMap DtAssistantPlot::mySeries
protected
const float DtAssistantPlot::theIntervalFactor = 0.001f
staticprotected

Constants used in scaling y axis.

Referenced by updateAxisScaling().

const float DtAssistantPlot::theScaleFactor = 1.2f
staticprotected

Constants used in scaling y axis.

Referenced by updateAxisScaling().


The documentation for this class was generated from the following files:

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)