Uwe,
So, your idea is to calculate the reference time like this:
e.g.:
...
MySeriesData : public QwtSeriesData
{
...
MySeriesData (qint64 reftime, const QVector<QPointF> &samples)
: m_reftime(reftime)
, m_samples(samples)
{
}
{
...
...
}
private:
qint64 m_reftime= 0;
QVector<QPointF> m_samples;
}
...
// And then...
const auto reftime
= QDateTime::currentMSecsSinceEpoch();
curve->setData(new MySeriesData(reftime, samples));
..
...
MySeriesData : public QwtSeriesData
{
...
MySeriesData (qint64 reftime, const QVector<QPointF> &samples)
: m_reftime(reftime)
, m_samples(samples)
{
}
QPointF sample(size_t index) const
{
...
...
return QPointF(x - m_reftime, y);
}
private:
qint64 m_reftime= 0;
QVector<QPointF> m_samples;
}
...
// And then...
const auto reftime = QDateTime::currentMSecsSinceEpoch();
curve->setData(new MySeriesData(reftime, samples));
..
To copy to clipboard, switch view to plain text mode
?
Bookmarks