summaryrefslogtreecommitdiff
path: root/TransceiverFactory.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'TransceiverFactory.hpp')
-rw-r--r--TransceiverFactory.hpp46
1 files changed, 30 insertions, 16 deletions
diff --git a/TransceiverFactory.hpp b/TransceiverFactory.hpp
index 7d0ad18a..f7b5167c 100644
--- a/TransceiverFactory.hpp
+++ b/TransceiverFactory.hpp
@@ -20,8 +20,8 @@ class QDir;
class TransceiverFactory
: public QObject
{
- Q_OBJECT;
- Q_ENUMS (DataBits StopBits Handshake PTTMethod TXAudioSource SplitMode);
+ Q_OBJECT
+ Q_ENUMS (DataBits StopBits Handshake PTTMethod TXAudioSource SplitMode)
public:
//
@@ -31,7 +31,7 @@ public:
//
struct Capabilities
{
- enum PortType {none, serial, network};
+ enum PortType {none, serial, network, usb};
explicit Capabilities (int model_number = 0
, PortType port_type = none
@@ -65,13 +65,20 @@ public:
// various Transceiver parameters
//
enum DataBits {seven_data_bits = 7, eight_data_bits};
+ Q_ENUM (DataBits)
enum StopBits {one_stop_bit = 1, two_stop_bits};
+ Q_ENUM (StopBits)
enum Handshake {handshake_none, handshake_XonXoff, handshake_hardware};
+ Q_ENUM (Handshake)
enum PTTMethod {PTT_method_VOX, PTT_method_CAT, PTT_method_DTR, PTT_method_RTS};
+ Q_ENUM (PTTMethod)
enum TXAudioSource {TX_audio_source_front, TX_audio_source_rear};
+ Q_ENUM (TXAudioSource)
enum SplitMode {split_mode_none, split_mode_rig, split_mode_emulate};
+ Q_ENUM (SplitMode)
TransceiverFactory ();
+ ~TransceiverFactory ();
static char const * const basic_transceiver_name_; // dummy transceiver is basic model
@@ -92,39 +99,44 @@ public:
QString rig_name; // from supported_transceivers () key
QString serial_port; // serial port device name or empty
QString network_port; // hostname:port or empty
+ QString usb_port; // [vid[:pid[:vendor[:product]]]]
int baud;
DataBits data_bits;
StopBits stop_bits;
Handshake handshake;
- bool force_line_control;
- bool dtr_high; // to power interface
- bool rts_high; // to power interface
- PTTMethod ptt_type; // "CAT" | "DTR" | "RTS" | "VOX"
- TXAudioSource audio_source; // some rigs allow audio routing
- // to Mic/Data connector
- SplitMode split_mode; // how to support split TX mode
- QString ptt_port; // serial port device name or special
- // value "CAT"
- int poll_interval; // in seconds for interfaces that
- // require polling for state changes
+ 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
+ // to Mic/Data connector
+ SplitMode split_mode; // how to support split TX mode
+ QString ptt_port; // serial port device name or special
+ // value "CAT"
+ int poll_interval; // in seconds for interfaces that
+ // require polling for state changes
bool operator == (ParameterPack const& rhs) const
{
return rhs.rig_name == rig_name
&& rhs.serial_port == serial_port
&& rhs.network_port == network_port
+ && rhs.usb_port == usb_port
&& rhs.baud == baud
&& 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
&& rhs.split_mode == split_mode
&& rhs.ptt_port == ptt_port
- && rhs.poll_interval == poll_interval;
+ && rhs.poll_interval == poll_interval
+ ;
}
};
@@ -153,12 +165,14 @@ bool operator != (TransceiverFactory::ParameterPack const& lhs, TransceiverFacto
// boilerplate routines to make enum types useable and debuggable in
// Qt
//
+#if QT_VERSION < 0x050500
Q_DECLARE_METATYPE (TransceiverFactory::DataBits);
Q_DECLARE_METATYPE (TransceiverFactory::StopBits);
Q_DECLARE_METATYPE (TransceiverFactory::Handshake);
Q_DECLARE_METATYPE (TransceiverFactory::PTTMethod);
Q_DECLARE_METATYPE (TransceiverFactory::TXAudioSource);
Q_DECLARE_METATYPE (TransceiverFactory::SplitMode);
+#endif
#if !defined (QT_NO_DEBUG_STREAM)
ENUM_QDEBUG_OPS_DECL (TransceiverFactory, DataBits);