PARP Research Group Universidad de Murcia


QVHistogramPlot Class Reference
[GUI blocks based on the QWT library]

Widget for plotting QList<double> property values from a block, as an histogram, over the time. More...

#include <QVHistogramPlot>

Inherits QVPlot.

List of all members.

Public Member Functions

 QVHistogramPlot (const QString name=QString(), bool time=true, int step=10, double maxim=0, double minim=0, QWidget *parent=0)
 Constructs a QVHistogramPlot with a given string identifier, and a iteration's parameters. Construct a new plot that shows QList<double> properties graphs as an histogram graph. This plot shows decorations, it hasn't got a pie graph, don't brush the data and autoshow. It can show graphs of QList<double> linked properties of different blocks.

Protected Member Functions

bool linkUnspecifiedInputProperty (QVPropertyContainer *sourceContainer, QString sourcePropName, LinkType linkType=AsynchronousLink)
 Links properties from blocks. This method safely links properties from blocks in a thread safe manner. If the iterations are based on block's iterations (time == false), the block must be synchronised with previous linked blocks. Only can be linked QList<double> properties.

Detailed Description

Widget for plotting QList<double> property values from a block, as an histogram, over the time.

Class QVHistogramPlot shows a widget which will read a QList<double> from a block's output property, and will continuously plot its evolution in time during block execution.

The abscissas axis will correspond to the QList size, while the ordinate axis will scale to the maximum value of the double values in the list read from the block.

To show the usage of the class, we need again a block which produces the QList<double> of values to be plotted. The following code shows an example:

class MyBlock: public QVProcessingBlock
        {
        public:
                MyBlock(QString name): QVProcessingBlock(name)
                        {
                        addProperty<QList<double> >("histogram", outputFlag);
                        [...]
                        }

                void iterate()
                        {
                        QList<double> histogram;
                        [...]
                        // Calculate values for the 'histogram' variable.
                        [...]
                        setPropertyValue<QList<double> >("histogram", histogram);
                        [...]
                        }
        }

And then, in the main function, we can create a QVHistogramPlot and link it with that property, like this:

#include <QVHistogramPlot>

void main()
        {
        [...]
        MyBlock myBlock("block");
        QVHistogramPlot histPlot("Histogram", false, 1);
        myBlock.linkProperty(histPlot,"histogram");
        [...]
        }

The result will be an application showing the following window widget:

qvision_histogramplot_window.png

The second and third parameters in the constructor of the QVListPlot correspond to time (true) or iteration (false) based operation, and the refreshing interval (in hundreths of seconds, in the first case, or in absolute number of iterations, in the second case).

See also:
QVNumericPlot
QVCPUPlot

Definition at line 92 of file qvhistogramplot.h.


Constructor & Destructor Documentation

QVHistogramPlot::QVHistogramPlot ( const QString  name = QString (),
bool  time = true,
int  step = 10,
double  maxim = 0,
double  minim = 0,
QWidget *  parent = 0 
)

Constructs a QVHistogramPlot with a given string identifier, and a iteration's parameters. Construct a new plot that shows QList<double> properties graphs as an histogram graph. This plot shows decorations, it hasn't got a pie graph, don't brush the data and autoshow. It can show graphs of QList<double> linked properties of different blocks.

Parameters:
name Identifier for the object to be created.
time True if the iterations are based on clock time (in second hundredths), and false if they are based on block's iterations.
step Set the base measure to plot's iterations ratio.
maxim The left axis maximum value shown, if it is 0, the maximum value is auto scale.
minim The left axis minimum value shown, it must be less than maximum value.
parent Identifier for the parent widget.
Todo:
los parámetros de configuración de los widgets numericplot e histogramplot puedan ser propiedades dinámicas.

Definition at line 35 of file qvhistogramplot.cpp.


Member Function Documentation

bool QVHistogramPlot::linkUnspecifiedInputProperty ( QVPropertyContainer sourceContainer,
QString  sourcePropName,
LinkType  linkType = AsynchronousLink 
) [protected]

Links properties from blocks. This method safely links properties from blocks in a thread safe manner. If the iterations are based on block's iterations (time == false), the block must be synchronised with previous linked blocks. Only can be linked QList<double> properties.

See also QVPropertyContainer::LinkType.

Parameters:
sourceContainer The container that whants to be linked.
sourcePropName The name of the source property to be linked.
linkType The link's type.

Definition at line 45 of file qvhistogramplot.cpp.


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



QVision framework. PARP research group. Copyright © 2007, 2008, 2009, 2010, 2011.