Make fSpread printing compatible with QSOs

This commit is contained in:
Bill Somerville 2020-07-20 18:27:29 +01:00
parent 0c15ed36e9
commit 06b9746619
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
4 changed files with 23 additions and 12 deletions

View File

@ -387,7 +387,8 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons
void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall,
QString const& mode,
bool displayDXCCEntity, LogBook const& logBook,
QString const& currentBand, bool ppfx, bool bCQonly)
QString const& currentBand, bool ppfx, bool bCQonly,
bool haveFSpread, float fSpread)
{
m_bPrincipalPrefix=ppfx;
QColor bg;
@ -421,6 +422,11 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"};
if(!dxGrid.contains(grid_regexp)) dxGrid="";
message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info
if (haveFSpread)
{
message += QString {37 - message.size (), QChar {' '}};
message += QChar::Nbsp + QString {"%1"}.arg (fSpread, 5, 'f', fSpread < 0.95 ? 3 : 2);
}
m_CQPriority="";
if (CQcall)
{

View File

@ -30,7 +30,8 @@ public:
void insertLineSpacer(QString const&);
void displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode,
bool displayDXCCEntity, LogBook const& logBook,
QString const& currentBand=QString {}, bool ppfx=false, bool bCQonly=false);
QString const& currentBand=QString {}, bool ppfx=false, bool bCQonly=false,
bool haveFSpread = false, float fSpread = 0.);
void displayTransmittedText(QString text, QString modeTx, qint32 txFreq, bool bFastMode, double TRperiod);
void displayQSY(QString text);
void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {});

View File

@ -3145,12 +3145,21 @@ void MainWindow::readFromStdout() //readFromStdout
{
while(proc_jt9.canReadLine()) {
auto line_read = proc_jt9.readLine ();
m_fSpread=line_read.mid(64,6).toFloat();
line_read=line_read.left(64);
if (auto p = std::strpbrk (line_read.constData (), "\n\r")) {
// truncate before line ending chars
line_read = line_read.left (p - line_read.constData ());
}
bool haveFSpread {false};
float fSpread {0.};
if (m_mode.startsWith ("FST240"))
{
auto text = line_read.mid (64, 6).trimmed ();
if (text.size ())
{
fSpread = text.toFloat (&haveFSpread);
line_read = line_read.left (64);
}
}
if(m_mode!="FT8" and m_mode!="FT4") {
//Pad 22-char msg to at least 37 chars
line_read = line_read.left(44) + " " + line_read.mid(44);
@ -3232,14 +3241,10 @@ void MainWindow::readFromStdout() //readFromStdout
}
} else {
DecodedText decodedtext1=decodedtext0;
if(m_mode.startsWith("FST240") and m_fSpread>0.0) {
QString t=decodedtext0.string();
DecodedText dt2 {QString {"%1%2%3"}.arg (t.left (46)).arg (m_fSpread, 5, 'f', m_fSpread < 0.95 ? 2 : 3).arg (t.mid(50)).trimmed ()};
decodedtext1=dt2;
}
ui->decodedTextBrowser->displayDecodedText(decodedtext1,m_baseCall,m_mode,m_config.DXCC(),
m_logBook,m_currentBand,m_config.ppfx(),
(ui->cbCQonly->isVisible() and ui->cbCQonly->isChecked()));
m_logBook,m_currentBand,m_config.ppfx(),
ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(),
haveFSpread, fSpread);
if(m_bBestSPArmed and m_mode=="FT4") {
QString messagePriority=ui->decodedTextBrowser->CQPriority();

View File

@ -419,7 +419,6 @@ private:
float m_t0Pick;
float m_t1Pick;
float m_fCPUmskrtd;
float m_fSpread;
qint32 m_waterfallAvg;
qint32 m_ntx;