Changeset - f2e074e18515
[Not reviewed]
default
0 1 0
Hasan Yavuz ÖZDERYA - 7 years ago 2019-01-22 09:22:16
hy@ozderya.net
fix crash on snapshot display
1 file changed with 15 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
/*
 
  Copyright © 2018 Hasan Yavuz Özderya
 
  Copyright © 2019 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
  serialplot is free software: you can redistribute it and/or modify
 
  it under the terms of the GNU General Public License as published by
 
  the Free Software Foundation, either version 3 of the License, or
 
@@ -355,18 +355,30 @@ void PlotManager::_addCurve(QwtPlotCurve
 
    // create the plot for the curve if we are on multi display
 
    Plot* plot;
 
    if (isMulti)
 
    {
 
        // create a new plot widget
 
        plot = addPlotWidget();
 
        plot->setDispChannels(QVector<const StreamChannel*>(1, _stream->channel(index)));
 
    }
 
    else
 
    {
 
        plot = plotWidgets[0];
 
        plot->setDispChannels(_stream->allChannels());
 
    }
 

	
 
    if (_stream != nullptr)     // not displaying snapshot
 
    {
 
        QVector<const StreamChannel*> dispChannels;
 
        if (isMulti)
 
        {
 
            dispChannels = QVector<const StreamChannel*>(1, _stream->channel(index));
 
        }
 
        else
 
        {
 
            dispChannels = _stream->allChannels();
 
        }
 
        plot->setDispChannels(dispChannels);
 
    }
 

	
 
    // show the curve
 
    curve->attach(plot);
 
    plot->replot();
 
}
0 comments (0 inline, 0 general)