15 using namespace swift::misc::physical_quantities;
16 using namespace swift::misc::network;
20 namespace swift::misc::aviation
22 CAtcStationList::CAtcStationList() {}
45 bool overrideWithNewer)
53 if (station.
getCallsign() != callsign) {
continue; }
56 if (m.
getType() == CInformationMessage::Unspecified) {
break; }
60 if (!overrideWithNewer) {
break; }
63 else { unequal =
true; }
75 if (station.
getCallsign() != callsign) {
continue; }
96 if (this->
isEmpty()) {
return {}; }
123 const QString currentSuffix = s.getCallsignSuffix();
124 if (suffix != currentSuffix)
126 suffix = currentSuffix;
129 split[currentSuffix].push_back(s);
bool containsBy(Predicate p) const
Return true if there is an element for which a given predicate returns true.
auto transform(F function) const
Return a new container generated by applying some transformation function to all elements of this one...
void sortBy(K1 key1, Keys... keys)
In-place sort by some particular key(s).
CSequence findBy(Predicate p) const
Return a copy containing only those elements for which a given predicate returns true.
int removeIf(Predicate p)
Remove elements for which a given predicate returns true.
bool isEmpty() const
Synonym for empty.
void sort(Predicate p)
In-place sort by a given comparator predicate.
bool isNewerThan(const ITimestampBased &otherTimestampObj) const
Is this newer than other?
Value object encapsulating information about an ATC station.
const CCallsign & getCallsign() const
Get callsign.
bool hasValidFrequency() const
Valid COM frequency.
bool isComUnitTunedToFrequency(const aviation::CComSystem &comUnit) const
Is Com unit tuned to this stations frequency.
const CInformationMessage & getInformationMessage(CInformationMessage::InformationType type) const
Message per type.
bool setOnline(bool online)
Set online.
bool isAtcStationFrequency(const physical_quantities::CFrequency &frequency) const
Is passed frequency the frequency of this station.
bool setMessage(const CInformationMessage &message)
Set given message.
int getSuffixSortOrder() const
Callsign suffix sort order.
const swift::misc::network::CUser & getController() const
Get controller.
bool isInRange() const
In range? If range and distance to own aircraft are not available false.
Value object for a list of ATC stations.
CAtcStationList()
Default constructor.
int removeIfOutsideRange()
Remove if marked outside of range.
QHash< QString, CAtcStationList > splitPerSuffix(bool sort=true) const
Split per suffix.
CAtcStationList stationsWithValidFrequency() const
Find 0..n stations with valid COM frequency.
bool hasComUnitTunedInChannelSpacing(const CComSystem &comUnit) const
Any stations tuned in frequency of COM unit (with channel spacing)
CAtcStationList sortedByAtcSuffixSortOrderAndDistance() const
Sorted by ATC suffix sort order and distance.
int setOnline(const CCallsign &callsign, bool online)
Set online status.
void sortByAtcSuffixSortOrderAndDistance()
Sort by ATC suffix sort order and distance.
CAtcStationList findIfFrequencyIsWithinSpacing(const physical_quantities::CFrequency &frequency)
Find 0..n stations with frequency (with 5 kHz spacing for .x20/.x25 and .x70/.x75)
CAtcStationList findIfComUnitTunedInChannelSpacing(const CComSystem &comUnit) const
Find 0..n stations tuned in frequency of COM unit (with channel spacing)
network::CUserList getControllers() const
All controllers (with valid data)
bool updateIfMessageChanged(const CInformationMessage &im, const CCallsign &callsign, bool overrideWithNewer)
Update if message changed.
CAtcStationList findInRange() const
Those in range.
Value object encapsulating information of a callsign.
const physical_quantities::CLength & getRelativeDistance() const
Get the distance.
Value object encapsulating a list of voice rooms.
bool isNull() const
Is quantity null?
auto MemberTransform(T memberFunc)
Returns a function object that returns the value returned by one of it's argument member functions.
auto MemberValid(T memberFunc)
Returns a predicate that returns true if the isValid() method of the value returned from one of its m...
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.