Fix a problem with plotting the Q65 sync curves for Q65-120x and Q65-300x.

This commit is contained in:
Joe Taylor 2021-03-15 17:00:56 -04:00
parent 0b4fb4c5f2
commit 4596ba05a0
3 changed files with 15 additions and 18 deletions

View File

@ -269,8 +269,6 @@ 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', &
status='unknown')
if(params%nmode.eq.4) then if(params%nmode.eq.4) then
jz=52*nfsample jz=52*nfsample
@ -289,7 +287,6 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
endif endif
npts65=52*12000 npts65=52*12000
if(params%nmode.eq.164) npts65=54*12000
if(baddata(id2,npts65)) then if(baddata(id2,npts65)) then
nsynced=0 nsynced=0
ndecoded=0 ndecoded=0

View File

@ -580,7 +580,7 @@ subroutine q65_write_red(iz,xdt,ccf2_avg,ccf2)
call q65_sync_curve(ccf2,1,iz,rms2) call q65_sync_curve(ccf2,1,iz,rms2)
rewind 17 rewind 17
write(17,1000) xdt write(17,1000) xdt,minval(ccf2_avg),maxval(ccf2_avg)
do i=max(1,nint(nfa/df)),nint(nfb/df) do i=max(1,nint(nfa/df)),nint(nfb/df)
freq=i*df freq=i*df
y1=ccf2_avg(i) y1=ccf2_avg(i)

View File

@ -12,7 +12,7 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#define MAX_SCREENSIZE 2048 #define MAX_SCREENSIZE 8192
extern "C" { extern "C" {
void flat4_(float swide[], int* iz, int* nflatten); void flat4_(float swide[], int* iz, int* nflatten);
@ -281,14 +281,14 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
f.open(m_redFile.toLatin1()); f.open(m_redFile.toLatin1());
if(f) { if(f) {
int x,y; int x,y;
float freq,xdt,sync,sync2; float freq,xdt,smin,smax,sync,sync2;
f >> xdt; f >> xdt >> smin >> smax;
if(f) { if(f) {
for(int i=0; i<99999; i++) { for(int i=0; i<99999; i++) {
f >> freq >> sync >> sync2; f >> freq >> sync >> sync2;
if(!f or f.eof()) break; if(!f or f.eof() or k>=MAX_SCREENSIZE or k2>=MAX_SCREENSIZE) break;
x=XfromFreq(freq); x=XfromFreq(freq);
if(sync > -99.0 and sync != 0.0) { if(sync > -99.0 and (smin!=0.0 or smax != 0.0)) {
y=m_h2*(0.9 - 0.09*gain2d*sync) - m_plot2dZero - 10; y=m_h2*(0.9 - 0.09*gain2d*sync) - m_plot2dZero - 10;
LineBuf2[k2].setX(x); //Red sync curve LineBuf2[k2].setX(x); //Red sync curve
LineBuf2[k2].setY(y); LineBuf2[k2].setY(y);
@ -303,11 +303,12 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
f.close(); f.close();
QPen pen0(Qt::red,2); QPen pen0(Qt::red,2);
painter2D.setPen(pen0); painter2D.setPen(pen0);
if(smin!=0.0 or smax != 0.0) {
painter2D.drawPolyline(LineBuf2,k2); painter2D.drawPolyline(LineBuf2,k2);
}
pen0.setColor("orange"); pen0.setColor("orange");
painter2D.setPen(pen0); painter2D.setPen(pen0);
painter2D.drawPolyline(LineBuf3,k); painter2D.drawPolyline(LineBuf3,k);
if(m_bQ65_Sync) {
QString t; QString t;
t = t.asprintf("DT = %6.2f",xdt); t = t.asprintf("DT = %6.2f",xdt);
painter2D.setPen(Qt::white); painter2D.setPen(Qt::white);
@ -316,7 +317,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
painter2D.drawText(m_w-100,m_h2/2,t); painter2D.drawText(m_w-100,m_h2/2,t);
} }
} }
}
update(); //trigger a new paintEvent update(); //trigger a new paintEvent
m_bScaleOK=true; m_bScaleOK=true;
} }