Changeset - 6abb4bd782b3
[Not reviewed]
default
0 1 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-21 12:46:06
hy@ozderya.net
fix zero passing of demo data calculation
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
mainwindow.cpp
Show inline comments
 
@@ -594,25 +594,25 @@ bool MainWindow::isDemoRunning()
 
}
 

	
 
void MainWindow::spsTimerTimeout()
 
{
 
    spsLabel.setText(QString::number(sampleCount/SPS_UPDATE_TIMEOUT) + "sps");
 
    sampleCount = 0;
 
}
 

	
 
void MainWindow::demoTimerTimeout()
 
{
 
    const double period = 100;
 
    demoCount++;
 
    if (demoCount > 100) demoCount = 0;
 
    if (demoCount >= 100) demoCount = 0;
 

	
 
    if (!ui->actionPause->isChecked())
 
    {
 
        for (unsigned int ci = 0; ci < numOfChannels; ci++)
 
        {
 
            // we are calculating the fourier components of square wave
 
            double value = 4*sin(2*M_PI*double((ci+1)*demoCount)/period)/((2*(ci+1))*M_PI);
 
            addChannelData(ci, &value, 1);
 
        }
 
        ui->plot->replot();
 
    }
 
}
0 comments (0 inline, 0 general)