Changeset - 92e73c460a79
[Not reviewed]
barplot
0 2 0
Hasan Yavuz Ă–ZDERYA - 8 years ago 2017-10-03 07:46:53
hy@ozderya.net
update barplot on start
2 files changed with 11 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/barplot.cpp
Show inline comments
 
@@ -22,12 +22,15 @@
 
BarPlot::BarPlot(ChannelManager* channelMan, QWidget* parent) :
 
    QwtPlot(parent), barChart(channelMan)
 
{
 
    _channelMan = channelMan;
 
    barChart.attach(this);
 

	
 
    connect(_channelMan, &ChannelManager::dataAdded, [this]()
 
            {
 
                barChart.resample();
 
                replot();
 
            });
 
    connect(_channelMan, &ChannelManager::dataAdded, this, &BarPlot::update);
 
    connect(_channelMan, &ChannelManager::numOfChannelsChanged, this, &BarPlot::update);
 
}
 

	
 
void BarPlot::update()
 
{
 
    barChart.resample();
 
    replot();
 
}
src/barplot.h
Show inline comments
 
@@ -34,9 +34,12 @@ public:
 

	
 
private:
 
    ChannelManager* _channelMan;
 
    BarChart barChart;
 

	
 
    QVector<double> chartData() const;
 

	
 
private slots:
 
    void update();
 
};
 

	
 
#endif // BARPLOT_H
0 comments (0 inline, 0 general)