@@ -343,96 +343,106 @@ void PlotManager::addCurve(QString title
auto curve = new QwtPlotCurve(title);
auto series = new FrameBufferSeries(xBuf, yBuf);
curve->setSamples(series);
_addCurve(curve);
}
void PlotManager::_addCurve(QwtPlotCurve* curve)
{
// store and init the curve
curves.append(curve);
unsigned index = curves.size()-1;
auto color = infoModel->color(index);
curve->setPen(color);
// create the plot for the curve if we are on multi display
Plot* plot;
if (isMulti)
// create a new plot widget
plot = addPlotWidget();
else
plot = plotWidgets[0];
if (_stream != nullptr) // not displaying snapshot
QVector<const StreamChannel*> dispChannels;
dispChannels = QVector<const StreamChannel*>(1, _stream->channel(index));
dispChannels = _stream->allChannels();
plot->setDispChannels(dispChannels);
// show the curve
curve->attach(plot);
plot->replot();
void PlotManager::removeCurves(unsigned number)
if (! isMulti)
plotWidgets[0]->setDispChannels(dispChannels);
for (unsigned i = 0; i < number; i++)
if (!curves.isEmpty())
delete curves.takeLast();
if (isMulti) // delete corresponding widget as well
delete plotWidgets.takeLast();
unsigned PlotManager::numOfCurves()
return curves.size();
Plot* PlotManager::plotWidget(unsigned curveIndex)
return plotWidgets[curveIndex];
return plotWidgets[0];
void PlotManager::replot()
for (auto plot : plotWidgets)
void PlotManager::showGrid(bool show)
plot->showGrid(show);
void PlotManager::showMinorGrid(bool show)
Status change: