mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-27 06:38:44 -05:00
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:
parent
d9bc8f5dff
commit
20c7046a90
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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_;
|
||||
};
|
||||
|
||||
|
@ -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 ();
|
||||
|
||||
if ((s.frequency () - m_dialFreq) || s.split () != m_splitMode)
|
||||
{
|
||||
@ -3045,6 +3040,9 @@ void MainWindow::pskSetLocal ()
|
||||
}
|
||||
|
||||
void MainWindow::transmitDisplay (bool transmitting)
|
||||
{
|
||||
|
||||
if (transmitting == m_transmitting)
|
||||
{
|
||||
if (transmitting)
|
||||
{
|
||||
@ -3087,3 +3085,4 @@ void MainWindow::transmitDisplay (bool transmitting)
|
||||
ui->pbTxMode->setEnabled (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user