You right, the second implementation is not even compile and not even written right. The thing is that I'm unable to right it proper way, that's the other thing.
And I came to this conclusion because, the line setRawSamples() is working fine if the data is not too fast, but if I given bulk or fast data its crashing at this point.
{
{
m_points.push_back(data.toPointF());
}
{
double yValue = data.toDouble();
cframe::TimeStamp time = Module::createTimestamp();
qint64 nanoElapsed = time.nSecsElapsed();
double xValue = nanoElapsed/(double)1000000000;
m_points.
push_back(QPointF(xValue, yValue
));
}
if (data.userType() == qMetaTypeId<QVector<QPointF>>())
{
QVector<QPointF> points = data.value<QVector<QPointF>>();
m_points.append(points);
}
m_curve.setSamples(m_points);
}
void Input::plottingData(QVariant data)
{
if (data.userType() == QMetaType::QPointF)
{
m_points.push_back(data.toPointF());
}
if (data.userType() == QMetaType::Double)
{
double yValue = data.toDouble();
cframe::TimeStamp time = Module::createTimestamp();
qint64 nanoElapsed = time.nSecsElapsed();
double xValue = nanoElapsed/(double)1000000000;
m_points.push_back(QPointF(xValue, yValue));
}
if (data.userType() == qMetaTypeId<QVector<QPointF>>())
{
QVector<QPointF> points = data.value<QVector<QPointF>>();
m_points.append(points);
}
m_curve.setSamples(m_points);
}
To copy to clipboard, switch view to plain text mode
Can you please check this code above and clarify does the problem is in the coding somewhere ?
Thanks
Bookmarks