1#ifndef TRANSCEIVER_FACTORY_HPP__
2#define TRANSCEIVER_FACTORY_HPP__
4#include "JS8_Main/qt_helpers.h"
5#include "Transceiver.h"
19class TransceiverFactory :
public QObject {
21 Q_ENUMS(DataBits StopBits Handshake PTTMethod TXAudioSource SplitMode)
30 enum PortType { none, serial, network, usb };
32 explicit Capabilities(
int model_number = 0, PortType port_type = none,
33 bool has_CAT_PTT =
false,
34 bool has_CAT_PTT_mic_data =
false,
35 bool has_CAT_indirect_serial_PTT =
false,
36 bool asynchronous =
false)
37 : model_number_{model_number}, port_type_{port_type},
38 has_CAT_PTT_{has_CAT_PTT},
39 has_CAT_PTT_mic_data_{has_CAT_PTT_mic_data},
40 has_CAT_indirect_serial_PTT_{has_CAT_indirect_serial_PTT},
41 asynchronous_{asynchronous} {}
46 bool has_CAT_PTT_mic_data_;
47 bool has_CAT_indirect_serial_PTT_;
55 typedef QMap<QString, Capabilities> Transceivers;
60 enum DataBits { seven_data_bits = 7, eight_data_bits, default_data_bits };
62 enum StopBits { one_stop_bit = 1, two_stop_bits, default_stop_bits };
78 enum TXAudioSource { TX_audio_source_front, TX_audio_source_rear };
80 enum SplitMode { split_mode_none, split_mode_rig, split_mode_emulate };
84 ~TransceiverFactory();
87 *
const basic_transceiver_name_;
92 Transceivers
const &supported_transceivers()
const;
95 Capabilities::PortType
96 CAT_port_type(QString
const &name)
const;
97 bool has_CAT_PTT(QString
const &name)
const;
98 bool has_CAT_PTT_mic_data(
99 QString
const &name)
const;
100 bool has_CAT_indirect_serial_PTT(QString
const &name)
102 bool has_asynchronous_CAT(
103 QString
const &name)
const;
108 QString network_port;
119 TXAudioSource audio_source;
121 SplitMode split_mode;
128 return rhs.rig_name == rig_name && rhs.serial_port == serial_port &&
129 rhs.network_port == network_port &&
130 rhs.usb_port == usb_port && rhs.baud == baud &&
131 rhs.data_bits == data_bits && rhs.stop_bits == stop_bits &&
132 rhs.handshake == handshake && rhs.force_dtr == force_dtr &&
133 rhs.dtr_high == dtr_high && rhs.force_rts == force_rts &&
134 rhs.rts_high == rts_high && rhs.ptt_type == ptt_type &&
135 rhs.audio_source == audio_source &&
136 rhs.split_mode == split_mode && rhs.ptt_port == ptt_port &&
137 rhs.poll_interval == poll_interval;
151 QThread *target_thread =
nullptr);
154 Transceivers transceivers_;
159 return !(lhs == rhs);
166#if QT_VERSION < 0x050500
167Q_DECLARE_METATYPE(TransceiverFactory::DataBits);
168Q_DECLARE_METATYPE(TransceiverFactory::StopBits);
169Q_DECLARE_METATYPE(TransceiverFactory::Handshake);
170Q_DECLARE_METATYPE(TransceiverFactory::PTTMethod);
171Q_DECLARE_METATYPE(TransceiverFactory::TXAudioSource);
172Q_DECLARE_METATYPE(TransceiverFactory::SplitMode);
175#if !defined(QT_NO_DEBUG_STREAM)
Definition TransceiverFactory.h:19
Definition TransceiverFactory.h:105