Changeset - 52af566267d1
[Not reviewed]
default
0 2 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2016-03-25 16:47:57
hy@ozderya.net
show sample per second value for a single channel, not total input
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/dataformatpanel.cpp
Show inline comments
 
@@ -173,25 +173,25 @@ void DataFormatPanel::enableDemo(bool en
 
    {
 
        demoTimer.start();
 
    }
 
    else
 
    {
 
        demoTimer.stop();
 
    }
 
}
 

	
 
void DataFormatPanel::spsTimerTimeout()
 
{
 
    unsigned currentSps = _samplesPerSecond;
 
    _samplesPerSecond = sampleCount/SPS_UPDATE_TIMEOUT;
 
    _samplesPerSecond = (sampleCount/_numOfChannels)/SPS_UPDATE_TIMEOUT;
 
    if (currentSps != _samplesPerSecond)
 
    {
 
        emit samplesPerSecondChanged(_samplesPerSecond);
 
    }
 
    sampleCount = 0;
 
}
 

	
 

	
 
void DataFormatPanel::demoTimerTimeout()
 
{
 
    const double period = 100;
 
    demoCount++;
src/mainwindow.cpp
Show inline comments
 
@@ -190,25 +190,25 @@ MainWindow::MainWindow(QWidget *parent) 
 
            QVariant::fromValue(Range{0, double(rmax)}));
 
    }
 
    ui->cbRangePresets->addItem("-1 to +1", QVariant::fromValue(Range{-1, +1}));
 
    ui->cbRangePresets->addItem("0 to +1", QVariant::fromValue(Range{0, +1}));
 
    ui->cbRangePresets->addItem("-100 to +100", QVariant::fromValue(Range{-100, +100}));
 
    ui->cbRangePresets->addItem("0 to +100", QVariant::fromValue(Range{0, +100}));
 

	
 
    QObject::connect(ui->cbRangePresets, SIGNAL(activated(int)),
 
                     this, SLOT(onRangeSelected()));
 

	
 
    // Init sps (sample per second) counter
 
    spsLabel.setText("0sps");
 
    spsLabel.setToolTip("samples per second (total of all channels)");
 
    spsLabel.setToolTip("samples per second (per channel)");
 
    ui->statusBar->addPermanentWidget(&spsLabel);
 
    QObject::connect(&dataFormatPanel,
 
                     &DataFormatPanel::samplesPerSecondChanged,
 
                     this, &MainWindow::onSpsChanged);
 

	
 
    // init demo
 
    QObject::connect(ui->actionDemoMode, &QAction::toggled,
 
                     this, &MainWindow::enableDemo);
 

	
 
    {   // init demo indicator
 
        QwtText demoText(" DEMO RUNNING ");  // looks better with spaces
 
        demoText.setColor(QColor("white"));
0 comments (0 inline, 0 general)