diff --git a/WSPRBandHopping.cpp b/WSPRBandHopping.cpp index 880f9ac1b..1638f5368 100644 --- a/WSPRBandHopping.cpp +++ b/WSPRBandHopping.cpp @@ -297,7 +297,7 @@ void WSPRBandHopping::set_tx_percent (int new_value) } // determine the parameters of the hop, if any -auto WSPRBandHopping::next_hop () -> Hop +auto WSPRBandHopping::next_hop (bool tx_enabled) -> Hop { auto const& now = QDateTime::currentDateTimeUtc (); auto const& date = now.date (); @@ -322,7 +322,7 @@ auto WSPRBandHopping::next_hop () -> Hop band_index = next_hopping_band(); - tx_next = next_is_tx (); + tx_next = next_is_tx () && tx_enabled; int frequencies_index {-1}; auto const& frequencies = m_->configuration_->frequencies (); @@ -422,14 +422,15 @@ auto WSPRBandHopping::next_hop () -> Hop return { periods[period_index] - , frequencies_index + , frequencies_index - , frequencies_index >= 0 // new band + , frequencies_index >= 0 // new band + && tx_enabled // transmit is allowed && !tx_next // not going to Tx anyway && m_->bands_[4].testBit (band_index) // tune up required && !m_->bands_[5].testBit (band_index) // not an Rx only band - , frequencies_index >= 0 // new band + , frequencies_index >= 0 // new band && tx_next // Tx scheduled && !m_->bands_[5].testBit (band_index) // not an Rx only band }; diff --git a/WSPRBandHopping.hpp b/WSPRBandHopping.hpp index 1d5a316da..5fac8c644 100644 --- a/WSPRBandHopping.hpp +++ b/WSPRBandHopping.hpp @@ -71,7 +71,7 @@ public: bool tx_next_; }; // return the next band parameters - Hop next_hop (); + Hop next_hop (bool tx_enabled); // determine if the next period should be a transmit period bool next_is_tx (); diff --git a/mainwindow.cpp b/mainwindow.cpp index a8405290e..229e04082 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4209,11 +4209,11 @@ void MainWindow::WSPR_scheduling () { m_WSPR_tx_next = false; if (ui->band_hopping_group_box->isChecked ()) { - auto hop_data = m_WSPR_band_hopping.next_hop (); // qDebug () << "hop data: period:" << hop_data.period_name_ // << "frequencies index:" << hop_data.frequencies_index_ // << "tune:" << hop_data.tune_required_ // << "tx:" << hop_data.tx_next_; + auto hop_data = m_WSPR_band_hopping.next_hop (m_auto); m_WSPR_tx_next = hop_data.tx_next_; if (hop_data.frequencies_index_ >= 0) { // new band ui->bandComboBox->setCurrentIndex (hop_data.frequencies_index_);