Hi all,
i am using QTimer to get Data from the parallel port at a given interval.
this is the code:
{
}
void getData::set()
{
fft.Data();
parport.setPortBi();
clk = 0;
}
void getData::startTimer()
{
connect(timer, SIGNAL(timeout()),this, SLOT(getData()));
timer->start(0.2675);
}
void getData::getData()
{
if(clk<22050)
{
parport.getdata();
fft.DATA[clk] = parport.finData;
clk++;
}
else
{
timer->stop();
return;
}
}
getData::getData(QWidget *parent) : QWidget(parent)
{
timer = new QTimer(this);
}
void getData::set()
{
fft.Data();
parport.setPortBi();
clk = 0;
}
void getData::startTimer()
{
connect(timer, SIGNAL(timeout()),this, SLOT(getData()));
timer->start(0.2675);
}
void getData::getData()
{
if(clk<22050)
{
parport.getdata();
fft.DATA[clk] = parport.finData;
clk++;
}
else
{
timer->stop();
return;
}
}
To copy to clipboard, switch view to plain text mode
now i want that after 22050 times it stops the timer and return. But it is not stopping and is continuing to enter the function that is connected with.
Do anyone now what i am doing wrong, or a different code that do the same function??
10x
Adrian
Bookmarks