live frequency view integration controls

This commit is contained in:
GullCode 2023-04-07 17:01:09 +02:00
parent 0559aa2037
commit fbf9138410
2 changed files with 39 additions and 12 deletions

View File

@ -52,7 +52,7 @@ namespace ui
void GlassView::add_spectrum_pixel(int16_t color) void GlassView::add_spectrum_pixel(int16_t color)
{ {
spectrum_row[pixel_index] = spectrum_rgb3_lut[color] ; spectrum_row[pixel_index] = spectrum_rgb3_lut[color] ;
spectrum_data[pixel_index] = ( 3 * spectrum_data[pixel_index] + color ) / 4 ; // smoothing spectrum_data[pixel_index] = ( live_frequency_integrate * spectrum_data[pixel_index] + color ) / (live_frequency_integrate + 1); // smoothing
pixel_index ++ ; pixel_index ++ ;
if (pixel_index == 240) // got an entire waterfall line if (pixel_index == 240) // got an entire waterfall line
@ -214,6 +214,7 @@ namespace ui
&text_range, &text_range,
&steps_config, &steps_config,
&view_config, &view_config,
&level_integration,
&filter_config, &filter_config,
&field_rf_amp, &field_rf_amp,
&range_presets, &range_presets,
@ -310,7 +311,6 @@ namespace ui
steps = v ; steps = v ;
}; };
view_config.set_selected_index(0); //default spectrum
view_config.on_change = [this](size_t n, OptionsField::value_t v) view_config.on_change = [this](size_t n, OptionsField::value_t v)
{ {
(void)n; (void)n;
@ -318,15 +318,25 @@ namespace ui
if( v ) if( v )
{ {
display.scroll_disable(); display.scroll_disable();
level_integration.hidden( false );
} }
else else
{ {
level_integration.hidden( true );
set_dirty();
display.scroll_set_area(109, 319); // Restart scroll on the correct coordinates display.scroll_set_area(109, 319); // Restart scroll on the correct coordinates
} }
// clear between changes // clear between changes
display.fill_rectangle( { { 0 , 108 } , { 240 , 320 - 108 } } , { 0 , 0 , 0 } ); display.fill_rectangle( { { 0 , 108 } , { 240 , 320 - 108 } } , { 0 , 0 , 0 } );
}; };
view_config.set_selected_index(0); //default spectrum
level_integration.on_change = [this](size_t n, OptionsField::value_t v)
{
(void)n;
live_frequency_integrate = v ;
};
level_integration.set_selected_index(2); //default integration of ( 3 * old value + new_value ) / 4
range_presets.on_change = [this](size_t n, OptionsField::value_t v) range_presets.on_change = [this](size_t n, OptionsField::value_t v)
{ {

View File

@ -94,13 +94,14 @@ namespace ui
uint8_t max_power = 0; uint8_t max_power = 0;
int32_t steps = 250 ; // default of 250 Mhz steps int32_t steps = 250 ; // default of 250 Mhz steps
bool live_frequency_view = false ; bool live_frequency_view = false ;
int16_t live_frequency_integrate = 3 ;
Labels labels{ Labels labels{
{{0, 0}, "MIN: MAX: LNA VGA ", Color::light_grey()}, {{0, 0}, "MIN: MAX: LNA VGA ", Color::light_grey()},
{{0, 1 * 16}, " RANGE: FILTER: AMP:", Color::light_grey()}, {{0, 1 * 16}, " RANGE: FILTER: AMP:", Color::light_grey()},
{{0, 2 * 16}, "PRESET:", Color::light_grey()}, {{0, 2 * 16}, "PRESET:", Color::light_grey()},
{{0, 3 * 16}, "MARKER: MHz +/- MHz", Color::light_grey()}, {{0, 3 * 16}, "MARKER: MHz +/- MHz", Color::light_grey()},
{{0, 4 * 16}, "RESOLUTION: STEPS:", Color::light_grey()} {{0, 4 * 16}, "RES: STEP:", Color::light_grey()}
}; };
NumberField field_frequency_min { NumberField field_frequency_min {
@ -132,7 +133,7 @@ namespace ui
""}; ""};
OptionsField steps_config{ OptionsField steps_config{
{ 21 * 8, 4 * 16}, { 14 * 8, 4 * 16},
4, 4,
{ {
{"1", 1}, {"1", 1},
@ -143,13 +144,29 @@ namespace ui
}}; }};
OptionsField view_config{ OptionsField view_config{
{25 * 8, 4 * 16}, { 19 * 8, 4 * 16},
5, 7,
{ {
{"SPCTR", false }, {"SPCTR-V", false },
{"LVL-V", true }, {"LEVEL-V", true },
}}; }};
OptionsField level_integration{
{ 27 * 8, 4 * 16},
2,
{
{"x1", 1 },
{"x2", 2 },
{"x3", 3 },
{"x4", 4 },
{"x5", 5 },
{"x6", 6 },
{"x7", 7 },
{"x8", 8 },
{"x9", 9 },
}};
OptionsField filter_config{ OptionsField filter_config{
{19 * 8, 1 * 16}, {19 * 8, 1 * 16},
4, 4,
@ -181,7 +198,7 @@ namespace ui
""}; ""};
NumberField field_trigger{ NumberField field_trigger{
{11 * 8, 4 * 16}, {4 * 8, 4 * 16},
3, 3,
{2, 128}, {2, 128},
2, 2,