From 606506f578b50bf3707252b0712ccb55475105ab Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 4 Jan 2024 10:52:36 -0500 Subject: [PATCH] Work in progress: Now able to read from *.qm files. --- qmap/libqmap/CMakeLists.txt | 1 + qmap/libqmap/read_qm.f90 | 26 ++++++++++++++++++++++++++ qmap/mainwindow.cpp | 12 ++++++++++-- qmap/mainwindow.h | 3 +++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 qmap/libqmap/read_qm.f90 diff --git a/qmap/libqmap/CMakeLists.txt b/qmap/libqmap/CMakeLists.txt index 79069df47..a1752ba10 100644 --- a/qmap/libqmap/CMakeLists.txt +++ b/qmap/libqmap/CMakeLists.txt @@ -25,6 +25,7 @@ set (libq65_FSRCS q65c.f90 q65_sync.f90 qmapa.f90 + read_qm.f90 recvpkt.f90 save_qm.f90 sun.f90 diff --git a/qmap/libqmap/read_qm.f90 b/qmap/libqmap/read_qm.f90 new file mode 100644 index 000000000..a38f8f566 --- /dev/null +++ b/qmap/libqmap/read_qm.f90 @@ -0,0 +1,26 @@ +subroutine read_qm(fname) + + include 'njunk.f90' + parameter(NMAX=60*96000,NFFT=32768) + character*(*) fname + character prog_id*24,mycall*12,mygrid*6 + real*8 fcenter + integer*1 id1(2,NMAX) + common/datcom/dd(2,5760000),ss(400,NFFT),savg(NFFT),fcenter,nutc,junk(NJUNK) + + open(28,file=trim(fname),status='old',access='stream',err=900) + read(28) prog_id,mycall,mygrid,ntx30a,ntx30b,ia,ib + id1=0 + read(28) id1(1:2,ia:ib) + dd=0. + dd(1:2,ia:ib)=id1(1:2,ia:ib) + fcenter=1296.090 + nutc=0100 + write(*,3001) prog_id,mycall(1:6),mygrid,ntx30a,ntx30b,ia,ib +3001 format(a24,2x,a6,2x,a6,2i5,2i9) + return + +900 print*,'Cannot open ',fname + + return +end subroutine read_qm diff --git a/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index b9f7e82c1..3867b61d6 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -655,7 +655,11 @@ void MainWindow::on_actionOpen_triggered() //Open File if(m_monitoring) on_monitorButton_clicked(); m_diskData=true; int dbDgrd=0; - *future1 = QtConcurrent::run(getfile, fname, dbDgrd); + if(m_path.indexOf(".iq")>0) { + *future1 = QtConcurrent::run(getfile, fname, dbDgrd); + } else { + *future1 = QtConcurrent::run(read_qm_, fname.toLatin1(), fname.length()); + } watcher1->setFuture(*future1); } } @@ -685,7 +689,11 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next } m_diskData=true; int dbDgrd=0; - *future1 = QtConcurrent::run(getfile, fname, dbDgrd); + if(m_path.indexOf(".iq")>0) { + *future1 = QtConcurrent::run(getfile, fname, dbDgrd); + } else { + *future1 = QtConcurrent::run(read_qm_, fname.toLatin1(), fname.length()); + } watcher1->setFuture(*future1); return; } diff --git a/qmap/mainwindow.h b/qmap/mainwindow.h index 05691e652..618772bab 100644 --- a/qmap/mainwindow.h +++ b/qmap/mainwindow.h @@ -203,6 +203,9 @@ extern "C" { void save_qm_(const char* fname, const char* prog_id, const char* mycall, const char* mygrid, float d4[], int* ntx30a, int* ntx30b, int len1, int len2, int len3, int len4); + + void read_qm_(const char* fname, int len); + } #endif // MAINWINDOW_H