mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-05 08:51:19 -05:00
aa1225ff96
Using a local event loop to wait for Omni-Rig to initialize has caused issues elsewhere, reverted to simple waits in teh hope that Omni-Rig initializes promptly.
60 lines
2.0 KiB
C++
60 lines
2.0 KiB
C++
#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)
|
|
{
|
|
d.nospace ()
|
|
<< "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")
|
|
<< ')';
|
|
return d.space ();
|
|
}
|
|
#endif
|
|
|
|
std::ostream& operator << (std::ostream& os, Transceiver::MODE m)
|
|
{
|
|
auto const& mo = Transceiver::staticMetaObject; \
|
|
return os << mo.enumerator (mo.indexOfEnumerator ("MODE")).valueToKey (static_cast<int> (m)); \
|
|
}
|
|
|
|
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} Mode: " << 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);
|
|
|
|
bool operator != (Transceiver::TransceiverState const& lhs, Transceiver::TransceiverState const& rhs)
|
|
{
|
|
return lhs.online_ != rhs.online_
|
|
|| lhs.rx_frequency_ != rhs.rx_frequency_
|
|
|| lhs.tx_frequency_ != rhs.tx_frequency_
|
|
|| lhs.mode_ != rhs.mode_
|
|
|| lhs.split_ != rhs.split_
|
|
|| lhs.ptt_ != rhs.ptt_;
|
|
}
|
|
|
|
bool operator == (Transceiver::TransceiverState const& lhs, Transceiver::TransceiverState const& rhs)
|
|
{
|
|
return !(lhs != rhs);
|
|
}
|