SyncStats should be output differently than DecoderDebug
This commit is contained in:
parent
bf8fb4aa85
commit
25d644955f
@ -225,7 +225,7 @@ subroutine js8dec(dd0,icos,newdat,syncStats,nQSOProgress,nfqso,nftx,ndepth,lapon
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if(syncStats) then
|
if(syncStats) then
|
||||||
write(*,*) '<DecodeDebug> candidate ', NSUBMODE, 'f1', f1, 'sync', nsync, 'xdt', xdt
|
write(*,*) '<DecodeSyncStat> candidate ', NSUBMODE, 'f1', f1, 'sync', nsync, 'xdt', xdt
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -423,7 +423,7 @@ subroutine js8dec(dd0,icos,newdat,syncStats,nQSOProgress,nfqso,nftx,ndepth,lapon
|
|||||||
|
|
||||||
if(nbadcrc.eq.0) then
|
if(nbadcrc.eq.0) then
|
||||||
if(syncStats) then
|
if(syncStats) then
|
||||||
write(*,*) '<DecodeDebug> decode ', NSUBMODE, 'f1', f1, 'sync', (sync*10), 'xdt', xdt2
|
write(*,*) '<DecodeSyncStat> decode ', NSUBMODE, 'f1', f1, 'sync', (sync*10), 'xdt', xdt2
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ subroutine subtractjs8(dd,itone,f0,dt)
|
|||||||
|
|
||||||
nstart=dt*12000+1
|
nstart=dt*12000+1
|
||||||
|
|
||||||
if(NWRITELOG.eq.0) then
|
if(NWRITELOG.eq.1) then
|
||||||
write(*,*) '<DecodeDebug> generating reference signal', nstart
|
write(*,*) '<DecodeDebug> generating reference signal', nstart
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
@ -33,14 +33,14 @@ subroutine subtractjs8(dd,itone,f0,dt)
|
|||||||
if(id.ge.1.and.id.le.NMAX) camp(i)=dd(id)*conjg(cref(i))
|
if(id.ge.1.and.id.le.NMAX) camp(i)=dd(id)*conjg(cref(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
if(NWRITELOG.eq.0) then
|
if(NWRITELOG.eq.1) then
|
||||||
write(*,*) '<DecodeDebug> filtering', NFFT
|
write(*,*) '<DecodeDebug> filtering', NFFT
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if(first) then
|
if(first) then
|
||||||
! Create and normalize the filter
|
! Create and normalize the filter
|
||||||
if(NWRITELOG.eq.0) then
|
if(NWRITELOG.eq.1) then
|
||||||
write(*,*) '<DecodeDebug> creating and normalizing filter'
|
write(*,*) '<DecodeDebug> creating and normalizing filter'
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
@ -94,7 +94,7 @@ subroutine subtractjs8(dd,itone,f0,dt)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if(NWRITELOG.eq.0) then
|
if(NWRITELOG.eq.1) then
|
||||||
write(*,*) '<DecodeDebug> generating complex amplitude'
|
write(*,*) '<DecodeDebug> generating complex amplitude'
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
@ -105,7 +105,7 @@ subroutine subtractjs8(dd,itone,f0,dt)
|
|||||||
cfilt(1:NFFT)=cfilt(1:NFFT)*cw(1:NFFT)
|
cfilt(1:NFFT)=cfilt(1:NFFT)*cw(1:NFFT)
|
||||||
call four2a(cfilt,NFFT,1,1,1)
|
call four2a(cfilt,NFFT,1,1,1)
|
||||||
|
|
||||||
if(NWRITELOG.eq.0) then
|
if(NWRITELOG.eq.1) then
|
||||||
write(*,*) '<DecodeDebug> subtracting filtered reference', NFFT
|
write(*,*) '<DecodeDebug> subtracting filtered reference', NFFT
|
||||||
flush(6)
|
flush(6)
|
||||||
endif
|
endif
|
||||||
|
110
mainwindow.cpp
110
mainwindow.cpp
@ -4874,71 +4874,81 @@ void MainWindow::processDecodedLine(QByteArray t){
|
|||||||
static bool hasNewDrift = false;
|
static bool hasNewDrift = false;
|
||||||
static int newDrift = 0;
|
static int newDrift = 0;
|
||||||
|
|
||||||
if(t.indexOf("<DecodeDebug>") >= 0) {
|
if(t.indexOf("<DecodeSyncStat>") >= 0) {
|
||||||
if(t.indexOf("f1") >= 0){
|
|
||||||
auto segs = QString(t.trimmed()).split(QRegExp("[\\s\\t]+"), QString::SkipEmptyParts);
|
auto segs = QString(t.trimmed()).split(QRegExp("[\\s\\t]+"), QString::SkipEmptyParts);
|
||||||
if(!segs.isEmpty()){
|
if(segs.isEmpty()){
|
||||||
auto m1 = QString(segs.at(2));
|
return;
|
||||||
auto m = int(m1.toInt());
|
}
|
||||||
auto period = computePeriodForSubmode(m);
|
|
||||||
|
|
||||||
auto f1 = QString(segs.at(4));
|
auto m1 = QString(segs.at(2));
|
||||||
auto f = int(f1.toFloat());
|
auto m = int(m1.toInt());
|
||||||
|
auto period = computePeriodForSubmode(m);
|
||||||
|
|
||||||
auto s1 = QString(segs.at(6));
|
auto f1 = QString(segs.at(4));
|
||||||
auto s = int(s1.toFloat());
|
auto f = int(f1.toFloat());
|
||||||
|
|
||||||
auto xdt1 = QString(segs.at(8));
|
auto s1 = QString(segs.at(6));
|
||||||
auto xdt = int(xdt1.toFloat());
|
auto s = int(s1.toFloat());
|
||||||
|
|
||||||
if(abs(xdt) <= 2){
|
auto xdt1 = QString(segs.at(8));
|
||||||
if(s < 10){
|
auto xdt = int(xdt1.toFloat());
|
||||||
m_wideGraph->drawLine(QColor(Qt::darkCyan), f, f + computeBandwidthForSubmode(m));
|
|
||||||
} else if (s <= 21){
|
|
||||||
m_wideGraph->drawLine(QColor(Qt::white), f, f + computeBandwidthForSubmode(m));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(t.contains("decode")){
|
// only draw candidates
|
||||||
auto now = QDateTime::currentDateTimeUtc();
|
if(abs(xdt) <= 2){
|
||||||
|
if(s < 10){
|
||||||
float n = 0;
|
m_wideGraph->drawLine(QColor(Qt::darkCyan), f, f + computeBandwidthForSubmode(m));
|
||||||
float nPos = period - (now.time().second() % period);
|
} else if (s <= 21){
|
||||||
float nNeg = (now.time().second() % period) - period;
|
m_wideGraph->drawLine(QColor(Qt::white), f, f + computeBandwidthForSubmode(m));
|
||||||
|
|
||||||
if(qAbs(nNeg) < nPos){
|
|
||||||
n = nNeg;
|
|
||||||
} else {
|
|
||||||
n = nPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
n -= (float)period;
|
|
||||||
n += computeFramesNeededForDecode(m)/RX_SAMPLE_RATE;
|
|
||||||
n -= xdt/2;
|
|
||||||
|
|
||||||
int xdtmin = qMin(n*1000, (float)DriftingDateTime::drift());
|
|
||||||
int xdtmax = qMax(n*1000, (float)DriftingDateTime::drift());
|
|
||||||
|
|
||||||
m_wideGraph->drawLine(QColor(Qt::red), f, f + computeBandwidthForSubmode(m));
|
|
||||||
|
|
||||||
int oldNewDrift = newDrift;
|
|
||||||
newDrift = (xdtmin + (xdtmax-xdtmin)/2);
|
|
||||||
newDrift = qMin(oldNewDrift, newDrift) + (qMax(oldNewDrift, newDrift)-qMin(oldNewDrift, newDrift))/2;
|
|
||||||
hasNewDrift = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(JS8_DEBUG_DECODE) qDebug() << "--> busy?" << m_decoderBusy << "lock exists?" << ( QFile{m_config.temp_dir ().absoluteFilePath (".lock")}.exists());
|
if(!t.contains("decode")){
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// but use decodes for drift
|
||||||
|
auto now = QDateTime::currentDateTimeUtc();
|
||||||
|
|
||||||
|
float n = 0;
|
||||||
|
float nPos = period - (now.time().second() % period);
|
||||||
|
float nNeg = (now.time().second() % period) - period;
|
||||||
|
|
||||||
|
if(qAbs(nNeg) < nPos){
|
||||||
|
n = nNeg;
|
||||||
|
} else {
|
||||||
|
n = nPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
n -= (float)period;
|
||||||
|
n += computeFramesNeededForDecode(m)/RX_SAMPLE_RATE;
|
||||||
|
n -= xdt;
|
||||||
|
|
||||||
|
int xdtmin = qMin(n*1000, (float)DriftingDateTime::drift());
|
||||||
|
int xdtmax = qMax(n*1000, (float)DriftingDateTime::drift());
|
||||||
|
|
||||||
|
m_wideGraph->drawLine(QColor(Qt::red), f, f + computeBandwidthForSubmode(m));
|
||||||
|
|
||||||
|
int oldNewDrift = newDrift;
|
||||||
|
newDrift = (xdtmin + (xdtmax-xdtmin)/2);
|
||||||
|
newDrift = qMin(oldNewDrift, newDrift) + (qMax(oldNewDrift, newDrift)-qMin(oldNewDrift, newDrift))/2;
|
||||||
|
hasNewDrift = true;
|
||||||
|
|
||||||
|
if(JS8_DEBUG_DECODE) qDebug() << "--> busy?" << m_decoderBusy << "lock exists?" << ( QFile{m_config.temp_dir ().absoluteFilePath (".lock")}.exists());
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(t.indexOf("<DecodeStarted>") >= 0) {
|
if(t.indexOf("<DecodeStarted>") >= 0) {
|
||||||
if(JS8_DEBUG_DECODE) qDebug() << "--> busy?" << m_decoderBusy << "lock exists?" << ( QFile{m_config.temp_dir ().absoluteFilePath (".lock")}.exists());
|
if(JS8_DEBUG_DECODE) qDebug() << "--> busy?" << m_decoderBusy << "lock exists?" << ( QFile{m_config.temp_dir ().absoluteFilePath (".lock")}.exists());
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(t.indexOf("<DecodeDebug>") >= 0) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(t.indexOf("<DecodeFinished>") >= 0) {
|
if(t.indexOf("<DecodeFinished>") >= 0) {
|
||||||
|
// TODO: decide if we should adjust here...
|
||||||
if(hasNewDrift){
|
if(hasNewDrift){
|
||||||
static int driftN = 1;
|
static int driftN = 1;
|
||||||
newDrift = ((driftN-1)*DriftingDateTime::drift() + newDrift)/driftN;
|
newDrift = ((driftN-1)*DriftingDateTime::drift() + newDrift)/driftN;
|
||||||
|
Loading…
Reference in New Issue
Block a user