From 2f9fde08531184ec99a52576db2f68d67ccedb9b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 21 Nov 2014 15:17:22 +0000 Subject: [PATCH] Add wisdom for the FFTs done by symspec_(), wsjtx[.exe]. Also complete the wrapper code in wisdom.c. TBD: should be possible to use fftw3f.f03 instead of the ad hoc wisdom.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4617 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 1 - lib/jt9.f90 | 4 +++- lib/wisdom.c | 9 +++++++++ mainwindow.cpp | 7 +++++++ mainwindow.h | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fbfe1a11..bb2e85e36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,7 +242,6 @@ set (wsjt_FSRCS lib/entail.f90 lib/extract.F90 lib/geocentric.f90 - lib/f77_wisdom.f90 lib/fano232.f90 lib/fchisq.f90 lib/fchisq65.f90 diff --git a/lib/jt9.f90 b/lib/jt9.f90 index f7584646e..ddf0e793e 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -74,7 +74,9 @@ program jt9 1000 format(a40) rewind 28 isuccess=0 - call import_wisdom_from_file(isuccess,28) + wisfile=trim(data_dir)//'/jt9_wisdom.dat' + n=len_trim(wisfile) + call import_wisdom(wisfile(1:n)//char(0),isuccess) close(28) 30 if(isuccess.ne.0) then write(14,1010) firstline diff --git a/lib/wisdom.c b/lib/wisdom.c index 59cdd2b68..ef008a7d8 100644 --- a/lib/wisdom.c +++ b/lib/wisdom.c @@ -1,4 +1,13 @@ void export_wisdom_(char fname[], int len) { + int fftwf_export_wisdom_to_filename(const char *); + fname[len-1]=0; fftwf_export_wisdom_to_filename(fname); } + +void import_wisdom_(char fname[], int *success, int len) +{ + int fftwf_import_wisdom_from_filename(const char *); + fname[len-1]=0; + *success = fftwf_import_wisdom_from_filename(fname); +} diff --git a/mainwindow.cpp b/mainwindow.cpp index 1d5960e58..0437c86d2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -380,6 +380,10 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme proc_jt9.start(QDir::toNativeSeparators (m_appDir) + QDir::separator () + "jt9", jt9_args, QIODevice::ReadWrite | QIODevice::Unbuffered); + QString fname(QDir::toNativeSeparators(m_config.data_path ().absoluteFilePath ("wsjtx_wisdom.dat"))); + QByteArray cfname=fname.toLocal8Bit(); + int success = fftwf_import_wisdom_from_filename(cfname); + getpfx(); //Load the prefix/suffix dictionary genStdMsgs(m_rpt); m_ntx=6; @@ -435,6 +439,9 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme //--------------------------------------------------- MainWindow destructor MainWindow::~MainWindow() { + QString fname(QDir::toNativeSeparators(m_config.data_path ().absoluteFilePath ("wsjtx_wisdom.dat"))); + QByteArray cfname=fname.toLocal8Bit(); + fftwf_export_wisdom_to_filename(cfname); m_audioThread->wait (); } diff --git a/mainwindow.h b/mainwindow.h index 7166d34f9..c1cd0d56f 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -417,6 +417,9 @@ extern "C" { int ptt_(int nport, int ntx, int* iptt, int* nopen); + int fftwf_import_wisdom_from_filename(const char *); + int fftwf_export_wisdom_to_filename(const char *); + } #endif // MAINWINDOW_H