mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-24 13:18:38 -05: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
bd838f9972
commit
fed0e9e171
@ -81,11 +81,11 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, /
|
||||
{
|
||||
QString msg=_string.mid(column_qsoText).trimmed();
|
||||
if(msg.length() < 1) return false;
|
||||
msg=(msg+" ").mid(0,22);
|
||||
int i1=msg.indexOf("\r");
|
||||
msg = msg.remove (QRegularExpression {"[<>]"});
|
||||
int i1=msg.indexOf('\r');
|
||||
if (i1>0)
|
||||
msg=msg.mid(0,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
|
||||
msg=msg.left (i1-1);
|
||||
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);
|
||||
if(w.size ()
|
||||
@ -124,7 +124,7 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, /
|
||||
QString DecodedText::call()
|
||||
{
|
||||
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(" ");
|
||||
return call.mid(0,i);
|
||||
}
|
||||
@ -133,9 +133,7 @@ QString DecodedText::call()
|
||||
void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid)
|
||||
{
|
||||
auto msg = _string;
|
||||
int i0=msg.indexOf("CQ ");
|
||||
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);
|
||||
msg = msg.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").mid (column_qsoText);
|
||||
int i1 = msg.indexOf(" ");
|
||||
call = msg.mid(i1+1);
|
||||
int i2 = call.indexOf(" ");
|
||||
|
@ -2527,7 +2527,7 @@ void MainWindow::pskPost(DecodedText decodedtext)
|
||||
Frequency frequency = m_freqNominal + audioFrequency;
|
||||
pskSetLocal ();
|
||||
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,
|
||||
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 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
|
||||
|
||||
int frequency = decodedtext.frequencyOffset();
|
||||
|
@ -111,7 +111,7 @@ void PSK_Reporter::sendReport()
|
||||
|
||||
// Send data to PSK Reporter site
|
||||
if (!m_pskReporterAddress.isNull()) {
|
||||
m_messageClient->send_raw_datagram (report, m_pskReporterAddress, 4739);
|
||||
m_messageClient->send_raw_datagram (report, m_pskReporterAddress, 4739);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user