6 #ifndef SWIFT_MISC_AVIATION_COMSYSTEM_H
7 #define SWIFT_MISC_AVIATION_COMSYSTEM_H
12 #include <QJsonObject>
29 namespace swift::misc::aviation
67 :
CModulator(name, activeFrequency, standbyFrequency.isNull() ? activeFrequency : standbyFrequency)
72 void setFrequencyActiveMHz(
double frequencyMHz);
76 void setFrequencyStandbyMHz(
double frequencyMHz);
90 void setActiveUnicom();
99 static CComSystem getCom1System(
double activeFrequencyMHz,
double standbyFrequencyMHz = -1);
106 static CComSystem getCom2System(
double activeFrequencyMHz,
double standbyFrequencyMHz = -1);
114 static bool isValidCivilAviationFrequency(
const physical_quantities::CFrequency &f);
117 static bool isValidMilitaryFrequency(
const physical_quantities::CFrequency &f);
120 static bool isValidComFrequency(
const physical_quantities::CFrequency &f);
124 static void roundToChannelSpacing(physical_quantities::CFrequency &frequency, ChannelSpacing channelSpacing);
128 static bool isSameFrequency(
const physical_quantities::CFrequency &freq1,
129 const physical_quantities::CFrequency &freq2);
133 static bool isValid8_33kHzChannel(
int fKHz);
136 static int round8_33kHzChannel(
int fKHz);
140 static bool isExclusiveWithin8_33kHzChannel(
const physical_quantities::CFrequency &freq);
143 static bool isWithin25kHzChannel(
const physical_quantities::CFrequency &freq);
146 static physical_quantities::CFrequency parseComFrequency(
const QString &input,
153 ChannelSpacing m_channelSpacing = ChannelSpacing8_33KHz;
157 static double channelSpacingToFrequencyKHz(ChannelSpacing channelSpacing);
CComSystem(const QString &name, const physical_quantities::CFrequency &activeFrequency, const physical_quantities::CFrequency &standbyFrequency={ 0, physical_quantities::CFrequencyUnit::nullUnit() })
Constructor.
void setChannelSpacing(ChannelSpacing spacing)
Set channel spacing.
CComSystem()
Default constructor.
ChannelSpacing getChannelSpacing() const
Get channel spacing.
ChannelSpacing
Channel spacing frequency.
@ ChannelSpacing25KHz
25kHz
@ ChannelSpacing50KHz
50kHz
Base class for COM, NAV, Squawk units.
CRTP class template from which a derived class can inherit property indexing functions.
CRTP class template which will generate marshalling operators for a derived class with its own marsha...
static CFrequencyUnit nullUnit()
Null unit.
SeparatorMode
Number separators / group separators.
#define SWIFT_MISC_DECLARE_USING_MIXIN_INDEX(DERIVED)
When a derived class and a base class both inherit from mixin::Index, the derived class uses this mac...
void registerMetadata()
Register all relevant metadata in Misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.