diff --git a/qmap/CMakeLists.txt b/qmap/CMakeLists.txt index 4a2a8f81b..d633245e2 100644 --- a/qmap/CMakeLists.txt +++ b/qmap/CMakeLists.txt @@ -42,9 +42,6 @@ add_executable (qmap ${qmap_CXXSRCS} ${qmap_CSRCS} ${qmap_GENUISRCS} qmap.rc) target_include_directories (qmap PRIVATE ${CMAKE_SOURCE_DIR} ${FFTW3_INCLUDE_DIRS}) target_link_libraries (qmap wsjt_qt qmap_impl ${FFTW3_LIBRARIES} Qt5::Widgets Qt5::Network Usb::Usb) -add_executable (cfom_iq libqmap/cfom_iq.f90) -target_link_libraries (cfom_iq qmap_impl) - if (WSJT_CREATE_WINMAIN) set_target_properties (qmap PROPERTIES WIN32_EXECUTABLE ON) endif (WSJT_CREATE_WINMAIN) diff --git a/qmap/commons.h b/qmap/commons.h index 9b904dcb0..171590e16 100644 --- a/qmap/commons.h +++ b/qmap/commons.h @@ -26,8 +26,8 @@ extern struct { //This is "common/datcom/..." in Fortran int ntx30a; //Number of seconds transmitted in first half minute , Q65-30x int ntx30b; //Number of seconds transmitted in second half minute, Q65-30x int ntol; //+/- decoding range around fQSO (Hz) - int nxant; //1 ==> add 45 deg to measured pol angle - int nCFOM; //1 ==> CFOM already done, 0 otherwise + int junk5; // + int junk4; // int nfsample; //Input sample rate int junk3; // int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) @@ -67,8 +67,8 @@ extern struct { //This is "common/datcom/..." in Fortran int ntx30a; //Number of seconds transmitted in first half minute , Q65-30x int ntx30b; //Number of seconds transmitted in second half minute, Q65-30x int ntol; //+/- decoding range around fQSO (Hz) - int nxant; //1 ==> add 45 deg to measured pol angle - int nCFOM; //1 ==> CFOM already done, 0 otherwise + int junk5; // + int junk4; // int nfsample; //Input sample rate int junk3; // int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) diff --git a/qmap/getfile.cpp b/qmap/getfile.cpp index 8c7ef7b9c..f3d8e0745 100644 --- a/qmap/getfile.cpp +++ b/qmap/getfile.cpp @@ -23,7 +23,13 @@ void getfile(QString fname, int dbDgrd) if(fp != NULL) { auto n = fread(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); - n = fread(id,2,npts,fp); + n=fread(id,2,npts,fp); + n=fread(&datcom_.ntx30a,4,1,fp); + n=fread(&datcom_.ntx30b,4,1,fp); + if(n==0) { + datcom_.ntx30a=0; + datcom_.ntx30b=0; + } int j=0; if(dbDgrd<0) { @@ -37,12 +43,6 @@ void getfile(QString fname, int dbDgrd) datcom_.d4[j++]=(float)id[i+1]; } } - n = fread(datcom_.mygrid,sizeof(datcom_.mygrid),1,fp); - short int one=0; - n= fread(&one,2,1,fp); - Q_UNUSED(n); - datcom_.nCFOM=one; - fclose(fp); datcom_.ndiskdat=1; @@ -56,10 +56,9 @@ void getfile(QString fname, int dbDgrd) } } -void save_iq(QString fname, bool bCFOM) +void save_iq(QString fname) { int npts=2*60*96000; - qint16* buf=(qint16*)malloc(2*npts); char name[80]; strcpy(name,fname.toLocal8Bit()); @@ -69,15 +68,11 @@ void save_iq(QString fname, bool bCFOM) fwrite(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); int j=0; for(int i=0; iactionAFMHot->isChecked()) on_actionAFMHot_triggered(); if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); - ui->cbCFOM->setVisible(false); - connect (m_wide_graph_window.get (), &WideGraph::freezeDecode2, this, &MainWindow::freezeDecode); connect (m_wide_graph_window.get (), &WideGraph::f11f12, this, &MainWindow::bumpDF); @@ -240,7 +238,6 @@ void MainWindow::writeSettings() settings.setValue("MaxDrift",ui->sbMaxDrift->value()); settings.setValue("Offset",ui->sbOffset->value()); settings.setValue("Also30",m_bAlso30); - settings.setValue("CFOM",ui->cbCFOM->isChecked()); } //---------------------------------------------------------- readSettings() @@ -300,7 +297,6 @@ void MainWindow::readSettings() m_bAlso30=settings.value("Also30",false).toBool(); ui->actionAlso_Q65_30x->setChecked(m_bAlso30); on_actionAlso_Q65_30x_toggled(m_bAlso30); - ui->cbCFOM->setChecked(settings.value("CFOM",false).toBool()); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && !ui->actionAFMHot->isChecked() && !ui->actionBlue->isChecked()) { on_actionLinrad_triggered(); @@ -321,7 +317,6 @@ void MainWindow::dataSink(int k) static int ndiskdat; static int nb; static int k0=0; - static int ndop00=0; static float px=0.0; static uchar lstrong[1024]; static float slimit; @@ -338,11 +333,6 @@ void MainWindow::dataSink(int k) if(m_NB) nb=1; nfsample=96000; - if(m_bCFOM) { - if(m_astro_window) ndop00=m_astro_window->getSelfDop(); - cfom_(datcom_.d4, &k0, &k, &ndop00); - } - if(m_bWTransmitting) zaptx_(datcom_.d4, &k0, &k); k0=k; @@ -411,11 +401,14 @@ void MainWindow::dataSink(int k) QString fname=m_saveDir + "/" + t.date().toString("yyMMdd") + "_" + t.time().toString("hhmm"); fname += ".iq"; - *future2 = QtConcurrent::run(save_iq, fname, m_bCFOM); + *future2 = QtConcurrent::run(save_iq, fname); watcher2->setFuture(*future2); } - if(ihsym==200) m_nTx30b=0; - if(ihsym==m_hsymStop) m_nTx60=0; + if(ihsym==m_hsymStop) { + m_nTx30a=0; + m_nTx30b=0; + m_nTx60=0; + } } soundInThread.m_dataSinkBusy=false; } @@ -703,6 +696,8 @@ void MainWindow::diskDat() //diskDat() //These may be redundant?? m_diskData=true; datcom_.newdat=1; + 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 int k = i*hsym + 0.5; @@ -806,10 +801,10 @@ void MainWindow::decode() //decode() { if(m_decoderBusy) return; //Don't attempt decode if decoder already busy if(m_nTx60>10) return; //Don't decode if WSJT-X transmitted too much in 60 s mode -//No need to call decoder for first half, if we transmitted in the firsat half: +//No need to call decoder for first half, if we transmitted in the first half: if((datcom_.nhsym<=200) and (m_nTx30a>5)) return; //No need to call decoder in second half, if we transmitted in that half: - if((datcom_.nhsym>=330) and (m_nTx30b>5)) return; + if((datcom_.nhsym>200) and (m_nTx30b>5)) return; QString fname=" "; ui->DecodeButton->setStyleSheet(m_pbdecoding_style1); @@ -830,6 +825,7 @@ void MainWindow::decode() //decode() datcom_.ndiskdat=1; int i0=m_path.indexOf(".iq"); if(i0>0) { + /* // Compute self Doppler using the filename for Date and Time int nyear=m_path.mid(i0-11,2).toInt()+2000; int month=m_path.mid(i0-9,2).toInt(); @@ -839,10 +835,8 @@ void MainWindow::decode() //decode() double uth=nhr + nmin/60.0; int nfreq=(int)datcom_.fcenter; int ndop00=0; - if((datcom_.nCFOM&1)==0) { - astrosub00_(&nyear, &month, &nday, &uth, &nfreq, m_myGrid.toLatin1(),&ndop00,6); - } - datcom_.ndop00=ndop00; //Send self Doppler (or 0, if disk data had CFOM already) to decoder + datcom_.ndop00=ndop00; //Send self Doppler to decoder + */ fname=m_path.mid(i0-11,11); } } @@ -859,7 +853,6 @@ void MainWindow::decode() //decode() datcom_.nfcal=m_fCal; datcom_.nfshift=nfshift; datcom_.ntol=m_tol; - datcom_.nxant=0; m_nutc0=datcom_.nutc; datcom_.nfsample=96000; datcom_.nBaseSubmode=m_modeQ65; @@ -998,25 +991,11 @@ void MainWindow::guiUpdate() m_bWTransmitting=false; } -// qDebug() << "AAA" << n60 << m_bWTransmitting << m_nTx60 << m_nTx30a << m_nTx30b -// << itest[0] << itest[1] << itest[2] << itest[3] << itest[4]; - - if(n60cbCFOM->setVisible(f.exists()); - m_bCFOM=ui->cbCFOM->isVisible() and ui->cbCFOM->isChecked(); - datcom_.nCFOM&=1; - if(m_bCFOM) { - datcom_.nCFOM|=2; - qDebug() << "CFOM" << n60 << datcom_.nCFOM << datcom_.ndop00 << datcom2_.ndop00; - } - n60z=n60; if(m_pctZap>30.0) { diff --git a/qmap/mainwindow.h b/qmap/mainwindow.h index ec81f47e0..f8dbe6ea7 100644 --- a/qmap/mainwindow.h +++ b/qmap/mainwindow.h @@ -133,7 +133,6 @@ private: bool m_bAlso30=false; bool m_bDiskDatBusy=false; bool m_bWTransmitting=false; - bool m_bCFOM=false; float m_pctZap; @@ -186,7 +185,7 @@ private: }; extern void getfile(QString fname, bool xpol, int idInt); -extern void save_iq(QString fname, bool xpol); +extern void save_iq(QString fname); extern int killbyname(const char* progName); extern "C" { @@ -200,8 +199,6 @@ extern "C" { void q65c_(int* itimer); - void cfom_(float d4[], int* k0, int* k, int* ndop0); - void zaptx_(float d4[], int* k0, int* k); } diff --git a/qmap/mainwindow.ui b/qmap/mainwindow.ui index b0ce1fb0f..1a950284f 100644 --- a/qmap/mainwindow.ui +++ b/qmap/mainwindow.ui @@ -332,33 +332,6 @@ - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - Apply Rx CFOM - - - - - diff --git a/qmap/soundin.cpp b/qmap/soundin.cpp index d10f9fb24..1b71b9e81 100644 --- a/qmap/soundin.cpp +++ b/qmap/soundin.cpp @@ -34,10 +34,10 @@ extern "C" int ntx30a; //Number of seconds transmitted in first half minute , Q65-30x int ntx30b; //Number of seconds transmitted in second half minute, Q65-30x int ntol; //+/- decoding range around fQSO (Hz) - int nxant; //1 ==> add 45 deg to measured pol angle - int nCFOM; //1 ==> CFOM already done, 0 otherwise + int junk5; // + int junk4; // int nfsample; //Input sample rate - int nxpol; //1 if using xpol antennas, 0 otherwise + int junk3; // int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) int ndop00; //EME Self Doppler int nsave; //Number of s3(64,63) spectra saved