mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-20 02:52:00 -05:00
Resolve a long standing rig control corner case
This change allows serial control lines to be forced high or low (DTR or RTS) while using the other (RTS, DTR) for PTT on the CAT serial port. It is only needed for some very obscure and rare serial line powered interfaces. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5869 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
08e86d8c56
commit
f4fdc0c492
@ -394,9 +394,8 @@ private:
|
||||
Q_SLOT void on_split_mode_button_group_buttonClicked (int);
|
||||
Q_SLOT void on_test_CAT_push_button_clicked ();
|
||||
Q_SLOT void on_test_PTT_push_button_clicked (bool checked);
|
||||
Q_SLOT void on_CAT_control_lines_group_box_toggled (bool);
|
||||
Q_SLOT void on_CAT_DTR_check_box_toggled (bool);
|
||||
Q_SLOT void on_CAT_RTS_check_box_toggled (bool);
|
||||
Q_SLOT void on_force_DTR_combo_box_currentIndexChanged (int);
|
||||
Q_SLOT void on_force_RTS_combo_box_currentIndexChanged (int);
|
||||
Q_SLOT void on_rig_combo_box_currentIndexChanged (int);
|
||||
Q_SLOT void on_sound_input_combo_box_currentTextChanged (QString const&);
|
||||
Q_SLOT void on_sound_output_combo_box_currentTextChanged (QString const&);
|
||||
@ -1048,9 +1047,22 @@ void Configuration::impl::initialize_models ()
|
||||
ui_->CAT_data_bits_button_group->button (rig_params_.data_bits)->setChecked (true);
|
||||
ui_->CAT_stop_bits_button_group->button (rig_params_.stop_bits)->setChecked (true);
|
||||
ui_->CAT_handshake_button_group->button (rig_params_.handshake)->setChecked (true);
|
||||
ui_->CAT_control_lines_group_box->setChecked (rig_params_.force_line_control);
|
||||
ui_->CAT_DTR_check_box->setChecked (rig_params_.dtr_high);
|
||||
ui_->CAT_RTS_check_box->setChecked (rig_params_.rts_high);
|
||||
if (rig_params_.force_dtr)
|
||||
{
|
||||
ui_->force_DTR_combo_box->setCurrentIndex (rig_params_.dtr_high ? 1 : 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_->force_DTR_combo_box->setCurrentIndex (0);
|
||||
}
|
||||
if (rig_params_.force_rts)
|
||||
{
|
||||
ui_->force_RTS_combo_box->setCurrentIndex (rig_params_.rts_high ? 1 : 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_->force_RTS_combo_box->setCurrentIndex (0);
|
||||
}
|
||||
ui_->TX_audio_source_button_group->button (rig_params_.audio_source)->setChecked (true);
|
||||
ui_->CAT_poll_interval_spin_box->setValue (rig_params_.poll_interval);
|
||||
ui_->udp_server_line_edit->setText (udp_server_name_);
|
||||
@ -1223,8 +1235,9 @@ void Configuration::impl::read_settings ()
|
||||
rig_params_.data_bits = settings_->value ("CATDataBits", QVariant::fromValue (TransceiverFactory::eight_data_bits)).value<TransceiverFactory::DataBits> ();
|
||||
rig_params_.stop_bits = settings_->value ("CATStopBits", QVariant::fromValue (TransceiverFactory::two_stop_bits)).value<TransceiverFactory::StopBits> ();
|
||||
rig_params_.handshake = settings_->value ("CATHandshake", QVariant::fromValue (TransceiverFactory::handshake_none)).value<TransceiverFactory::Handshake> ();
|
||||
rig_params_.force_line_control = settings_->value ("CATForceControlLines", false).toBool ();
|
||||
rig_params_.force_dtr = settings_->value ("CATForceDTR", false).toBool ();
|
||||
rig_params_.dtr_high = settings_->value ("DTR", false).toBool ();
|
||||
rig_params_.force_rts = settings_->value ("CATForceRTS", false).toBool ();
|
||||
rig_params_.rts_high = settings_->value ("RTS", false).toBool ();
|
||||
rig_params_.ptt_type = settings_->value ("PTTMethod", QVariant::fromValue (TransceiverFactory::PTT_method_VOX)).value<TransceiverFactory::PTTMethod> ();
|
||||
rig_params_.audio_source = settings_->value ("TXAudioSource", QVariant::fromValue (TransceiverFactory::TX_audio_source_front)).value<TransceiverFactory::TXAudioSource> ();
|
||||
@ -1322,8 +1335,9 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("73TxDisable", disable_TX_on_73_);
|
||||
settings_->setValue ("Runaway", watchdog_);
|
||||
settings_->setValue ("Tx2QSO", TX_messages_);
|
||||
settings_->setValue ("CATForceControlLines", rig_params_.force_line_control);
|
||||
settings_->setValue ("CATForceDTR", rig_params_.force_dtr);
|
||||
settings_->setValue ("DTR", rig_params_.dtr_high);
|
||||
settings_->setValue ("CATForceRTS", rig_params_.force_rts);
|
||||
settings_->setValue ("RTS", rig_params_.rts_high);
|
||||
settings_->setValue ("TXAudioSource", QVariant::fromValue (rig_params_.audio_source));
|
||||
settings_->setValue ("Polling", rig_params_.poll_interval);
|
||||
@ -1360,6 +1374,23 @@ void Configuration::impl::set_rig_invariants ()
|
||||
auto port_type = transceiver_factory_.CAT_port_type (rig);
|
||||
|
||||
bool is_serial_CAT (TransceiverFactory::Capabilities::serial == port_type);
|
||||
auto const& cat_port = ui_->CAT_port_combo_box->currentText ();
|
||||
|
||||
// only enable CAT option if transceiver has CAT PTT
|
||||
ui_->PTT_CAT_radio_button->setEnabled (CAT_PTT_enabled);
|
||||
|
||||
auto enable_ptt_port = TransceiverFactory::PTT_method_CAT != ptt_method && TransceiverFactory::PTT_method_VOX != ptt_method;
|
||||
ui_->PTT_port_combo_box->setEnabled (enable_ptt_port);
|
||||
ui_->PTT_port_label->setEnabled (enable_ptt_port);
|
||||
|
||||
ui_->PTT_port_combo_box->setItemData (ui_->PTT_port_combo_box->findText ("CAT")
|
||||
, CAT_indirect_serial_PTT ? combo_box_item_enabled : combo_box_item_disabled
|
||||
, Qt::UserRole - 1);
|
||||
|
||||
ui_->PTT_DTR_radio_button->setEnabled (!("CAT" == ptt_port && !CAT_indirect_serial_PTT));
|
||||
|
||||
ui_->PTT_RTS_radio_button->setEnabled (!((is_serial_CAT && ptt_port == cat_port && is_hw_handshake)
|
||||
|| ("CAT" == ptt_port && !CAT_indirect_serial_PTT)));
|
||||
|
||||
if (TransceiverFactory::basic_transceiver_name_ == rig)
|
||||
{
|
||||
@ -1420,34 +1451,16 @@ void Configuration::impl::set_rig_invariants ()
|
||||
}
|
||||
}
|
||||
ui_->CAT_serial_port_parameters_group_box->setEnabled (is_serial_CAT);
|
||||
ui_->CAT_control_lines_group_box->setEnabled (is_serial_CAT);
|
||||
ui_->CAT_RTS_check_box->setEnabled (is_serial_CAT
|
||||
&& ui_->CAT_control_lines_group_box->isChecked ()
|
||||
&& !is_hw_handshake);
|
||||
ui_->force_DTR_combo_box->setEnabled (is_serial_CAT
|
||||
&& (cat_port != ptt_port
|
||||
|| !ui_->PTT_DTR_radio_button->isEnabled ()
|
||||
|| !ui_->PTT_DTR_radio_button->isChecked ()));
|
||||
ui_->force_RTS_combo_box->setEnabled (is_serial_CAT
|
||||
&& !is_hw_handshake
|
||||
&& (cat_port != ptt_port
|
||||
|| !ui_->PTT_RTS_radio_button->isEnabled ()
|
||||
|| !ui_->PTT_RTS_radio_button->isChecked ()));
|
||||
}
|
||||
|
||||
auto const& cat_port = ui_->CAT_port_combo_box->currentText ();
|
||||
|
||||
// only enable CAT option if transceiver has CAT PTT
|
||||
ui_->PTT_CAT_radio_button->setEnabled (CAT_PTT_enabled);
|
||||
|
||||
auto enable_ptt_port = TransceiverFactory::PTT_method_CAT != ptt_method && TransceiverFactory::PTT_method_VOX != ptt_method;
|
||||
ui_->PTT_port_combo_box->setEnabled (enable_ptt_port);
|
||||
ui_->PTT_port_label->setEnabled (enable_ptt_port);
|
||||
|
||||
ui_->PTT_port_combo_box->setItemData (ui_->PTT_port_combo_box->findText ("CAT")
|
||||
, CAT_indirect_serial_PTT ? combo_box_item_enabled : combo_box_item_disabled
|
||||
, Qt::UserRole - 1);
|
||||
|
||||
auto control_lines_available = !ui_->CAT_control_lines_group_box->isEnabled ()
|
||||
|| !ui_->CAT_control_lines_group_box->isChecked ();
|
||||
ui_->PTT_DTR_radio_button->setEnabled (!(((is_serial_CAT && ptt_port == cat_port)
|
||||
&& !control_lines_available)
|
||||
|| ("CAT" == ptt_port && !CAT_indirect_serial_PTT)));
|
||||
|
||||
ui_->PTT_RTS_radio_button->setEnabled (!(((is_serial_CAT && ptt_port == cat_port)
|
||||
&& (!control_lines_available || is_hw_handshake))
|
||||
|| ("CAT" == ptt_port && !CAT_indirect_serial_PTT)));
|
||||
}
|
||||
|
||||
bool Configuration::impl::validate ()
|
||||
@ -1522,9 +1535,10 @@ TransceiverFactory::ParameterPack Configuration::impl::gather_rig_data ()
|
||||
result.data_bits = static_cast<TransceiverFactory::DataBits> (ui_->CAT_data_bits_button_group->checkedId ());
|
||||
result.stop_bits = static_cast<TransceiverFactory::StopBits> (ui_->CAT_stop_bits_button_group->checkedId ());
|
||||
result.handshake = static_cast<TransceiverFactory::Handshake> (ui_->CAT_handshake_button_group->checkedId ());
|
||||
result.force_line_control = ui_->CAT_control_lines_group_box->isChecked ();
|
||||
result.dtr_high = ui_->CAT_DTR_check_box->isChecked ();
|
||||
result.rts_high = ui_->CAT_RTS_check_box->isChecked ();
|
||||
result.force_dtr = ui_->force_DTR_combo_box->isEnabled () && ui_->force_DTR_combo_box->currentIndex () > 0;
|
||||
result.dtr_high = 1 == ui_->force_DTR_combo_box->currentIndex ();
|
||||
result.force_rts = ui_->force_RTS_combo_box->isEnabled () && ui_->force_RTS_combo_box->currentIndex () > 0;
|
||||
result.rts_high = 1 == ui_->force_RTS_combo_box->currentIndex ();
|
||||
result.poll_interval = ui_->CAT_poll_interval_spin_box->value ();
|
||||
result.ptt_type = static_cast<TransceiverFactory::PTTMethod> (ui_->PTT_method_button_group->checkedId ());
|
||||
result.ptt_port = ui_->PTT_port_combo_box->currentText ();
|
||||
@ -1911,17 +1925,12 @@ void Configuration::impl::on_test_PTT_push_button_clicked (bool checked)
|
||||
}
|
||||
}
|
||||
|
||||
void Configuration::impl::on_CAT_control_lines_group_box_toggled (bool /* checked */)
|
||||
void Configuration::impl::on_force_DTR_combo_box_currentIndexChanged (int /* index */)
|
||||
{
|
||||
set_rig_invariants ();
|
||||
}
|
||||
|
||||
void Configuration::impl::on_CAT_DTR_check_box_toggled (bool /* checked */)
|
||||
{
|
||||
set_rig_invariants ();
|
||||
}
|
||||
|
||||
void Configuration::impl::on_CAT_RTS_check_box_toggled (bool /* checked */)
|
||||
void Configuration::impl::on_force_RTS_combo_box_currentIndexChanged (int /* index */)
|
||||
{
|
||||
set_rig_invariants ();
|
||||
}
|
||||
|
@ -669,32 +669,75 @@ a few, particularly some Kenwood rigs, require it).</string>
|
||||
<property name="title">
|
||||
<string>Force Control Lines</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="CAT_DTR_check_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Force the DTR control linelow or high on the CAT serial port.</p><p>This is required for a few CAT interfaces that are powered</p><p>from the DTR control line.</p><p>Normally you should leave this unchecked.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DTR</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QFormLayout" name="formLayout_8">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="force_DTR_label">
|
||||
<property name="text">
|
||||
<string>DTR:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>force_DTR_combo_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="force_DTR_combo_box">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>High</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Low</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="CAT_RTS_check_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Force the RTS control line low or high on the CAT serial port.</p><p>This is required for a few CAT interfaces that are powered</p><p>from the RTS control line.</p><p>Normally you should leave this unchecked.</p><p>This option is only available if Hardware handshaking is not</p><p>selected above.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RTS</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QFormLayout" name="formLayout_9">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="force_RTS_label">
|
||||
<property name="text">
|
||||
<string>RTS:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>force_RTS_combo_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="force_RTS_combo_box">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>High</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Low</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -2278,12 +2321,11 @@ soundcard changes</string>
|
||||
<tabstop>CAT_handshake_none_radio_button</tabstop>
|
||||
<tabstop>CAT_handshake_xon_radio_button</tabstop>
|
||||
<tabstop>CAT_handshake_hardware_radio_button</tabstop>
|
||||
<tabstop>CAT_control_lines_group_box</tabstop>
|
||||
<tabstop>CAT_DTR_check_box</tabstop>
|
||||
<tabstop>CAT_RTS_check_box</tabstop>
|
||||
<tabstop>force_DTR_combo_box</tabstop>
|
||||
<tabstop>force_RTS_combo_box</tabstop>
|
||||
<tabstop>PTT_VOX_radio_button</tabstop>
|
||||
<tabstop>PTT_CAT_radio_button</tabstop>
|
||||
<tabstop>PTT_DTR_radio_button</tabstop>
|
||||
<tabstop>PTT_CAT_radio_button</tabstop>
|
||||
<tabstop>PTT_RTS_radio_button</tabstop>
|
||||
<tabstop>PTT_port_combo_box</tabstop>
|
||||
<tabstop>TX_source_data_radio_button</tabstop>
|
||||
@ -2301,6 +2343,7 @@ soundcard changes</string>
|
||||
<tabstop>sound_output_combo_box</tabstop>
|
||||
<tabstop>sound_output_channel_combo_box</tabstop>
|
||||
<tabstop>save_path_select_push_button</tabstop>
|
||||
<tabstop>azel_path_select_push_button</tabstop>
|
||||
<tabstop>jt9w_bandwidth_mult_combo_box</tabstop>
|
||||
<tabstop>jt9w_min_dt_double_spin_box</tabstop>
|
||||
<tabstop>jt9w_max_dt_double_spin_box</tabstop>
|
||||
@ -2397,12 +2440,12 @@ soundcard changes</string>
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -258,9 +258,12 @@ HamlibTransceiver::HamlibTransceiver (int model_number, TransceiverFactory::Para
|
||||
case TransceiverFactory::handshake_hardware: set_conf ("serial_handshake", "Hardware"); break;
|
||||
}
|
||||
|
||||
if (params.force_line_control)
|
||||
if (params.force_dtr)
|
||||
{
|
||||
set_conf ("dtr_state", params.dtr_high ? "ON" : "OFF");
|
||||
}
|
||||
if (params.force_rts)
|
||||
{
|
||||
if (TransceiverFactory::handshake_hardware != params.handshake)
|
||||
{
|
||||
set_conf ("rts_state", params.rts_high ? "ON" : "OFF");
|
||||
|
@ -96,8 +96,9 @@ public:
|
||||
DataBits data_bits;
|
||||
StopBits stop_bits;
|
||||
Handshake handshake;
|
||||
bool force_line_control;
|
||||
bool force_dtr;
|
||||
bool dtr_high; // to power interface
|
||||
bool force_rts;
|
||||
bool rts_high; // to power interface
|
||||
PTTMethod ptt_type; // "CAT" | "DTR" | "RTS" | "VOX"
|
||||
TXAudioSource audio_source; // some rigs allow audio routing
|
||||
@ -117,8 +118,9 @@ public:
|
||||
&& rhs.data_bits == data_bits
|
||||
&& rhs.stop_bits == stop_bits
|
||||
&& rhs.handshake == handshake
|
||||
&& rhs.force_line_control == force_line_control
|
||||
&& rhs.force_dtr == force_dtr
|
||||
&& rhs.dtr_high == dtr_high
|
||||
&& rhs.force_rts == force_rts
|
||||
&& rhs.rts_high == rts_high
|
||||
&& rhs.ptt_type == ptt_type
|
||||
&& rhs.audio_source == audio_source
|
||||
|
Loading…
Reference in New Issue
Block a user