Record button remove (#968)

* removed unused debug and record buttons
* added log checkbox
* changed ignore and log to false at app start for pocsag
* fixed warning: suggest parentheses around arithmetic in operand of '^' proc signal
* ui comsetic fix
This commit is contained in:
gullradriel 2023-05-10 14:12:49 +02:00 committed by GitHub
parent 909b00bdae
commit 9a22a760ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 83 deletions

View File

@ -64,8 +64,8 @@ private:
std::app_settings settings { }; std::app_settings settings { };
std::app_settings::AppSettings app_settings { }; std::app_settings::AppSettings app_settings { };
bool logging { true }; bool logging { false };
bool ignore { true }; bool ignore { false };
uint32_t last_address = 0xFFFFFFFF; uint32_t last_address = 0xFFFFFFFF;
pocsag::POCSAGState pocsag_state { }; pocsag::POCSAGState pocsag_state { };
@ -91,12 +91,6 @@ private:
FrequencyField field_frequency { FrequencyField field_frequency {
{ 0 * 8, 0 * 8 }, { 0 * 8, 0 * 8 },
}; };
Checkbox check_log {
{ 24 * 8, 21 },
3,
"LOG",
true
};
NumberField field_volume{ NumberField field_volume{
{ 28 * 8, 0 * 16 }, { 28 * 8, 0 * 16 },
2, 2,
@ -106,16 +100,22 @@ private:
}; };
Checkbox check_ignore { Checkbox check_ignore {
{ 1 * 8, 21 }, { 0 * 8, 21 },
12, 8,
"Ignore addr:", "Ign addr",
true false
}; };
SymField sym_ignore { SymField sym_ignore {
{ 16 * 8, 21 }, { 13 * 8, 25 },
7, 7,
SymField::SYMFIELD_DEC SymField::SYMFIELD_DEC
}; };
Checkbox check_log {
{ 240 - 8 * 8, 21 },
3,
"LOG",
false
};
Console console { Console console {
{ 0, 3 * 16, 240, 256 } { 0, 3 * 16, 240, 256 }

View File

@ -60,9 +60,9 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
&field_lna, &field_lna,
&field_vga, &field_vga,
&field_frequency, &field_frequency,
&check_log,
&text_debug, &text_debug,
&button_modem_setup, &button_modem_setup,
&record_view,
&console &console
}); });
@ -74,13 +74,6 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
field_rf_amp.set_value(app_settings.rx_amp); field_rf_amp.set_value(app_settings.rx_amp);
} }
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
};
record_view.set_sampling_rate(24000);
// Auto-configure modem for LCR RX (will be removed later) // Auto-configure modem for LCR RX (will be removed later)
update_freq(467225500); // 462713300 update_freq(467225500); // 462713300
auto def_bell202 = &modem_defs[0]; auto def_bell202 = &modem_defs[0];
@ -105,6 +98,11 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
}; };
}; };
check_log.set_value(logging);
check_log.on_select = [this](Checkbox&, bool v) {
logging = v;
};
button_modem_setup.on_select = [&nav](Button&) { button_modem_setup.on_select = [&nav](Button&) {
nav.push<ModemSetupView>(); nav.push<ModemSetupView>();
}; };
@ -153,22 +151,23 @@ void AFSKRxView::on_data(uint32_t value, bool is_data) {
console.write(str_console); console.write(str_console);
if (logger) str_log += str_byte; if (logger && logging) str_log += str_byte;
if ((value != 0x7F) && (prev_value == 0x7F)) { if ((value != 0x7F) && (prev_value == 0x7F)) {
// Message split // Message split
console.writeln(""); console.writeln("");
console_color++; console_color++;
if (logger) { if (logger && logging) {
logger->log_raw_data(str_log); logger->log_raw_data(str_log);
str_log = ""; str_log = "";
} }
} }
prev_value = value; prev_value = value;
} else { }
else {
// Baudrate estimation // Baudrate estimation
text_debug.set("~" + to_string_dec_uint(value)); text_debug.set("Baudrate estimation: ~" + to_string_dec_uint(value));
} }
} }

View File

@ -64,6 +64,7 @@ private:
uint8_t console_color { 0 }; uint8_t console_color { 0 };
uint32_t prev_value { 0 }; uint32_t prev_value { 0 };
std::string str_log { "" }; std::string str_log { "" };
bool logging { false };
RFAmpField field_rf_amp { RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 } { 13 * 8, 0 * 16 }
@ -85,23 +86,23 @@ private:
{ 0 * 8, 0 * 16 }, { 0 * 8, 0 * 16 },
}; };
Checkbox check_log {
{ 0 * 8, 1 * 16 },
3,
"LOG",
false
};
Text text_debug { Text text_debug {
{ 0 * 8, 1 * 16, 10 * 8, 16 }, { 0 * 8, 12 + 2 * 16, 240, 16 },
"DEBUG" "DEBUG"
}; };
Button button_modem_setup { Button button_modem_setup {
{ 12 * 8, 1 * 16, 96, 24 }, { 240 - 12 * 8, 1 * 16, 96, 24 },
"Modem setup" "Modem setup"
}; };
// DEBUG
RecordView record_view {
{ 0 * 8, 3 * 16, 30 * 8, 1 * 16 },
u"AFS_????", RecordView::FileType::WAV, 4096, 4
};
Console console { Console console {
{ 0, 4 * 16, 240, 240 } { 0, 4 * 16, 240, 240 }
}; };

View File

@ -54,9 +54,7 @@ BTLERxView::BTLERxView(NavigationView& nav) {
&field_lna, &field_lna,
&field_vga, &field_vga,
&field_frequency, &field_frequency,
&text_debug,
&button_modem_setup, &button_modem_setup,
&record_view,
&console &console
}); });
@ -68,13 +66,6 @@ BTLERxView::BTLERxView(NavigationView& nav) {
field_rf_amp.set_value(app_settings.rx_amp); field_rf_amp.set_value(app_settings.rx_amp);
} }
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
};
record_view.set_sampling_rate(24000);
// Auto-configure modem for LCR RX (will be removed later) // Auto-configure modem for LCR RX (will be removed later)
update_freq(2426000000); update_freq(2426000000);
auto def_bell202 = &modem_defs[0]; auto def_bell202 = &modem_defs[0];
@ -103,7 +94,6 @@ BTLERxView::BTLERxView(NavigationView& nav) {
nav.push<ModemSetupView>(); nav.push<ModemSetupView>();
}; };
// Auto-configure modem for LCR RX (will be removed later) // Auto-configure modem for LCR RX (will be removed later)
baseband::set_btle(persistent_memory::modem_baudrate(), 8, 0, false); baseband::set_btle(persistent_memory::modem_baudrate(), 8, 0, false);

View File

@ -53,7 +53,6 @@ private:
uint8_t console_color { 0 }; uint8_t console_color { 0 };
uint32_t prev_value { 0 }; uint32_t prev_value { 0 };
std::string str_log { "" };
RFAmpField field_rf_amp { RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 } { 13 * 8, 0 * 16 }
@ -75,23 +74,11 @@ private:
{ 0 * 8, 0 * 16 }, { 0 * 8, 0 * 16 },
}; };
Text text_debug {
{ 0 * 8, 1 * 16, 10 * 8, 16 },
"DEBUG"
};
Button button_modem_setup { Button button_modem_setup {
{ 12 * 8, 1 * 16, 96, 24 }, { 240 - 12 * 8, 1 * 16, 96, 24 },
"Modem setup" "Modem setup"
}; };
// DEBUG
RecordView record_view {
{ 0 * 8, 3 * 16, 30 * 8, 1 * 16 },
u"AFS_????", RecordView::FileType::WAV, 4096, 4
};
Console console { Console console {
{ 0, 4 * 16, 240, 240 } { 0, 4 * 16, 240, 240 }
}; };

View File

@ -54,9 +54,7 @@ NRFRxView::NRFRxView(NavigationView& nav) {
&field_lna, &field_lna,
&field_vga, &field_vga,
&field_frequency, &field_frequency,
&text_debug,
&button_modem_setup, &button_modem_setup,
&record_view,
&console &console
}); });
@ -68,12 +66,6 @@ NRFRxView::NRFRxView(NavigationView& nav) {
field_rf_amp.set_value(app_settings.rx_amp); field_rf_amp.set_value(app_settings.rx_amp);
} }
// DEBUG
record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message);
};
record_view.set_sampling_rate(24000);
// Auto-configure modem for LCR RX (will be removed later) // Auto-configure modem for LCR RX (will be removed later)
update_freq(2480000000); update_freq(2480000000);
auto def_bell202 = &modem_defs[0]; auto def_bell202 = &modem_defs[0];

View File

@ -52,7 +52,6 @@ private:
uint8_t console_color { 0 }; uint8_t console_color { 0 };
uint32_t prev_value { 0 }; uint32_t prev_value { 0 };
std::string str_log { "" };
RFAmpField field_rf_amp { RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 } { 13 * 8, 0 * 16 }
@ -74,23 +73,11 @@ private:
{ 0 * 8, 0 * 16 }, { 0 * 8, 0 * 16 },
}; };
Text text_debug {
{ 0 * 8, 1 * 16, 10 * 8, 16 },
"DEBUG"
};
Button button_modem_setup { Button button_modem_setup {
{ 12 * 8, 1 * 16, 96, 24 }, { 240 - 12 * 8, 1 * 16, 96, 24 },
"Modem setup" "Modem setup"
}; };
// DEBUG
RecordView record_view {
{ 0 * 8, 3 * 16, 30 * 8, 1 * 16 },
u"AFS_????", RecordView::FileType::WAV, 4096, 4
};
Console console { Console console {
{ 0, 4 * 16, 240, 240 } { 0, 4 * 16, 240, 240 }
}; };

View File

@ -67,7 +67,7 @@ void SigGenProcessor::execute(const buffer_c8_t& buffer) {
// 16 bits LFSR .taps: 16, 15, 13, 4 ;feedback polynomial: x^16 + x^15 + x^13 + x^4 + 1 // 16 bits LFSR .taps: 16, 15, 13, 4 ;feedback polynomial: x^16 + x^15 + x^13 + x^4 + 1
// Periode 65535= 2^n-1, quite continuous . // Periode 65535= 2^n-1, quite continuous .
if (counter == 0) { // we slow down the shift register, because the pseudo random noise clock freq was too high for modulator. if (counter == 0) { // we slow down the shift register, because the pseudo random noise clock freq was too high for modulator.
bit_16 = ((lfsr_16 >> 0) ^ (lfsr_16 >> 1) ^ (lfsr_16 >> 3) ^ (lfsr_16 >> 4) ^ (lfsr_16 >> 12) & 1); bit_16 = ((lfsr_16 >> 0) ^ (lfsr_16 >> 1) ^ (lfsr_16 >> 3) ^ (lfsr_16 >> 4) ^ ((lfsr_16 >> 12) & 1) );
lfsr_16 = (lfsr_16 >> 1) | (bit_16 << 15); lfsr_16 = (lfsr_16 >> 1) | (bit_16 << 15);
sample = (lfsr_16 & 0x00FF); // main pseudo random noise generator. sample = (lfsr_16 & 0x00FF); // main pseudo random noise generator.
} }