mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 12:23:37 -05:00
fb1b2e7687
-----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEUELwYiy7vDRM+hTD2GSwbR6BYY8FAl3a8/QACgkQ2GSwbR6B YY8y+ggAqwaaCRMCSwDzStooYjStJErVoZ/yB//MmoF+798TBb+3MkiT+KclW7aN rxTOmEJ+a84PmsiW6Qz/AAcHPnbKDhtwWASZooopgNYDfgyaUib3HfIa+cFJO6my OUzlTsH94yDxeBCWOtf1dLiP0YwJKfp/vxzbfDAWXTd4dx3Ok/7KwghYocmP3eCq ruZ+dWojQzwE+h50P6B9gTFxGWMHUDDNeZ/c8u494wqDQvQaRoM9oOnQWzlGiMis JaerraI52JEdFLnXjtLYeyXtfg+zA0KvRY2DWy1aCPpGkNjy3DPNlOA+cDQpzBru NIqsUF+GplgkVs3sKNLXq36ZgaBQBg== =5w4B -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEUELwYiy7vDRM+hTD2GSwbR6BYY8FAl3a9R8ACgkQ2GSwbR6B YY9SWQf+JdfIvlHy8ExSs9ImCLck/e66V2OAqaEONQX1bEC4QiG3M/rVJGgf2iFz ZFshtilsajlpsYZQIFToTmJmI76eGLAmyNIcZN2WpcJQMNWZnxqklMj2wIHbRh+g Pvw3FC+lc4LUjZCCMYrVjNXxsRmQtjqV1lVFBnmrAWCdrgHmhyrVbPZT4B+fRTXL ikw/BiRgxhI0aoIWKzNrtztMYUBjanKLTHE81AVgsgZkBDNybOjR7mE2E/Jwc4Qx mVu+Z0uI+bVuBlMOrqp0K+rrUz7qMZe5/AMSRbgzwfueEOIShgu2wrfV++3JDXLH AhtIAcL/b39RBx0jkFE8rBKaZpkoAw== =DNp6 -----END PGP SIGNATURE----- Merge tag 'wsjtx-2.1.1' into develop Tagging the WSJT-X v2.1.1 release
73 lines
2.3 KiB
C++
73 lines
2.3 KiB
C++
#ifndef OMNI_RIG_TRANSCEIVER_HPP__
|
|
#define OMNI_RIG_TRANSCEIVER_HPP__
|
|
|
|
#include <memory>
|
|
|
|
#include <QScopedPointer>
|
|
#include <QString>
|
|
#include <QTimer>
|
|
|
|
#include "TransceiverFactory.hpp"
|
|
#include "TransceiverBase.hpp"
|
|
|
|
#include "OmniRig.h"
|
|
|
|
//
|
|
// OmniRig Transceiver Interface
|
|
//
|
|
// Implemented as a Transceiver decorator because we may want the PTT
|
|
// services of another Transceiver type such as the HamlibTransceiver
|
|
// which can be enabled by wrapping a HamlibTransceiver instantiated
|
|
// as a "Hamlib Dummy" transceiver in the Transceiver factory method.
|
|
//
|
|
class OmniRigTransceiver final
|
|
: public TransceiverBase
|
|
{
|
|
Q_OBJECT;
|
|
|
|
public:
|
|
static void register_transceivers (TransceiverFactory::Transceivers *, int id1, int id2);
|
|
|
|
enum RigNumber {One = 1, Two};
|
|
|
|
// takes ownership of wrapped Transceiver
|
|
explicit OmniRigTransceiver (std::unique_ptr<TransceiverBase> wrapped, RigNumber, TransceiverFactory::PTTMethod ptt_type, QString const& ptt_port, QObject * parent = nullptr);
|
|
|
|
int do_start () override;
|
|
void do_stop () override;
|
|
void do_frequency (Frequency, MODE, bool no_ignore) override;
|
|
void do_tx_frequency (Frequency, MODE, bool no_ignore) override;
|
|
void do_mode (MODE) override;
|
|
void do_ptt (bool on) override;
|
|
|
|
private:
|
|
bool await_notification_with_timeout (int timeout);
|
|
Q_SIGNAL void notified () const;
|
|
// Q_SLOT void timeout_check ();
|
|
Q_SLOT void handle_COM_exception (int, QString, QString, QString);
|
|
Q_SLOT void handle_visible_change ();
|
|
Q_SLOT void handle_rig_type_change (int rig_number);
|
|
Q_SLOT void handle_status_change (int rig_number);
|
|
Q_SLOT void handle_params_change (int rig_number, int params);
|
|
Q_SLOT void handle_custom_reply (int, QVariant const& command, QVariant const& reply);
|
|
|
|
static MODE map_mode (OmniRig::RigParamX param);
|
|
static OmniRig::RigParamX map_mode (MODE mode);
|
|
|
|
std::unique_ptr<TransceiverBase> wrapped_; // may be null
|
|
bool use_for_ptt_;
|
|
TransceiverFactory::PTTMethod ptt_type_;
|
|
QScopedPointer<OmniRig::OmniRigX> omni_rig_;
|
|
RigNumber rig_number_;
|
|
QScopedPointer<OmniRig::RigX> rig_;
|
|
QScopedPointer<OmniRig::PortBits> port_;
|
|
QString rig_type_;
|
|
int readable_params_;
|
|
int writable_params_;
|
|
QScopedPointer<QTimer> offline_timer_;
|
|
bool send_update_signal_;
|
|
bool reversed_; // some rigs can reverse VFOs
|
|
};
|
|
|
|
#endif
|