diff --git a/qmap/getfile.cpp b/qmap/getfile.cpp
index a8f8f86b4..cea79afbd 100644
--- a/qmap/getfile.cpp
+++ b/qmap/getfile.cpp
@@ -25,7 +25,6 @@ void getfile(QString fname, bool xpol, int dbDgrd)
if(fp != NULL) {
auto n = fread(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp);
n = fread(id,2,npts,fp);
- Q_UNUSED (n);
int j=0;
if(dbDgrd<0) {
@@ -39,6 +38,12 @@ void getfile(QString fname, bool xpol, int dbDgrd)
datcom_.d4[j++]=(float)id[i+1];
}
}
+ n = fread(datcom_.mygrid,sizeof(datcom_.mygrid),1,fp);
+ short int one=0;
+ fread(&one,2,1,fp);
+ Q_UNUSED(n);
+// if(n>0) qDebug() << "bb" << datcom_.mygrid << one;
+
fclose(fp);
datcom_.ndiskdat=1;
@@ -52,10 +57,10 @@ void getfile(QString fname, bool xpol, int dbDgrd)
}
}
-void savetf2(QString fname, bool xpol)
+void save_iq(QString fname, bool bCFOM)
{
int npts=2*60*96000;
- if(xpol) npts=2*npts;
+ if(bCFOM) npts=2*npts;
qint16* buf=(qint16*)malloc(2*npts);
char name[80];
@@ -70,6 +75,11 @@ void savetf2(QString fname, bool xpol)
buf[i+1]=(qint16)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);
+ }
fclose(fp);
}
free(buf);
diff --git a/qmap/getfile.h b/qmap/getfile.h
index 796c31e5c..a2bf85667 100644
--- a/qmap/getfile.h
+++ b/qmap/getfile.h
@@ -6,7 +6,7 @@
#include "commons.h"
void getfile(QString fname, bool xpol, int dbDgrd);
-void savetf2(QString fname, bool xpol);
+void save_iq(QString fname, bool bCFOM);
float gran();
#endif // GETFILE_H
diff --git a/qmap/mainwindow.cpp b/qmap/mainwindow.cpp
index f7af98d4c..3f70675ce 100644
--- a/qmap/mainwindow.cpp
+++ b/qmap/mainwindow.cpp
@@ -248,6 +248,7 @@ 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()
@@ -306,6 +307,7 @@ 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();
@@ -424,13 +426,14 @@ void MainWindow::dataSink(int k)
QDateTime t = QDateTime::currentDateTimeUtc();
m_dateTime=t.toString("yyMMdd_hhmm");
decode(); //Start the decoder
- if(m_saveAll and !m_diskData and (m_nTx30<5 and m_nTx60<10)) {
+ if(m_saveAll and !m_diskData and (m_nTx30<5 and m_nTx60<10) and ihsym==m_hsymStop) {
QDir dir(m_saveDir);
if (!dir.exists()) dir.mkpath(".");
QString fname=m_saveDir + "/" + t.date().toString("yyMMdd") + "_" +
t.time().toString("hhmm");
fname += ".iq";
- *future2 = QtConcurrent::run(savetf2, fname, false);
+ bool bCFOM=ui->cbCFOM->isChecked();
+ *future2 = QtConcurrent::run(save_iq, fname, bCFOM);
watcher2->setFuture(*future2);
}
m_nTx30=0;
diff --git a/qmap/mainwindow.h b/qmap/mainwindow.h
index 3a5e8faae..df3b879d8 100644
--- a/qmap/mainwindow.h
+++ b/qmap/mainwindow.h
@@ -193,7 +193,7 @@ private:
};
extern void getfile(QString fname, bool xpol, int idInt);
-extern void savetf2(QString fname, bool xpol);
+extern void save_iq(QString fname, bool xpol);
extern int killbyname(const char* progName);
extern "C" {
diff --git a/qmap/mainwindow.ui b/qmap/mainwindow.ui
index 299eee97f..534071f47 100644
--- a/qmap/mainwindow.ui
+++ b/qmap/mainwindow.ui
@@ -344,7 +344,7 @@
- 20
+ 10
20
@@ -353,7 +353,7 @@
-
- Apply CFOM
+ Apply Rx CFOM