6#ifndef SWIFT_MISC_AVIATION_COMSYSTEM_H
7#define SWIFT_MISC_AVIATION_COMSYSTEM_H
29namespace 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,
147 physical_quantities::CPqString::SeparatorMode sep);
150 static void registerMetadata();
153 ChannelSpacing m_channelSpacing = ChannelSpacing8_33KHz;
157 static double channelSpacingToFrequencyKHz(ChannelSpacing channelSpacing);
COM system (aka "radio").
CComSystem(const QString &name, const physical_quantities::CFrequency &activeFrequency, const physical_quantities::CFrequency &standbyFrequency={ 0, physical_quantities::CFrequencyUnit::nullUnit() })
Constructor.
CModulator< CComSystem > base_type
Base type.
void setChannelSpacing(ChannelSpacing spacing)
Set channel spacing.
ChannelSpacing getChannelSpacing() const
Get channel spacing.
ChannelSpacing
Channel spacing frequency.
@ ChannelSpacing25KHz
25kHz
@ ChannelSpacing50KHz
50kHz
@ ChannelSpacing8_33KHz
8.33kHz
CComSystem()=default
Default constructor.
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.
#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...
#define SWIFT_MISC_EXPORT
Export a class or function from the library.