00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include <iostream>
00026 #include "qvcpuplot.h"
00027
00028 QVCPUPlot::QVCPUPlot(const QString name, bool decorations, bool autoShow, bool time, int step, QWidget *parent):
00029 QVPlot(name, decorations, true, true, autoShow, time, step, parent)
00030 { }
00031
00032 #ifndef DOXYGEN_IGNORE_THIS
00033 bool QVCPUPlot::linkUnspecifiedInputProperty(QVPropertyContainer *sourceContainer, QString sourcePropName, LinkType linkType)
00034 {
00035 QVProcessingBlock* block;
00036 if((block = dynamic_cast<QVProcessingBlock*>(sourceContainer)) != NULL)
00037 {
00038 int propType = block->getPropertyType(sourcePropName);
00039 int cpusType = QVariant::fromValue(QVStat()).userType();
00040
00041 if (propType != cpusType) {
00042 std::cerr << "Warning: a cpuplot only can be linked to a QVStat property." << std::endl;
00043 return false;
00044 }
00045 else
00046 return QVPlot::linkUnspecifiedInputProperty(block, sourcePropName, linkType);
00047 }
00048 else
00049 return false;
00050 }
00051
00052 QStringList QVCPUPlot::getPropertyCurvNames(QString property) const
00053 {
00054 const QVStat stat = getPropertyValue<QVStat>(property);
00055 return stat.getFlagNames();
00056 }
00057
00058 QList<double> QVCPUPlot::getPropertyCurvValues(QString property) const
00059 {
00060 const QVStat stat = getPropertyValue<QVStat>(property);
00061 return stat.getLastStats();
00062 }
00063
00064 QList<int> QVCPUPlot::getPropertyCurvOrders(QString property) const
00065 {
00066 const QVStat stat = getPropertyValue<QVStat>(property);
00067 return stat.getFlagOrder();
00068 }
00069 #endif