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
This commit is contained in:
Joe Taylor 2015-06-02 15:59:52 +00:00
parent 793068c55f
commit c4909d52b0
4 changed files with 20 additions and 12 deletions

View File

@ -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;
{

View File

@ -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

View File

@ -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

View File

@ -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()