mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-09-04 14:17:52 -04:00
Working toward ability to write and read *.qm files.
This commit is contained in:
parent
b5bbf4a860
commit
4a4225bb9c
@ -1,10 +1,11 @@
|
|||||||
subroutine save_qm(fname,nutc,dd,ntx30a,ntx30b)
|
subroutine save_qm(fname,prog_id,mycall,mygrid,dd,ntx30a,ntx30b)
|
||||||
|
|
||||||
parameter(NMAX=60*96000)
|
parameter(NMAX=60*96000)
|
||||||
character*(*) fname
|
character*(*) fname,prog_id,mycall,mygrid
|
||||||
|
character prog_id_24*24,mycall_12*12,mygrid_6*6
|
||||||
real*4 dd(2,NMAX)
|
real*4 dd(2,NMAX)
|
||||||
integer*1 id1(2,NMAX)
|
integer*1 id1(2,NMAX)
|
||||||
|
|
||||||
ia=1
|
ia=1
|
||||||
ib=NMAX
|
ib=NMAX
|
||||||
if(ntx30a.gt.5) ia=NMAX/2+1
|
if(ntx30a.gt.5) ia=NMAX/2+1
|
||||||
@ -19,11 +20,42 @@ subroutine save_qm(fname,nutc,dd,ntx30a,ntx30b)
|
|||||||
nsum=2*(ib-ia+1)
|
nsum=2*(ib-ia+1)
|
||||||
rms=sqrt(sq/nsum)
|
rms=sqrt(sq/nsum)
|
||||||
|
|
||||||
|
nbad=0
|
||||||
|
dmax=0.
|
||||||
|
fac=10.0/rms
|
||||||
|
do i=ia,ib
|
||||||
|
x=fac*dd(1,i)
|
||||||
|
y=fac*dd(2,i)
|
||||||
|
ax=abs(x)
|
||||||
|
ay=abs(y)
|
||||||
|
dmax=max(dmax,ax,ay)
|
||||||
|
if(ax.gt.127.0) then
|
||||||
|
x=0.
|
||||||
|
nbad=nbad+1
|
||||||
|
endif
|
||||||
|
if(ay.gt.127.0) then
|
||||||
|
y=0.
|
||||||
|
nbad=nbad+1
|
||||||
|
endif
|
||||||
|
id1(1,i)=nint(x)
|
||||||
|
id1(2,i)=nint(y)
|
||||||
|
enddo
|
||||||
|
if(ia.gt.30*96000) id1(1:2,1:ia-1)=0
|
||||||
|
if(ib.eq.30*96000) id1(1:2,ib+1:60*96000)=0
|
||||||
|
|
||||||
jz=len(fname)
|
jz=len(fname)
|
||||||
fname(jz-1:jz)="qm"
|
fname(jz-1:jz)="qm"
|
||||||
write(*,3001) fname(jz-13:jz),nutc,rms,db(rms*rms),ia,ib, &
|
write(*,3001) fname(jz-13:jz),rms,db(rms*rms),dmax,nbad,ia,ib, &
|
||||||
nsum/(2*96000),ntx30a,ntx30b
|
nsum/(2*96000),ntx30a,ntx30b
|
||||||
3001 format(a14,2x,i4.4,2f7.1,2i9,3i5)
|
3001 format(a14,3f7.1,i8,2i9,3i5)
|
||||||
|
|
||||||
|
open(29,file=trim(fname),status='unknown',access='stream')
|
||||||
|
prog_id_24=prog_id//" "
|
||||||
|
mycall_12=mycall
|
||||||
|
mygrid_6=mygrid
|
||||||
|
write(29) prog_id_24,mycall_12,mygrid_6,ntx30a,ntx30b,ia,ib
|
||||||
|
write(29) id1(1:2,ia:ib)
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine save_qm
|
end subroutine save_qm
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Override programs executable basename as application name.
|
// Override programs executable basename as application name.
|
||||||
a.setApplicationName ("QMAP");
|
a.setApplicationName ("QMAP");
|
||||||
a.setApplicationVersion ("0.3");
|
a.setApplicationVersion ("0.4");
|
||||||
// switch off as we share an Info.plist file with WSJT-X
|
// switch off as we share an Info.plist file with WSJT-X
|
||||||
a.setAttribute (Qt::AA_DontUseNativeMenuBar);
|
a.setAttribute (Qt::AA_DontUseNativeMenuBar);
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
@ -403,8 +403,11 @@ void MainWindow::dataSink(int k)
|
|||||||
fname += ".iq";
|
fname += ".iq";
|
||||||
*future2 = QtConcurrent::run(save_iq, fname);
|
*future2 = QtConcurrent::run(save_iq, fname);
|
||||||
watcher2->setFuture(*future2);
|
watcher2->setFuture(*future2);
|
||||||
int len1=fname.length();
|
QString t{"QMAP v" + QCoreApplication::applicationVersion() + " " + revision()};
|
||||||
save_qm_(fname.toLatin1(), &datcom2_.nutc, datcom2_.d4,&m_nTx30a,&m_nTx30b,len1);
|
qDebug() << "aa" << t.simplified() << m_myCall << m_myGrid << datcom_.fcenter;
|
||||||
|
save_qm_(fname.toLatin1(), t.toLatin1(), m_myCall.toLatin1(), m_myGrid.toLatin1(),
|
||||||
|
datcom2_.d4, &datcom2_.ntx30a, &datcom2_.ntx30b, fname.length(), t.length(),
|
||||||
|
m_myCall.length(), m_myGrid.length());
|
||||||
}
|
}
|
||||||
if(ihsym==m_hsymStop) {
|
if(ihsym==m_hsymStop) {
|
||||||
m_nTx30a=0;
|
m_nTx30a=0;
|
||||||
@ -640,11 +643,11 @@ void MainWindow::on_actionOpen_triggered() //Open File
|
|||||||
soundInThread.setMonitoring(m_monitoring);
|
soundInThread.setMonitoring(m_monitoring);
|
||||||
QString fname;
|
QString fname;
|
||||||
fname=QFileDialog::getOpenFileName(this, "Open File", m_path,
|
fname=QFileDialog::getOpenFileName(this, "Open File", m_path,
|
||||||
"MAP65/QMAP Files (*.iq)");
|
"MAP65/QMAP Files (*.iq *.qm)");
|
||||||
if(fname != "") {
|
if(fname != "") {
|
||||||
m_path=fname;
|
m_path=fname;
|
||||||
int i;
|
int i;
|
||||||
i=fname.indexOf(".iq") - 11;
|
i=qMax(fname.indexOf(".iq") - 11, fname.indexOf(".qm") - 11);
|
||||||
if(i>=0) {
|
if(i>=0) {
|
||||||
lab1->setStyleSheet("QLabel{background-color: #66ff66}");
|
lab1->setStyleSheet("QLabel{background-color: #66ff66}");
|
||||||
lab1->setText(" " + fname.mid(i,15) + " ");
|
lab1->setText(" " + fname.mid(i,15) + " ");
|
||||||
@ -662,7 +665,11 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next
|
|||||||
int i,len;
|
int i,len;
|
||||||
QFileInfo fi(m_path);
|
QFileInfo fi(m_path);
|
||||||
QStringList list;
|
QStringList list;
|
||||||
list= fi.dir().entryList().filter(".iq");
|
if(m_path.indexOf(".iq")>0) {
|
||||||
|
list= fi.dir().entryList().filter(".iq");
|
||||||
|
} else {
|
||||||
|
list= fi.dir().entryList().filter(".qm");
|
||||||
|
}
|
||||||
for (i = 0; i < list.size()-1; ++i) {
|
for (i = 0; i < list.size()-1; ++i) {
|
||||||
if(i==list.size()-2) m_loopall=false;
|
if(i==list.size()-2) m_loopall=false;
|
||||||
len=list.at(i).length();
|
len=list.at(i).length();
|
||||||
@ -671,7 +678,7 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next
|
|||||||
QString fname=m_path.replace(n-len,len,list.at(i+1));
|
QString fname=m_path.replace(n-len,len,list.at(i+1));
|
||||||
m_path=fname;
|
m_path=fname;
|
||||||
int i;
|
int i;
|
||||||
i=fname.indexOf(".iq") - 11;
|
i=qMax(fname.indexOf(".iq") - 11, fname.indexOf(".qm") - 11);
|
||||||
if(i>=0) {
|
if(i>=0) {
|
||||||
lab1->setStyleSheet("QLabel{background-color: #66ff66}");
|
lab1->setStyleSheet("QLabel{background-color: #66ff66}");
|
||||||
lab1->setText(" " + fname.mid(i,len) + " ");
|
lab1->setText(" " + fname.mid(i,len) + " ");
|
||||||
|
@ -201,8 +201,8 @@ extern "C" {
|
|||||||
|
|
||||||
void zaptx_(float d4[], int* k0, int* k);
|
void zaptx_(float d4[], int* k0, int* k);
|
||||||
|
|
||||||
void save_qm_(const char* fname, int* nutc, float d4[], int* ntx30a, int* ntx30b, int len1);
|
void save_qm_(const char* fname, const char* prog_id, const char* mycall, const char* mygrid,
|
||||||
|
float d4[], int* ntx30a, int* ntx30b, int len1, int len2, int len3, int len4);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user