mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-27 06:38:44 -05:00
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:
parent
2cceab6106
commit
2a9597980d
@ -319,15 +319,7 @@ auto WSPRBandHopping::next_hop () -> Hop
|
||||
|
||||
band_index = next_hopping_band();
|
||||
|
||||
if (100 == m_->tx_percent_)
|
||||
{
|
||||
tx_next = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// consult scheduler to determine if next period should be a tx interval
|
||||
tx_next = next_tx_state(m_->tx_percent_);
|
||||
}
|
||||
tx_next = next_is_tx ();
|
||||
|
||||
int frequencies_index {-1};
|
||||
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
|
||||
};
|
||||
}
|
||||
|
||||
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_);
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,8 @@ public:
|
||||
};
|
||||
// return the next band parameters
|
||||
Hop next_hop ();
|
||||
// determine if the next period should be a transmit period
|
||||
bool next_is_tx ();
|
||||
|
||||
private:
|
||||
class impl;
|
||||
|
@ -4297,19 +4297,16 @@ void MainWindow::on_pbTxNext_clicked(bool b)
|
||||
|
||||
void MainWindow::bandHopping()
|
||||
{
|
||||
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_;
|
||||
|
||||
if (m_auto &&hop_data.tx_next_) {
|
||||
m_nrx = 0;
|
||||
} else {
|
||||
m_nrx = 1;
|
||||
}
|
||||
|
||||
bool transmit {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_;
|
||||
|
||||
transmit = hop_data.tx_next_;
|
||||
|
||||
// QThread::msleep(500); //### Is this OK to do ??? ###
|
||||
|
||||
if (hop_data.frequencies_index_ >= 0) { // new band
|
||||
@ -4323,7 +4320,7 @@ void MainWindow::bandHopping()
|
||||
QFile f {path};
|
||||
if (f.exists ()) {
|
||||
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
|
||||
@ -4331,15 +4328,24 @@ void MainWindow::bandHopping()
|
||||
// Produce a short tuneup signal
|
||||
m_tuneup = false;
|
||||
if (hop_data.tune_required_) {
|
||||
m_tuneup = true;
|
||||
on_tuneButton_clicked (true);
|
||||
tuneATU_Timer->start (2500);
|
||||
m_tuneup = true;
|
||||
on_tuneButton_clicked (true);
|
||||
tuneATU_Timer->start (2500);
|
||||
}
|
||||
}
|
||||
|
||||
// Display grayline status
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user