General cleanup. Remove CFOM stuff. Fix logic for 30 s transmissions. Add ntx30x to .iq files.

This commit is contained in:
Joe Taylor 2024-01-03 13:51:37 -05:00
parent 05ed9c050d
commit 69f3186b13
10 changed files with 44 additions and 94 deletions

View File

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

View File

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

View File

@ -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; i<npts; i+=2) {
buf[i]=(qint16)datcom_.d4[j++];
buf[i+1]=(qint16)datcom_.d4[j++];
buf[i]=(qint16)qRound(datcom_.d4[j++]);
buf[i+1]=(qint16)qRound(datcom_.d4[j++]);
}
fwrite(buf,2,npts,fp);
if(bCFOM) {
fwrite(&datcom_.mygrid,sizeof(datcom_.mygrid),1,fp);
short int one=1;
fwrite(&one,2,1,fp);
}
fwrite(&datcom_.ntx30a,4,2,fp); //Write ntx30a and ntx30b to disk
fclose(fp);
}
free(buf);

View File

@ -6,7 +6,7 @@
#include "commons.h"
void getfile(QString fname, int dbDgrd);
void save_iq(QString fname, bool bCFOM);
void save_iq(QString fname);
float gran();
#endif // GETFILE_H

View File

@ -5,7 +5,6 @@ set (libq65_FSRCS
astro.f90
astro0.f90
astrosub.f90
cfom.f90
chkstat.f90
dcoord.f90
decode0.f90
@ -32,6 +31,7 @@ set (libq65_FSRCS
timf2.f90
tm2.f90
toxyz.f90
zaptx.f90
f77_wisdom.f
)

9
qmap/libqmap/zaptx.f90 Normal file
View File

@ -0,0 +1,9 @@
subroutine zaptx(dd,k0,k)
parameter(NMAX=60*96000)
real dd(2,NMAX)
dd(1:2,k0+1:k)=0.
return
end subroutine zaptx

View File

@ -178,8 +178,6 @@ MainWindow::MainWindow(QWidget *parent) :
if(ui->actionAFMHot->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(n60<n60z) {
if((n60<n60z) and !m_diskData) {
m_nTx30a=0;
m_nTx30b=0;
m_nTx60=0;
}
// Check for a file named "cfom"
QFile f(m_appDir + "/cfom");
ui->cbCFOM->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) {

View File

@ -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);
}

View File

@ -332,33 +332,6 @@
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbCFOM">
<property name="text">
<string>Apply Rx CFOM</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="0" column="0" colspan="2">

View File

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