|
|
|
|
@ -488,7 +488,7 @@ static const struct {
|
|
|
|
|
#endif
|
|
|
|
|
[KM_LEVEL] = {keypads_plusmin , "LEVEL"}, // KM_LEVEL
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
[KM_LIMIT_FREQ] = {keypads_freq , "END\nFREQ"}, // KM_LIMIT_FREQ
|
|
|
|
|
[KM_LIMIT_FREQ] = {keypads_freq , "FREQ"}, // KM_LIMIT_FREQ
|
|
|
|
|
[KM_LIMIT_LEVEL] = {keypads_plusmin_unit , "LEVEL"}, // KM_LIMIT_LEVEL
|
|
|
|
|
#endif
|
|
|
|
|
[KM_MARKER_TIME] = {keypads_time , "MARKER\nTIME"}, // KM_MARKER_TIME
|
|
|
|
|
@ -518,13 +518,16 @@ static const menuitem_t menu_top[];
|
|
|
|
|
static const menuitem_t menu_trace[];
|
|
|
|
|
static const menuitem_t menu_marker_trace[];
|
|
|
|
|
static const menuitem_t menu_subtract_trace[];
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
static const menuitem_t menu_limit_trace[];
|
|
|
|
|
static const menuitem_t menu_reference[];
|
|
|
|
|
static const menuitem_t menu_limit_modify[];
|
|
|
|
|
#endif
|
|
|
|
|
static const menuitem_t menu_average[];
|
|
|
|
|
static const menuitem_t menu_reffer[];
|
|
|
|
|
static const menuitem_t menu_sweep_points[];
|
|
|
|
|
static const menuitem_t menu_sweep_points_form[];
|
|
|
|
|
static const menuitem_t menu_modulation[];
|
|
|
|
|
static const menuitem_t menu_limit_modify[];
|
|
|
|
|
static const menuitem_t menu_marker_ref_select[];
|
|
|
|
|
#ifdef __USE_SERIAL_CONSOLE__
|
|
|
|
|
static const menuitem_t menu_connection[];
|
|
|
|
|
@ -1535,6 +1538,18 @@ static UI_FUNCTION_ADV_CALLBACK(menu_trace_acb)
|
|
|
|
|
menu_move_back(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_reference_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if(b){
|
|
|
|
|
b->param_1.i = data+1;
|
|
|
|
|
b->icon = (data == active_reference) ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
active_reference = data;
|
|
|
|
|
menu_move_back(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_marker_trace_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
@ -1588,12 +1603,12 @@ static UI_FUNCTION_ADV_CALLBACK(menu_limit_trace_acb)
|
|
|
|
|
(void)item;
|
|
|
|
|
if(b){
|
|
|
|
|
if (data) {
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "LIMIT\nTRACE %d", data);
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "TRACE %d", data);
|
|
|
|
|
b->bg = LCD_TRACE_1_COLOR+data-1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "LIMIT\nOFF");
|
|
|
|
|
b->icon = (data == setting.limit_trace) ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "OFF");
|
|
|
|
|
b->icon = (data == setting.limit_trace[active_reference]) ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (setting.normalized_trace != -1 && data-1 == TRACE_TEMP) {
|
|
|
|
|
@ -1601,11 +1616,11 @@ static UI_FUNCTION_ADV_CALLBACK(menu_limit_trace_acb)
|
|
|
|
|
redraw_request|= REDRAW_AREA;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (setting.limit_trace != data && setting.limit_trace >0) { // Clear previous limit trace
|
|
|
|
|
setting.stored[setting.limit_trace-1] = false;
|
|
|
|
|
TRACE_DISABLE(1<<(setting.limit_trace-1));
|
|
|
|
|
if (setting.limit_trace[active_reference] != data && setting.limit_trace[active_reference] >0) { // Clear previous limit trace
|
|
|
|
|
setting.stored[setting.limit_trace[active_reference]-1] = false;
|
|
|
|
|
TRACE_DISABLE(1<<(setting.limit_trace[active_reference]-1));
|
|
|
|
|
}
|
|
|
|
|
setting.limit_trace = data;
|
|
|
|
|
setting.limit_trace[active_reference] = data;
|
|
|
|
|
menu_move_back(false);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
@ -1754,29 +1769,36 @@ static UI_FUNCTION_ADV_CALLBACK(menu_waterfall_acb){
|
|
|
|
|
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
uint8_t active_limit = 0;
|
|
|
|
|
uint8_t active_reference = 0;
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_limit_select_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if(b){
|
|
|
|
|
if (data == 0) {
|
|
|
|
|
if (setting.limit_trace) {
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "LIMIT\nTRACE %d", setting.limit_trace);
|
|
|
|
|
b->bg = LCD_TRACE_1_COLOR+setting.limit_trace-1;
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "REFERENCE\n %d", active_reference+1);
|
|
|
|
|
} else if (data == 1) {
|
|
|
|
|
if (setting.limit_trace[active_reference]) {
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "TRACE %d", setting.limit_trace[active_reference]);
|
|
|
|
|
b->bg = LCD_TRACE_1_COLOR+setting.limit_trace[active_reference]-1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "LIMIT\nOFF");
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "OFF");
|
|
|
|
|
} else {
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "%.6FHz\n%.2F%s", (float)setting.limits[data-1].frequency, value(setting.limits[data-1].level),unit_string[setting.unit]);
|
|
|
|
|
b->icon = (setting.limits[data-1].enabled?BUTTON_ICON_CHECK:BUTTON_ICON_NOCHECK) ;
|
|
|
|
|
plot_printf(b->text, sizeof(b->text), "%.6FHz\n%.2F%s", (float)setting.limits[active_reference][data-2].frequency, value(setting.limits[active_reference][data-2].level),unit_string[setting.unit]);
|
|
|
|
|
b->icon = (setting.limits[active_reference][data-2].enabled?BUTTON_ICON_CHECK:BUTTON_ICON_NOCHECK) ;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (data == 0) {
|
|
|
|
|
menu_push_submenu(menu_reference);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (data == 1) {
|
|
|
|
|
menu_push_submenu(menu_limit_trace);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
active_limit = data -1;
|
|
|
|
|
setting.limits[active_limit].enabled = true;
|
|
|
|
|
active_limit = data - 2;
|
|
|
|
|
setting.limits[active_reference][active_limit].enabled = true;
|
|
|
|
|
limits_update();
|
|
|
|
|
menu_push_submenu(menu_limit_modify);
|
|
|
|
|
}
|
|
|
|
|
@ -1889,7 +1911,7 @@ static UI_FUNCTION_CALLBACK(menu_limit_disable_cb)
|
|
|
|
|
(void)item;
|
|
|
|
|
(void)data;
|
|
|
|
|
if (active_limit<LIMITS_MAX){
|
|
|
|
|
setting.limits[active_limit].enabled = false;
|
|
|
|
|
setting.limits[active_reference][active_limit].enabled = false;
|
|
|
|
|
limits_update();
|
|
|
|
|
menu_move_back(false);
|
|
|
|
|
}
|
|
|
|
|
@ -2477,15 +2499,14 @@ const menuitem_t menu_marker_modify[] = {
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
static const menuitem_t menu_limit_modify[] =
|
|
|
|
|
{
|
|
|
|
|
{ MT_KEYPAD, KM_LIMIT_FREQ, "FREQUENCY", "End frequency"},
|
|
|
|
|
{ MT_KEYPAD, KM_LIMIT_LEVEL, "LEVEL", "Limit level"},
|
|
|
|
|
{ MT_KEYPAD, KM_LIMIT_FREQ, "FREQUENCY", "Frequency"},
|
|
|
|
|
{ MT_KEYPAD, KM_LIMIT_LEVEL, "LEVEL", "Level"},
|
|
|
|
|
{ MT_CALLBACK, 0, "DISABLE", menu_limit_disable_cb},
|
|
|
|
|
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_limit_select[] = {
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, MT_CUSTOM_LABEL, menu_limit_select_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK | MT_REPEATS, DATA_STARTS_REPEATS(1,6), MT_CUSTOM_LABEL, menu_limit_select_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK | MT_REPEATS, DATA_STARTS_REPEATS(0,8), MT_CUSTOM_LABEL, menu_limit_select_acb },
|
|
|
|
|
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back
|
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
@ -2887,6 +2908,12 @@ static const menuitem_t menu_limit_trace[] =
|
|
|
|
|
{ MT_ADV_CALLBACK|MT_REPEATS,DATA_STARTS_REPEATS(0,TRACES_MAX+1), MT_CUSTOM_LABEL, menu_limit_trace_acb},
|
|
|
|
|
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const menuitem_t menu_reference[] =
|
|
|
|
|
{
|
|
|
|
|
{ MT_ADV_CALLBACK|MT_REPEATS,DATA_STARTS_REPEATS(0,REFERENCE_MAX), "REFERENCE\n%d", menu_reference_acb},
|
|
|
|
|
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back
|
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static const menuitem_t menu_traces[] =
|
|
|
|
|
@ -2911,7 +2938,7 @@ static const menuitem_t menu_display[] = {
|
|
|
|
|
{ MT_SUBMENU, 0, "VBW", menu_vbw},
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
{ MT_SUBMENU, 0, "LIMITS", menu_limit_select},
|
|
|
|
|
{ MT_SUBMENU, 0, "REFERENCE\nTRACE",menu_limit_select},
|
|
|
|
|
#endif
|
|
|
|
|
{ MT_KEYPAD, KM_SWEEP_TIME, "SWEEP\nTIME", "0..600s, 0=disable"}, // This must be item 3 to match highlighting
|
|
|
|
|
{ MT_SUBMENU, 0, "SWEEP\nPOINTS", menu_sweep_points},
|
|
|
|
|
@ -3136,11 +3163,11 @@ static void fetch_numeric_target(uint8_t mode)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
case KM_LIMIT_FREQ:
|
|
|
|
|
uistat.freq_value = setting.limits[active_limit].frequency;
|
|
|
|
|
uistat.freq_value = setting.limits[active_reference][active_limit].frequency;
|
|
|
|
|
plot_printf(uistat.text, sizeof uistat.text, "%3.6fMHz", uistat.freq_value / 1000000.0);
|
|
|
|
|
break;
|
|
|
|
|
case KM_LIMIT_LEVEL:
|
|
|
|
|
uistat.value = value(setting.limits[active_limit].level);
|
|
|
|
|
uistat.value = value(setting.limits[active_reference][active_limit].level);
|
|
|
|
|
plot_printf(uistat.text, sizeof uistat.text, "%.1f", uistat.value);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
@ -3300,11 +3327,11 @@ set_numeric_value(void)
|
|
|
|
|
break;
|
|
|
|
|
#ifdef __LIMITS__
|
|
|
|
|
case KM_LIMIT_FREQ:
|
|
|
|
|
setting.limits[active_limit].frequency = uistat.freq_value - (setting.frequency_offset - FREQUENCY_SHIFT);
|
|
|
|
|
setting.limits[active_reference][active_limit].frequency = uistat.freq_value - (setting.frequency_offset - FREQUENCY_SHIFT);
|
|
|
|
|
limits_update();
|
|
|
|
|
break;
|
|
|
|
|
case KM_LIMIT_LEVEL:
|
|
|
|
|
setting.limits[active_limit].level = to_dBm(uistat.value);
|
|
|
|
|
setting.limits[active_reference][active_limit].level = to_dBm(uistat.value);
|
|
|
|
|
limits_update();
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
@ -3518,7 +3545,7 @@ redraw_cal_status:
|
|
|
|
|
|
|
|
|
|
// Scale
|
|
|
|
|
ili9341_set_foreground(LCD_FG_COLOR);
|
|
|
|
|
#if 1
|
|
|
|
|
#if 0
|
|
|
|
|
unsigned int i = 0;
|
|
|
|
|
while (i < ARRAY_COUNT(scale_value)) {
|
|
|
|
|
float t = (setting.scale/setting.unit_scale) / scale_value[i];
|
|
|
|
|
|