mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-13 03:08:49 -04:00
Merge branch 'hotfix-2.0.0-rc6' of bitbucket.org:k1jt/wsjtx into hotfix-2.0.0-rc6
This commit is contained in:
+30
-21
@@ -1,12 +1,20 @@
|
||||
//---------------------------------------------------------- MainWindow
|
||||
#include "mainwindow.h"
|
||||
#include <cinttypes>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <functional>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#include <fftw3.h>
|
||||
#include <QStringListModel>
|
||||
#include <QSettings>
|
||||
#include <QKeyEvent>
|
||||
#include <QSharedMemory>
|
||||
#include <QFileDialog>
|
||||
#include <QTextBlock>
|
||||
#include <QProgressBar>
|
||||
#include <QLineEdit>
|
||||
#include <QRegExpValidator>
|
||||
#include <QRegExp>
|
||||
@@ -2953,18 +2961,22 @@ void MainWindow::decodeDone ()
|
||||
void MainWindow::readFromStdout() //readFromStdout
|
||||
{
|
||||
while(proc_jt9.canReadLine()) {
|
||||
QByteArray t=proc_jt9.readLine();
|
||||
auto line_read = proc_jt9.readLine ();
|
||||
if (auto p = std::strpbrk (line_read.constData (), "\n\r"))
|
||||
{
|
||||
// truncate before line ending chars
|
||||
line_read = line_read.left (p - line_read.constData ());
|
||||
}
|
||||
if(m_mode!="FT8") {
|
||||
//Pad 22-char msg to 37 chars
|
||||
t=t.left(43) + " " + t.mid(43,-1);
|
||||
t=t.trimmed();
|
||||
//Pad 22-char msg to at least 37 chars
|
||||
line_read = line_read.left(43) + " " + line_read.mid(43);
|
||||
}
|
||||
// qint64 ms=QDateTime::currentMSecsSinceEpoch() - m_msec0;
|
||||
bool bAvgMsg=false;
|
||||
int navg=0;
|
||||
if(t.indexOf("<DecodeFinished>") >= 0) {
|
||||
if(line_read.indexOf("<DecodeFinished>") >= 0) {
|
||||
if(m_mode=="QRA64") m_wideGraph->drawRed(0,0);
|
||||
m_bDecoded = t.mid(20).trimmed().toInt() > 0;
|
||||
m_bDecoded = line_read.mid(20).trimmed().toInt() > 0;
|
||||
int mswait=3*1000*m_TRperiod/4;
|
||||
if(!m_diskData) killFileTimer.start(mswait); //Kill in 3/4 period
|
||||
decodeDone ();
|
||||
@@ -2976,16 +2988,16 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
return;
|
||||
} else {
|
||||
if(m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64" or m_mode=="FT8") {
|
||||
int n=t.indexOf("f");
|
||||
if(n<0) n=t.indexOf("d");
|
||||
int n=line_read.indexOf("f");
|
||||
if(n<0) n=line_read.indexOf("d");
|
||||
if(n>0) {
|
||||
QString tt=t.mid(n+1,1);
|
||||
QString tt=line_read.mid(n+1,1);
|
||||
navg=tt.toInt();
|
||||
if(navg==0) {
|
||||
char c = tt.data()->toLatin1();
|
||||
if(int(c)>=65 and int(c)<=90) navg=int(c)-54;
|
||||
}
|
||||
if(navg>1 or t.indexOf("f*")>0) bAvgMsg=true;
|
||||
if(navg>1 or line_read.indexOf("f*")>0) bAvgMsg=true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2998,8 +3010,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
<< m_mode << endl;
|
||||
m_RxLog=0;
|
||||
}
|
||||
int n=t.length();
|
||||
out << t.mid(0,n-2) << endl;
|
||||
out << line_read.left (line_read.size() - 2).trimmed () << endl;
|
||||
f.close();
|
||||
} else {
|
||||
MessageBox::warning_message (this, tr ("File Open Error")
|
||||
@@ -3015,10 +3026,8 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
m_blankLine = false;
|
||||
}
|
||||
|
||||
DecodedText decodedtext0 {QString::fromUtf8(t.constData())
|
||||
.remove(QRegularExpression {"\r|\n"})};
|
||||
DecodedText decodedtext {QString::fromUtf8(t.constData())
|
||||
.remove(QRegularExpression {"\r|\n"}).remove("TU; ")};
|
||||
DecodedText decodedtext0 {QString::fromUtf8(line_read.constData())};
|
||||
DecodedText decodedtext {QString::fromUtf8(line_read.constData()).remove("TU; ")};
|
||||
|
||||
if(m_mode=="FT8" and SpecOp::FOX == m_config.special_op_id() and
|
||||
(decodedtext.string().contains("R+") or decodedtext.string().contains("R-"))) {
|
||||
@@ -3101,7 +3110,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
if(w.at(0)==m_config.my_callsign() or w.at(0)==Radio::base_callsign(m_config.my_callsign())) {
|
||||
//### Check for ui->dxCallEntry->text()==foxCall before logging! ###
|
||||
ui->stopTxButton->click ();
|
||||
on_logQSOButton_clicked();
|
||||
logQSOTimer.start(0);
|
||||
}
|
||||
if((w.at(2)==m_config.my_callsign() or w.at(2)==Radio::base_callsign(m_config.my_callsign()))
|
||||
and ui->tx3->text().length()>0) {
|
||||
@@ -3119,7 +3128,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
ui->tx3->text().length()>0) {
|
||||
if(w.at(2)=="RR73") {
|
||||
ui->stopTxButton->click ();
|
||||
on_logQSOButton_clicked();
|
||||
logQSOTimer.start(0);
|
||||
} else {
|
||||
if(w.at(1)==Radio::base_callsign(ui->dxCallEntry->text()) and
|
||||
(w.at(2).mid(0,1)=="+" or w.at(2).mid(0,1)=="-")) {
|
||||
@@ -4454,7 +4463,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
|
||||
m_nextCall=""; //### Temporary: disable use of "TU;" message
|
||||
if(SpecOp::RTTY == m_config.special_op_id() and m_nextCall!="") {
|
||||
// We're in RTTY contest and have "nextCall" queued up: send a "TU; ..." message
|
||||
on_logQSOButton_clicked();
|
||||
logQSOTimer.start(0);
|
||||
ui->tx3->setText(ui->tx3->text().remove("TU; "));
|
||||
useNextCall();
|
||||
QString t="TU; " + ui->tx3->text();
|
||||
@@ -4463,7 +4472,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
|
||||
} else {
|
||||
// if(SpecOp::RTTY == m_config.special_op_id()) {
|
||||
if(false) {
|
||||
on_logQSOButton_clicked();
|
||||
logQSOTimer.start(0);
|
||||
m_ntx=6;
|
||||
ui->txrb6->setChecked(true);
|
||||
} else {
|
||||
@@ -8217,7 +8226,7 @@ list2Done:
|
||||
{
|
||||
writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid)
|
||||
.arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand));
|
||||
on_logQSOButton_clicked();
|
||||
logQSOTimer.start(0);
|
||||
m_foxRateQueue.enqueue (now); //Add present time in seconds
|
||||
//to Rate queue.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user