mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-11 10:22:25 -04:00
Make handling of special CQ messages consistent
CQ NNN ... and CQ aa ... are coalesced to CQ_NNN ... and CQ_aa ... so as to keep the word count and indexes consistent with plain CQ ..., DE ... and QRZ ... standard message forms when parsing messages. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7356 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
87875a0267
commit
d973574627
@ -81,11 +81,11 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, /
|
|||||||
{
|
{
|
||||||
QString msg=_string.mid(column_qsoText).trimmed();
|
QString msg=_string.mid(column_qsoText).trimmed();
|
||||||
if(msg.length() < 1) return false;
|
if(msg.length() < 1) return false;
|
||||||
msg=(msg+" ").mid(0,22);
|
msg = msg.remove (QRegularExpression {"[<>]"});
|
||||||
int i1=msg.indexOf("\r");
|
int i1=msg.indexOf('\r');
|
||||||
if (i1>0)
|
if (i1>0)
|
||||||
msg=msg.mid(0,i1-1) + " ";
|
msg=msg.left (i1-1);
|
||||||
bool b = stdmsg_(msg.mid(0,22).toLatin1().constData(),22); // stdmsg is a fortran routine that packs the text, unpacks it and compares the result
|
bool b = stdmsg_ ((msg + " ").toLatin1().constData(),22); // stdmsg is a fortran routine that packs the text, unpacks it and compares the result
|
||||||
|
|
||||||
QStringList w=msg.split(" ",QString::SkipEmptyParts);
|
QStringList w=msg.split(" ",QString::SkipEmptyParts);
|
||||||
if(w.size ()
|
if(w.size ()
|
||||||
@ -124,7 +124,7 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, /
|
|||||||
QString DecodedText::call()
|
QString DecodedText::call()
|
||||||
{
|
{
|
||||||
auto call = _string;
|
auto call = _string;
|
||||||
call = call.replace (QRegularExpression {" CQ ([A-Z]{2,2}) "}, " CQ_\\1 ").mid (column_qsoText);
|
call = call.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").mid (column_qsoText);
|
||||||
int i = call.indexOf(" ");
|
int i = call.indexOf(" ");
|
||||||
return call.mid(0,i);
|
return call.mid(0,i);
|
||||||
}
|
}
|
||||||
@ -133,9 +133,7 @@ QString DecodedText::call()
|
|||||||
void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid)
|
void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid)
|
||||||
{
|
{
|
||||||
auto msg = _string;
|
auto msg = _string;
|
||||||
int i0=msg.indexOf("CQ ");
|
msg = msg.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").mid (column_qsoText);
|
||||||
if(i0>0 and mid(i0+3,3).toInt()>0) msg=msg.mid(0,i0+3) + msg.mid(i0+7,-1);
|
|
||||||
msg = msg.replace (QRegularExpression {" CQ ([A-Z]{2,2}) "}, " CQ_\\1 ").mid (column_qsoText);
|
|
||||||
int i1 = msg.indexOf(" ");
|
int i1 = msg.indexOf(" ");
|
||||||
call = msg.mid(i1+1);
|
call = msg.mid(i1+1);
|
||||||
int i2 = call.indexOf(" ");
|
int i2 = call.indexOf(" ");
|
||||||
|
@ -2527,7 +2527,7 @@ void MainWindow::pskPost(DecodedText decodedtext)
|
|||||||
Frequency frequency = m_freqNominal + audioFrequency;
|
Frequency frequency = m_freqNominal + audioFrequency;
|
||||||
pskSetLocal ();
|
pskSetLocal ();
|
||||||
if(grid_regexp.exactMatch (grid)) {
|
if(grid_regexp.exactMatch (grid)) {
|
||||||
// qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr;
|
// qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr;
|
||||||
psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode,
|
psk_Reporter->addRemoteStation(deCall,grid,QString::number(frequency),msgmode,
|
||||||
QString::number(snr),QString::number(QDateTime::currentDateTime().toTime_t()));
|
QString::number(snr),QString::number(QDateTime::currentDateTime().toTime_t()));
|
||||||
}
|
}
|
||||||
@ -3247,7 +3247,7 @@ void MainWindow::processMessage(QString const& messages, int position, bool ctrl
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto t3 = decodedtext.string ();
|
auto t3 = decodedtext.string ();
|
||||||
auto t4 = t3.replace (QRegularExpression {" CQ ([A-Z]{2,2}) "}, " CQ_\\1 ").split (" ", QString::SkipEmptyParts);
|
auto t4 = t3.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").split (" ", QString::SkipEmptyParts);
|
||||||
if(t4.size () < 6) return; //Skip the rest if no decoded text
|
if(t4.size () < 6) return; //Skip the rest if no decoded text
|
||||||
|
|
||||||
int frequency = decodedtext.frequencyOffset();
|
int frequency = decodedtext.frequencyOffset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user