Changeset - 42da1825ce45
[Not reviewed]
plot-manager
0 3 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-08-25 01:34:48
hy@ozderya.net
implemented plotman.replot
3 files changed with 23 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/mainwindow.cpp
Show inline comments
 
@@ -141,7 +141,7 @@ MainWindow::MainWindow(QWidget *parent) 
 

	
 
    // init data format and reader
 
    QObject::connect(&dataFormatPanel, &DataFormatPanel::dataAdded,
 
                     ui->plot, &QwtPlot::replot);
 
                     plotMan, &PlotManager::replot);
 

	
 
    QObject::connect(ui->actionPause, &QAction::triggered,
 
                     &dataFormatPanel, &DataFormatPanel::pause);
 
@@ -297,14 +297,14 @@ void MainWindow::clearPlot()
 
    {
 
        channelMan.channelBuffer(ci)->clear();
 
    }
 
    ui->plot->replot();
 
    plotMan->replot();
 
}
 

	
 
void MainWindow::onNumOfSamplesChanged(int value)
 
{
 
    numOfSamples = value;
 
    channelMan.setNumOfSamples(value);
 
    ui->plot->replot();
 
    plotMan->replot();
 
}
 

	
 
void MainWindow::onNumOfChannelsChanged(unsigned value)
 
@@ -325,8 +325,7 @@ void MainWindow::onNumOfChannelsChanged(
 
        plotMan->removeCurves(oldNum - numOfChannels);
 
    }
 

	
 
    // TODO: plotman.replot
 
    ui->plot->replot();
 
    plotMan->replot();
 
}
 

	
 
void MainWindow::onChannelNameChanged(unsigned channel, QString name)
 
@@ -359,7 +358,7 @@ void MainWindow::enableDemo(bool enabled
 
            dataFormatPanel.enableDemo(true);
 
            ui->actionDemoMode->setChecked(true);
 
            demoIndicator.show();
 
            ui->plot->replot();
 
            plotMan->replot();
 
        }
 
        else
 
        {
 
@@ -371,7 +370,7 @@ void MainWindow::enableDemo(bool enabled
 
        dataFormatPanel.enableDemo(false);
 
        ui->actionDemoMode->setChecked(false);
 
        demoIndicator.hide();
 
        ui->plot->replot();
 
        plotMan->replot();
 
    }
 
}
 

	
src/plotmanager.cpp
Show inline comments
 
@@ -204,3 +204,18 @@ Plot* PlotManager::plotWidget(unsigned c
 
        return plotWidgets[0];
 
    }
 
}
 

	
 
void PlotManager::replot()
 
{
 
    if (isMulti)
 
    {
 
        for (auto plot : plotWidgets)
 
        {
 
            plot->replot();
 
        }
 
    }
 
    else
 
    {
 
        plotWidgets[0]->replot();
 
    }
 
}
src/plotmanager.h
Show inline comments
 
@@ -56,6 +56,8 @@ signals:
 
public slots:
 
    /// Enable/Disable multiple plot display
 
    void setMulti(bool enabled);
 
    /// Update all plot widgets
 
    void replot();
 

	
 
private:
 
    bool isMulti;
0 comments (0 inline, 0 general)