mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-15 16:42:12 -05:00
f200506571
Working frequencies are mode dependent and a reset to defaults button has been added. Also re-factored much of the model and item delegate code to simplify several of the model implementations. Introduced a single routine called from main to register the custom types with Qt. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5453 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#ifndef RADIO_HPP_
|
|
#define RADIO_HPP_
|
|
|
|
#include <QObject>
|
|
#include <QLocale>
|
|
|
|
class QVariant;
|
|
class QString;
|
|
|
|
//
|
|
// Declarations common to radio software.
|
|
//
|
|
|
|
namespace Radio
|
|
{
|
|
//
|
|
// Frequency types
|
|
//
|
|
using Frequency = quint64;
|
|
using FrequencyDelta = qint64;
|
|
|
|
//
|
|
// Frequency type conversion.
|
|
//
|
|
// QVariant argument is convertible to double and is assumed to
|
|
// be scaled by (10 ** -scale).
|
|
//
|
|
Frequency frequency (QVariant const&, int scale);
|
|
FrequencyDelta frequency_delta (QVariant const&, int scale);
|
|
|
|
//
|
|
// Frequency type formatting
|
|
//
|
|
QString frequency_MHz_string (Frequency, QLocale const& = QLocale ());
|
|
QString frequency_MHz_string (FrequencyDelta, QLocale const& = QLocale ());
|
|
QString pretty_frequency_MHz_string (Frequency, QLocale const& = QLocale ());
|
|
QString pretty_frequency_MHz_string (double, int scale, QLocale const& = QLocale ());
|
|
QString pretty_frequency_MHz_string (FrequencyDelta, QLocale const& = QLocale ());
|
|
|
|
//
|
|
// Callsigns
|
|
//
|
|
bool is_callsign (QString const&);
|
|
bool is_compound_callsign (QString const&);
|
|
QString base_callsign (QString);
|
|
}
|
|
|
|
Q_DECLARE_METATYPE (Radio::Frequency);
|
|
Q_DECLARE_METATYPE (Radio::FrequencyDelta);
|
|
|
|
#endif
|