From 1edd3716a17c55c556a3ab96c3ecbbf2bd505fa4 Mon Sep 17 00:00:00 2001 From: jLynx Date: Thu, 11 May 2023 11:44:19 +1200 Subject: [PATCH] Revert "specific directory for screens and logs (#971)" (#972) This reverts commit bc1ad5598c5280ac4d57c9bed28c025b105122da. --- firmware/application/apps/acars_app.cpp | 4 +--- firmware/application/apps/ais_app.cpp | 4 +--- firmware/application/apps/ert_app.cpp | 4 +--- firmware/application/apps/pocsag_app.cpp | 4 +--- firmware/application/apps/tpms_app.cpp | 4 +--- firmware/application/apps/ui_adsb_rx.cpp | 8 ++------ firmware/application/apps/ui_afsk_rx.cpp | 4 +--- firmware/application/apps/ui_aprs_rx.cpp | 4 +--- firmware/application/apps/ui_sonde.cpp | 5 ++--- firmware/application/ui_navigation.cpp | 6 +----- 10 files changed, 12 insertions(+), 35 deletions(-) diff --git a/firmware/application/apps/acars_app.cpp b/firmware/application/apps/acars_app.cpp index 06f42819..108a673a 100644 --- a/firmware/application/apps/acars_app.cpp +++ b/firmware/application/apps/acars_app.cpp @@ -98,11 +98,9 @@ ACARSAppView::ACARSAppView(NavigationView& nav) { logging = v; }; - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if (logger) - logger->append("LOGS/ACARS.TXT"); + logger->append("acars.txt"); } ACARSAppView::~ACARSAppView() { diff --git a/firmware/application/apps/ais_app.cpp b/firmware/application/apps/ais_app.cpp index fc7f7bb9..d45efc0d 100644 --- a/firmware/application/apps/ais_app.cpp +++ b/firmware/application/apps/ais_app.cpp @@ -397,11 +397,9 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { this->on_show_list(); }; - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if( logger ) { - logger->append(u"LOGS/AIS.TXT"); + logger->append(u"ais.txt"); } } diff --git a/firmware/application/apps/ert_app.cpp b/firmware/application/apps/ert_app.cpp index 1b93d703..447286ef 100644 --- a/firmware/application/apps/ert_app.cpp +++ b/firmware/application/apps/ert_app.cpp @@ -130,11 +130,9 @@ ERTAppView::ERTAppView(NavigationView&) { static_cast(receiver_model.vga()), }); */ - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if( logger ) { - logger->append(u"LOGS/ERT.TXT"); + logger->append(u"ert.txt"); } } diff --git a/firmware/application/apps/pocsag_app.cpp b/firmware/application/apps/pocsag_app.cpp index 89852859..0c5580b8 100644 --- a/firmware/application/apps/pocsag_app.cpp +++ b/firmware/application/apps/pocsag_app.cpp @@ -129,11 +129,9 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) { ignore_address /= 10; } - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if (logger) - logger->append("LOGS/POCSAG.TXT"); + logger->append("pocsag.txt"); audio::output::start(); audio::output::unmute(); diff --git a/firmware/application/apps/tpms_app.cpp b/firmware/application/apps/tpms_app.cpp index f20020ec..5f3a0d09 100644 --- a/firmware/application/apps/tpms_app.cpp +++ b/firmware/application/apps/tpms_app.cpp @@ -194,11 +194,9 @@ TPMSAppView::TPMSAppView(NavigationView&) { options_temperature.set_selected_index(0, true); - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if( logger ) { - logger->append(u"LOGS/TMPS.TXT"); + logger->append(u"tpms.txt"); } } diff --git a/firmware/application/apps/ui_adsb_rx.cpp b/firmware/application/apps/ui_adsb_rx.cpp index b6057c5e..ca899ffc 100644 --- a/firmware/application/apps/ui_adsb_rx.cpp +++ b/firmware/application/apps/ui_adsb_rx.cpp @@ -117,12 +117,6 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView( std::unique_ptr logger { }; - logger = std::make_unique(); - std::string folder = "LOGS"; - make_new_directory(folder); - if (logger) - logger->append(u"LOGS/ADSB.TXT"); - icao_code = to_string_hex(entry_copy.ICAO_address, 6); text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6)); @@ -357,6 +351,7 @@ void ADSBRxView::sort_entries_by_state() } void ADSBRxView::on_frame(const ADSBFrameMessage * message) { + logger = std::make_unique(); rtc::RTC datetime; std::string callsign; std::string str_info; @@ -437,6 +432,7 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) { } // frame.get_DF() == DF_ADSB if (logger) { + logger->append(u"adsb.txt"); // will log each frame in format: // 20171103100227 8DADBEEFDEADBEEFDEADBEEFDEADBEEF ICAO:nnnnnn callsign Alt:nnnnnn Latnnn.nn Lonnnn.nn logger->log_str(logentry); diff --git a/firmware/application/apps/ui_afsk_rx.cpp b/firmware/application/apps/ui_afsk_rx.cpp index 2a0d7de0..e8daa261 100644 --- a/firmware/application/apps/ui_afsk_rx.cpp +++ b/firmware/application/apps/ui_afsk_rx.cpp @@ -107,11 +107,9 @@ AFSKRxView::AFSKRxView(NavigationView& nav) { nav.push(); }; - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if (logger) - logger->append("LOGS/AFSK.TXT"); + logger->append("AFSK_LOG.TXT"); // Auto-configure modem for LCR RX (will be removed later) baseband::set_afsk(persistent_memory::modem_baudrate(), 8, 0, false); diff --git a/firmware/application/apps/ui_aprs_rx.cpp b/firmware/application/apps/ui_aprs_rx.cpp index d5390548..c1f16893 100644 --- a/firmware/application/apps/ui_aprs_rx.cpp +++ b/firmware/application/apps/ui_aprs_rx.cpp @@ -141,11 +141,9 @@ APRSRxView::APRSRxView(NavigationView& nav, Rect parent_rect) : View(parent_rect options_region.set_selected_index(0, true); - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if (logger) - logger->append("LOGS/APRS.TXT"); + logger->append("APRS_RX_LOG.TXT"); baseband::set_aprs(1200); diff --git a/firmware/application/apps/ui_sonde.cpp b/firmware/application/apps/ui_sonde.cpp index 0f3fedce..5ddf157e 100644 --- a/firmware/application/apps/ui_sonde.cpp +++ b/firmware/application/apps/ui_sonde.cpp @@ -133,13 +133,12 @@ SondeView::SondeView(NavigationView& nav) { 999); //set a dummy heading out of range to draw a cross...probably not ideal? }; - std::string folder = "LOGS"; - make_new_directory(folder); logger = std::make_unique(); if (logger) - logger->append(u"LOGS/SONDE.TXT"); + logger->append(u"sonde.txt"); // initialize audio: + field_volume.set_value((receiver_model.headphone_volume() - audio::headphone::volume_range().max).decibel() + 99); field_volume.on_change = [this](int32_t v) { diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index bd1f9090..1870b126 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -367,11 +367,7 @@ void SystemStatusView::on_bias_tee() { }*/ void SystemStatusView::on_camera() { - - std::string folder = "SCREENSHOTS"; - make_new_directory(folder); - - auto path = next_filename_stem_matching_pattern(u"SCREENSHOTS/SCR_????"); + auto path = next_filename_stem_matching_pattern(u"SCR_????"); if( path.empty() ) { return; }