Add simple icao logging to adsb receiver app. (#120)

* Add simple icao logging to adsb receiver app.

* full frame logging and expanded details
This commit is contained in:
Mycroft
2017-11-08 12:23:06 -08:00
committed by Furrtek
parent 196518457f
commit 3b0346ca21
2 changed files with 41 additions and 13 deletions
+15 -1
View File
@@ -26,10 +26,11 @@
#include "ui_geomap.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "recent_entries.hpp"
#include "log_file.hpp"
#include "adsb.hpp"
#include "message.hpp"
using namespace adsb;
namespace ui {
@@ -100,6 +101,18 @@ struct AircraftRecentEntry {
using AircraftRecentEntries = RecentEntries<AircraftRecentEntry>;
class ADSBLogger {
public:
Optional<File::Error> append(const std::filesystem::path& filename) {
return log_file.append(filename);
}
void log_str(std::string& logline);
private:
LogFile log_file { };
};
class ADSBRxDetailsView : public View {
public:
ADSBRxDetailsView(NavigationView&, const AircraftRecentEntry& entry, const std::function<void(void)> on_close);
@@ -186,6 +199,7 @@ public:
std::string title() const override { return "ADS-B receive"; };
private:
std::unique_ptr<ADSBLogger> logger { };
void on_frame(const ADSBFrameMessage * message);
void on_tick_second();