Merge branch 'release-2.1.0' of bitbucket.org:k1jt/wsjtx into release-2.1.0

This commit is contained in:
Joe Taylor 2019-06-03 13:35:45 -04:00
commit bda0206617
5 changed files with 686 additions and 645 deletions

View File

@ -192,13 +192,25 @@ int OmniRigTransceiver::do_start ()
.arg (readable_params_, 8, 16, QChar ('0'))
.arg (writable_params_, 8, 16, QChar ('0'))
.arg (rig_number_).toLocal8Bit ());
for (int i = 0; i < 5; ++i)
{
if (OmniRig::ST_ONLINE == rig_->Status ())
{
break;
}
await_notification_with_timeout (1000);
}
if (OmniRig::ST_ONLINE != rig_->Status ())
{
throw_qstring ("OmniRig: " + rig_->StatusStr ());
}
await_notification_with_timeout (1000);
update_rx_frequency (rig_->GetRxFrequency ());
qDebug () << "Initial state:" << state ();
auto f = rig_->GetRxFrequency ();
for (int i = 0; (f == 0) && (i < 5); ++i)
{
await_notification_with_timeout (1000);
f = rig_->GetRxFrequency ();
}
update_rx_frequency (f);
int resolution {0};
if (OmniRig::PM_UNKNOWN == rig_->Vfo ()
&& (writable_params_ & (OmniRig::PM_VFOA | OmniRig::PM_VFOB))
@ -208,7 +220,7 @@ int OmniRigTransceiver::do_start ()
// can't query VFO but can set explicitly
rig_->SetVfo (OmniRig::PM_VFOA);
}
auto f = state ().frequency ();
f = state ().frequency ();
if (f % 10) return resolution; // 1Hz resolution
auto test_frequency = f - f % 100 + 55;
if (OmniRig::PM_FREQ & writable_params_)
@ -348,6 +360,10 @@ void OmniRigTransceiver::handle_status_change (int rig_number)
{
offline ("Rig went offline");
}
else
{
Q_EMIT notified ();
}
// else
// {
// update_rx_frequency (rig_->GetRxFrequency ());
@ -452,39 +468,45 @@ void OmniRigTransceiver::handle_params_change (int rig_number, int params)
if (readable_params_ & OmniRig::PM_FREQA)
{
auto f = rig_->FreqA ();
TRACE_CAT ("OmniRigTransceiver", "FREQA = " << f);
if (reversed_)
if (f)
{
update_other_frequency (f);
TRACE_CAT ("OmniRigTransceiver", "FREQA = " << f);
if (reversed_)
{
update_other_frequency (f);
}
else
{
update_rx_frequency (f);
}
}
else
{
update_rx_frequency (f);
}
need_frequency = false;
}
if (readable_params_ & OmniRig::PM_FREQB)
{
auto f = rig_->FreqB ();
TRACE_CAT ("OmniRigTransceiver", "FREQB = " << f);
if (reversed_)
if (f)
{
TRACE_CAT ("OmniRigTransceiver", "FREQB = " << f);
if (reversed_)
{
update_rx_frequency (f);
}
else
{
update_other_frequency (f);
}
}
}
if (readable_params_ & OmniRig::PM_FREQ && !state ().ptt ())
{
auto f = rig_->Freq ();
if (f)
{
TRACE_CAT ("OmniRigTransceiver", "FREQ = " << f);
update_rx_frequency (f);
}
else
{
update_other_frequency (f);
}
need_frequency = false;
}
}
if (need_frequency && (readable_params_ & OmniRig::PM_FREQ)
&& !state ().ptt ())
{
auto f = rig_->Freq ();
TRACE_CAT ("OmniRigTransceiver", "FREQ = " << f);
update_rx_frequency (f);
}
if (params & OmniRig::PM_PITCH)
{
TRACE_CAT ("OmniRigTransceiver", "PITCH");

View File

@ -211,8 +211,11 @@ void TransceiverBase::stop () noexcept
void TransceiverBase::update_rx_frequency (Frequency rx)
{
actual_.frequency (rx);
requested_.frequency (rx); // track rig changes
if (rx)
{
actual_.frequency (rx);
requested_.frequency (rx); // track rig changes
}
}
void TransceiverBase::update_other_frequency (Frequency tx)

1246
cty.dat

File diff suppressed because it is too large Load Diff

View File

@ -234,8 +234,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_configurations_button {0},
m_settings {multi_settings->settings ()},
ui(new Ui::MainWindow),
m_logBook {&m_config},
m_config {&m_network_manager, temp_directory, m_settings, &m_logBook, this},
m_logBook {&m_config},
m_WSPR_band_hopping {m_settings, &m_config, this},
m_WSPR_tx_next {false},
m_rigErrorMessageBox {MessageBox::Critical, tr ("Rig Control Error")

View File

@ -357,8 +357,8 @@ private:
QSettings * m_settings;
QScopedPointer<Ui::MainWindow> ui;
LogBook m_logBook; // must be before Configuration construction
Configuration m_config;
LogBook m_logBook; // must be after Configuration construction
WSPRBandHopping m_WSPR_band_hopping;
bool m_WSPR_tx_next;
MessageBox m_rigErrorMessageBox;