diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index d6d83ea24..16af8a29c 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1443,6 +1443,7 @@ void MainWindow::dataSink(qint64 frames) dec_data.params.ndiskdat=1; } else { dec_data.params.ndiskdat=0; + m_wideGraph->setDiskUTC(-1); } m_bUseRef=m_wideGraph->useRef(); @@ -2864,6 +2865,7 @@ void MainWindow::on_actionDecode_remaining_files_in_directory_triggered() void MainWindow::diskDat() //diskDat() { + m_wideGraph->setDiskUTC(dec_data.params.nutc); if(dec_data.params.kin>0) { int k; int kstep=m_FFTSize; diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index 557196ca9..3b8daa9cd 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -246,13 +246,24 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) if(m_line == painter1.fontMetrics ().height ()) { painter1.setPen(Qt::white); QString t; - qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; - int n = fmod(0.001*ms,m_TRperiod); - QDateTime t1=QDateTime::currentDateTimeUtc().addSecs(-n); - if(m_TRperiod<60.0) { - t=t1.toString("hh:mm:ss") + " " + m_rxBand; + if(m_nUTC<0) { + qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; + int n = fmod(0.001*ms,m_TRperiod); + QDateTime t1=QDateTime::currentDateTimeUtc().addSecs(-n); + if(m_TRperiod<60.0) { + t=t1.toString("hh:mm:ss") + " " + m_rxBand; + } else { + t=t1.toString("hh:mm") + " " + m_rxBand; + } } else { - t=t1.toString("hh:mm") + " " + m_rxBand; + int ih=m_nUTC/10000; + int im=(m_nUTC - 10000*ih)/100; + int is=m_nUTC%100; + if(m_TRperiod<60) { + t.sprintf("%02d:%02d:%02d",ih,im,is) + " " + m_rxBand; + } else { + t.sprintf("%02d:%02d",ih,im) + " " + m_rxBand; + } } painter1.drawText (5, painter1.fontMetrics ().ascent (), t); } @@ -882,3 +893,8 @@ void CPlotter::setRedFile(QString fRed) { m_redFile=fRed; } + +void CPlotter::setDiskUTC(int nutc) +{ + m_nUTC=nutc; +} diff --git a/widgets/plotter.h b/widgets/plotter.h index 582d36451..52936f2b8 100644 --- a/widgets/plotter.h +++ b/widgets/plotter.h @@ -87,6 +87,7 @@ public: void setRedFile(QString fRed); void setFST4_FreqRange(int fLow,int fHigh); void setSingleDecode(bool b); + void setDiskUTC(int nutc); bool scaleOK () const {return m_bScaleOK;} signals: @@ -136,6 +137,7 @@ private: qint32 m_ib; qint32 m_nfa; qint32 m_nfb; + qint32 m_nUTC; QPixmap m_WaterfallPixmap; QPixmap m_2DPixmap; diff --git a/widgets/widegraph.cpp b/widgets/widegraph.cpp index bb53279cd..edb81c2f0 100644 --- a/widgets/widegraph.cpp +++ b/widgets/widegraph.cpp @@ -542,3 +542,8 @@ void WideGraph::setRedFile(QString fRed) { ui->widePlot->setRedFile(fRed); } + +void WideGraph::setDiskUTC(int nutc) +{ + ui->widePlot->setDiskUTC(nutc); +} diff --git a/widgets/widegraph.h b/widgets/widegraph.h index 421fc8213..e8d241daf 100644 --- a/widgets/widegraph.h +++ b/widgets/widegraph.h @@ -51,6 +51,7 @@ public: void setRedFile(QString fRed); void setFST4_FreqRange(int fLow,int fHigh); void setSingleDecode(bool b); + void setDiskUTC(int nutc); signals: void freezeDecode2(int n);