Fix various fake split mode issues

Merged from wsjtx-1.4 branch.



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4573 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2014-10-30 22:03:04 +00:00
parent 4fea8ebd0c
commit 3b43a18362
4 changed files with 50 additions and 44 deletions

View File

@ -111,7 +111,7 @@ void DXLabSuiteCommanderTransceiver::do_ptt (bool on)
update_PTT (on);
do_frequency (state ().frequency ()); // gets Commander synchronized
// do_frequency (state ().frequency ()); // gets Commander synchronized
}
void DXLabSuiteCommanderTransceiver::do_frequency (Frequency f)

View File

@ -3,6 +3,7 @@
EmulateSplitTransceiver::EmulateSplitTransceiver (std::unique_ptr<Transceiver> wrapped)
: wrapped_ {std::move (wrapped)}
, frequency_ {0, 0}
, pre_tx_frequency_ {0}
, tx_ {false}
{
// Connect update signal of wrapped Transceiver object instance to ours.
@ -52,8 +53,11 @@ void EmulateSplitTransceiver::ptt (bool on) noexcept
#endif
// Save TX state for future frequency change requests.
if ((tx_ = on))
if (on)
{
// save the Rx frequency
pre_tx_frequency_ = frequency_[0];
// Switch to other frequency if we have one i.e. client wants
// split operation).
wrapped_->frequency (frequency_[frequency_[1] ? 1 : 0]);
@ -67,8 +71,10 @@ void EmulateSplitTransceiver::ptt (bool on) noexcept
wrapped_->ptt (false);
// Switch to RX frequency.
wrapped_->frequency (frequency_[0]);
wrapped_->frequency (pre_tx_frequency_);
pre_tx_frequency_ = 0;
}
tx_ = on;
}
void EmulateSplitTransceiver::handle_update (TransceiverState state)
@ -79,9 +85,9 @@ void EmulateSplitTransceiver::handle_update (TransceiverState state)
// Change to reflect emulated state, we don't want to report the
// shifted frequency when transmitting.
if (tx_)
if (pre_tx_frequency_)
{
state.frequency (frequency_[0]);
state.frequency (pre_tx_frequency_);
}
else
{

View File

@ -46,6 +46,7 @@ private:
std::unique_ptr<Transceiver> wrapped_;
Frequency frequency_[2]; // [0] <- RX, [1] <- other
Frequency pre_tx_frequency_; // return to this on switching to Rx
bool tx_;
};

View File

@ -2846,13 +2846,8 @@ void MainWindow::on_cbPlus2kHz_toggled(bool checked)
void MainWindow::handle_transceiver_update (Transceiver::TransceiverState s)
{
static bool prior_ptt {false};
if (!s.ptt () && prior_ptt)
{
transmitDisplay (false);
}
prior_ptt = s.ptt ();
transmitDisplay (false);
if ((s.frequency () - m_dialFreq) || s.split () != m_splitMode)
{
@ -3046,44 +3041,48 @@ void MainWindow::pskSetLocal ()
void MainWindow::transmitDisplay (bool transmitting)
{
if (transmitting)
{
signalMeter->setValue(0);
if (m_monitoring)
if (transmitting == m_transmitting)
{
if (transmitting)
{
monitor (false);
signalMeter->setValue(0);
if (m_monitoring)
{
monitor (false);
}
m_btxok=true;
}
m_btxok=true;
}
auto QSY_allowed = !transmitting || m_config.tx_QSY_allowed () || !m_config.split_mode ();
if (ui->cbTxLock->isChecked ())
{
ui->RxFreqSpinBox->setEnabled (QSY_allowed);
ui->pbT2R->setEnabled (QSY_allowed);
}
ui->TxFreqSpinBox->setEnabled (QSY_allowed);
ui->pbR2T->setEnabled (QSY_allowed);
ui->cbTxLock->setEnabled (QSY_allowed);
// only allow +2kHz when not transmitting or if TX QSYs are allowed
ui->cbPlus2kHz->setEnabled (!transmitting || m_config.tx_QSY_allowed ());
// the following are always disallowed in transmit
ui->menuMode->setEnabled (!transmitting);
ui->bandComboBox->setEnabled (!transmitting);
if (!transmitting)
{
if ("JT9+JT65" == m_mode)
auto QSY_allowed = !transmitting || m_config.tx_QSY_allowed () || !m_config.split_mode ();
if (ui->cbTxLock->isChecked ())
{
// allow mode switch in Rx when in dual mode
ui->pbTxMode->setEnabled (true);
ui->RxFreqSpinBox->setEnabled (QSY_allowed);
ui->pbT2R->setEnabled (QSY_allowed);
}
ui->TxFreqSpinBox->setEnabled (QSY_allowed);
ui->pbR2T->setEnabled (QSY_allowed);
ui->cbTxLock->setEnabled (QSY_allowed);
// only allow +2kHz when not transmitting or if TX QSYs are allowed
ui->cbPlus2kHz->setEnabled (!transmitting || m_config.tx_QSY_allowed ());
// the following are always disallowed in transmit
ui->menuMode->setEnabled (!transmitting);
ui->bandComboBox->setEnabled (!transmitting);
if (!transmitting)
{
if ("JT9+JT65" == m_mode)
{
// allow mode switch in Rx when in dual mode
ui->pbTxMode->setEnabled (true);
}
}
else
{
ui->pbTxMode->setEnabled (false);
}
}
else
{
ui->pbTxMode->setEnabled (false);
}
}