mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Make fSpread printing compatible with QSOs
This commit is contained in:
		
							parent
							
								
									0c15ed36e9
								
							
						
					
					
						commit
						06b9746619
					
				@ -387,7 +387,8 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons
 | 
				
			|||||||
void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall,
 | 
					void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall,
 | 
				
			||||||
                                     QString const& mode,
 | 
					                                     QString const& mode,
 | 
				
			||||||
                                     bool displayDXCCEntity, LogBook const& logBook,
 | 
					                                     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;
 | 
					  m_bPrincipalPrefix=ppfx;
 | 
				
			||||||
  QColor bg;
 | 
					  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"};
 | 
					  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="";
 | 
					  if(!dxGrid.contains(grid_regexp)) dxGrid="";
 | 
				
			||||||
  message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info
 | 
					  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="";
 | 
					  m_CQPriority="";
 | 
				
			||||||
  if (CQcall)
 | 
					  if (CQcall)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
				
			|||||||
@ -30,7 +30,8 @@ public:
 | 
				
			|||||||
  void insertLineSpacer(QString const&);
 | 
					  void insertLineSpacer(QString const&);
 | 
				
			||||||
  void displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode,
 | 
					  void displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode,
 | 
				
			||||||
                          bool displayDXCCEntity, LogBook const& logBook,
 | 
					                          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 displayTransmittedText(QString text, QString modeTx, qint32 txFreq, bool bFastMode, double TRperiod);
 | 
				
			||||||
  void displayQSY(QString text);
 | 
					  void displayQSY(QString text);
 | 
				
			||||||
  void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {});
 | 
					  void displayFoxToBeCalled(QString t, QColor bg = QColor {}, QColor fg = QColor {});
 | 
				
			||||||
 | 
				
			|||||||
@ -3145,12 +3145,21 @@ void MainWindow::readFromStdout()                             //readFromStdout
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  while(proc_jt9.canReadLine()) {
 | 
					  while(proc_jt9.canReadLine()) {
 | 
				
			||||||
    auto line_read = proc_jt9.readLine ();
 | 
					    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")) {
 | 
					    if (auto p = std::strpbrk (line_read.constData (), "\n\r")) {
 | 
				
			||||||
      // truncate before line ending chars
 | 
					      // truncate before line ending chars
 | 
				
			||||||
      line_read = line_read.left (p - line_read.constData ());
 | 
					      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") {
 | 
					    if(m_mode!="FT8" and m_mode!="FT4") {
 | 
				
			||||||
      //Pad 22-char msg to at least 37 chars
 | 
					      //Pad 22-char msg to at least 37 chars
 | 
				
			||||||
      line_read = line_read.left(44) + "              " + line_read.mid(44);
 | 
					      line_read = line_read.left(44) + "              " + line_read.mid(44);
 | 
				
			||||||
@ -3232,14 +3241,10 @@ void MainWindow::readFromStdout()                             //readFromStdout
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          DecodedText decodedtext1=decodedtext0;
 | 
					          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(),
 | 
					          ui->decodedTextBrowser->displayDecodedText(decodedtext1,m_baseCall,m_mode,m_config.DXCC(),
 | 
				
			||||||
               m_logBook,m_currentBand,m_config.ppfx(),
 | 
					                                                     m_logBook,m_currentBand,m_config.ppfx(),
 | 
				
			||||||
               (ui->cbCQonly->isVisible() and ui->cbCQonly->isChecked()));
 | 
					                                                     ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(),
 | 
				
			||||||
 | 
					                                                     haveFSpread, fSpread);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          if(m_bBestSPArmed and m_mode=="FT4") {
 | 
					          if(m_bBestSPArmed and m_mode=="FT4") {
 | 
				
			||||||
            QString messagePriority=ui->decodedTextBrowser->CQPriority();
 | 
					            QString messagePriority=ui->decodedTextBrowser->CQPriority();
 | 
				
			||||||
 | 
				
			|||||||
@ -419,7 +419,6 @@ private:
 | 
				
			|||||||
  float   m_t0Pick;
 | 
					  float   m_t0Pick;
 | 
				
			||||||
  float   m_t1Pick;
 | 
					  float   m_t1Pick;
 | 
				
			||||||
  float   m_fCPUmskrtd;
 | 
					  float   m_fCPUmskrtd;
 | 
				
			||||||
  float   m_fSpread;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  qint32  m_waterfallAvg;
 | 
					  qint32  m_waterfallAvg;
 | 
				
			||||||
  qint32  m_ntx;
 | 
					  qint32  m_ntx;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user