4#include <QtGui/QDialog>
6#include <qwt_plot_curve.h>
8#include <qwt_plot_grid.h>
22 newplot2(QWidget *parent = 0):m_curve(NULL)
26 for (
int i = 0; i < 1000; i++)
32 this->setTitle(
"Winch 2");
34 this->setAxisTitle(QwtPlot::xBottom,
"Time/seconds");
36 this->setAxisTitle(QwtPlot::yLeft,
"Force [N]");
39 this->setAutoReplot(
true);
44 void appendData2(
double x,
double y){
47 memmove(m_y, &m_y[1], 999 *
sizeof(
double));
48 memmove(m_x, &m_x[1], 999 *
sizeof(
double));
59void TimeFrame(
const QString &mystring)
61 timeFrame =mystring.toDouble();
68 this->setAxisAutoScale(QwtPlot::yLeft);
72 m_curve =
new QwtPlotCurve();
73 m_curve->setPen(QPen(QColor::fromRgb(0, 255, 0), 3));
74 m_curve->setRawSamples(m_x, m_y, 1000);
75 m_curve->attach(
this);
79 double max = *(std::max_element(&m_y[0], &m_y[999]));
80 double min = *(std::min_element(&m_y[0], &m_y[999]));
82 this->setAxisScale(QwtPlot::xBottom, m_x[999]-timeFrame, m_x[999]);
83 this->setAxisScale(QwtPlot::yLeft, min, max);
103 QwtPlotCurve *m_curve;
Definition: newplot2.h:18