ADSB RX App cleanup (#1569)

* WIP refactoring/gardening

* WIP cleanup, adding status dots

* Rename ageStep

* WIP Cleanup

* Wrapping up ADSB refactor/cleanup.

* Don't initialize strings to "     "

* Better map refresh

* Fix colorization of recent entries

* Fit and finish
This commit is contained in:
Kyle Reed 2023-11-10 08:22:29 -08:00 committed by GitHub
parent bbd1a5a2ef
commit f4f538f69b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 533 additions and 432 deletions

View file

@ -24,13 +24,13 @@
#include "ui_widget.hpp"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <list>
#include <utility>
#include <functional>
#include <iterator>
#include <algorithm>
#include <list>
#include <utility>
template <class Entry>
using RecentEntries = std::list<Entry>;
@ -42,6 +42,13 @@ typename ContainerType::const_iterator find(const ContainerType& entries, const
[key](typename ContainerType::const_reference e) { return e.key() == key; });
}
template <typename ContainerType, typename Key>
typename ContainerType::iterator find(ContainerType& entries, const Key key) {
return std::find_if(
std::begin(entries), std::end(entries),
[key](typename ContainerType::const_reference e) { return e.key() == key; });
}
template <typename ContainerType>
static void truncate_entries(ContainerType& entries, const size_t entries_max = 64) {
while (entries.size() > entries_max) {