From ca5a1ed3487ada73594cd39b13e875f15e75d618 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 11 Jul 2015 22:49:56 +0000 Subject: [PATCH] Make WSPR band hopping tuneup Tx dependent on Enable Tx button state Tuneup is now only possible with Tx Enable checked, if no message transmission is required with tuneup transmissions then Tx percentage zero must be selected along with Enable Tx. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5713 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- WSPRBandHopping.cpp | 11 ++++++----- WSPRBandHopping.hpp | 2 +- mainwindow.cpp | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) 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_);