#include <qvgui/qvcpuplot.h>
Public Member Functions | |
QVCpuPlot (const QString name=QString(), bool decorations=true, bool autoShow=true, bool time=true, int step=100, QWidget *parent=0) | |
Constructs a QVCpuPlot with a given string identifier, showing properties and iteration's parameters. | |
bool | linkProperty (QVWorker &worker) |
Links properties from workers. This method safely links the "cpu stats" worker's property in a thread safe manner. | |
bool | linkProperty (QVWorker &worker, const QString propertyName) |
Links properties from workers. |
This class lets us plot graphs for QVStat worker's output properties. First, we need workers with QVStat output properties, like this:
class MyWorker: public QVWorker { public: MyWorker(QString name): QVWorker(name) { addProperty< QVImage<uChar,1> >("Input image", inputFlag|outputFlag); addProperty< QVImage<uChar,1> >("Output image", outputFlag); addProperty<QVStat>("statistics", outputFlag); ...
And then, in the main function, we can create a QVCpuPlot and link it with that property, like this:
... MyWorker myWorker("worker"); QVCpuPlot cpuPlot("statistics plot"); cpuPlot.linkProperty(myWorker, "statistics"); ...
Showing us a graph window like this:
If we link some workers QVStat properties to one QVCpuPlot, it plots all QVStat's time flags in link order, like this:
All workers have a QVStat output property, "cpu stats", that can be linked like this:
... MyWorker myWorker("worker"); QVCpuPlot cpuPlot("statistics plot"); cpuPlot.linkProperty(myWorker); ...
And it's QVCpuPlot graph is shown when we puss the graph worker GUI button:
See also: QVNumericPlot class QVHistogramPlot class.
Definition at line 90 of file qvcpuplot.h.
QVCpuPlot::QVCpuPlot | ( | const QString | name = QString() , |
|
bool | decorations = true , |
|||
bool | autoShow = true , |
|||
bool | time = true , |
|||
int | step = 100 , |
|||
QWidget * | parent = 0 | |||
) |
Constructs a QVCpuPlot with a given string identifier, showing properties and iteration's parameters.
name | Identifier for the object to be created. | |
decorations | Indicate if the plot must shown the scale axis. | |
autoShow | Indicate if the plot are shown at the beginning or must be shown by the user. | |
time | True if the iterations are based on clock time (in second hundredths), and false if they are based on worker's iterations. | |
step | Set the base measure to plot's iterations ratio. | |
parent | Identifier for the parent widget. |
Definition at line 28 of file qvcpuplot.cpp.
bool QVCpuPlot::linkProperty | ( | QVWorker & | worker | ) |
Links properties from workers. This method safely links the "cpu stats" worker's property in a thread safe manner.
See also QVPropertyContainer::LinkType.
worker | The source QVWorker. | |
propertyName | Identifying QString for the source property. |
Definition at line 45 of file qvcpuplot.cpp.
bool QVCpuPlot::linkProperty | ( | QVWorker & | worker, | |
const QString | propertyName | |||
) |
Links properties from workers.
This method safely links QVStat properties from workers in a thread safe manner. If the iterations are based on worker's iterations (time == false), the worker must be synchronised with previous linked workers. Only can be linked QVStat properties.
See also linkProperty(QVWorker &worker, const QString propertyName).
worker | The source QVWorker. |
Definition at line 32 of file qvcpuplot.cpp.