WSJT-X/DXLabSuiteCommanderTransceiver.hpp
Bill Somerville d7ef043d88 ------------------------------------------------------------------------
r5299 | bsomervi | 2015-04-26 17:50:40 +0100 (Sun, 26 Apr 2015) | 4 lines

Some HRD commands need a settling time otherwise they don't stick

This seems  to be  limited to  the Yaesu  FTdx3000 "RX  A" and  "RX B"
commands so a short delay has been added after these sort of commands.
------------------------------------------------------------------------

Merged from wsjtx branch.



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx-1.5@5300 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2015-04-26 16:58:50 +00:00

58 lines
1.7 KiB
C++

#ifndef DX_LAB_SUITE_COMMANDER_TRANSCEIVER_HPP__
#define DX_LAB_SUITE_COMMANDER_TRANSCEIVER_HPP__
#include <memory>
#include "TransceiverFactory.hpp"
#include "PollingTransceiver.hpp"
class QTcpSocket;
class QByteArray;
class QString;
//
// DX Lab Suite Commander 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 DXLabSuiteCommanderTransceiver final
: public PollingTransceiver
{
Q_OBJECT; // for translation context
public:
static void register_transceivers (TransceiverFactory::Transceivers *, int id);
// takes ownership of wrapped Transceiver
explicit DXLabSuiteCommanderTransceiver (std::unique_ptr<TransceiverBase> wrapped, QString const& address, bool use_for_ptt, int poll_interval);
~DXLabSuiteCommanderTransceiver ();
protected:
void do_start () override;
void do_stop () override;
void do_frequency (Frequency, MODE) override;
void do_tx_frequency (Frequency, bool rationalise_mode) override;
void do_mode (MODE, bool rationalise) override;
void do_ptt (bool on) override;
void poll () override;
private:
void simple_command (QString const&, bool no_debug = false);
QString command_with_reply (QString const&, bool no_debug = false);
bool write_to_port (QString const&);
QString frequency_to_string (Frequency) const;
Frequency string_to_frequency (QString) const;
std::unique_ptr<TransceiverBase> wrapped_;
bool use_for_ptt_;
QString server_;
QTcpSocket * commander_;
QLocale locale_;
};
#endif