mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 05:38:46 -05:00
1. Display proper UTC on Fast Graph for files read from disk.
2. Move cursor DT readout to lower left of top panel. 3. More work on pick-decodes... but it's not yet fully working. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7092 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
71443a9396
commit
c4d00b0f47
@ -58,8 +58,10 @@ void FastGraph::saveSettings()
|
||||
m_settings->endGroup();
|
||||
}
|
||||
|
||||
void FastGraph::plotSpec()
|
||||
void FastGraph::plotSpec(bool diskData, int UTCdisk)
|
||||
{
|
||||
ui->fastPlot->m_diskData=diskData;
|
||||
ui->fastPlot->m_UTCdisk=UTCdisk;
|
||||
ui->fastPlot->draw();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
explicit FastGraph(QSettings *, QWidget *parent = 0);
|
||||
~FastGraph();
|
||||
|
||||
void plotSpec();
|
||||
void plotSpec(bool diskData, int UTCdisk);
|
||||
void saveSettings();
|
||||
void setTRperiod(int n);
|
||||
|
||||
|
46
fastplot.cpp
46
fastplot.cpp
@ -23,6 +23,7 @@ FPlotter::FPlotter(QWidget *parent) : //FPlotter Constructor
|
||||
m_jh0 {9999},
|
||||
m_bPaint2 {true}
|
||||
{
|
||||
m_diskData=false;
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setAttribute(Qt::WA_PaintOnScreen,false);
|
||||
setAutoFillBackground(false);
|
||||
@ -146,14 +147,28 @@ void FPlotter::draw() //draw()
|
||||
QPoint LineBuf[703];
|
||||
QPen penGreen(Qt::green,1);
|
||||
|
||||
if(m_diskData) {
|
||||
int ih=m_UTCdisk/10000;
|
||||
int im=m_UTCdisk/100 % 100;
|
||||
int is=m_UTCdisk % 100;
|
||||
m_t.sprintf("%2.2d:%2.2d:%2.2d",ih,im,is);
|
||||
}
|
||||
|
||||
int k0=m_jh0;
|
||||
if(fast_jh < m_jh0 or m_bPaint2) {
|
||||
k0=0;
|
||||
QRect tmp(0,0,m_w,119);
|
||||
painter1.fillRect(tmp,Qt::black);
|
||||
painter1.setPen(Qt::white);
|
||||
m_t=QDateTime::currentDateTimeUtc().toString("hh:mm:ss");
|
||||
painter1.drawText(10,95,m_t);
|
||||
if(m_diskData) {
|
||||
int ih=m_UTCdisk/10000;
|
||||
int im=m_UTCdisk/100 % 100;
|
||||
int is=m_UTCdisk % 100;
|
||||
m_t.sprintf("%2.2d:%2.2d:%2.2d",ih,im,is);
|
||||
} else {
|
||||
m_t=QDateTime::currentDateTimeUtc().toString("hh:mm:ss");
|
||||
}
|
||||
if(fast_jh>0) painter1.drawText(10,95,m_t);
|
||||
}
|
||||
|
||||
float gain = pow(10.0,(m_plotGain/20.0));
|
||||
@ -161,16 +176,10 @@ void FPlotter::draw() //draw()
|
||||
int i = k%64;
|
||||
int j = k/64;
|
||||
int y=0.005*gain*fast_s[k] + m_plotZero;
|
||||
if(y<0) y=0;
|
||||
if(y>254) y=254;
|
||||
painter1.setPen(g_ColorTbl[y]);
|
||||
painter1.drawPoint(j,64-i);
|
||||
|
||||
/*
|
||||
// Testing 2x expanded scale in x direction:
|
||||
painter1.drawPoint(2*j,64-i);
|
||||
painter1.drawPoint(2*j+1,64-i);
|
||||
*/
|
||||
if(y<0) y=0;
|
||||
if(y>254) y=254;
|
||||
painter1.setPen(g_ColorTbl[y]);
|
||||
painter1.drawPoint(j,64-i);
|
||||
}
|
||||
|
||||
painter1.setPen(penGreen); // Upper green curve
|
||||
@ -191,7 +200,7 @@ void FPlotter::draw() //draw()
|
||||
QRect tmp(0,120,m_w,219);
|
||||
painter1.fillRect(tmp,Qt::black);
|
||||
painter1.setPen(Qt::white);
|
||||
painter1.drawText(10,195,m_t0);
|
||||
if(fast_jh>0 and m_jh0 < 9999) painter1.drawText(10,195,m_t0);
|
||||
m_t0=m_t;
|
||||
|
||||
for(int k=0; k<64*fast_jh2; k++) { //Lower spectrogram
|
||||
@ -219,7 +228,7 @@ void FPlotter::draw() //draw()
|
||||
|
||||
painter1.setPen(Qt::white);
|
||||
painter1.drawLine(0,100, m_w,100);
|
||||
m_jh0=fast_jh;
|
||||
if(fast_jh>0) m_jh0=fast_jh;
|
||||
update(); //trigger a new paintEvent
|
||||
}
|
||||
|
||||
@ -231,14 +240,11 @@ void FPlotter::mouseMoveEvent(QMouseEvent *event)
|
||||
float t=x/m_pixPerSecond;
|
||||
QString t1;
|
||||
t1.sprintf("%5.2f",t);
|
||||
if(m_t1.length()==5) {
|
||||
painter.setPen(Qt::black);
|
||||
painter.drawText(60,95,m_t1);
|
||||
}
|
||||
QRectF rect0(78,85,40,13); //### Should use font metrics ###
|
||||
painter.fillRect(rect0,Qt::black);
|
||||
painter.setPen(Qt::yellow);
|
||||
painter.drawText(60,95,t1);
|
||||
painter.drawText(80,95,t1);
|
||||
update();
|
||||
m_t1=t1;
|
||||
}
|
||||
|
||||
void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent
|
||||
|
@ -27,6 +27,8 @@ public:
|
||||
qint32 m_x0;
|
||||
qint32 m_x1;
|
||||
qint32 m_y0;
|
||||
qint32 m_UTCdisk;
|
||||
bool m_diskData;
|
||||
|
||||
void draw(); //Update the Fast plot
|
||||
void setPlotZero(int plotZero);
|
||||
|
@ -15,8 +15,8 @@ subroutine fast_decode(id2,narg,ntrperiod,bShMsgs,line, &
|
||||
character*80 line(100)
|
||||
character*12 mycall_12,hiscall_12
|
||||
character*6 mycall,hiscall
|
||||
data first/.true./,nutcb/0/
|
||||
save npts,cdat,cdat2,id2a,id2b,nutcb
|
||||
data first/.true./,nutca/0/,nutcb/0/
|
||||
save npts,cdat,cdat2,id2a,id2b,nutca,nutcb
|
||||
|
||||
if(first) then
|
||||
id2a=0
|
||||
@ -34,11 +34,13 @@ subroutine fast_decode(id2,narg,ntrperiod,bShMsgs,line, &
|
||||
npick=narg(5)
|
||||
t0=0.001*narg(6)
|
||||
t1=0.001*narg(7)
|
||||
tmid=0.5*(t0+t1)
|
||||
maxlines=narg(8)
|
||||
nmode=narg(9)
|
||||
nrxfreq=narg(10)
|
||||
ntol=narg(11)
|
||||
nhashcalls=narg(12)
|
||||
! print*,'A',nutc
|
||||
|
||||
line(1:100)(1:1)=char(0)
|
||||
if(t0.gt.float(ntrperiod)) go to 900
|
||||
@ -48,28 +50,45 @@ subroutine fast_decode(id2,narg,ntrperiod,bShMsgs,line, &
|
||||
call fast9(id2,narg,line)
|
||||
go to 900
|
||||
else if(nmode.eq.104) then
|
||||
! MSK144 mode
|
||||
if(newdat.eq.1) then
|
||||
id2b=id2a
|
||||
id2a=id2
|
||||
nutcb=nutc
|
||||
id2b=id2a !Data for lower panel
|
||||
id2a=id2 !Data for upper panel
|
||||
nutcb=nutca
|
||||
nutca=nutc
|
||||
endif
|
||||
ia=max(1,nint(t0*12000.0))
|
||||
ib=nint(t1*12000.0)
|
||||
if(ib.gt.ntrperiod*12000) ib=ntrperiod*12000
|
||||
nz=ib-ia+1
|
||||
! write(*,3001) newdat,npick,ia,ib,nz,ndat0,t0,t1,id2(50000),id2b(50000)
|
||||
!3001 format(2i3,4i8,2f7.2,2i8)
|
||||
! if(npick.gt.1) go to 900 !### DISABLE PICK FROM LOWER PANEL###
|
||||
if(newdat.eq.1 .or. npick.le.1) then
|
||||
! New data, or pick-decode from upper panel
|
||||
! line(1)=char(0)
|
||||
|
||||
if(newdat.eq.1) then
|
||||
! Full sequence of new data
|
||||
! write(*,3001) newdat,npick,nutca
|
||||
!3001 format(2i3,3i8)
|
||||
call msk144_decode(id2a(ia),nz,nutca,0,mycall,hiscall, &
|
||||
bShMsgs,ntol,t0,line)
|
||||
go to 100
|
||||
endif
|
||||
|
||||
if(npick.eq.1) then
|
||||
! Pick-decode from upper panel
|
||||
! write(*,3001) newdat,npick,nutc
|
||||
call msk144_decode(id2(ia),nz,nutc,0,mycall,hiscall, &
|
||||
bShMsgs,ntol,t0,line)
|
||||
else
|
||||
go to 100
|
||||
endif
|
||||
|
||||
if(npick.eq.2) then
|
||||
! Pick-decode from lower panel
|
||||
call msk144_decode(id2b(ia),nz,nutcb,0,mycall,hiscall, &
|
||||
! write(*,3001) newdat,npick,nutca
|
||||
call msk144_decode(id2b(ia),nz,nutca,0,mycall,hiscall, &
|
||||
bShMsgs,ntol,t0,line)
|
||||
endif
|
||||
100 continue
|
||||
go to 900
|
||||
|
||||
endif
|
||||
|
||||
if(newdat.eq.1) then
|
||||
|
@ -199,7 +199,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
m_XIT {0},
|
||||
m_sec0 {-1},
|
||||
m_RxLog {1}, //Write Date and Time to RxLog
|
||||
m_nutc0 {9999},
|
||||
m_nutc0 {999999},
|
||||
m_ntr {0},
|
||||
m_tx {0},
|
||||
m_TRperiod {60},
|
||||
@ -804,6 +804,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
ui->actionInclude_averaging->setChecked((m_ndepth&16)>0);
|
||||
ui->actionInclude_correlation->setChecked((m_ndepth&32)>0);
|
||||
|
||||
m_UTCdisk=-1;
|
||||
m_ntx = 1;
|
||||
ui->txrb1->setChecked(true);
|
||||
|
||||
@ -1265,7 +1266,7 @@ void MainWindow::fastSink(qint64 frames)
|
||||
QString t;
|
||||
t.sprintf(" Rx noise: %5.1f ",px);
|
||||
ui->signal_meter_widget->setValue(px); // Update thermometer
|
||||
m_fastGraph->plotSpec();
|
||||
m_fastGraph->plotSpec(m_diskData,m_UTCdisk);
|
||||
|
||||
decodeNow=false;
|
||||
m_k0=k;
|
||||
@ -1909,6 +1910,10 @@ void MainWindow::on_actionOpen_triggered() //Open File
|
||||
void MainWindow::read_wav_file (QString const& fname)
|
||||
{
|
||||
// call diskDat() when done
|
||||
int i0=fname.lastIndexOf("_");
|
||||
int i1=fname.indexOf(".wav");
|
||||
m_nutc0=m_UTCdisk;
|
||||
m_UTCdisk=fname.mid(i0+1,i1-i0-1).toInt();
|
||||
m_wav_future_watcher.setFuture (QtConcurrent::run ([this, fname] {
|
||||
auto basename = fname.mid (fname.lastIndexOf ('/') + 1);
|
||||
auto pos = fname.indexOf (".wav", 0, Qt::CaseInsensitive);
|
||||
@ -2090,9 +2095,10 @@ void MainWindow::decode() //decode()
|
||||
{
|
||||
if(!m_dataAvailable or m_TRperiod==0) return;
|
||||
ui->DecodeButton->setChecked (true);
|
||||
if(dec_data.params.nagain==0 && m_diskData && !m_bFastMode) {
|
||||
if(!dec_data.params.nagain && m_diskData && !m_bFastMode) {
|
||||
dec_data.params.nutc=dec_data.params.nutc/100;
|
||||
}
|
||||
// qDebug() << "a" << m_diskData << m_nPick << m_nutc0 << dec_data.params.nutc;
|
||||
if(dec_data.params.nagain==0 && dec_data.params.newdat==1 && (!m_diskData)) {
|
||||
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
|
||||
int imin=ms/60000;
|
||||
@ -2100,8 +2106,7 @@ void MainWindow::decode() //decode()
|
||||
imin=imin % 60;
|
||||
if(m_TRperiod>=60) imin=imin - (imin % (m_TRperiod/60));
|
||||
dec_data.params.nutc=100*ihr + imin;
|
||||
if(m_mode=="ISCAT" or m_bFast9) {
|
||||
|
||||
if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
|
||||
QDateTime t=QDateTime::currentDateTimeUtc().addSecs(2-m_TRperiod);
|
||||
ihr=t.toString("hh").toInt();
|
||||
imin=t.toString("mm").toInt();
|
||||
@ -2110,6 +2115,19 @@ void MainWindow::decode() //decode()
|
||||
dec_data.params.nutc=10000*ihr + 100*imin + isec;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_nPick==1 and !m_diskData) {
|
||||
QDateTime t=QDateTime::currentDateTimeUtc();
|
||||
int ihr=t.toString("hh").toInt();
|
||||
int imin=t.toString("mm").toInt();
|
||||
int isec=t.toString("ss").toInt();
|
||||
isec=isec - isec%m_TRperiod;
|
||||
dec_data.params.nutc=10000*ihr + 100*imin + isec;
|
||||
}
|
||||
if(m_nPick==1 and m_diskData)
|
||||
|
||||
if(m_nPick==2) dec_data.params.nutc=m_nutc0;
|
||||
// qDebug() << "b" << m_diskData << m_nPick << m_nutc0 << dec_data.params.nutc;
|
||||
dec_data.params.nfqso=m_wideGraph->rxFreq();
|
||||
qint32 depth {m_ndepth};
|
||||
if (!ui->actionInclude_averaging->isEnabled ()) depth &= ~16;
|
||||
@ -2131,7 +2149,7 @@ void MainWindow::decode() //decode()
|
||||
dec_data.params.naggressive=0;
|
||||
}
|
||||
if(dec_data.params.nutc < m_nutc0) m_RxLog = 1; //Date and Time to all.txt
|
||||
m_nutc0=dec_data.params.nutc;
|
||||
if(dec_data.params.newdat==1 and !m_diskData) m_nutc0=dec_data.params.nutc;
|
||||
dec_data.params.ntxmode=9;
|
||||
if(m_modeTx=="JT65") dec_data.params.ntxmode=65;
|
||||
dec_data.params.nmode=9;
|
||||
@ -5701,6 +5719,7 @@ void MainWindow::fastPick(int x0, int x1, int y)
|
||||
if(y > 120) m_nPick=2;
|
||||
m_t0Pick=x0/pixPerSecond;
|
||||
m_t1Pick=x1/pixPerSecond;
|
||||
m_dataAvailable=true;
|
||||
decode();
|
||||
}
|
||||
}
|
||||
|
@ -370,6 +370,7 @@ private:
|
||||
qint32 m_TRperiodFast;
|
||||
qint32 m_nTx73;
|
||||
qint32 m_freqCQ;
|
||||
qint32 m_UTCdisk;
|
||||
|
||||
bool m_btxok; //True if OK to transmit
|
||||
bool m_diskData;
|
||||
|
Loading…
Reference in New Issue
Block a user