mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-18 01:52:05 -05:00
Take advantage of the forthcommng DX Lab Commander enhancement
V12.2.6 of teh DX Lab Suite Commander finally has a way to suppress mode rationalization when setting the split Tx frequency. This now means that we can now honor the radio setting to not change the rig modulation mode. This should help with a number of rigs that require different modes on teh Tx and Rx VFOs for optimal wide band digital operation. This will also help with some rig and interface combinations that lock up or otherwise misbehave when setting the Tx VFO mode at certain times with respect to other rig control commands. This change also improves mode setting in general hopefully closing a few corner case issues when starting up and when transmitting for the first time in a session. Included is the latest DX Lab Suite Commander TCP/IP commands documentation correct for v12.2.6. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7030 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
3975e79c30
commit
424ed88645
@ -645,10 +645,6 @@ QString Configuration::rig_name () const {return m_->rig_params_.rig_name;}
|
||||
|
||||
bool Configuration::is_transceiver_online () const
|
||||
{
|
||||
#if WSJT_TRACE_CAT
|
||||
qDebug () << "Configuration::is_transceiver_online: " << m_->cached_rig_state_;
|
||||
#endif
|
||||
|
||||
return m_->rig_active_;
|
||||
}
|
||||
|
||||
@ -1280,7 +1276,6 @@ void Configuration::impl::read_settings ()
|
||||
x2ToneSpacing_ = settings_->value("x2ToneSpacing",false).toBool ();
|
||||
offsetRxFreq_ = settings_->value("OffsetRx",false).toBool();
|
||||
rig_params_.poll_interval = settings_->value ("Polling", 0).toInt ();
|
||||
rig_params_.set_rig_mode = data_mode_ != data_mode_none;
|
||||
rig_params_.split_mode = settings_->value ("SplitMode", QVariant::fromValue (TransceiverFactory::split_mode_none)).value<TransceiverFactory::SplitMode> ();
|
||||
udp_server_name_ = settings_->value ("UDPServer", "127.0.0.1").toString ();
|
||||
udp_server_port_ = settings_->value ("UDPServerPort", 2237).toUInt ();
|
||||
@ -1600,7 +1595,6 @@ TransceiverFactory::ParameterPack Configuration::impl::gather_rig_data ()
|
||||
result.ptt_type = static_cast<TransceiverFactory::PTTMethod> (ui_->PTT_method_button_group->checkedId ());
|
||||
result.ptt_port = ui_->PTT_port_combo_box->currentText ();
|
||||
result.audio_source = static_cast<TransceiverFactory::TXAudioSource> (ui_->TX_audio_source_button_group->checkedId ());
|
||||
result.set_rig_mode = static_cast<DataMode> (ui_->TX_mode_button_group->checkedId ()) != data_mode_none;
|
||||
result.split_mode = static_cast<TransceiverFactory::SplitMode> (ui_->split_mode_button_group->checkedId ());
|
||||
return result;
|
||||
}
|
||||
@ -2251,7 +2245,15 @@ void Configuration::impl::transceiver_tx_frequency (Frequency f)
|
||||
Q_ASSERT (!f || split_mode ());
|
||||
if (split_mode ())
|
||||
{
|
||||
Transceiver::MODE mode {Transceiver::UNK};
|
||||
switch (data_mode_)
|
||||
{
|
||||
case data_mode_USB: mode = Transceiver::USB; break;
|
||||
case data_mode_data: mode = Transceiver::DIG_U; break;
|
||||
case data_mode_none: break;
|
||||
}
|
||||
cached_rig_state_.online (true); // we want the rig online
|
||||
cached_rig_state_.mode (mode);
|
||||
cached_rig_state_.split (f);
|
||||
cached_rig_state_.tx_frequency (f);
|
||||
|
||||
|
@ -155,13 +155,17 @@ void DXLabSuiteCommanderTransceiver::do_frequency (Frequency f, MODE m, bool /*n
|
||||
update_rx_frequency (f);
|
||||
}
|
||||
|
||||
void DXLabSuiteCommanderTransceiver::do_tx_frequency (Frequency tx, bool /*no_ignore*/)
|
||||
void DXLabSuiteCommanderTransceiver::do_tx_frequency (Frequency tx, MODE mode, bool /*no_ignore*/)
|
||||
{
|
||||
TRACE_CAT ("DXLabSuiteCommanderTransceiver", tx << state ());
|
||||
if (tx)
|
||||
{
|
||||
auto f_string = frequency_to_string (tx);
|
||||
auto params = ("<xcvrfreq:%1>" + f_string + "<SuppressDual:1>Y").arg (f_string.size ());
|
||||
if (UNK == mode)
|
||||
{
|
||||
params += "<SuppressModeChange:1>Y";
|
||||
}
|
||||
simple_command (("<command:11>CmdQSXSplit<parameters:%1>" + params).arg (params.size ()));
|
||||
}
|
||||
else
|
||||
@ -421,7 +425,7 @@ auto DXLabSuiteCommanderTransceiver::string_to_frequency (QString s) const -> Fr
|
||||
// conversion to Hz
|
||||
bool ok;
|
||||
|
||||
// auto f = locale_.toDouble (s, &ok); // use when CmdSendFreq and
|
||||
// auto f = locale_.toDouble (s, &ok); // use when CmdSendFreq and
|
||||
// CmdSendTxFreq reinstated
|
||||
|
||||
auto f = QLocale::c ().toDouble (s, &ok); // temporary fix
|
||||
|
@ -35,7 +35,7 @@ protected:
|
||||
int do_start () override;
|
||||
void do_stop () override;
|
||||
void do_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_mode (MODE) override;
|
||||
void do_ptt (bool on) override;
|
||||
|
||||
|
@ -70,12 +70,10 @@ HRDTransceiver::HRDTransceiver (std::unique_ptr<TransceiverBase> wrapped
|
||||
, QString const& server
|
||||
, bool use_for_ptt
|
||||
, int poll_interval
|
||||
, bool set_rig_mode
|
||||
, QObject * parent)
|
||||
: PollingTransceiver {poll_interval, parent}
|
||||
, wrapped_ {std::move (wrapped)}
|
||||
, use_for_ptt_ {use_for_ptt}
|
||||
, set_rig_mode_ {set_rig_mode}
|
||||
, server_ {server}
|
||||
, hrd_ {0}
|
||||
, protocol_ {none}
|
||||
@ -542,7 +540,7 @@ void HRDTransceiver::do_frequency (Frequency f, MODE m, bool /*no_ignore*/)
|
||||
update_rx_frequency (f);
|
||||
}
|
||||
|
||||
void HRDTransceiver::do_tx_frequency (Frequency tx, bool /*no_ignore*/)
|
||||
void HRDTransceiver::do_tx_frequency (Frequency tx, MODE mode, bool /*no_ignore*/)
|
||||
{
|
||||
TRACE_CAT ("HRDTransceiver", tx << "reversed" << reversed_);
|
||||
|
||||
@ -571,15 +569,15 @@ void HRDTransceiver::do_tx_frequency (Frequency tx, bool /*no_ignore*/)
|
||||
bool split {tx != 0};
|
||||
if (split)
|
||||
{
|
||||
if (set_rig_mode_)
|
||||
if (mode != UNK)
|
||||
{
|
||||
if (!reversed_ && mode_B_dropdown_ >= 0)
|
||||
{
|
||||
set_dropdown (mode_B_dropdown_, lookup_mode (state ().mode (), mode_B_map_));
|
||||
set_dropdown (mode_B_dropdown_, lookup_mode (mode, mode_B_map_));
|
||||
}
|
||||
else if (reversed_ && mode_B_dropdown_ >= 0)
|
||||
{
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (state ().mode (), mode_A_map_));
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (mode, mode_A_map_));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -588,22 +586,22 @@ void HRDTransceiver::do_tx_frequency (Frequency tx, bool /*no_ignore*/)
|
||||
if (rx_B_button_ >= 0)
|
||||
{
|
||||
set_button (reversed_ ? rx_A_button_ : rx_B_button_);
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (state ().mode (), mode_A_map_));
|
||||
set_data_mode (state ().mode ());
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (mode, mode_A_map_));
|
||||
set_data_mode (mode);
|
||||
set_button (reversed_ ? rx_B_button_ : rx_A_button_);
|
||||
}
|
||||
else if (receiver_dropdown_ >= 0)
|
||||
{
|
||||
set_dropdown (receiver_dropdown_, (reversed_ ? rx_A_selection_ : rx_B_selection_).front ());
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (state ().mode (), mode_A_map_));
|
||||
set_data_mode (state ().mode ());
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (mode, mode_A_map_));
|
||||
set_data_mode (mode);
|
||||
set_dropdown (receiver_dropdown_, (reversed_ ? rx_B_selection_ : rx_A_selection_).front ());
|
||||
}
|
||||
else if (vfo_count_ > 1)
|
||||
{
|
||||
set_button (vfo_A_button_ >= 0 ? (reversed_ ? vfo_A_button_ : vfo_B_button_) : vfo_toggle_button_);
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (state ().mode (), mode_A_map_));
|
||||
set_data_mode (state ().mode ());
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (mode, mode_A_map_));
|
||||
set_data_mode (mode);
|
||||
set_button (vfo_A_button_ >= 0 ? (reversed_ ? vfo_B_button_ : vfo_A_button_) : vfo_toggle_button_);
|
||||
}
|
||||
// else Tx VFO mode gets set with frequency below
|
||||
@ -630,12 +628,12 @@ void HRDTransceiver::do_tx_frequency (Frequency tx, bool /*no_ignore*/)
|
||||
// we rationalise the modes here as well as the frequencies
|
||||
set_button (vfo_B_button_ >= 0 ? vfo_B_button_ : vfo_toggle_button_);
|
||||
send_simple_command ("set frequency-hz " + fo_string);
|
||||
if (set_rig_mode_ && mode_B_dropdown_ < 0)
|
||||
if (mode != UNK && mode_B_dropdown_ < 0)
|
||||
{
|
||||
// do this here rather than later so we only
|
||||
// toggle/switch VFOs once
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (state ().mode (), mode_A_map_));
|
||||
set_data_mode (state ().mode ());
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (mode, mode_A_map_));
|
||||
set_data_mode (mode);
|
||||
}
|
||||
set_button (vfo_A_button_ >= 0 ? vfo_A_button_ : vfo_toggle_button_);
|
||||
}
|
||||
@ -713,7 +711,7 @@ void HRDTransceiver::do_mode (MODE mode)
|
||||
{
|
||||
set_dropdown (mode_A_dropdown_, lookup_mode (mode, mode_A_map_));
|
||||
}
|
||||
if (set_rig_mode_ && state ().split ()) // rationalise mode if split
|
||||
if (mode != UNK && state ().split ()) // rationalise mode if split
|
||||
{
|
||||
if (reversed_)
|
||||
{
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
, QString const& server
|
||||
, bool use_for_ptt
|
||||
, int poll_interval
|
||||
, bool set_rig_mode
|
||||
, QObject * parent = nullptr);
|
||||
|
||||
protected:
|
||||
@ -43,7 +42,7 @@ protected:
|
||||
int do_start () override;
|
||||
void do_stop () override;
|
||||
void do_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_mode (MODE) override;
|
||||
void do_ptt (bool on) override;
|
||||
|
||||
@ -81,8 +80,6 @@ private:
|
||||
|
||||
bool use_for_ptt_; // Use HRD for PTT.
|
||||
|
||||
bool set_rig_mode_; // Set VFO mode when required
|
||||
|
||||
QString server_; // The TCP/IP addrress and port for
|
||||
// the HRD server.
|
||||
|
||||
|
@ -185,7 +185,6 @@ HamlibTransceiver::HamlibTransceiver (TransceiverFactory::PTTMethod ptt_type, QS
|
||||
QObject * parent)
|
||||
: PollingTransceiver {0, parent}
|
||||
, rig_ {rig_init (RIG_MODEL_DUMMY)}
|
||||
, set_rig_mode_ {false}
|
||||
, back_ptt_port_ {false}
|
||||
, one_VFO_ {false}
|
||||
, is_dummy_ {true}
|
||||
@ -237,7 +236,6 @@ HamlibTransceiver::HamlibTransceiver (int model_number, TransceiverFactory::Para
|
||||
QObject * parent)
|
||||
: PollingTransceiver {params.poll_interval, parent}
|
||||
, rig_ {rig_init (model_number)}
|
||||
, set_rig_mode_ {params.set_rig_mode}
|
||||
, back_ptt_port_ {TransceiverFactory::TX_audio_source_rear == params.audio_source}
|
||||
, one_VFO_ {false}
|
||||
, is_dummy_ {RIG_MODEL_DUMMY == model_number}
|
||||
@ -677,7 +675,7 @@ void HamlibTransceiver::do_frequency (Frequency f, MODE m, bool no_ignore)
|
||||
}
|
||||
}
|
||||
|
||||
void HamlibTransceiver::do_tx_frequency (Frequency tx, bool no_ignore)
|
||||
void HamlibTransceiver::do_tx_frequency (Frequency tx, MODE mode, bool no_ignore)
|
||||
{
|
||||
TRACE_CAT ("HamlibTransceiver", tx << "reversed:" << reversed_);
|
||||
|
||||
@ -728,11 +726,11 @@ void HamlibTransceiver::do_tx_frequency (Frequency tx, bool no_ignore)
|
||||
|
||||
error_check (rig_set_freq (rig_.data (), RIG_VFO_CURR, tx), tr ("setting frequency"));
|
||||
|
||||
if (set_rig_mode_ && mode_query_works_)
|
||||
if (UNK != mode && mode_query_works_)
|
||||
{
|
||||
rmode_t current_mode;
|
||||
pbwidth_t current_width;
|
||||
auto new_mode = map_mode (state ().mode ());
|
||||
auto new_mode = map_mode (mode);
|
||||
error_check (rig_get_mode (rig_.data (), RIG_VFO_CURR, ¤t_mode, ¤t_width), tr ("getting current VFO mode"));
|
||||
TRACE_CAT ("HamlibTransceiver", "rig_get_mode mode = " << rig_strrmode (current_mode) << "bw =" << current_width);
|
||||
|
||||
@ -747,9 +745,9 @@ void HamlibTransceiver::do_tx_frequency (Frequency tx, bool no_ignore)
|
||||
else if (!one_VFO_ || no_ignore) // if not single VFO addressing and not forced
|
||||
{
|
||||
hamlib_tx_vfo_fixup fixup (rig_.data (), tx_vfo);
|
||||
if (set_rig_mode_)
|
||||
if (UNK != mode)
|
||||
{
|
||||
auto new_mode = map_mode (state ().mode ());
|
||||
auto new_mode = map_mode (mode);
|
||||
TRACE_CAT ("HamlibTransceiver", "rig_set_split_freq_mode freq = " << tx
|
||||
<< " mode = " << rig_strrmode (new_mode));
|
||||
error_check (rig_set_split_freq_mode (rig_.data (), RIG_VFO_CURR, tx, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting split TX frequency and mode"));
|
||||
|
@ -36,7 +36,7 @@ class HamlibTransceiver final
|
||||
int do_start () override;
|
||||
void do_stop () override;
|
||||
void do_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_mode (MODE) override;
|
||||
void do_ptt (bool) override;
|
||||
|
||||
@ -52,7 +52,6 @@ class HamlibTransceiver final
|
||||
struct RIGDeleter {static void cleanup (RIG *);};
|
||||
QScopedPointer<RIG, RIGDeleter> rig_;
|
||||
|
||||
bool set_rig_mode_;
|
||||
bool back_ptt_port_;
|
||||
bool one_VFO_;
|
||||
bool is_dummy_;
|
||||
|
@ -589,12 +589,16 @@ void OmniRigTransceiver::do_frequency (Frequency f, MODE m, bool /*no_ignore*/)
|
||||
}
|
||||
}
|
||||
|
||||
void OmniRigTransceiver::do_tx_frequency (Frequency tx, bool /*no_ignore*/)
|
||||
void OmniRigTransceiver::do_tx_frequency (Frequency tx, MODE m, bool /*no_ignore*/)
|
||||
{
|
||||
TRACE_CAT ("OmniRigTransceiver", tx << state ());
|
||||
bool split {tx != 0};
|
||||
if (split)
|
||||
{
|
||||
if (UNK != m)
|
||||
{
|
||||
do_mode (m);
|
||||
}
|
||||
TRACE_CAT ("OmniRigTransceiver", "set SPLIT mode on");
|
||||
rig_->SetSplitMode (state ().frequency (), tx);
|
||||
update_other_frequency (tx);
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
int do_start () override;
|
||||
void do_stop () override;
|
||||
void do_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, bool no_ignore) override;
|
||||
void do_tx_frequency (Frequency, MODE, bool no_ignore) override;
|
||||
void do_mode (MODE) override;
|
||||
void do_ptt (bool on) override;
|
||||
void do_sync (bool force_signal, bool no_poll) override;
|
||||
|
@ -85,7 +85,7 @@ void PollingTransceiver::do_post_frequency (Frequency f, MODE m)
|
||||
}
|
||||
}
|
||||
|
||||
void PollingTransceiver::do_post_tx_frequency (Frequency f)
|
||||
void PollingTransceiver::do_post_tx_frequency (Frequency f, MODE)
|
||||
{
|
||||
if (next_state_.tx_frequency () != f)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ protected:
|
||||
void do_post_start () override final;
|
||||
void do_post_stop () override final;
|
||||
void do_post_frequency (Frequency, MODE) override final;
|
||||
void do_post_tx_frequency (Frequency) override final;
|
||||
void do_post_tx_frequency (Frequency, MODE) override final;
|
||||
void do_post_mode (MODE) override final;
|
||||
void do_post_ptt (bool = true) override final;
|
||||
bool do_pre_update () override final;
|
||||
|
@ -93,8 +93,8 @@ void TransceiverBase::set (TransceiverState const& s,
|
||||
// || s.split () != requested_.split ())) // or split change
|
||||
|| (s.tx_frequency () && ptt_on)) // or about to tx split
|
||||
{
|
||||
do_tx_frequency (s.tx_frequency (), ptt_on);
|
||||
do_post_tx_frequency (s.tx_frequency ());
|
||||
do_tx_frequency (s.tx_frequency (), s.mode (), ptt_on);
|
||||
do_post_tx_frequency (s.tx_frequency (), s.mode ());
|
||||
|
||||
// record what actually changed
|
||||
requested_.tx_frequency (actual_.tx_frequency ());
|
||||
@ -150,8 +150,8 @@ void TransceiverBase::shutdown ()
|
||||
if (requested_.split ())
|
||||
{
|
||||
// try and reset split mode
|
||||
do_tx_frequency (0, true);
|
||||
do_post_tx_frequency (0);
|
||||
do_tx_frequency (0, UNK, true);
|
||||
do_post_tx_frequency (0, UNK);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
|
@ -107,8 +107,8 @@ protected:
|
||||
virtual void do_frequency (Frequency, MODE, bool no_ignore) = 0;
|
||||
virtual void do_post_frequency (Frequency, MODE) {}
|
||||
|
||||
virtual void do_tx_frequency (Frequency, bool no_ignore) = 0;
|
||||
virtual void do_post_tx_frequency (Frequency) {}
|
||||
virtual void do_tx_frequency (Frequency, MODE, bool no_ignore) = 0;
|
||||
virtual void do_post_tx_frequency (Frequency, MODE) {}
|
||||
|
||||
virtual void do_mode (MODE) = 0;
|
||||
virtual void do_post_mode (MODE) {}
|
||||
|
@ -121,7 +121,7 @@ std::unique_ptr<Transceiver> TransceiverFactory::create (ParameterPack const& pa
|
||||
}
|
||||
|
||||
// wrap the basic Transceiver object instance with a decorator object that talks to ham Radio Deluxe
|
||||
result.reset (new HRDTransceiver {std::move (basic_transceiver), params.network_port, PTT_method_CAT == params.ptt_type, params.poll_interval, params.set_rig_mode});
|
||||
result.reset (new HRDTransceiver {std::move (basic_transceiver), params.network_port, PTT_method_CAT == params.ptt_type, params.poll_interval});
|
||||
if (target_thread)
|
||||
{
|
||||
result->moveToThread (target_thread);
|
||||
|
@ -111,7 +111,6 @@ public:
|
||||
PTTMethod ptt_type; // "CAT" | "DTR" | "RTS" | "VOX"
|
||||
TXAudioSource audio_source; // some rigs allow audio routing
|
||||
// to Mic/Data connector
|
||||
bool set_rig_mode; // handle rig mode when required
|
||||
SplitMode split_mode; // how to support split TX mode
|
||||
QString ptt_port; // serial port device name or special
|
||||
// value "CAT"
|
||||
@ -134,7 +133,6 @@ public:
|
||||
&& rhs.rts_high == rts_high
|
||||
&& rhs.ptt_type == ptt_type
|
||||
&& rhs.audio_source == audio_source
|
||||
&& rhs.set_rig_mode == set_rig_mode
|
||||
&& rhs.split_mode == split_mode
|
||||
&& rhs.ptt_port == ptt_port
|
||||
&& rhs.poll_interval == poll_interval
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user