Add a log channel for rig control

RIGCTRL is defined as a log channel for rig control messages and the
appropriate logger is made available to children of the Transceiver
class. Use Transceiver::logger() to access the logger.

Switched existing rig control QDebug messages to Boost logging.
This commit is contained in:
Bill Somerville
2020-09-25 02:37:41 +01:00
parent bd529c0ce5
commit cbd4f109a8
19 changed files with 361 additions and 403 deletions
+10 -34
View File
@@ -166,6 +166,7 @@
#include <QDebug>
#include "pimpl_impl.hpp"
#include "Logger.hpp"
#include "qt_helpers.hpp"
#include "MetaDataRegistry.hpp"
#include "SettingsGroup.hpp"
@@ -792,10 +793,7 @@ bool Configuration::is_dummy_rig () const
bool Configuration::transceiver_online ()
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::transceiver_online: " << m_->cached_rig_state_;
#endif
LOG_TRACE ("transceiver_online: " << m_->cached_rig_state_);
return m_->have_rig ();
}
@@ -806,54 +804,37 @@ int Configuration::transceiver_resolution () const
void Configuration::transceiver_offline ()
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::transceiver_offline:" << m_->cached_rig_state_;
#endif
LOG_TRACE ("transceiver_offline: " << m_->cached_rig_state_);
m_->close_rig ();
}
void Configuration::transceiver_frequency (Frequency f)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::transceiver_frequency:" << f << m_->cached_rig_state_;
#endif
LOG_TRACE ("transceiver_frequency: " << f << m_->cached_rig_state_);
m_->transceiver_frequency (f);
}
void Configuration::transceiver_tx_frequency (Frequency f)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::transceiver_tx_frequency:" << f << m_->cached_rig_state_;
#endif
LOG_TRACE ("transceiver_tx_frequency: " << f << m_->cached_rig_state_);
m_->transceiver_tx_frequency (f);
}
void Configuration::transceiver_mode (MODE mode)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::transceiver_mode:" << mode << m_->cached_rig_state_;
#endif
LOG_TRACE ("transceiver_mode: " << mode << " " << m_->cached_rig_state_);
m_->transceiver_mode (mode);
}
void Configuration::transceiver_ptt (bool on)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::transceiver_ptt:" << on << m_->cached_rig_state_;
#endif
LOG_TRACE ("transceiver_ptt: " << on << " " << m_->cached_rig_state_);
m_->transceiver_ptt (on);
}
void Configuration::sync_transceiver (bool force_signal, bool enforce_mode_and_split)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::sync_transceiver: force signal:" << force_signal << "enforce_mode_and_split:" << enforce_mode_and_split << m_->cached_rig_state_;
#endif
LOG_TRACE ("sync_transceiver: force signal: " << force_signal << " enforce_mode_and_split: " << enforce_mode_and_split << " " << m_->cached_rig_state_);
m_->sync_transceiver (force_signal);
if (!enforce_mode_and_split)
{
@@ -2723,9 +2704,7 @@ void Configuration::impl::sync_transceiver (bool /*force_signal*/)
void Configuration::impl::handle_transceiver_update (TransceiverState const& state,
unsigned sequence_number)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::handle_transceiver_update: Transceiver State #:" << sequence_number << state;
#endif
LOG_TRACE ("handle_transceiver_update: Transceiver State #: " << sequence_number << " " << state);
// only follow rig on some information, ignore other stuff
cached_rig_state_.online (state.online ());
@@ -2773,10 +2752,7 @@ void Configuration::impl::handle_transceiver_update (TransceiverState const& sta
void Configuration::impl::handle_transceiver_failure (QString const& reason)
{
#if WSJT_TRACE_CAT
qDebug () << "Configuration::handle_transceiver_failure: reason:" << reason;
#endif
LOG_TRACE ("handle_transceiver_failure: reason: " << reason);
close_rig ();
ui_->test_PTT_push_button->setChecked (false);