Beispiel #1
0
void CQPlotSubwidget::addHisto1DTab(const std::string &title,
                                    const CPlotDataChannelSpec &x, const C_FLOAT64 &incr)
{
  CPlotItem *item = new CPlotItem(title, NULL, CPlotItem::histoItem1d);
  item->addChannel(x);
  item->setValue("increment", incr);
  addPlotItem(item);
}
Beispiel #2
0
void CQPlotSubwidget::addCurveTab(const std::string &title,
                                  const CPlotDataChannelSpec &x,
                                  const CPlotDataChannelSpec &y)
{
  CPlotItem *item = new CPlotItem(title, NULL, CPlotItem::curve2d);
  item->addChannel(x);
  item->addChannel(y);
  addPlotItem(item);
}
Beispiel #3
0
void CQPlotSubwidget::addSpectrumTab(const std::string &title,
                                     const CPlotDataChannelSpec &x,
                                     const CPlotDataChannelSpec &yone,
                                     const CPlotDataChannelSpec &ytwo)
{
  CPlotItem *item = new CPlotItem(title, NULL, CPlotItem::spectogram);
  item->addChannel(x);
  item->addChannel(yone);
  item->addChannel(ytwo);
  addPlotItem(item);
}
Beispiel #4
0
bool PlotWidget::eventFilter(QObject *obj, QEvent *ev)
{
    if (ev->type() == QEvent::Scroll) {
        QScrollEvent *se = static_cast<QScrollEvent *>(ev);
        QScroller *scroller = QScroller::scroller(m_widget);

        QPointF v = scroller->velocity();
        //v.rx() *= scroller->pixelPerMeter().x();
        //v.ry() *= scroller->pixelPerMeter().y();

        PlotItem pi = { v, se->contentPos(), se->overshootDistance() };
        addPlotItem(pi);
    }

    return QWidget::eventFilter(obj, ev);
}