mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-21 19:48:54 -04:00
Don't use future/watcher for reading raw data from disk. Better use of 30-second Rx sequences.
This commit is contained in:
parent
ae14fa13e9
commit
8be743e0b8
@ -1,4 +1,4 @@
|
||||
subroutine read_qm(fname)
|
||||
subroutine read_qm(fname,iret)
|
||||
|
||||
include 'njunk.f90'
|
||||
parameter(NMAX=60*96000,NFFT=32768)
|
||||
@ -13,22 +13,36 @@ subroutine read_qm(fname)
|
||||
ntx30a,ntx30b !...
|
||||
|
||||
open(28,file=trim(fname),status='old',access='stream',err=900)
|
||||
read(28) prog_id,mycall,mygrid,fcenter,nutc,ntx30a,ntx30b,ndop00,ndop58, &
|
||||
ia,ib,fac0,nxtra
|
||||
read(28,end=910) prog_id,mycall,mygrid,fcenter,nutc,ntx30a, &
|
||||
ntx30b,ndop00,ndop58,ia,ib,fac0,nxtra
|
||||
fac=1.0
|
||||
if(fac0.gt.0.0) fac=1.0/fac0
|
||||
id1=0
|
||||
read(28) id1(1:2,ia:ib)
|
||||
read(28,end=910) id1(1:2,ia:ib)
|
||||
dd=0.
|
||||
dd(1:2,ia:ib)=fac*id1(1:2,ia:ib) !Boost back to previous level
|
||||
|
||||
iret=3
|
||||
if(ib.eq.NMAX/2) iret=1
|
||||
if(ia.eq.NMAX/2+1) iret=2
|
||||
! print*,'A',ia,ib,iret
|
||||
! write(*,3001) prog_id,mycall(1:6),mygrid,fcenter,nutc,ntx30a,ntx30b, &
|
||||
! ndop00,ndop58,ia,ib
|
||||
!3001 format(a24,2x,a6,2x,a6,f10.3,i6.4,2i5/4i9)
|
||||
go to 999
|
||||
|
||||
900 print*,'Cannot open ',fname
|
||||
900 iret=-1; go to 999
|
||||
910 iret=-2
|
||||
|
||||
999 close(28)
|
||||
|
||||
! sq1=0.
|
||||
! sq2=0.
|
||||
! NH=NMAX/2
|
||||
! do i=1,NMAX
|
||||
! if(i.le.NH) sq1=sq1 + dd(1,i)*dd(1,i) + dd(2,i)*dd(2,i)
|
||||
! if(i.gt.NH) sq2=sq2 + dd(1,i)*dd(1,i) + dd(2,i)*dd(2,i)
|
||||
! enddo
|
||||
! print*,'B',sqrt(sq1/NMAX),sqrt(sq2/NMAX)
|
||||
|
||||
return
|
||||
end subroutine read_qm
|
||||
|
@ -132,9 +132,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
if(m_modeQ65==4) on_actionQ65D_triggered();
|
||||
if(m_modeQ65==5) on_actionQ65E_triggered();
|
||||
|
||||
future1 = new QFuture<void>;
|
||||
watcher1 = new QFutureWatcher<void>;
|
||||
connect(watcher1, SIGNAL(finished()),this,SLOT(diskDat()));
|
||||
connect(&watcher3, SIGNAL(finished()),this,SLOT(decoderFinished()));
|
||||
|
||||
// Assign input device and start input thread
|
||||
@ -671,12 +668,13 @@ void MainWindow::on_actionOpen_triggered() //Open File
|
||||
if(m_monitoring) on_monitorButton_clicked();
|
||||
m_diskData=true;
|
||||
int dbDgrd=0;
|
||||
int iret=4;
|
||||
if(m_path.indexOf(".iq")>0) {
|
||||
*future1 = QtConcurrent::run(getfile, fname, dbDgrd);
|
||||
getfile(fname, dbDgrd);
|
||||
} else {
|
||||
*future1 = QtConcurrent::run(read_qm_, fname.toLatin1(), fname.length());
|
||||
read_qm_(fname.toLatin1(), &iret, fname.length());
|
||||
}
|
||||
watcher1->setFuture(*future1);
|
||||
if(iret > 0) diskDat(iret);
|
||||
}
|
||||
}
|
||||
|
||||
@ -705,12 +703,13 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next
|
||||
}
|
||||
m_diskData=true;
|
||||
int dbDgrd=0;
|
||||
int iret=4;
|
||||
if(m_path.indexOf(".iq")>0) {
|
||||
*future1 = QtConcurrent::run(getfile, fname, dbDgrd);
|
||||
getfile(fname, dbDgrd);
|
||||
} else {
|
||||
*future1 = QtConcurrent::run(read_qm_, fname.toLatin1(), fname.length());
|
||||
read_qm_(fname.toLatin1(), &iret, fname.length());
|
||||
}
|
||||
watcher1->setFuture(*future1);
|
||||
if(iret > 0) diskDat(iret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -722,8 +721,12 @@ void MainWindow::on_actionDecode_remaining_files_in_directory_triggered()
|
||||
on_actionOpen_next_in_directory_triggered();
|
||||
}
|
||||
|
||||
void MainWindow::diskDat() //diskDat()
|
||||
void MainWindow::diskDat(int iret) //diskDat()
|
||||
{
|
||||
int ia=0;
|
||||
int ib=400;
|
||||
if(iret==1) ib=202;
|
||||
// qDebug() << "aa" << iret << ia << ib;
|
||||
m_bDiskDatBusy=true;
|
||||
double hsym;
|
||||
//These may be redundant??
|
||||
@ -732,7 +735,7 @@ void MainWindow::diskDat() //diskDat()
|
||||
m_nTx30a=datcom_.ntx30a;
|
||||
m_nTx30b=datcom_.ntx30b;
|
||||
hsym=0.15*96000.0; //Samples per Q65-30x half-symbol or Q65-60x quarter-symbol
|
||||
for(int i=0; i<400; i++) { // Do the half-symbol FFTs
|
||||
for(int i=ia; i<ib; i++) { // Do the half-symbol FFTs
|
||||
int k = i*hsym + 0.5;
|
||||
if(k > 60*96000) break;
|
||||
dataSink(k);
|
||||
|
@ -39,7 +39,7 @@ public slots:
|
||||
void showSoundInError(const QString& errorMsg);
|
||||
void showStatusMessage(const QString& statusMsg);
|
||||
void dataSink(int k);
|
||||
void diskDat();
|
||||
void diskDat(int iret);
|
||||
void decoderFinished();
|
||||
void freezeDecode(int n);
|
||||
void guiUpdate();
|
||||
@ -155,8 +155,6 @@ private:
|
||||
|
||||
QMessageBox msgBox0;
|
||||
|
||||
QFuture<void>* future1;
|
||||
QFutureWatcher<void>* watcher1;
|
||||
QFutureWatcher<void> watcher3; //For decoder
|
||||
|
||||
QString m_path;
|
||||
@ -208,7 +206,7 @@ extern "C" {
|
||||
float d4[], int* ntx30a, int* ntx30b, double* fcenter, int* nutc,
|
||||
int* dop00, int* dop58, int len1, int len2, int len3, int len4);
|
||||
|
||||
void read_qm_(const char* fname, int len);
|
||||
void read_qm_(const char* fname, int* iret, int len);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user