From 8dc2fef8447d86fd60bb99df39e551bda3cfb17e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 1 Oct 2016 20:10:46 +0000 Subject: [PATCH] Back out some changes that were broken. PSK reporter not yet functional for MSK144. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7136 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decodedtext.cpp | 2 -- mainwindow.cpp | 83 +++++++++++++++++++++++++++---------------------- mainwindow.h | 1 - 3 files changed, 46 insertions(+), 40 deletions(-) diff --git a/decodedtext.cpp b/decodedtext.cpp index f162feafb..d453886d9 100644 --- a/decodedtext.cpp +++ b/decodedtext.cpp @@ -103,7 +103,6 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, / if (ok and i1>=-50 and i1<50) { report = tt; - qDebug() << "A report for " << _string << "::" << report; } else { @@ -113,7 +112,6 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, / if(ok and i1>=-50 and i1<50) { report = tt.mid(1); - qDebug() << "B report for " << _string << "::" << report; } } } diff --git a/mainwindow.cpp b/mainwindow.cpp index 04b785f86..edba77f12 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1296,8 +1296,6 @@ void MainWindow::fastSink(qint64 frames) message=QString::fromLatin1(line); DecodedText decodedtext; decodedtext=message.replace("\n",""); - bool stdMsg = decodedtext.report(m_baseCall, - Radio::base_callsign(ui->dxCallEntry->text()), m_rptRcvd); ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(), m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(), m_config.color_NewCall()); @@ -1312,7 +1310,6 @@ void MainWindow::fastSink(qint64 frames) } writeAllTxt(message); } - float fracTR=float(k)/(12000.0*m_TRperiod); decodeNow=false; if(fracTR>0.98) { @@ -2346,7 +2343,21 @@ void::MainWindow::fast_decode_done() // extract details and send to PSKreporter if(m_config.spot_to_psk_reporter() and stdMsg and !m_diskData) { - sendToPskReporter(decodedtext); + QString msgmode=m_mode; + QString deCall; + QString grid; + decodedtext.deCallAndGrid(/*out*/deCall,grid); + int audioFrequency = decodedtext.frequencyOffset(); + int snr = decodedtext.snr(); + Frequency frequency = m_freqNominal + audioFrequency; + pskSetLocal(); + if(grid_regexp.exactMatch (grid)) + { + // qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr; + psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode, + QString::number(snr), + QString::number(QDateTime::currentDateTime().toTime_t())); + } } } } @@ -2356,26 +2367,6 @@ void::MainWindow::fast_decode_done() m_bFastDone=false; } -void MainWindow::sendToPskReporter(DecodedText decodedtext) -{ - QString msgmode=m_mode; - if(m_mode=="JT9+JT65") { - msgmode="JT9"; - if (decodedtext.isJT65()) msgmode="JT65"; - } - QString deCall; - QString grid; - decodedtext.deCallAndGrid(/*out*/deCall,grid); - int audioFrequency = decodedtext.frequencyOffset(); - int snr = decodedtext.snr(); - Frequency frequency = m_freqNominal + audioFrequency; - pskSetLocal(); - if(grid_regexp.exactMatch (grid)) { - psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode, - QString::number(snr),QString::number(QDateTime::currentDateTime().toTime_t())); - } -} - void MainWindow::writeAllTxt(QString message) { // Write decoded text to file "ALL.TXT". @@ -2532,7 +2523,22 @@ void MainWindow::readFromStdout() //readFromStdout int nsec=QDateTime::currentMSecsSinceEpoch()/1000-m_secBandChanged; bool okToPost=(nsec>50); if(m_config.spot_to_psk_reporter () and stdMsg and !m_diskData and okToPost) { - sendToPskReporter(decodedtext); + QString msgmode="JT9"; + if (decodedtext.isJT65()) msgmode="JT65"; + QString deCall; + QString grid; + decodedtext.deCallAndGrid(/*out*/deCall,grid); + int audioFrequency = decodedtext.frequencyOffset(); + int snr = decodedtext.snr(); + Frequency frequency = m_freqNominal + audioFrequency; + pskSetLocal (); + if(grid_regexp.exactMatch (grid)) + { + // qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr; + psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode, + QString::number(snr), + QString::number(QDateTime::currentDateTime().toTime_t())); + } } if((m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64") and m_msgAvgWidget!=NULL) { @@ -3306,17 +3312,18 @@ void MainWindow::processMessage(QString const& messages, int position, bool ctrl if(t4.size () < 6) return; //Skip the rest if no decoded text int frequency = decodedtext.frequencyOffset(); - if(m_mode != "MSK144") { - if (ui->RxFreqSpinBox->isEnabled()) { + if (ui->RxFreqSpinBox->isEnabled ()) + { ui->RxFreqSpinBox->setValue (frequency); //Set Rx freq } - if (decodedtext.isTX()) { - if (ctrl && ui->TxFreqSpinBox->isEnabled ()) { - ui->TxFreqSpinBox->setValue(frequency); //Set Tx freq - } + if (decodedtext.isTX()) + { + if (ctrl && ui->TxFreqSpinBox->isEnabled ()) + { + ui->TxFreqSpinBox->setValue(frequency); //Set Tx freq + } return; } - } int nmod=ntsec % (2*m_TRperiod); m_txFirst=(nmod!=0); @@ -3370,13 +3377,14 @@ void MainWindow::processMessage(QString const& messages, int position, bool ctrl } int i9=m_QSOText.indexOf(decodedtext.string()); - if (i9<0 and !decodedtext.isTX()) { + if (i9<0 and !decodedtext.isTX()) + { decodedtext=t2; - ui->decodedTextBrowser2->displayDecodedText(decodedtext, m_baseCall, false, m_logBook, + ui->decodedTextBrowser2->displayDecodedText(decodedtext, m_baseCall, false, m_logBook, m_config.color_CQ(), m_config.color_MyCall(), m_config.color_DXCC(), m_config.color_NewCall()); - m_QSOText=decodedtext; - } + m_QSOText=decodedtext; + } // prior DX call (possible QSO partner) auto qso_partner_base_call = Radio::base_callsign (ui->dxCallEntry-> text ()); @@ -4053,13 +4061,14 @@ void MainWindow::on_actionMSK144_triggered() ui->sbFtol->setVisible(true); ui->cbAutoSeq->setVisible(true); ui->ClrAvgButton->setVisible(false); + ui->cbShMsgs->setVisible(true); ui->actionMSK144->setChecked(true); ui->rptSpinBox->setMinimum(-8); ui->rptSpinBox->setMaximum(24); ui->rptSpinBox->setValue(0); ui->rptSpinBox->setSingleStep(1); - ui->sbFtol->setMinimum(22); + ui->sbFtol->setMinimum(23); ui->sbFtol->setMaximum(25); bool b=m_config.my_callsign()=="K1JT" or m_config.my_callsign()=="K9AN"; ui->cbCQRx->setEnabled(b); diff --git a/mainwindow.h b/mainwindow.h index efea18af9..21649f0a9 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -534,7 +534,6 @@ private: void transmit (double snr = 99.); void rigFailure (QString const& reason); void pskSetLocal (); - void sendToPskReporter(DecodedText decodedtext); void displayDialFrequency (); void transmitDisplay (bool); void processMessage(QString const& messages, qint32 position, bool ctrl);