From b219b59296aab3c3ed82e44d7fda99bb911fb87f Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sun, 27 Mar 2022 10:21:22 -0400 Subject: [PATCH] Fix the logic for replying to a CQ responder who sends report instead of grid. --- widgets/mainwindow.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 5b371cb4e..5e24d24a8 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3729,7 +3729,7 @@ void MainWindow::readFromStdout() //readFromStdout } } if(m_bCallingCQ && !m_bAutoReply && for_us && SpecOp::FOX > m_config.special_op_id()) { - if(ui->respondComboBox->currentText()=="CQ: First") { + if(ui->respondComboBox->currentText()!="CQ: First") { m_bDoubleClicked=true; m_bAutoReply = true; processMessage (decodedtext); @@ -3738,19 +3738,21 @@ void MainWindow::readFromStdout() //readFromStdout if(ui->respondComboBox->currentText()=="CQ: Max Dist") { QString deCall; QString deGrid; - bool bContest=m_config.special_op_id()==SpecOp::NA_VHF or - m_config.special_op_id()==SpecOp::ARRL_DIGI; decodedtext.deCallAndGrid(/*out*/deCall,deGrid); if(deGrid.contains(grid_regexp) or - (bContest and (deGrid.contains("+") or deGrid.contains("-")))) { - double utch=0.0; - int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; - azdist_(const_cast ((m_config.my_grid () + " ").left (6).toLatin1 ().constData ()), - const_cast ((deGrid + " ").left(6).toLatin1 ().constData ()),&utch, - &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6); - int points=nDkm/500; - if(nDkm > 500*points) points += 1; - points += 1; + (deGrid.contains("+") or deGrid.contains("-"))) { + int points=0; + if(deGrid.contains(grid_regexp)) { + double utch=0.0; + int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; + azdist_(const_cast ((m_config.my_grid () + " ").left (6).toLatin1 ().constData ()), + const_cast ((deGrid + " ").left(6).toLatin1 ().constData ()),&utch, + &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6); + points=nDkm/500; + if(nDkm > 500*points) points += 1; + points += 1; + } + if(points>m_maxPoints) { m_maxPoints=points; m_deCall=deCall; @@ -3760,6 +3762,7 @@ void MainWindow::readFromStdout() //readFromStdout ui->dxGridEntry->setText(deGrid); genStdMsgs(QString::number(decodedtext.snr())); int ntx=2; + bool bContest=m_config.special_op_id()==SpecOp::NA_VHF or m_config.special_op_id()==SpecOp::ARRL_DIGI; if(bContest) ntx=3; setTxMsg(ntx); }