mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-06 16:05:09 -04:00
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:
@@ -1,7 +1,15 @@
|
||||
#include "Transceiver.hpp"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "moc_Transceiver.cpp"
|
||||
|
||||
Transceiver::Transceiver (logger_type * logger, QObject * parent)
|
||||
: QObject {parent}
|
||||
, logger_ {logger}
|
||||
{
|
||||
}
|
||||
|
||||
#if !defined (QT_NO_DEBUG_STREAM)
|
||||
QDebug operator << (QDebug d, Transceiver::TransceiverState const& s)
|
||||
{
|
||||
@@ -15,6 +23,16 @@ QDebug operator << (QDebug d, Transceiver::TransceiverState const& s)
|
||||
}
|
||||
#endif
|
||||
|
||||
std::ostream& operator << (std::ostream& os, Transceiver::TransceiverState const& s)
|
||||
{
|
||||
return os
|
||||
<< "Transceiver::TransceiverState(online: " << (s.online_ ? "yes" : "no")
|
||||
<< " Frequency {" << s.rx_frequency_ << "Hz, " << s.tx_frequency_ << "Hz} " << s.mode_
|
||||
<< "; SPLIT: " << (Transceiver::TransceiverState::Split::on == s.split_ ? "on" : Transceiver::TransceiverState::Split::off == s.split_ ? "off" : "unknown")
|
||||
<< "; PTT: " << (s.ptt_ ? "on" : "off")
|
||||
<< ')';
|
||||
}
|
||||
|
||||
ENUM_QDATASTREAM_OPS_IMPL (Transceiver, MODE);
|
||||
|
||||
ENUM_CONVERSION_OPS_IMPL (Transceiver, MODE);
|
||||
|
||||
Reference in New Issue
Block a user