User the hopping WSPR Tx schedule even when not hopping

The  Tx  schedule  used  in  band  hopping  is  tailored  to  minimize
consecutive transmit  periods while maintaining roughly  the requested
Tx/Rx ratio rather than being truly random.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5546 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2015-06-06 13:28:20 +00:00
parent 5a8fa2f379
commit a0f9aa367e
3 changed files with 38 additions and 25 deletions

View File

@ -319,15 +319,7 @@ auto WSPRBandHopping::next_hop () -> Hop
band_index = next_hopping_band(); band_index = next_hopping_band();
if (100 == m_->tx_percent_) tx_next = next_is_tx ();
{
tx_next = 1;
}
else
{
// consult scheduler to determine if next period should be a tx interval
tx_next = next_tx_state(m_->tx_percent_);
}
int frequencies_index {-1}; int frequencies_index {-1};
auto const& frequencies = m_->configuration_->frequencies (); auto const& frequencies = m_->configuration_->frequencies ();
@ -407,3 +399,16 @@ auto WSPRBandHopping::next_hop () -> Hop
&& !m_->bands_[5].testBit (band_index) // not an Rx only band && !m_->bands_[5].testBit (band_index) // not an Rx only band
}; };
} }
bool WSPRBandHopping::next_is_tx ()
{
if (100 == m_->tx_percent_)
{
return true;
}
else
{
// consult scheduler to determine if next period should be a tx interval
return next_tx_state(m_->tx_percent_);
}
}

View File

@ -71,6 +71,8 @@ public:
}; };
// return the next band parameters // return the next band parameters
Hop next_hop (); Hop next_hop ();
// determine if the next period should be a transmit period
bool next_is_tx ();
private: private:
class impl; class impl;

View File

@ -4297,19 +4297,16 @@ void MainWindow::on_pbTxNext_clicked(bool b)
void MainWindow::bandHopping() void MainWindow::bandHopping()
{ {
auto hop_data = m_WSPR_band_hopping.next_hop (); bool transmit {false};
qDebug () << "hop data: period:" << hop_data.period_name_
<< "frequencies index:" << hop_data.frequencies_index_
<< "tune:" << hop_data.tune_required_
<< "tx:" << hop_data.tx_next_;
if (m_auto &&hop_data.tx_next_) {
m_nrx = 0;
} else {
m_nrx = 1;
}
if (ui->band_hopping_group_box->isChecked ()) { 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_;
transmit = hop_data.tx_next_;
// QThread::msleep(500); //### Is this OK to do ??? ### // QThread::msleep(500); //### Is this OK to do ??? ###
if (hop_data.frequencies_index_ >= 0) { // new band if (hop_data.frequencies_index_ >= 0) { // new band
@ -4323,7 +4320,7 @@ void MainWindow::bandHopping()
QFile f {path}; QFile f {path};
if (f.exists ()) { if (f.exists ()) {
m_cmnd = QDir::toNativeSeparators (f.fileName ()) + ' ' + m_cmnd = QDir::toNativeSeparators (f.fileName ()) + ' ' +
m_config.bands ()->find (m_dialFreq).remove ('m'); m_config.bands ()->find (m_dialFreq).remove ('m');
} }
} }
if(m_cmnd!="") p3.start(m_cmnd); // Execute user's hardware controller if(m_cmnd!="") p3.start(m_cmnd); // Execute user's hardware controller
@ -4331,15 +4328,24 @@ void MainWindow::bandHopping()
// Produce a short tuneup signal // Produce a short tuneup signal
m_tuneup = false; m_tuneup = false;
if (hop_data.tune_required_) { if (hop_data.tune_required_) {
m_tuneup = true; m_tuneup = true;
on_tuneButton_clicked (true); on_tuneButton_clicked (true);
tuneATU_Timer->start (2500); tuneATU_Timer->start (2500);
} }
} }
// Display grayline status // Display grayline status
auto_tx_label->setText (hop_data.period_name_); auto_tx_label->setText (hop_data.period_name_);
} }
else {
transmit = m_WSPR_band_hopping.next_is_tx ();
}
if (m_auto && transmit) {
m_nrx = 0;
} else {
m_nrx = 1;
}
} }
void MainWindow::on_tabWidget_currentChanged (int new_value) void MainWindow::on_tabWidget_currentChanged (int new_value)