![]() |
University of Murcia, Spain ![]() |
QVCPUPlot Class ReferenceClass for plot graphs of worker's cpustat properties.
More...
|
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. Each QVWorker object is created with a property containing a stat object, resuming its time consumption and internal statistics. The class QVCPUPlot can be used to plot those time statistics.
The following code features how to create a CPU plot object in a QVision application:
void main() { [...] ComponentTreeWorker componentTreeWorker("Component Tree"); CannyWorker cannyWorker("Canny operator"); ContourPainter contourPainter("Contour painter"); [...] QVCPUPlot cpuPlot("CPU Plot", true, 10); cpuPlot.linkProperty(componentTreeWorker); cpuPlot.linkProperty(cannyWorker); cpuPlot.linkProperty(contourPainter); [...] }
This application will display a plot like the following:
By default, the QVDefaultGUI includes the following button for CPU plot statistics displaying, which opens a QVNumericPlot widget plotting the worker CPU usage:
Definition at line 69 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.