Renamed parameters in rx_capture.ini file (#2452)

* Rename settings in file to match screen
* Renamed variables for hopefully better clarity
This commit is contained in:
Mark Thompson 2024-12-29 11:29:31 -06:00 committed by GitHub
parent 57ce978bab
commit 01034af077
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 18 deletions

View File

@ -55,25 +55,24 @@ CaptureAppView::CaptureAppView(NavigationView& nav)
this->field_frequency.set_step(v); this->field_frequency.set_step(v);
}; };
option_format.set_selected_index(previous_format); option_format.set_selected_index(file_format);
option_format.on_change = [this](size_t, uint32_t file_type) { option_format.on_change = [this](size_t, uint32_t file_type) {
previous_format = file_type; file_format = file_type;
record_view.set_file_type((RecordView::FileType)file_type); record_view.set_file_type((RecordView::FileType)file_type);
}; };
check_trim.set_value(previous_trim); check_trim.set_value(trim);
check_trim.on_select = [this](Checkbox&, bool v) { check_trim.on_select = [this](Checkbox&, bool v) {
previous_trim = v; trim = v;
record_view.set_auto_trim(v); record_view.set_auto_trim(v);
}; };
freqman_set_bandwidth_option(SPEC_MODULATION, option_bandwidth); freqman_set_bandwidth_option(SPEC_MODULATION, option_bandwidth);
option_bandwidth.on_change = [this](size_t, uint32_t bandwidth) { option_bandwidth.on_change = [this](size_t, uint32_t new_capture_rate) {
/* Nyquist would imply a sample rate of 2x bandwidth, but because the ADC /* Nyquist would imply a sample rate of 2x bandwidth, but because the ADC
* provides 2 values (I,Q), the sample_rate is equal to bandwidth here. */ * provides 2 values (I,Q), the sample_rate is equal to bandwidth here. */
auto sample_rate = bandwidth;
/* base_rate (bandwidth) is used for FFT calculation and display LCD, and also in recording writing SD Card rate. */ /* capture_rate (bandwidth) is used for FFT calculation and display LCD, and also in recording writing SD Card rate. */
/* ex. sampling_rate values, 4Mhz, when recording 500 kHz (BW) and fs 8 Mhz, when selected 1 Mhz BW ... */ /* ex. sampling_rate values, 4Mhz, when recording 500 kHz (BW) and fs 8 Mhz, when selected 1 Mhz BW ... */
/* ex. recording 500kHz BW to .C16 file, base_rate clock 500kHz x2(I,Q) x 2 bytes (int signed) =2MB/sec rate SD Card. */ /* ex. recording 500kHz BW to .C16 file, base_rate clock 500kHz x2(I,Q) x 2 bytes (int signed) =2MB/sec rate SD Card. */
@ -81,7 +80,7 @@ CaptureAppView::CaptureAppView(NavigationView& nav)
// record_view determines the correct oversampling to apply and returns the actual sample rate. // record_view determines the correct oversampling to apply and returns the actual sample rate.
// NB: record_view is what actually updates proc_capture baseband settings. // NB: record_view is what actually updates proc_capture baseband settings.
auto actual_sample_rate = record_view.set_sampling_rate(sample_rate); auto actual_sample_rate = record_view.set_sampling_rate(new_capture_rate);
// Update the radio model with the actual sampling rate. // Update the radio model with the actual sampling rate.
receiver_model.set_sampling_rate(actual_sample_rate); receiver_model.set_sampling_rate(actual_sample_rate);
@ -91,19 +90,19 @@ CaptureAppView::CaptureAppView(NavigationView& nav)
receiver_model.set_baseband_bandwidth(anti_alias_filter_bandwidth); receiver_model.set_baseband_bandwidth(anti_alias_filter_bandwidth);
// Automatically switch default capture format to C8 when bandwidth setting is increased to >=1.5MHz anb back to C16 for <=1,25Mhz // Automatically switch default capture format to C8 when bandwidth setting is increased to >=1.5MHz anb back to C16 for <=1,25Mhz
if ((bandwidth >= 1500000) && (previous_bandwidth < 1500000)) { if ((new_capture_rate >= 1500000) && (capture_rate < 1500000)) {
option_format.set_selected_index(1); // Default C8 format for REC, 1500K ... 5500k option_format.set_selected_index(1); // Default C8 format for REC, 1500K ... 5500k
} }
if ((bandwidth <= 1250000) && (previous_bandwidth > 1250000)) { if ((new_capture_rate <= 1250000) && (capture_rate > 1250000)) {
option_format.set_selected_index(0); // Default C16 format for REC , 12k5 ... 1250K option_format.set_selected_index(0); // Default C16 format for REC , 12k5 ... 1250K
} }
previous_bandwidth = bandwidth; capture_rate = new_capture_rate;
waterfall.start(); waterfall.start();
}; };
receiver_model.enable(); receiver_model.enable();
option_bandwidth.set_by_value(previous_bandwidth); option_bandwidth.set_by_value(capture_rate);
record_view.on_error = [&nav](std::string message) { record_view.on_error = [&nav](std::string message) {
nav.display_modal("Error", message); nav.display_modal("Error", message);

View File

@ -49,9 +49,9 @@ class CaptureAppView : public View {
private: private:
static constexpr ui::Dim header_height = 3 * 16; static constexpr ui::Dim header_height = 3 * 16;
uint32_t previous_bandwidth{500000}; uint32_t capture_rate{500000};
uint32_t previous_format{0}; uint32_t file_format{0};
bool previous_trim{false}; bool trim{false};
NavigationView& nav_; NavigationView& nav_;
RxRadioState radio_state_{ReceiverModel::Mode::Capture}; RxRadioState radio_state_{ReceiverModel::Mode::Capture};
@ -59,9 +59,9 @@ class CaptureAppView : public View {
"rx_capture", "rx_capture",
app_settings::Mode::RX, app_settings::Mode::RX,
{ {
{"previous_bandwidth"sv, &previous_bandwidth}, {"capture_rate"sv, &capture_rate},
{"previous_format"sv, &previous_format}, {"file_format"sv, &file_format},
{"previous_trim"sv, &previous_trim}, {"trim"sv, &trim},
}}; }};
Labels labels{ Labels labels{