diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-04-27 12:26:36 +0100 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-04-27 12:26:36 +0100 |
| commit | 92bc165d4773fd349c819f0e003141bc6deffd2e (patch) | |
| tree | 4f85e7df3439fd3460ca8f355266f0e5409497a2 /qmap/getfile.cpp | |
| parent | b3177e837e5875f91766ee84ee6a14127509e7fe (diff) | |
| parent | 93f7198f9c2864ef9630cc0cc9e46d6cc1933aa9 (diff) | |
Update upstream source from tag 'upstream/2.7.0_rc4+repack'
Update to upstream version '2.7.0~rc4+repack'
with Debian dir 44013c61dd790a48f294ea090087c1fb373ab33f
Diffstat (limited to 'qmap/getfile.cpp')
| -rwxr-xr-x | qmap/getfile.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/qmap/getfile.cpp b/qmap/getfile.cpp index 95dd0791..715d7249 100755 --- a/qmap/getfile.cpp +++ b/qmap/getfile.cpp @@ -6,10 +6,10 @@ extern qint16 id[2*60*96000];
-void getfile(QString fname, bool xpol, int dbDgrd)
+void getfile(QString fname, int dbDgrd)
{
- int npts=2*56*96000;
- if(xpol) npts=2*npts;
+// int npts=2*56*96000;
+ int npts=2*60*96000;
// Degrade S/N by dbDgrd dB -- for tests only!!
float dgrd=0.0;
@@ -23,31 +23,32 @@ void getfile(QString fname, bool xpol, int dbDgrd) if(fp != NULL) {
auto n = fread(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp);
-// qDebug() << "aa0" << sizeof(datcom_.fcenter) << n << datcom_.fcenter;
- n = fread(id,2,npts,fp);
- Q_UNUSED (n);
+ 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) {
for(int i=0; i<npts; i+=2) {
datcom_.d4[j++]=fac*((float)id[i] + dgrd*gran());
datcom_.d4[j++]=fac*((float)id[i+1] + dgrd*gran());
-// if(!xpol) j+=2; //Skip over d4(3,x) and d4(4,x)
}
} else {
for(int i=0; i<npts; i+=2) {
datcom_.d4[j++]=(float)id[i];
datcom_.d4[j++]=(float)id[i+1];
-// if(!xpol) j+=2; //Skip over d4(3,x) and d4(4,x)
}
}
fclose(fp);
datcom_.ndiskdat=1;
int nfreq=(int)datcom_.fcenter;
- if(nfreq!=144 and nfreq != 432 and nfreq != 1296) datcom_.fcenter=1296.080;
- int i0=fname.indexOf(".tf2");
- if(i0<0) i0=fname.indexOf(".iq");
+ if(nfreq!=144 and nfreq != 432 and nfreq != 1296) datcom_.fcenter=1296.090;
+ int i0=fname.indexOf(".iq");
datcom_.nutc=0;
if(i0>0) {
datcom_.nutc=100*fname.mid(i0-4,2).toInt() + fname.mid(i0-2,2).toInt();
@@ -55,11 +56,9 @@ void getfile(QString fname, bool xpol, int dbDgrd) }
}
-void savetf2(QString fname, bool xpol)
+void save_iq(QString fname)
{
- int npts=2*56*96000;
- if(xpol) npts=2*npts;
-
+ int npts=2*60*96000;
qint16* buf=(qint16*)malloc(2*npts);
char name[80];
strcpy(name,fname.toLocal8Bit());
@@ -69,11 +68,11 @@ void savetf2(QString fname, bool xpol) 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++];
-// if(!xpol) j+=2; //Skip over d4(3,x) and d4(4,x)
+ buf[i]=(qint16)qRound(datcom_.d4[j++]);
+ buf[i+1]=(qint16)qRound(datcom_.d4[j++]);
}
fwrite(buf,2,npts,fp);
+ fwrite(&datcom_.ntx30a,4,2,fp); //Write ntx30a and ntx30b to disk
fclose(fp);
}
free(buf);
|
