From adebd2420a9c07668863508d005c6c899e657930 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 2 Jun 2015 15:59:52 +0000 Subject: [PATCH] Pass absolute file path for JPLEPH to astrosub_(). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5494 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- astro.cpp | 9 +++++---- astro.h | 5 +++-- lib/astrosub.f90 | 8 +++++--- mainwindow.cpp | 10 +++++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/astro.cpp b/astro.cpp index 384844365..23c7dc63a 100644 --- a/astro.cpp +++ b/astro.cpp @@ -82,7 +82,7 @@ void Astro::write_settings () } void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid, qint64 freqMoon, - qint32* ndop, qint32* ndop00, bool bTx) + qint32* ndop, qint32* ndop00, bool bTx, QString jpleph) { double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx; double ramoon,decmoon,dgrd,poloffset,xnr,techo,width1,width2; @@ -100,14 +100,15 @@ void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid, qint64 fre int nfreq=freqMoon/1000000; double freq8=(double)freqMoon; - QDir dataDir = QStandardPaths::writableLocation (QStandardPaths::DataLocation); - QString fname = QDir::toNativeSeparators(dataDir.absoluteFilePath ("azel.dat")); + QDir writable = QStandardPaths::writableLocation (QStandardPaths::DataLocation); + QString AzElFileName = QDir::toNativeSeparators(writable.absoluteFilePath ("azel.dat")); astrosub_(&nyear, &month, &nday, &uth, &freq8, mygrid.toLatin1(), hisgrid.toLatin1(), &azsun, &elsun, &azmoon, &elmoon, &azmoondx, &elmoondx, &ntsky, ndop, ndop00, &ramoon, &decmoon, &dgrd, &poloffset, &xnr, &techo, &width1, &width2, &bTx, - fname.toLatin1(), 6, 6, fname.length()); + AzElFileName.toLatin1(), jpleph.toLatin1(), 6, 6, + AzElFileName.length(), jpleph.length()); QString message; { diff --git a/astro.h b/astro.h index dcf18a8fd..e5062be87 100644 --- a/astro.h +++ b/astro.h @@ -23,7 +23,7 @@ public: explicit Astro(QSettings * settings, QWidget * parent = nullptr); ~Astro (); void astroUpdate(QDateTime t, QString mygrid, QString hisgrid, qint64 freqMoon, - qint32* ndop, qint32 *ndop00, bool bTx); + qint32* ndop, qint32 *ndop00, bool bTx, QString jpleph); bool m_bDopplerTracking; bool m_bRxAudioTrack; @@ -65,7 +65,8 @@ extern "C" { double* elmoondx, int* ntsky, int* ndop, int* ndop00, double* ramoon, double* decmoon, double* dgrd, double* poloffset, double* xnr, double* techo, double* width1, double* width2, - bool* bTx, const char* fname, int len1, int len2, int len3); + bool* bTx, const char* AzElFileName, const char* jpleph, + int len1, int len2, int len3, int len4); } #endif // ASTRO_H diff --git a/lib/astrosub.f90 b/lib/astrosub.f90 index db424356c..10e717e1d 100644 --- a/lib/astrosub.f90 +++ b/lib/astrosub.f90 @@ -1,9 +1,11 @@ subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & - RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,techo8,width1,width2,bTx,fname) + RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,techo8,width1,width2,bTx, & + AzElFileName,jpleph) implicit real*8 (a-h,o-z) - character*6 mygrid,hisgrid,fname*(*),c1*1 + character*6 mygrid,hisgrid,c1*1 + character*6 AzElFileName*(*),jpleph*(*) logical*1 bTx call astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & @@ -16,7 +18,7 @@ subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & ih=uth8 im=mod(imin,60) is=mod(isec,60) - open(15,file=fname,status='unknown',err=900) + open(15,file=AzElFileName,status='unknown',err=900) c1='R' nRx=1 if(bTx) then diff --git a/mainwindow.cpp b/mainwindow.cpp index b959b68c7..6c690f917 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2132,7 +2132,8 @@ void MainWindow::guiUpdate() m_freqMoon=m_dialFreq + 1000*m_astroWidget->m_kHz + m_astroWidget->m_Hz; int ndop,ndop00; m_astroWidget->astroUpdate(t, m_config.my_grid (), m_hisGrid,m_freqMoon, - &ndop, &ndop00, m_transmitting); + &ndop, &ndop00, m_transmitting, + m_config.data_dir().absoluteFilePath("JPLEPH")); //Apply Doppler corrections only for 50 MHz and above if(m_freqNominal>=50000000) { @@ -4382,11 +4383,14 @@ void MainWindow::bandHopping() void MainWindow::on_pushButton_clicked() { + qDebug() << "A" << m_config.data_dir(); + qDebug() << "B" << m_config.data_dir().absolutePath(); + qDebug() << "C" << m_config.data_dir().absoluteFilePath("JPLEPH"); +/* m_hopTest=true; -// for(int i=0; i<720; i++) { bandHopping(); -// } m_hopTest=false; +*/ } void MainWindow::on_sunriseBands_editingFinished()