mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Another attempt at eliminating confusion when NA VHF Contest Mode is in use.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8105 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									e4bf52ca05
								
							
						
					
					
						commit
						5b1652141b
					
				@ -129,6 +129,8 @@ extern "C" {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  void freqcal_(short d2[], int* k, int* nkhz,int* noffset, int* ntol,
 | 
					  void freqcal_(short d2[], int* k, int* nkhz,int* noffset, int* ntol,
 | 
				
			||||||
                char line[], int len);
 | 
					                char line[], int len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void fix_contest_msg_(char* MyGrid, char* msg, int len1, int len2);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int volatile itone[NUM_ISCAT_SYMBOLS];  //Audio tones for all Tx symbols
 | 
					int volatile itone[NUM_ISCAT_SYMBOLS];  //Audio tones for all Tx symbols
 | 
				
			||||||
@ -2816,7 +2818,9 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  auto const& message_words = message.messageWords ();
 | 
					  auto const& message_words = message.messageWords ();
 | 
				
			||||||
  auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size ();
 | 
					  auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size ();
 | 
				
			||||||
  if (message_words.size () > 2 && (message.isStandardMessage () || is_73)) {
 | 
					  bool is_OK=false;
 | 
				
			||||||
 | 
					  if(m_mode=="MSK144" and message.string().indexOf(ui->dxCallEntry->text()+" R ")>0) is_OK=true;
 | 
				
			||||||
 | 
					  if (message_words.size () > 2 && (message.isStandardMessage () || (is_73 or is_OK))) {
 | 
				
			||||||
    auto df = message.frequencyOffset ();
 | 
					    auto df = message.frequencyOffset ();
 | 
				
			||||||
    auto within_tolerance =
 | 
					    auto within_tolerance =
 | 
				
			||||||
      (qAbs (ui->RxFreqSpinBox->value () - df) <= int (start_tolerance)
 | 
					      (qAbs (ui->RxFreqSpinBox->value () - df) <= int (start_tolerance)
 | 
				
			||||||
@ -2854,8 +2858,7 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler
 | 
				
			|||||||
            || (m_bCallingCQ && m_bAutoReply
 | 
					            || (m_bCallingCQ && m_bAutoReply
 | 
				
			||||||
                // look for type 2 compound call replies on our Tx and Rx offsets
 | 
					                // look for type 2 compound call replies on our Tx and Rx offsets
 | 
				
			||||||
                && ((within_tolerance && "DE" == message_words.at (1))
 | 
					                && ((within_tolerance && "DE" == message_words.at (1))
 | 
				
			||||||
                    || message_words.at (1).contains (m_baseCall)))))
 | 
					                    || message_words.at (1).contains (m_baseCall))))) {
 | 
				
			||||||
      {
 | 
					 | 
				
			||||||
      processMessage (message);
 | 
					      processMessage (message);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -3732,9 +3735,14 @@ void MainWindow::processMessage(DecodedText const& message, bool ctrl, bool alt)
 | 
				
			|||||||
  QString hiscall;
 | 
					  QString hiscall;
 | 
				
			||||||
  QString hisgrid;
 | 
					  QString hisgrid;
 | 
				
			||||||
  message.deCallAndGrid(/*out*/hiscall,hisgrid);
 | 
					  message.deCallAndGrid(/*out*/hiscall,hisgrid);
 | 
				
			||||||
//  qDebug() << "a" << m_mode << m_config.my_grid() << hisgrid <<
 | 
					  int nWarn=0;
 | 
				
			||||||
//              m_rigState.frequency() << m_bCheckedContest;
 | 
					  QString warnMsg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if(m_mode=="MSK144" and message.string().indexOf(hiscall+" R ")>0 and
 | 
				
			||||||
 | 
					     !ui->cbVHFcontest->isChecked()) {
 | 
				
			||||||
 | 
					    warnMsg=tr("Should you be operating in NA VHF Contest mode?");
 | 
				
			||||||
 | 
					    nWarn=1;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  if((m_mode=="FT8" or m_mode=="MSK144") and hisgrid.length()==4 and
 | 
					  if((m_mode=="FT8" or m_mode=="MSK144") and hisgrid.length()==4 and
 | 
				
			||||||
     m_rigState.frequency()>50000000 and !m_bCheckedContest) {
 | 
					     m_rigState.frequency()>50000000 and !m_bCheckedContest) {
 | 
				
			||||||
    double utch=0.0;
 | 
					    double utch=0.0;
 | 
				
			||||||
@ -3742,29 +3750,34 @@ void MainWindow::processMessage(DecodedText const& message, bool ctrl, bool alt)
 | 
				
			|||||||
    azdist_(const_cast <char *> (m_config.my_grid().toLatin1().constData()),
 | 
					    azdist_(const_cast <char *> (m_config.my_grid().toLatin1().constData()),
 | 
				
			||||||
            const_cast <char *> (hisgrid.toLatin1().constData()),&utch,
 | 
					            const_cast <char *> (hisgrid.toLatin1().constData()),&utch,
 | 
				
			||||||
            &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,6,6);
 | 
					            &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,6,6);
 | 
				
			||||||
//    qDebug() << "b" << nDkm;
 | 
					 | 
				
			||||||
    if(nDkm>10000) {
 | 
					    if(nDkm>10000) {
 | 
				
			||||||
      auto const& message=tr("Locator in decoded message seems to imply"
 | 
					      warnMsg=tr("Locator in decoded message seems to imply\n"
 | 
				
			||||||
                             " a distance greater than 10,000 km. Should"
 | 
					             "a distance greater than 10,000 km. Should\n"
 | 
				
			||||||
             "you be operating in NA VHF Contest mode?");
 | 
					             "you be operating in NA VHF Contest mode?");
 | 
				
			||||||
 | 
					      nWarn=2;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if(nWarn>0) {
 | 
				
			||||||
    QMessageBox msgBox;
 | 
					    QMessageBox msgBox;
 | 
				
			||||||
    msgBox.setWindowTitle("Contest mode?");
 | 
					    msgBox.setWindowTitle("Contest mode?");
 | 
				
			||||||
      msgBox.setText(message);
 | 
					    msgBox.setText(warnMsg);
 | 
				
			||||||
    msgBox.setStandardButtons(QMessageBox::Yes);
 | 
					    msgBox.setStandardButtons(QMessageBox::Yes);
 | 
				
			||||||
    msgBox.addButton(QMessageBox::No);
 | 
					    msgBox.addButton(QMessageBox::No);
 | 
				
			||||||
    msgBox.setDefaultButton(QMessageBox::Yes);
 | 
					    msgBox.setDefaultButton(QMessageBox::Yes);
 | 
				
			||||||
    if(msgBox.exec() == QMessageBox::Yes){
 | 
					    if(msgBox.exec() == QMessageBox::Yes){
 | 
				
			||||||
      ui->cbVHFcontest->setChecked(true);
 | 
					      ui->cbVHFcontest->setChecked(true);
 | 
				
			||||||
 | 
					      if(nWarn==2) {
 | 
				
			||||||
 | 
					        on_DecodeButton_clicked (true);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      ui->cbVHFcontest->setChecked(false);
 | 
					      ui->cbVHFcontest->setChecked(false);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    m_bCheckedContest=true;
 | 
					    m_bCheckedContest=true;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size ();
 | 
					  auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size ();
 | 
				
			||||||
  if (!is_73 && !message.isStandardMessage ())
 | 
					  if (!is_73 and !message.isStandardMessage() and (nWarn==0)) {
 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    qDebug () << "Not processing message - hiscall:" << hiscall << "hisgrid:" << hisgrid;
 | 
					    qDebug () << "Not processing message - hiscall:" << hiscall << "hisgrid:" << hisgrid;
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user