Display original UTC on waterfall for data read from .wav files. Should replace "sprintf" in plotter.cpp lines 263 and 265.

This commit is contained in:
Joe Taylor 2021-03-16 16:55:28 -04:00
parent 61ba34a0b4
commit 75fbe1cb13
5 changed files with 32 additions and 6 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -542,3 +542,8 @@ void WideGraph::setRedFile(QString fRed)
{
ui->widePlot->setRedFile(fRed);
}
void WideGraph::setDiskUTC(int nutc)
{
ui->widePlot->setDiskUTC(nutc);
}

View File

@ -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);