36 #include "qwt/src/qwt.h"
37 #include "qwt/src/qwt_plot.h"
38 #include "qwt/src/qwt_plot_curve.h"
48 Q_UNUSED(scopeConfig);
49 Q_UNUSED(scopeGadgetWidget);
55 QDateTime NOW = QDateTime::currentDateTime();
56 double toTime = NOW.toTime_t();
57 toTime += NOW.time().msec() / 1000.0;
59 scopeGadgetWidget->setAxisScale(QwtPlot::xBottom, toTime -
m_xWindowSize, toTime);
70 Q_UNUSED(scopeConfig);
71 Q_UNUSED(scopeGadgetWidget);
122 stdSum += pow(
yDataHistory->at(
i) - boxcarAvg, 2) / (meanSamples - 1);
124 yData->append(sqrt(stdSum));
126 yData->append(boxcarAvg);
129 yData->append(currentValue);
157 QDateTime NOW = QDateTime::currentDateTime();
159 double currentValue =
188 stdSum += pow(
yDataHistory->at(
i) - boxcarAvg, 2) / (meanSamples - 1);
190 yData->append(sqrt(stdSum));
192 yData->append(boxcarAvg);
195 yData->append(currentValue);
198 double valueX = NOW.toTime_t() + NOW.time().msec() / 1000.0;
199 xData->append(valueX);
220 if (
xData->size() == 0)
223 newestValue =
xData->last();
224 oldestValue =
xData->first();
238 void TimeSeriesPlotData::removeStaleDataTimeout()
251 delete scatterplotData;
QVector< double > * xData
virtual void deletePlots(PlotData *)
ScatterplotData::deletePlots Delete all plot data.
virtual bool readAndResetUpdatedFlag()
bool append(UAVObject *obj)
TimeSeriesPlotData::append Appends data to time series data.
QVector< double > * yDataHistory
virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *)
Scatterplot2dScopeConfig::plotNewData Update plot with new data.
virtual void removeStaleData()
TimeSeriesPlotData::removeStaleData Removes stale data from time series plot.
void clearPlots()
ScatterplotData::clearPlots Clear all plot data.
QVector< double > * yData
virtual void plotNewData(PlotData *, ScopeConfig *, ScopeGadgetWidget *)
Scatterplot2dScopeConfig::plotNewData Update plot with new data.
bool append(UAVObject *obj)
Append new data to the plot.
UAVObjectField * getField(const QString &name)
The ScopeConfig class The parent class for scope configuration classes data sources.
double valueAsDouble(UAVObject *obj, UAVObjectField *field, bool haveSubField, QString uavSubFieldName)
valueAsDouble Fetch the value from the UAVO and return it as a double