QtPdWidgets  2.3.1
Classes | Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
Pd::XYGraph Class Reference

XY Graph. More...

#include <XYGraph.h>

Inheritance diagram for Pd::XYGraph:
Inheritance graph
[legend]
Collaboration diagram for Pd::XYGraph:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

 XYGraph (QWidget *parent=0)
 Constructor. More...
 
virtual ~XYGraph ()
 Destructor. More...
 
void addVariable (PdCom::Variable, const PdCom::Selector &={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double=1.0, double=0.0)
 Subscribes the horizontal/vertical channel to a ProcessVariable. More...
 
void addVariable (PdCom::Process *, const QString &, const PdCom::Selector &={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double=1.0, double=0.0)
 Subscribes the horizontal/vertical channel to a ProcessVariable. More...
 
void clearVariables ()
 Unsubscribes from any subscribed ProcessVariables. More...
 
void clearData ()
 Clears any displayed data. More...
 
double getTimeRange () const
 
void setTimeRange (double)
 Sets the timeRange. More...
 
void resetTimeRange ()
 Resets the timeRange. More...
 
double getScaleXMin () const
 
void setScaleXMin (double)
 Sets the minimum value of the horizontal scale. More...
 
void resetScaleXMin ()
 Resets the minimum value of the horizontal scale. More...
 
double getScaleXMax () const
 
void setScaleXMax (double)
 Sets the maximum value of the horizontal scale. More...
 
void resetScaleXMax ()
 Resets the maximum value of the horizontal scale. More...
 
double getScaleYMin () const
 
void setScaleYMin (double)
 Sets the minimum value of the vertical scale. More...
 
void resetScaleYMin ()
 Resets the minimum value of the vertical scale. More...
 
double getScaleYMax () const
 
void setScaleYMax (double)
 Sets the maximum value of the vertical scale. More...
 
void resetScaleYMax ()
 Resets the maximum value of the vertical scale. More...
 
int getLineWidth () const
 
void setLineWidth (int)
 Sets the line width. More...
 
void resetLineWidth ()
 Resets the line width. More...
 
QColor getLineColor () const
 
void setLineColor (const QColor &)
 Sets line color. More...
 
void resetLineColor ()
 Resets the line color. More...
 
virtual QSize sizeHint () const
 Gives a hint aboute the optimal size. More...
 

Protected Member Functions

bool event (QEvent *)
 Event handler. More...
 
void resizeEvent (QResizeEvent *)
 Handles the widget's resize event. More...
 
void paintEvent (QPaintEvent *)
 Paint function. More...
 

Properties

double timeRange
 The time range to display. More...
 
double scaleXMin
 The minimum value of the horizontal scale. More...
 
double scaleXMax
 The maximum value of the horizontal scale. More...
 
double scaleYMin
 The minimum value of the vertical scale. More...
 
double scaleYMax
 The maximum value of the vertical scale. More...
 
int lineWidth
 The line width. More...
 
QColor lineColor
 The line color. More...
 

Private Attributes

struct PD_PRIVATE Impl
 
std::unique_ptr< Implimpl
 

Detailed Description

XY Graph.

Constructor & Destructor Documentation

◆ XYGraph()

XYGraph::XYGraph ( QWidget *  parent = 0)

Constructor.

Parameters
parentparent widget

References impl.

◆ ~XYGraph()

XYGraph::~XYGraph ( )
virtual

Destructor.

References clearVariables().

Member Function Documentation

◆ addVariable() [1/2]

void XYGraph::addVariable ( PdCom::Variable  pv,
const PdCom::Selector &  selector = {},
const QtPdCom::Transmission &  transmission = QtPdCom::event_mode,
double  gain = 1.0,
double  offset = 0.0 
)

Subscribes the horizontal/vertical channel to a ProcessVariable.

The first call connects the horizontal channel to the given ProcessVariable. The second call will connect the vertical channel to the given ProcessVariable. Any further call will be ignored.

Todo:
Add channel paremeter.

References impl, NumAxes, and X.

◆ addVariable() [2/2]

void XYGraph::addVariable ( PdCom::Process *  p,
const QString &  path,
const PdCom::Selector &  selector = {},
const QtPdCom::Transmission &  transmission = QtPdCom::event_mode,
double  gain = 1.0,
double  offset = 0.0 
)

Subscribes the horizontal/vertical channel to a ProcessVariable.

The first call connects the horizontal channel to the given ProcessVariable. The second call will connect the vertical channel to the given ProcessVariable. Any further call will be ignored.

Todo:
Add channel paremeter.

References impl, NumAxes, and X.

◆ clearData()

void XYGraph::clearData ( )

Clears any displayed data.

References impl.

◆ clearVariables()

void XYGraph::clearVariables ( )

Unsubscribes from any subscribed ProcessVariables.

References impl, NumAxes, and X.

Referenced by ~XYGraph().

◆ event()

bool XYGraph::event ( QEvent *  event)
protected

Event handler.

Parameters
eventPaint event flags.

References impl.

Referenced by paintEvent(), and resizeEvent().

◆ getLineColor()

QColor XYGraph::getLineColor ( ) const
Returns
The line color.

References impl.

◆ getLineWidth()

int XYGraph::getLineWidth ( ) const
Returns
The line width.

References impl.

◆ getScaleXMax()

double XYGraph::getScaleXMax ( ) const
Returns
The maximum value of the horizontal scale.

References impl.

◆ getScaleXMin()

double XYGraph::getScaleXMin ( ) const
Returns
The minimum value of the horizontal scale.

References impl.

◆ getScaleYMax()

double XYGraph::getScaleYMax ( ) const
Returns
The maximum value of the vertical scale.

References impl.

◆ getScaleYMin()

double XYGraph::getScaleYMin ( ) const
Returns
The minimum value of the vertical scale.

References impl.

◆ getTimeRange()

double XYGraph::getTimeRange ( ) const
Returns
The timeRange.

References impl.

◆ paintEvent()

void XYGraph::paintEvent ( QPaintEvent *  event)
protected

Paint function.

Parameters
eventpaint event flags

References event(), impl, X, and Y.

◆ resetLineColor()

void XYGraph::resetLineColor ( )

Resets the line color.

References DEFAULT_LINE_COLOR, and setLineColor().

◆ resetLineWidth()

void XYGraph::resetLineWidth ( )

Resets the line width.

References DEFAULT_LINE_WIDTH, and setLineWidth().

◆ resetScaleXMax()

void XYGraph::resetScaleXMax ( )

Resets the maximum value of the horizontal scale.

References DEFAULT_SCALEXMAX, and setScaleXMax().

◆ resetScaleXMin()

void XYGraph::resetScaleXMin ( )

Resets the minimum value of the horizontal scale.

References DEFAULT_SCALEXMIN, and setScaleXMin().

◆ resetScaleYMax()

void XYGraph::resetScaleYMax ( )

Resets the maximum value of the vertical scale.

References DEFAULT_SCALEYMAX, and setScaleYMax().

◆ resetScaleYMin()

void XYGraph::resetScaleYMin ( )

Resets the minimum value of the vertical scale.

References DEFAULT_SCALEYMIN, and setScaleYMin().

◆ resetTimeRange()

void XYGraph::resetTimeRange ( )

Resets the timeRange.

References DEFAULT_TIMERANGE, and setTimeRange().

◆ resizeEvent()

void XYGraph::resizeEvent ( QResizeEvent *  event)
protected

Handles the widget's resize event.

Parameters
eventResize event.

References event(), and impl.

◆ setLineColor()

void XYGraph::setLineColor ( const QColor &  color)

Sets line color.

References impl.

Referenced by resetLineColor().

◆ setLineWidth()

void XYGraph::setLineWidth ( int  width)

Sets the line width.

References impl.

Referenced by resetLineWidth().

◆ setScaleXMax()

void XYGraph::setScaleXMax ( double  scale)

Sets the maximum value of the horizontal scale.

References impl.

Referenced by resetScaleXMax().

◆ setScaleXMin()

void XYGraph::setScaleXMin ( double  scale)

Sets the minimum value of the horizontal scale.

References impl.

Referenced by resetScaleXMin().

◆ setScaleYMax()

void XYGraph::setScaleYMax ( double  scale)

Sets the maximum value of the vertical scale.

References impl.

Referenced by resetScaleYMax().

◆ setScaleYMin()

void XYGraph::setScaleYMin ( double  scale)

Sets the minimum value of the vertical scale.

References impl.

Referenced by resetScaleYMin().

◆ setTimeRange()

void XYGraph::setTimeRange ( double  range)

Sets the timeRange.

References impl.

Referenced by resetTimeRange().

◆ sizeHint()

QSize XYGraph::sizeHint ( ) const
virtual

Gives a hint aboute the optimal size.

Member Data Documentation

◆ Impl

struct PD_PRIVATE Pd::XYGraph::Impl
private

◆ impl

std::unique_ptr<Impl> Pd::XYGraph::impl
private

Property Documentation

◆ lineColor

QColor Pd::XYGraph::lineColor
readwrite

The line color.

◆ lineWidth

int Pd::XYGraph::lineWidth
readwrite

The line width.

◆ scaleXMax

double Pd::XYGraph::scaleXMax
readwrite

The maximum value of the horizontal scale.

◆ scaleXMin

double Pd::XYGraph::scaleXMin
readwrite

The minimum value of the horizontal scale.

◆ scaleYMax

double Pd::XYGraph::scaleYMax
readwrite

The maximum value of the vertical scale.

◆ scaleYMin

double Pd::XYGraph::scaleYMin
readwrite

The minimum value of the vertical scale.

◆ timeRange

double Pd::XYGraph::timeRange
readwrite

The time range to display.

Older points will be discarded.


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