mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 00:45:42 -04:00
Logging Updates (#978)
* log_file ensures directory exists * Fix audio timestamp path * Fix auto inc, add subfolder for recordings * Fix auto inc and support subfolder
This commit is contained in:
parent
8b395239d2
commit
a8cdde7bea
22 changed files with 132 additions and 62 deletions
|
@ -98,10 +98,9 @@ ACARSAppView::ACARSAppView(NavigationView& nav) {
|
|||
logging = v;
|
||||
};
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<ACARSLogger>();
|
||||
if (logger)
|
||||
logger->append( LOG_ROOT_DIR "/ACARS.TXT" );
|
||||
logger->append(LOG_ROOT_DIR "/ACARS.TXT");
|
||||
}
|
||||
|
||||
ACARSAppView::~ACARSAppView() {
|
||||
|
|
|
@ -397,7 +397,6 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } {
|
|||
this->on_show_list();
|
||||
};
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<AISLogger>();
|
||||
if( logger ) {
|
||||
logger->append( LOG_ROOT_DIR "/AIS.TXT" );
|
||||
|
|
|
@ -232,7 +232,7 @@ private:
|
|||
|
||||
RecordView record_view {
|
||||
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
|
||||
u"AUD",
|
||||
u"AUD", u"AUDIO",
|
||||
RecordView::FileType::WAV,
|
||||
4096,
|
||||
4
|
||||
|
|
|
@ -108,7 +108,7 @@ private:
|
|||
|
||||
RecordView record_view {
|
||||
{ 0 * 8, 2 * 16, 30 * 8, 1 * 16 },
|
||||
u"BBD_????", RecordView::FileType::RawS16, 16384, 3
|
||||
u"BBD_????.*", u"CAPTURES", RecordView::FileType::RawS16, 16384, 3
|
||||
};
|
||||
|
||||
spectrum::WaterfallWidget waterfall { };
|
||||
|
|
|
@ -130,7 +130,6 @@ ERTAppView::ERTAppView(NavigationView&) {
|
|||
static_cast<int8_t>(receiver_model.vga()),
|
||||
}); */
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<ERTLogger>();
|
||||
if( logger ) {
|
||||
logger->append( LOG_ROOT_DIR "/ERT.TXT" );
|
||||
|
|
|
@ -129,10 +129,9 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
|
|||
ignore_address /= 10;
|
||||
}
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<POCSAGLogger>();
|
||||
if (logger)
|
||||
logger->append( LOG_ROOT_DIR "/POCSAG.TXT" );
|
||||
logger->append(LOG_ROOT_DIR "/POCSAG.TXT");
|
||||
|
||||
audio::output::start();
|
||||
audio::output::unmute();
|
||||
|
|
|
@ -194,7 +194,6 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
|||
|
||||
options_temperature.set_selected_index(0, true);
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<TPMSLogger>();
|
||||
if( logger ) {
|
||||
logger->append( LOG_ROOT_DIR "/TPMS.TXT" );
|
||||
|
|
|
@ -117,8 +117,6 @@ ADSBRxAircraftDetailsView::ADSBRxAircraftDetailsView(
|
|||
|
||||
std::unique_ptr<ADSBLogger> logger { };
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
|
||||
icao_code = to_string_hex(entry_copy.ICAO_address, 6);
|
||||
text_icao_address.set(to_string_hex(entry_copy.ICAO_address, 6));
|
||||
|
||||
|
|
|
@ -107,10 +107,9 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
|
|||
nav.push<ModemSetupView>();
|
||||
};
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<AFSKLogger>();
|
||||
if (logger)
|
||||
logger->append( LOG_ROOT_DIR "/AFSK.TXT" );
|
||||
logger->append(LOG_ROOT_DIR "/AFSK.TXT");
|
||||
|
||||
// Auto-configure modem for LCR RX (will be removed later)
|
||||
baseband::set_afsk(persistent_memory::modem_baudrate(), 8, 0, false);
|
||||
|
|
|
@ -141,10 +141,9 @@ APRSRxView::APRSRxView(NavigationView& nav, Rect parent_rect) : View(parent_rect
|
|||
|
||||
options_region.set_selected_index(0, true);
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<APRSLogger>();
|
||||
if (logger)
|
||||
logger->append( LOG_ROOT_DIR "/APRS.TXT" );
|
||||
logger->append(LOG_ROOT_DIR "/APRS.TXT");
|
||||
|
||||
baseband::set_aprs(1200);
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ private:
|
|||
// DEBUG
|
||||
RecordView record_view {
|
||||
{ 0 * 8, 1 * 16, 30 * 8, 1 * 16 },
|
||||
u"AFS_????", RecordView::FileType::WAV, 4096, 4
|
||||
u"AFS_????.WAV", u"APRS", RecordView::FileType::WAV, 4096, 4
|
||||
};
|
||||
|
||||
Console console {
|
||||
|
|
|
@ -42,8 +42,7 @@ bool is_hidden_file(const fs::path& path) {
|
|||
|
||||
// Gets a truncated name from a path for display.
|
||||
std::string truncate(const fs::path& path, size_t max_length) {
|
||||
auto name = path.string();
|
||||
return name.length() <= max_length ? name : name.substr(0, max_length);
|
||||
return ::truncate(path.string(), max_length);
|
||||
}
|
||||
|
||||
// Gets a human readable file size string.
|
||||
|
|
|
@ -133,7 +133,6 @@ SondeView::SondeView(NavigationView& nav) {
|
|||
999); //set a dummy heading out of range to draw a cross...probably not ideal?
|
||||
};
|
||||
|
||||
make_new_directory(LOG_ROOT_DIR);
|
||||
logger = std::make_unique<SondeLogger>();
|
||||
if (logger)
|
||||
logger->append( LOG_ROOT_DIR "/SONDE.TXT" );
|
||||
|
|
|
@ -79,7 +79,6 @@ TestView::TestView(NavigationView& nav) {
|
|||
cal_value = raw_alt - 0x80;
|
||||
};
|
||||
|
||||
|
||||
logger = std::make_unique<TestLogger>();
|
||||
if (logger)
|
||||
logger->append("saucepan.txt");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue