reoganised things a little, added nb_columns management in ui

This commit is contained in:
GullCode 2023-03-14 22:23:16 +01:00
parent 155543e5d5
commit a1705dd9d4
2 changed files with 26 additions and 5 deletions

View File

@ -62,6 +62,7 @@ namespace ui {
&field_bw,
&field_mode,
&step_mode,
&rssi_resolution,
&button_frequency,
&text_ctcss,
&freq_stats_rssi,
@ -143,6 +144,13 @@ namespace ui {
}
};
rssi_resolution.on_change = [this](size_t, OptionsField::value_t v) {
if( v != -1 )
{
rssi_graph.set_nb_columns( v );
}
};
audio_mode.on_change = [this](size_t, OptionsField::value_t v) {
if( v == 0 )
{
@ -215,7 +223,7 @@ namespace ui {
last_min_rssi = rssi.get_min();
last_avg_rssi = rssi.get_avg();
last_max_rssi = rssi.get_max();
freq_stats_rssi.set( "RSSI: "+to_string_dec_int( rssi.get_min() )+"/"+to_string_dec_int( rssi.get_avg() )+"/"+to_string_dec_int( rssi.get_max() )+" db, dt: "+to_string_dec_int( rssi.get_delta() )+" db" );
freq_stats_rssi.set( "RSSI: "+to_string_dec_int( rssi.get_min() )+"/"+to_string_dec_int( rssi.get_avg() )+"/"+to_string_dec_int( rssi.get_max() )+",dt: "+to_string_dec_int( rssi.get_delta() ) );
}
} /* on_statistic_updates */
@ -290,7 +298,7 @@ namespace ui {
{
last_idx = min_idx ;
if (min_diff < 40)
text_ctcss.set(tone_keys[min_idx].first);
text_ctcss.set("T: "+tone_keys[min_idx].first);
else
text_ctcss.set(" ");
}

View File

@ -174,12 +174,13 @@ namespace ui {
Text text_ctcss {
{ 20 * 8, 3 * 16 + 4 , 14 * 8, 1 * 8 },
{ 22 * 8, 3 * 16 + 4 , 14 * 8, 1 * 8 },
""
};
// RSSI: XX/XX/XXX,dt: XX
Text freq_stats_rssi {
{ 0 * 8 , 3 * 16 + 4 , 20 * 8, 16 },
{ 0 * 8 , 3 * 16 + 4 , 22 * 8, 16 },
};
Text freq_stats_db {
@ -188,7 +189,7 @@ namespace ui {
OptionsField peak_mode {
{ 44 + 10 * 8, 4 * 16 + 4 },
{ 40 + 10 * 8, 4 * 16 + 4 },
10,
{
{"peak:none", 0},
@ -200,6 +201,18 @@ namespace ui {
{"peak:10s",10000},
}
};
OptionsField rssi_resolution {
{ 44 + 20 * 8, 4 * 16 + 4},
4,
{
{"16x", 16},
{"32x", 32},
{"64x", 64},
{"128x", 128},
{"240x", 240},
}
};
void handle_coded_squelch(const uint32_t value);
void on_headphone_volume_changed(int32_t v);