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 "qvnumericplot.h"
00027
00028 QVNumericPlot::QVNumericPlot(const QString name, bool time, int step, QWidget *parent): QVPlot(name, true, false, false, true, time, step, parent)
00029 { }
00030
00031 bool QVNumericPlot::linkUnspecifiedInputProperty(QVPropertyContainer *sourceContainer, QString sourcePropName, LinkType linkType)
00032 {
00033 QVProcessingBlock* block;
00034 if((block = dynamic_cast<QVProcessingBlock*>(sourceContainer)) != NULL)
00035 {
00036
00037 if (not ( sourceContainer->isType<int>(sourcePropName) ||
00038 sourceContainer->isType<double>(sourcePropName) ||
00039 sourceContainer->isType<uChar>(sourcePropName)
00040 ))
00041
00042 {
00043 std::cerr << "Warning: a numericplot only can be linked to a int or double property." << std::endl;
00044 return false;
00045 }
00046 else
00047 return QVPlot::linkUnspecifiedInputProperty(block, sourcePropName, linkType);
00048 }
00049 else
00050 return false;
00051 }
00052
00053 QStringList QVNumericPlot::getPropertyCurvNames(QString property) const
00054 {
00055 return (QStringList() << property);
00056 }
00057
00058 QList<double> QVNumericPlot::getPropertyCurvValues(QString property) const
00059 {
00060
00061
00062 QList<double> value;
00063 if (isType<int>(property))
00064
00065 value << getPropertyValue<int>(property);
00066 else if (isType<double>(property))
00067
00068 value << getPropertyValue<double>(property);
00069 else if (isType<uChar>(property))
00070 value << getPropertyValue<uChar>(property);
00071
00072 return value;
00073 }
00074
00075 QList<int> QVNumericPlot::getPropertyCurvOrders(QString) const
00076 {
00077 QList<int> order;
00078 return (order << 1);
00079 }
00080