mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
@@ -181,6 +181,19 @@ namespace BlackMisc::Aviation
|
||||
}
|
||||
}
|
||||
|
||||
bool CComSystem::isExclusiveWithin8_33kHzChannel(const PhysicalQuantities::CFrequency &freq)
|
||||
{
|
||||
const int freqKHz = freq.value(CFrequencyUnit::kHz());
|
||||
if (freqKHz < 118000 || freqKHz >= 137000 || !isValid8_33kHzChannel(freqKHz)) { return false; }
|
||||
return !isWithin25kHzChannel(freq);
|
||||
}
|
||||
|
||||
bool CComSystem::isWithin25kHzChannel(const PhysicalQuantities::CFrequency &freq)
|
||||
{
|
||||
const int end = static_cast<int>(freq.value(CFrequencyUnit::kHz())) % 100;
|
||||
return end == 0 || end == 25 || end == 50 || end == 75;
|
||||
}
|
||||
|
||||
bool CComSystem::isWithinChannelSpacing(const CFrequency &setFrequency, const CFrequency &compareFrequency, CComSystem::ChannelSpacing channelSpacing)
|
||||
{
|
||||
if (setFrequency.isNull() || compareFrequency.isNull()) { return false; }
|
||||
|
||||
@@ -148,6 +148,13 @@ namespace BlackMisc::Aviation
|
||||
//! Round passed frequency in kHz to 8.33 frequency spacing
|
||||
static int round8_33kHzChannel(int fKHz);
|
||||
|
||||
//! Is frequency a "new" 8.33 kHz frequency and not within 25 kHz spacing
|
||||
//! E.g. returns false for 122.825 but true for 118.305
|
||||
static bool isExclusiveWithin8_33kHzChannel(const PhysicalQuantities::CFrequency &freq);
|
||||
|
||||
//! Is frequency within 25 kHz frequency spacing
|
||||
static bool isWithin25kHzChannel(const PhysicalQuantities::CFrequency &freq);
|
||||
|
||||
//! Parses almost any shitty string to a valid COM frequency
|
||||
static PhysicalQuantities::CFrequency parseComFrequency(const QString &input, PhysicalQuantities::CPqString::SeparatorMode sep);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user