mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-02 22:22:33 -04:00
Better scheme for displaying QRA65 sync results.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7561 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
f72fc0d7a3
commit
3c7e20b05b
@ -88,7 +88,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
|
|||||||
if(params%nmode.eq.4 .or. params%nmode.eq.65) open(14,file=trim(temp_dir)// &
|
if(params%nmode.eq.4 .or. params%nmode.eq.65) open(14,file=trim(temp_dir)// &
|
||||||
'/avemsg.txt',status='unknown')
|
'/avemsg.txt',status='unknown')
|
||||||
if(params%nmode.eq.164) open(17,file=trim(temp_dir)//'/red.dat', &
|
if(params%nmode.eq.164) open(17,file=trim(temp_dir)//'/red.dat', &
|
||||||
access='stream',status='unknown')
|
status='unknown')
|
||||||
|
|
||||||
if(params%nmode.eq.4) then
|
if(params%nmode.eq.4) then
|
||||||
jz=52*nfsample
|
jz=52*nfsample
|
||||||
|
@ -117,8 +117,8 @@ subroutine sync64(c0,nf1,nf2,nfqso,ntol,mode64,emedelay,dtx,f0,jpk,sync, &
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
s0a=s0a+2.0
|
s0a=s0a+2.0
|
||||||
write(17) ia,ib,s0a(ia:ib) !Save data for red curve
|
! write(17) ia,ib,s0a(ia:ib) !Save data for red curve
|
||||||
close(17)
|
! close(17)
|
||||||
|
|
||||||
nskip=50
|
nskip=50
|
||||||
call lorentzian(s0a(ia+nskip:ib-nskip),iz-2*nskip,a)
|
call lorentzian(s0a(ia+nskip:ib-nskip),iz-2*nskip,a)
|
||||||
@ -137,18 +137,29 @@ subroutine sync64(c0,nf1,nf2,nfqso,ntol,mode64,emedelay,dtx,f0,jpk,sync, &
|
|||||||
rms2=sqrt(sq/40.0)
|
rms2=sqrt(sq/40.0)
|
||||||
sync2=10.0*log10(a(2)/rms2)
|
sync2=10.0*log10(a(2)/rms2)
|
||||||
|
|
||||||
! do i=1,iz-2*nskip
|
slimit=6.0
|
||||||
! x=i
|
rewind 17
|
||||||
! z=(x-a(3))/(0.5*a(4))
|
write(17,1110) 0.0,0.0
|
||||||
! yfit=a(1)
|
rewind 17
|
||||||
! if(abs(z).lt.3.0) then
|
! rewind 76
|
||||||
! d=1.0 + z*z
|
do i=2,iz-2*nskip-1,3
|
||||||
! yfit=a(1) + a(2)*(1.0/d - 0.1)
|
x=i
|
||||||
! endif
|
z=(x-a(3))/(0.5*a(4))
|
||||||
! j=i+ia+49
|
yfit=a(1)
|
||||||
! write(76,1110) j*df3,s0a(j),yfit
|
if(abs(z).lt.3.0) then
|
||||||
!1110 format(3f10.3)
|
d=1.0 + z*z
|
||||||
! enddo
|
yfit=a(1) + a(2)*(1.0/d - 0.1)
|
||||||
|
endif
|
||||||
|
j=i+ia+49
|
||||||
|
freq=j*df3
|
||||||
|
ss=(s0a(j-1)+s0a(j)+s0a(j+1))/3.0
|
||||||
|
if(ss.gt.slimit) write(17,1110) freq,ss
|
||||||
|
1110 format(3f10.3)
|
||||||
|
! write(76,1110) freq,ss,yfit
|
||||||
|
enddo
|
||||||
|
flush(17)
|
||||||
|
close(17)
|
||||||
|
! flush(76)
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine sync64
|
end subroutine sync64
|
||||||
|
@ -2554,6 +2554,8 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
bool bAvgMsg=false;
|
bool bAvgMsg=false;
|
||||||
int navg=0;
|
int navg=0;
|
||||||
if(t.indexOf("<DecodeFinished>") >= 0) {
|
if(t.indexOf("<DecodeFinished>") >= 0) {
|
||||||
|
if(m_mode=="QRA64") m_wideGraph->drawRed(0,0);
|
||||||
|
/*
|
||||||
if(m_mode=="QRA64") {
|
if(m_mode=="QRA64") {
|
||||||
char name[512];
|
char name[512];
|
||||||
QString fname=m_config.temp_dir ().absoluteFilePath ("red.dat");
|
QString fname=m_config.temp_dir ().absoluteFilePath ("red.dat");
|
||||||
@ -2570,6 +2572,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
m_bDecoded = t.mid (20).trimmed ().toInt () > 0;
|
m_bDecoded = t.mid (20).trimmed ().toInt () > 0;
|
||||||
if(!m_diskData) killFileTimer.start (3*1000*m_TRperiod/4); //Kill in 45 s
|
if(!m_diskData) killFileTimer.start (3*1000*m_TRperiod/4); //Kill in 45 s
|
||||||
decodeDone ();
|
decodeDone ();
|
||||||
@ -4401,7 +4404,8 @@ void MainWindow::on_actionQRA64_triggered()
|
|||||||
ui->sbSubmode->setValue(m_nSubMode);
|
ui->sbSubmode->setValue(m_nSubMode);
|
||||||
ui->actionInclude_averaging->setEnabled(false);
|
ui->actionInclude_averaging->setEnabled(false);
|
||||||
ui->actionInclude_correlation->setEnabled(false);
|
ui->actionInclude_correlation->setEnabled(false);
|
||||||
|
QString fname {QDir::toNativeSeparators(m_config.temp_dir ().absoluteFilePath ("red.dat"))};
|
||||||
|
m_wideGraph->setRedFile(fname);
|
||||||
QFile f(m_appDir + "/old_qra_sync");
|
QFile f(m_appDir + "/old_qra_sync");
|
||||||
if(f.exists() and !m_bQRAsyncWarned) {
|
if(f.exists() and !m_bQRAsyncWarned) {
|
||||||
MessageBox::warning_message (this, tr ("*** WARNING *** "),
|
MessageBox::warning_message (this, tr ("*** WARNING *** "),
|
||||||
|
68
plotter.cpp
68
plotter.cpp
@ -3,6 +3,8 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "commons.h"
|
#include "commons.h"
|
||||||
#include "moc_plotter.cpp"
|
#include "moc_plotter.cpp"
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#define MAX_SCREENSIZE 2048
|
#define MAX_SCREENSIZE 2048
|
||||||
|
|
||||||
@ -131,39 +133,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
|
|||||||
m_fMax=FreqfromX(iz);
|
m_fMax=FreqfromX(iz);
|
||||||
|
|
||||||
m_line++;
|
m_line++;
|
||||||
if(m_mode=="QRA64" and bRed) {
|
|
||||||
double df_qra64=4000.0/(7*2304);
|
|
||||||
int j0,j1;
|
|
||||||
int k=0;
|
|
||||||
float smax,y3max=0;
|
|
||||||
float y3[MAX_SCREENSIZE];
|
|
||||||
for(int i=1; i<iz; i++) {
|
|
||||||
j0=FreqfromX(i-1)/df_qra64;
|
|
||||||
j1=FreqfromX(i)/df_qra64;
|
|
||||||
smax=0.0;
|
|
||||||
for(int jj=j0; jj<=j1; jj++) {
|
|
||||||
if(dec_data.sred[jj]>smax) smax=dec_data.sred[jj];
|
|
||||||
}
|
|
||||||
y3[i]=smax;
|
|
||||||
if(smax>y3max)y3max=smax;
|
|
||||||
}
|
|
||||||
float fac=0.8/qMax(y3max,10.0f);
|
|
||||||
for(int i=1; i<iz; i++) {
|
|
||||||
if(FreqfromX(i)>=m_ia*df_qra64 and FreqfromX(i)<m_ib*df_qra64) {
|
|
||||||
y2=fac*y3[i];
|
|
||||||
LineBuf2[k].setX(i);
|
|
||||||
LineBuf2[k].setY(int(m_h2*(0.9-y2)));
|
|
||||||
k++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
painter2D.drawPolyline(LineBuf,jtop);
|
|
||||||
painter2D.setPen(Qt::red);
|
|
||||||
painter2D.drawPolyline(LineBuf2,k);
|
|
||||||
ktop=k;
|
|
||||||
update(); //trigger a new paintEvent
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(bScroll) {
|
if(bScroll) {
|
||||||
flat4_(swide,&iz,&m_Flatten);
|
flat4_(swide,&iz,&m_Flatten);
|
||||||
flat4_(&dec_data.savg[j0],&jz,&m_Flatten);
|
flat4_(&dec_data.savg[j0],&jz,&m_Flatten);
|
||||||
@ -262,6 +231,34 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
|
|||||||
x1=XfromFreq(m_rxFreq+750);
|
x1=XfromFreq(m_rxFreq+750);
|
||||||
painter2D.drawText(x1-4,y,"73");
|
painter2D.drawText(x1-4,y,"73");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(bRed) {
|
||||||
|
std::ifstream f;
|
||||||
|
f.open(m_redFile.toLatin1());
|
||||||
|
if(f) {
|
||||||
|
int x,y;
|
||||||
|
float freq,sync;
|
||||||
|
float slimit=6.0;
|
||||||
|
QPen pen0(Qt::red,1);
|
||||||
|
painter1.setPen(pen0);
|
||||||
|
for(int i=0; i<99999; i++) {
|
||||||
|
f >> freq >> sync;
|
||||||
|
if(f.eof()) break;
|
||||||
|
x=XfromFreq(freq);
|
||||||
|
y=(sync-slimit)*3.0;
|
||||||
|
if(y>0) {
|
||||||
|
if(y>15.0) y=15.0;
|
||||||
|
if(x>=0 and x<=m_w) {
|
||||||
|
painter1.setPen(pen0);
|
||||||
|
painter1.drawLine(x,0,x,y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
f.close();
|
||||||
|
}
|
||||||
|
// m_bDecodeFinished=false;
|
||||||
|
}
|
||||||
|
|
||||||
update(); //trigger a new paintEvent
|
update(); //trigger a new paintEvent
|
||||||
m_bScaleOK=true;
|
m_bScaleOK=true;
|
||||||
}
|
}
|
||||||
@ -732,3 +729,8 @@ void CPlotter::setVHF(bool bVHF)
|
|||||||
{
|
{
|
||||||
m_bVHF=bVHF;
|
m_bVHF=bVHF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlotter::setRedFile(QString fRed)
|
||||||
|
{
|
||||||
|
m_redFile=fRed;
|
||||||
|
}
|
||||||
|
@ -84,6 +84,7 @@ public:
|
|||||||
bool Reference() const {return m_bReference;}
|
bool Reference() const {return m_bReference;}
|
||||||
void drawRed(int ia, int ib, float swide[]);
|
void drawRed(int ia, int ib, float swide[]);
|
||||||
void setVHF(bool bVHF);
|
void setVHF(bool bVHF);
|
||||||
|
void setRedFile(QString fRed);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void freezeDecode1(int n);
|
void freezeDecode1(int n);
|
||||||
@ -133,6 +134,7 @@ private:
|
|||||||
QString m_mode;
|
QString m_mode;
|
||||||
QString m_modeTx;
|
QString m_modeTx;
|
||||||
QString m_rxBand;
|
QString m_rxBand;
|
||||||
|
QString m_redFile;
|
||||||
|
|
||||||
bool m_Running;
|
bool m_Running;
|
||||||
bool m_paintEventBusy;
|
bool m_paintEventBusy;
|
||||||
|
@ -551,3 +551,8 @@ void WideGraph::on_sbPercent2dPlot_valueChanged(int n)
|
|||||||
m_Percent2DScreen=n;
|
m_Percent2DScreen=n;
|
||||||
ui->widePlot->SetPercent2DScreen(n);
|
ui->widePlot->SetPercent2DScreen(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WideGraph::setRedFile(QString fRed)
|
||||||
|
{
|
||||||
|
ui->widePlot->setRedFile(fRed);
|
||||||
|
}
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
void setWSPRtransmitted();
|
void setWSPRtransmitted();
|
||||||
void drawRed(int ia, int ib);
|
void drawRed(int ia, int ib);
|
||||||
void setVHF(bool bVHF);
|
void setVHF(bool bVHF);
|
||||||
|
void setRedFile(QString fRed);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void freezeDecode2(int n);
|
void freezeDecode2(int n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user