Implement menu item chain

multi_trace
DiSlord 5 years ago committed by erikkaashoek
parent ddae6a3682
commit 2957fc289b

249
ui.c

@ -136,7 +136,6 @@ typedef struct {
#define EVT_TOUCH_DOWN 1 #define EVT_TOUCH_DOWN 1
#define EVT_TOUCH_PRESSED 2 #define EVT_TOUCH_PRESSED 2
#define EVT_TOUCH_RELEASED 3 #define EVT_TOUCH_RELEASED 3
#define EVT_TOUCH_LONGPRESS 4
#define TOUCH_INTERRUPT_ENABLED 1 #define TOUCH_INTERRUPT_ENABLED 1
static uint8_t touch_status_flag = 0; static uint8_t touch_status_flag = 0;
@ -599,7 +598,7 @@ select_lever_mode(int mode)
// type of menu item // type of menu item
enum { enum {
MT_NONE, // sentinel menu MT_NONE, // sentinel menu
MT_BLANK, // blank menu (nothing draw) // MT_BLANK, // blank menu (nothing draw)
MT_SUBMENU, // enter to submenu MT_SUBMENU, // enter to submenu
MT_CALLBACK, // call user function MT_CALLBACK, // call user function
MT_ADV_CALLBACK, // adv call user function MT_ADV_CALLBACK, // adv call user function
@ -788,16 +787,50 @@ active_marker_select(int item) // used only to select an active marker from the
#define MENU_STACK_DEPTH_MAX 7 #define MENU_STACK_DEPTH_MAX 7
const menuitem_t *menu_stack[MENU_STACK_DEPTH_MAX] = { const menuitem_t *menu_stack[MENU_STACK_DEPTH_MAX] = {
menu_top, NULL, NULL, NULL menu_top, NULL, NULL, NULL, NULL, NULL, NULL
}; };
int current_menu_is_form(void)
{
return menu_stack[menu_current_level]->type & MT_FORM;
}
static bool menuDisabled(uint8_t type){
if ((type & MT_LOW) && !MODE_LOW(setting.mode))
return true;
if ((type & MT_HIGH) && !MODE_HIGH(setting.mode))
return true;
// if (type == MT_BLANK)
// return true;
return false;
}
static const menuitem_t *menu_next_item(const menuitem_t *m){
do{
m++;
m = MT_MASK(m->type) == MT_NONE ? (menuitem_t *)m->reference : m;
} while(m!=NULL && menuDisabled(m->type));
return m;
}
static const menuitem_t *current_menu_item(int i){
const menuitem_t * m = menu_stack[menu_current_level];
while (i--) m = menu_next_item(m);
return m;
}
static int current_menu_get_count(void){
int i = 0;
const menuitem_t *m = menu_stack[menu_current_level];
while (m){m = menu_next_item(m); i++;}
return i;
}
static void static void
ensure_selection(void) ensure_selection(void)
{ {
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *menu = menu_stack[menu_current_level];
int i; int i = current_menu_get_count();
for (i = 0; MT_MASK(menu[i].type) != MT_NONE; i++)
;
if (selection < 0) selection = -1; if (selection < 0) selection = -1;
if (selection >= i) selection = i-1; if (selection >= i) selection = i-1;
if (MT_MASK(menu[0].type) == MT_TITLE && selection == 0) selection = 1; if (MT_MASK(menu[0].type) == MT_TITLE && selection == 0) selection = 1;
@ -814,17 +847,18 @@ menu_move_back(bool leave_ui)
if (menu_current_level == 0) if (menu_current_level == 0)
return; return;
erase_menu_buttons(); erase_menu_buttons();
if ( menu_is_form(menu_stack[menu_current_level ]) && bool form = current_menu_is_form();
!menu_is_form(menu_stack[menu_current_level-1]))
redraw_request|=REDRAW_AREA|REDRAW_BATTERY|REDRAW_FREQUENCY|REDRAW_CAL_STATUS; // redraw all if switch from form to normal menu mode
menu_current_level--; menu_current_level--;
selection = -1;
if (leave_ui){ // redraw all if switch from form to normal menu mode or back
if (form != current_menu_is_form())
redraw_request|=REDRAW_AREA|REDRAW_BATTERY|REDRAW_FREQUENCY|REDRAW_CAL_STATUS;
selection = -1;
if (leave_ui)
ui_mode_normal(); ui_mode_normal();
return; else
} ui_mode_menu();
ui_mode_menu();
} }
static void static void
@ -849,11 +883,6 @@ menu_push_highoutput(void)
menu_push_submenu(menu_highoutputmode); menu_push_submenu(menu_highoutputmode);
} }
int current_menu_is_form(void)
{
return menu_is_form(menu_stack[menu_current_level]);
}
/* /*
static void static void
menu_move_top(void) menu_move_top(void)
@ -870,14 +899,13 @@ menu_move_top(void)
static void static void
menu_invoke(int item) menu_invoke(int item)
{ {
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *menu = current_menu_item(item);
menu = &menu[item]; if (menu == NULL) return;
switch (MT_MASK(menu->type)) { switch (MT_MASK(menu->type)) {
case MT_NONE: // case MT_NONE:
case MT_BLANK: // case MT_BLANK:
ui_mode_normal(); // ui_mode_normal();
break; // break;
case MT_CANCEL: case MT_CANCEL:
menu_move_back(false); menu_move_back(false);
@ -905,7 +933,7 @@ menu_invoke(int item)
case MT_KEYPAD: case MT_KEYPAD:
uistat.auto_center_marker = false; uistat.auto_center_marker = false;
if (menu->type & MT_FORM) { if (current_menu_is_form()) {
redraw_frame(); // Remove form numbers redraw_frame(); // Remove form numbers
} }
kp_help_text = (char *)menu->reference; kp_help_text = (char *)menu->reference;
@ -1053,21 +1081,6 @@ draw_numeric_area_frame(void)
draw_numeric_input(""); draw_numeric_input("");
} }
#ifndef __VNA__
extern void menu_item_modify_attribute(
const menuitem_t *menu, int item, ui_button_t *button);
#endif
static bool menuDisabled(uint8_t type){
if ((type & MT_LOW) && !MODE_LOW(setting.mode))
return true;
if ((type & MT_HIGH) && !MODE_HIGH(setting.mode))
return true;
if (type == MT_BLANK)
return true;
return false;
}
#define ICON_WIDTH 16 #define ICON_WIDTH 16
#define ICON_HEIGHT 11 #define ICON_HEIGHT 11
@ -1159,24 +1172,15 @@ draw_menu_buttons(const menuitem_t *menu, uint32_t mask)
int i = 0; int i = 0;
int y = 0; int y = 0;
ui_button_t button; ui_button_t button;
for (i = 0; i < MENU_BUTTON_MAX; i++) { const menuitem_t *m = menu;
if (MT_MASK(menu[i].type) == MT_NONE) for (i = 0; i < MENU_BUTTON_MAX && m; m = menu_next_item(m), i++, y += menu_button_height) {
break; if ((mask&(1<<i)) == 0)
if (menuDisabled(menu[i].type)) //not applicable to mode
continue; continue;
#ifdef __SWEEP_RESTART__
if ((mask&(1<<i)) == 0) {
y += menu_button_height;
continue;
}
#else
(void)mask;
#endif
button.icon = BUTTON_ICON_NONE; button.icon = BUTTON_ICON_NONE;
// Border width // Border width
button.border = MENU_BUTTON_BORDER; button.border = MENU_BUTTON_BORDER;
if (MT_MASK(menu[i].type) == MT_TITLE) { if (MT_MASK(m->type) == MT_TITLE) {
button.fg = LCD_FG_COLOR; button.fg = LCD_FG_COLOR;
button.bg = LCD_BG_COLOR; button.bg = LCD_BG_COLOR;
button.border = 0; // no border for title button.border = 0; // no border for title
@ -1196,25 +1200,25 @@ draw_menu_buttons(const menuitem_t *menu, uint32_t mask)
menu_item_modify_attribute(menu, i, &button); // before plot_printf to create status text menu_item_modify_attribute(menu, i, &button); // before plot_printf to create status text
char *text; char *text;
// MT_ADV_CALLBACK - allow change button data in callback, more easy and correct // MT_ADV_CALLBACK - allow change button data in callback, more easy and correct
if (MT_MASK(menu[i].type) == MT_ADV_CALLBACK){ if (MT_MASK(m->type) == MT_ADV_CALLBACK){
menuaction_acb_t cb = (menuaction_acb_t)menu[i].reference; menuaction_acb_t cb = (menuaction_acb_t)m->reference;
if (cb) (*cb)(i, menu[i].data, &button); if (cb) (*cb)(i, m->data, &button);
// Apply custom text, from button label and // Apply custom text, from button label and
if (menu[i].label != MT_CUSTOM_LABEL) if (m->label != MT_CUSTOM_LABEL)
plot_printf(button.text, sizeof(button.text), menu[i].label, button.param_1.u); plot_printf(button.text, sizeof(button.text), m->label, button.param_1.u);
text = button.text; text = button.text;
} }
else else
text = menu[i].label; text = m->label;
// Only keypad retrieves value // Only keypad retrieves value
if (MT_MASK(menu[i].type) == MT_KEYPAD) { if (MT_MASK(m->type) == MT_KEYPAD) {
fetch_numeric_target(menu[i].data); fetch_numeric_target(m->data);
plot_printf(button.text, sizeof button.text, menu[i].label, uistat.text); plot_printf(button.text, sizeof button.text, m->label, uistat.text);
text = button.text; text = button.text;
} }
int button_height = menu_button_height; int button_height = menu_button_height;
if (menu[i].type & MT_FORM) { if (current_menu_is_form()) {
int button_width = MENU_FORM_WIDTH; int button_width = MENU_FORM_WIDTH;
int button_start = (LCD_WIDTH - MENU_FORM_WIDTH)/2; // At center of screen int button_start = (LCD_WIDTH - MENU_FORM_WIDTH)/2; // At center of screen
draw_button(button_start, y, button_width, button_height, &button); draw_button(button_start, y, button_width, button_height, &button);
@ -1224,29 +1228,29 @@ draw_menu_buttons(const menuitem_t *menu, uint32_t mask)
text_offs = button_start+6+ICON_WIDTH+1; text_offs = button_start+6+ICON_WIDTH+1;
} }
#ifdef __ICONS__ #ifdef __ICONS__
if (menu[i].type & MT_ICON) { if (m->type & MT_ICON) {
ili9341_blitBitmap(button_start+MENU_FORM_WIDTH-2*FORM_ICON_WIDTH-8,y+(button_height-FORM_ICON_HEIGHT)/2,FORM_ICON_WIDTH,FORM_ICON_HEIGHT,& left_icons[((menu[i].data >>4)&0xf)*2*FORM_ICON_HEIGHT]); ili9341_blitBitmap(button_start+MENU_FORM_WIDTH-2*FORM_ICON_WIDTH-8,y+(button_height-FORM_ICON_HEIGHT)/2,FORM_ICON_WIDTH,FORM_ICON_HEIGHT,& left_icons[((menu[i].data >>4)&0xf)*2*FORM_ICON_HEIGHT]);
ili9341_blitBitmap(button_start+MENU_FORM_WIDTH- FORM_ICON_WIDTH-8,y+(button_height-FORM_ICON_HEIGHT)/2,FORM_ICON_WIDTH,FORM_ICON_HEIGHT,&right_icons[((menu[i].data >>0)&0xf)*2*FORM_ICON_HEIGHT]); ili9341_blitBitmap(button_start+MENU_FORM_WIDTH- FORM_ICON_WIDTH-8,y+(button_height-FORM_ICON_HEIGHT)/2,FORM_ICON_WIDTH,FORM_ICON_HEIGHT,&right_icons[((menu[i].data >>0)&0xf)*2*FORM_ICON_HEIGHT]);
} }
#endif #endif
int local_text_shift = 0; int local_text_shift = 0;
if (MT_MASK(menu[i].type) == MT_KEYPAD) { if (MT_MASK(m->type) == MT_KEYPAD) {
int local_slider_positions = 0; int local_slider_positions = 0;
if (menu[i].data == KM_CENTER) { if (m->data == KM_CENTER) {
local_slider_positions = LCD_WIDTH/2+setting.slider_position; local_slider_positions = LCD_WIDTH/2+setting.slider_position;
lcd_printf(button_start+12 + 0 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", -(float)setting.slider_span); lcd_printf(button_start+12 + 0 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", -(float)setting.slider_span);
lcd_printf(button_start+12 + 1 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", -(float)setting.slider_span/10); lcd_printf(button_start+12 + 1 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", -(float)setting.slider_span/10);
lcd_printf(button_start+12 + 2 * MENU_FORM_WIDTH/5, y+button_height-9, "Set"); lcd_printf(button_start+12 + 2 * MENU_FORM_WIDTH/5, y+button_height-9, "Set");
lcd_printf(button_start+12 + 3 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", (float)setting.slider_span/10); lcd_printf(button_start+12 + 3 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", (float)setting.slider_span/10);
lcd_printf(button_start+12 + 4 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", (float)setting.slider_span); lcd_printf(button_start+12 + 4 * MENU_FORM_WIDTH/5, y+button_height-9, "%+3.0FHz", (float)setting.slider_span);
} else if (menu[i].data == KM_LOWOUTLEVEL) { } else if (m->data == KM_LOWOUTLEVEL) {
local_slider_positions = ((get_level() - level_min()) * (MENU_FORM_WIDTH-8)) / level_range() + OFFSETX+4; local_slider_positions = ((get_level() - level_min()) * (MENU_FORM_WIDTH-8)) / level_range() + OFFSETX+4;
lcd_printf(button_start+12 + 0 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", -10); lcd_printf(button_start+12 + 0 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", -10);
lcd_printf(button_start+12 + 1 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", -1); lcd_printf(button_start+12 + 1 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", -1);
lcd_printf(button_start+12 + 2 * MENU_FORM_WIDTH/5, y+button_height-9, "Set"); lcd_printf(button_start+12 + 2 * MENU_FORM_WIDTH/5, y+button_height-9, "Set");
lcd_printf(button_start+12 + 3 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", 1); lcd_printf(button_start+12 + 3 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", 1);
lcd_printf(button_start+12 + 4 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", 10); lcd_printf(button_start+12 + 4 * MENU_FORM_WIDTH/5, y+button_height-9, "%+ddB", 10);
} else if (menu[i].data == KM_HIGHOUTLEVEL) { } else if (m->data == KM_HIGHOUTLEVEL) {
local_slider_positions = ((get_level() - level_min() ) * (MENU_FORM_WIDTH-8)) / level_range() + OFFSETX+4; local_slider_positions = ((get_level() - level_min() ) * (MENU_FORM_WIDTH-8)) / level_range() + OFFSETX+4;
} }
if (local_slider_positions){ if (local_slider_positions){
@ -1279,7 +1283,6 @@ draw_menu_buttons(const menuitem_t *menu, uint32_t mask)
ili9341_drawstring(text, text_offs, y+(button_height-linesFONT_GET_HEIGHT)/2); ili9341_drawstring(text, text_offs, y+(button_height-linesFONT_GET_HEIGHT)/2);
#endif #endif
} }
y += button_height;
} }
// Cleanup other buttons (less flicker) // Cleanup other buttons (less flicker)
// Erase empty buttons // Erase empty buttons
@ -1287,7 +1290,7 @@ draw_menu_buttons(const menuitem_t *menu, uint32_t mask)
ili9341_set_background(LCD_BG_COLOR); ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(LCD_WIDTH-MENU_BUTTON_WIDTH, y, MENU_BUTTON_WIDTH, NO_WATERFALL - y); ili9341_fill(LCD_WIDTH-MENU_BUTTON_WIDTH, y, MENU_BUTTON_WIDTH, NO_WATERFALL - y);
} }
// if (menu[i].type & MT_FORM) // if (current_menu_is_form())
// draw_battery_status(); // draw_battery_status();
} }
@ -1323,8 +1326,9 @@ menu_select_touch(int i, int pos)
selection = i; selection = i;
draw_menu_mask(mask); draw_menu_mask(mask);
#if 1 // drag values #if 1 // drag values
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *m = current_menu_item(i);
int keypad = menu[i].data; if (m == NULL) return;
int keypad = m->data;
int touch_x, touch_y, prev_touch_x = 0; int touch_x, touch_y, prev_touch_x = 0;
systime_t dt = 0; systime_t dt = 0;
int mode = SL_UNKNOWN; int mode = SL_UNKNOWN;
@ -1335,7 +1339,7 @@ menu_select_touch(int i, int pos)
if (dt > BUTTON_DOWN_LONG_TICKS) break; if (dt > BUTTON_DOWN_LONG_TICKS) break;
} }
if (menu_is_form(menu) && MT_MASK(menu[i].type) == MT_KEYPAD && dt >= BUTTON_DOWN_LONG_TICKS){ if (current_menu_is_form() && MT_MASK(m->type) == MT_KEYPAD && dt >= BUTTON_DOWN_LONG_TICKS){
// Wait release touch and process it // Wait release touch and process it
while (touch_check() != EVT_TOUCH_NONE){ while (touch_check() != EVT_TOUCH_NONE){
touch_position(&touch_x, &touch_y); touch_position(&touch_x, &touch_y);
@ -1421,8 +1425,8 @@ menu_select_touch(int i, int pos)
draw_menu_mask(1<<i); draw_menu_mask(1<<i);
return; return;
} }
if (menu_is_form(menu) && MT_MASK(menu[i].type) == MT_KEYPAD){ if (current_menu_is_form() && MT_MASK(m->type) == MT_KEYPAD){
bool do_exit = false; bool do_exit = false;
long_t step = 0; long_t step = 0;
if (keypad == KM_LOWOUTLEVEL) { if (keypad == KM_LOWOUTLEVEL) {
switch (pos) { switch (pos) {
@ -1471,35 +1475,27 @@ nogo:
static void static void
menu_apply_touch(int touch_x, int touch_y) menu_apply_touch(int touch_x, int touch_y)
{ {
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *m = menu_stack[menu_current_level];
int i; int i;
int y = 0; int y = 0;
for (i = 0; i < MENU_BUTTON_MAX; i++) { int active_button_start;
if (MT_MASK(menu[i].type) == MT_NONE) if (current_menu_is_form()) {
break; active_button_start = (LCD_WIDTH - MENU_FORM_WIDTH)/2;
if (menuDisabled(menu[i].type)) //not applicable to mode // active_button_stop = LCD_WIDTH - active_button_start;
continue; } else {
if (MT_MASK(menu[i].type) == MT_TITLE) { active_button_start = LCD_WIDTH - MENU_BUTTON_WIDTH;
y += menu_button_height; // active_button_stop = LCD_WIDTH;
continue; }
} for (i = 0; i < MENU_BUTTON_MAX && m; m = menu_next_item(m), i++) {
int active_button_start; if (MT_MASK(m->type) != MT_TITLE) {
if (menu[i].type & MT_FORM) { if (y < touch_y && touch_y < y+menu_button_height && touch_x > active_button_start) {
active_button_start = (LCD_WIDTH - MENU_FORM_WIDTH)/2;
// active_button_stop = LCD_WIDTH - active_button_start;
} else {
active_button_start = LCD_WIDTH - MENU_BUTTON_WIDTH;
// active_button_stop = LCD_WIDTH;
}
if (y < touch_y && touch_y < y+menu_button_height) {
if (touch_x > active_button_start) {
menu_select_touch(i, (( touch_x - active_button_start) * 5 ) / MENU_FORM_WIDTH); menu_select_touch(i, (( touch_x - active_button_start) * 5 ) / MENU_FORM_WIDTH);
return; return;
} }
} }
y += menu_button_height; y += menu_button_height;
} }
if (menu_is_form(menu)) if (current_menu_is_form())
return; return;
touch_wait_release(); touch_wait_release();
ui_mode_normal(); ui_mode_normal();
@ -1771,43 +1767,26 @@ ui_process_menu_lever(void)
// if false user must select some thing // if false user must select some thing
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *menu = menu_stack[menu_current_level];
int status = btn_check(); int status = btn_check();
if (status != 0) { if (status == 0) return;
if (selection >=0 && status & EVT_BUTTON_SINGLE_CLICK) { if (selection >=0 && status & EVT_BUTTON_SINGLE_CLICK) {
menu_invoke(selection); menu_invoke(selection);
} else { return;
do {
uint32_t mask = 1<<selection;
if (status & EVT_UP) {
// skip menu item if disabled
while (menuDisabled(menu[selection+1].type))
selection++;
// close menu if next item is sentinel, else step up
if (menu[selection+1].type != MT_NONE)
selection++;
else if (!(menu[0].type & MT_FORM)) // not close if type = form menu
goto menuclose;
}
if (status & EVT_DOWN) {
// skip menu item if disabled
while (selection > 0 && menuDisabled(menu[selection-1].type))
selection--;
// close menu if item is 0, else step down
if (selection > 0)
selection--;
else if (!(menu[0].type & MT_FORM)) // not close if type = form menu
goto menuclose;
}
//activate:
ensure_selection();
draw_menu_mask(mask|(1<<selection));
chThdSleepMilliseconds(100); // Add delay for not move so fast in menu
} while ((status = btn_wait_release()) != 0);
}
} }
uint16_t count = current_menu_get_count();
do {
uint32_t mask = 1<<selection;
if (status & EVT_UP ) selection++;
if (status & EVT_DOWN) selection--;
// not close if type = form menu
if ((uint16_t)selection >= count && !(menu[0].type & MT_FORM)){
ui_mode_normal();
return;
}
ensure_selection();
draw_menu_mask(mask|(1<<selection));
chThdSleepMilliseconds(100); // Add delay for not move so fast in menu
} while ((status = btn_wait_release()) != 0);
return; return;
menuclose:
ui_mode_normal();
} }
static int static int
@ -2321,11 +2300,11 @@ ui_process(void)
} }
if (operation_requested&OP_TOUCH if (operation_requested&OP_TOUCH
#ifdef __REMOTE_DESKTOP__ #ifdef __REMOTE_DESKTOP__
|| previous_mouse_state != mouse_down || previous_mouse_x != mouse_x || previous_mouse_y != mouse_y || previous_mouse_state != mouse_down || previous_mouse_x != mouse_x || previous_mouse_y != mouse_y
#endif #endif
) { ) {
ui_process_touch(); ui_process_touch();
operation_requested = OP_NONE; operation_requested = OP_NONE;
} }
touch_start_watchdog(); touch_start_watchdog();
} }

@ -2017,6 +2017,12 @@ static UI_FUNCTION_ADV_CALLBACK(menu_connection_acb)
} }
#endif #endif
// ===[MENU DEFINITION]========================================================= // ===[MENU DEFINITION]=========================================================
// Back button submenu list
static const menuitem_t menu_back[] = {
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel
};
#if 0 #if 0
static const menuitem_t menu_store_preset_high[8] = static const menuitem_t menu_store_preset_high[8] =
{ {
@ -2026,8 +2032,7 @@ static const menuitem_t menu_store_preset_high[8] =
{ MT_ADV_CALLBACK, 7, "STORE %d", menu_store_preset_acb}, { MT_ADV_CALLBACK, 7, "STORE %d", menu_store_preset_acb},
{ MT_ADV_CALLBACK, 8, "STORE %d", menu_store_preset_acb}, { MT_ADV_CALLBACK, 8, "STORE %d", menu_store_preset_acb},
{ MT_ADV_CALLBACK, 100,"FACTORY\nDEFAULTS",menu_store_preset_acb}, { MT_ADV_CALLBACK, 100,"FACTORY\nDEFAULTS",menu_store_preset_acb},
{ MT_CANCEL, 255, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL,menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_load_preset_high[] = static const menuitem_t menu_load_preset_high[] =
@ -2038,8 +2043,7 @@ static const menuitem_t menu_load_preset_high[] =
{ MT_ADV_CALLBACK, 7, MT_CUSTOM_LABEL, menu_load_preset_acb}, { MT_ADV_CALLBACK, 7, MT_CUSTOM_LABEL, menu_load_preset_acb},
{ MT_ADV_CALLBACK, 8, MT_CUSTOM_LABEL, menu_load_preset_acb}, { MT_ADV_CALLBACK, 8, MT_CUSTOM_LABEL, menu_load_preset_acb},
{ MT_SUBMENU, 0, "STORE" , menu_store_preset_high}, { MT_SUBMENU, 0, "STORE" , menu_store_preset_high},
{ MT_CANCEL, 255, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL,menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2051,8 +2055,7 @@ static const menuitem_t menu_store_preset[] =
{ MT_ADV_CALLBACK, 3, "STORE %d", menu_store_preset_acb}, { MT_ADV_CALLBACK, 3, "STORE %d", menu_store_preset_acb},
{ MT_ADV_CALLBACK, 4, "STORE %d", menu_store_preset_acb}, { MT_ADV_CALLBACK, 4, "STORE %d", menu_store_preset_acb},
{ MT_ADV_CALLBACK, 100,"FACTORY\nDEFAULTS",menu_store_preset_acb}, { MT_ADV_CALLBACK, 100,"FACTORY\nDEFAULTS",menu_store_preset_acb},
{ MT_CANCEL, 255, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL,menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_load_preset[] = static const menuitem_t menu_load_preset[] =
@ -2063,8 +2066,7 @@ static const menuitem_t menu_load_preset[] =
{ MT_ADV_CALLBACK, 3, MT_CUSTOM_LABEL, menu_load_preset_acb}, { MT_ADV_CALLBACK, 3, MT_CUSTOM_LABEL, menu_load_preset_acb},
{ MT_ADV_CALLBACK, 4, MT_CUSTOM_LABEL, menu_load_preset_acb}, { MT_ADV_CALLBACK, 4, MT_CUSTOM_LABEL, menu_load_preset_acb},
{ MT_SUBMENU, 0, "STORE" , menu_store_preset}, { MT_SUBMENU, 0, "STORE" , menu_store_preset},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifdef TINYSA4 #ifdef TINYSA4
static const menuitem_t menu_mixer_drive[] = { static const menuitem_t menu_mixer_drive[] = {
@ -2073,8 +2075,7 @@ static const menuitem_t menu_mixer_drive[] = {
{ MT_ADV_CALLBACK, 2, "%+ddBm", menu_mixer_drive_acb}, { MT_ADV_CALLBACK, 2, "%+ddBm", menu_mixer_drive_acb},
{ MT_ADV_CALLBACK, 1, "%+ddBm", menu_mixer_drive_acb}, { MT_ADV_CALLBACK, 1, "%+ddBm", menu_mixer_drive_acb},
{ MT_ADV_CALLBACK, 0, "%+ddBm", menu_mixer_drive_acb}, { MT_ADV_CALLBACK, 0, "%+ddBm", menu_mixer_drive_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#else #else
static const menuitem_t menu_lo_drive[] = { static const menuitem_t menu_lo_drive[] = {
@ -2082,8 +2083,7 @@ static const menuitem_t menu_lo_drive[] = {
{ MT_ADV_CALLBACK, 14, "%+ddBm", menu_lo_drive_acb}, { MT_ADV_CALLBACK, 14, "%+ddBm", menu_lo_drive_acb},
{ MT_ADV_CALLBACK, 13, "%+ddBm", menu_lo_drive_acb}, { MT_ADV_CALLBACK, 13, "%+ddBm", menu_lo_drive_acb},
{ MT_ADV_CALLBACK, 12, "%+ddBm", menu_lo_drive_acb}, { MT_ADV_CALLBACK, 12, "%+ddBm", menu_lo_drive_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2095,8 +2095,7 @@ static const menuitem_t menu_modulation[] = {
{ MT_FORM | MT_ADV_CALLBACK, MO_WFM, "Wide FM", menu_modulation_acb}, { MT_FORM | MT_ADV_CALLBACK, MO_WFM, "Wide FM", menu_modulation_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_LOW, MO_EXTERNAL, "External", menu_modulation_acb}, { MT_FORM | MT_ADV_CALLBACK | MT_LOW, MO_EXTERNAL, "External", menu_modulation_acb},
{ MT_FORM | MT_KEYPAD, KM_MODULATION, "FREQ: %s", "50Hz..6kHz"}, { MT_FORM | MT_KEYPAD, KM_MODULATION, "FREQ: %s", "50Hz..6kHz"},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK",NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_sweep[] = { static const menuitem_t menu_sweep[] = {
@ -2104,8 +2103,7 @@ static const menuitem_t menu_sweep[] = {
{ MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", VARIANT("-70..70","-90..90")}, { MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", VARIANT("-70..70","-90..90")},
{ MT_FORM | MT_KEYPAD, KM_SWEEP_TIME, "SWEEP TIME: %s", "0..600 seconds"}, { MT_FORM | MT_KEYPAD, KM_SWEEP_TIME, "SWEEP TIME: %s", "0..600 seconds"},
{ MT_FORM | MT_SUBMENU, 0, "SWEEP POINTS", menu_sweep_points_form}, { MT_FORM | MT_SUBMENU, 0, "SWEEP POINTS", menu_sweep_points_form},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK",NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
char low_level_help_text[12] = "-76..-6"; char low_level_help_text[12] = "-76..-6";
@ -2159,8 +2157,7 @@ static const menuitem_t menu_average[] = {
#ifdef __QUASI_PEAK__ #ifdef __QUASI_PEAK__
{ MT_ADV_CALLBACK, AV_QUASI, "QUASI\nPEAK", menu_average_acb}, { MT_ADV_CALLBACK, AV_QUASI, "QUASI\nPEAK", menu_average_acb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_rbw[] = { static const menuitem_t menu_rbw[] = {
@ -2175,8 +2172,7 @@ static const menuitem_t menu_rbw[] = {
{ MT_ADV_CALLBACK, 7, "%sHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 7, "%sHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 8, "%sHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 8, "%sHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 9, "%sHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 9, "%sHz", menu_rbw_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
#else #else
{ MT_ADV_CALLBACK, 1, "%4dkHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 1, "%4dkHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 2, "%4dkHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 2, "%4dkHz", menu_rbw_acb},
@ -2184,8 +2180,7 @@ static const menuitem_t menu_rbw[] = {
{ MT_ADV_CALLBACK, 4, "%4dkHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 4, "%4dkHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 5, "%4dkHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 5, "%4dkHz", menu_rbw_acb},
{ MT_ADV_CALLBACK, 6, "%4dkHz", menu_rbw_acb}, { MT_ADV_CALLBACK, 6, "%4dkHz", menu_rbw_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
#endif #endif
}; };
@ -2198,8 +2193,7 @@ static const menuitem_t menu_vbw[] = {
{ MT_ADV_CALLBACK, 3, "%s RBW", menu_vbw_acb}, { MT_ADV_CALLBACK, 3, "%s RBW", menu_vbw_acb},
{ MT_ADV_CALLBACK, 4, "%s RBW", menu_vbw_acb}, { MT_ADV_CALLBACK, 4, "%s RBW", menu_vbw_acb},
{ MT_ADV_CALLBACK, 5, "%s RBW", menu_vbw_acb}, { MT_ADV_CALLBACK, 5, "%s RBW", menu_vbw_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2212,8 +2206,7 @@ static const menuitem_t menu_scale_per2[] = {
{ MT_ADV_CALLBACK,10, "0.01/", menu_scale_per_acb}, { MT_ADV_CALLBACK,10, "0.01/", menu_scale_per_acb},
//{ MT_ADV_CALLBACK,11, "0.005/", menu_scale_per_acb}, //{ MT_ADV_CALLBACK,11, "0.005/", menu_scale_per_acb},
//{ MT_SUBMENU, 0, S_RARROW" MORE", menu_scale_per2}, //{ MT_SUBMENU, 0, S_RARROW" MORE", menu_scale_per2},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_scale_per[] = { static const menuitem_t menu_scale_per[] = {
@ -2224,8 +2217,7 @@ static const menuitem_t menu_scale_per[] = {
{ M_ADVT_CALLBACK, 4, " 1/", menu_scale_per_acb}, { M_ADVT_CALLBACK, 4, " 1/", menu_scale_per_acb},
{ MT_ADV_CALLBACK, 5, "0.5/", menu_scale_per_acb}, { MT_ADV_CALLBACK, 5, "0.5/", menu_scale_per_acb},
{ MT_SUBMENU, 0, S_RARROW" MORE", menu_scale_per2}, { MT_SUBMENU, 0, S_RARROW" MORE", menu_scale_per2},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2234,8 +2226,7 @@ static const menuitem_t menu_reffer2[] = {
{ MT_FORM | MT_ADV_CALLBACK, 5, "%s", menu_reffer_acb}, { MT_FORM | MT_ADV_CALLBACK, 5, "%s", menu_reffer_acb},
{ MT_FORM | MT_ADV_CALLBACK, 6, "%s", menu_reffer_acb}, { MT_FORM | MT_ADV_CALLBACK, 6, "%s", menu_reffer_acb},
{ MT_FORM | MT_ADV_CALLBACK, 7, "%s", menu_reffer_acb}, { MT_FORM | MT_ADV_CALLBACK, 7, "%s", menu_reffer_acb},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2248,8 +2239,7 @@ static const menuitem_t menu_reffer[] = {
{ MT_FORM | MT_ADV_CALLBACK, 6, "%s", menu_reffer_acb}, { MT_FORM | MT_ADV_CALLBACK, 6, "%s", menu_reffer_acb},
{ MT_FORM | MT_ADV_CALLBACK, 7, "%s", menu_reffer_acb}, { MT_FORM | MT_ADV_CALLBACK, 7, "%s", menu_reffer_acb},
//{ MT_FORM | MT_SUBMENU, 0, S_RARROW" MORE", menu_reffer2}, //{ MT_FORM | MT_SUBMENU, 0, S_RARROW" MORE", menu_reffer2},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_atten[] = { static const menuitem_t menu_atten[] = {
@ -2257,8 +2247,7 @@ static const menuitem_t menu_atten[] = {
{ MT_KEYPAD | MT_LOW, KM_ATTENUATION, "MANUAL", "0 - 30dB"}, { MT_KEYPAD | MT_LOW, KM_ATTENUATION, "MANUAL", "0 - 30dB"},
{ MT_ADV_CALLBACK | MT_HIGH,0, "0dB", menu_atten_high_acb}, { MT_ADV_CALLBACK | MT_HIGH,0, "0dB", menu_atten_high_acb},
{ MT_ADV_CALLBACK | MT_HIGH,30, "22.5 - 40dB", menu_atten_high_acb}, { MT_ADV_CALLBACK | MT_HIGH,30, "22.5 - 40dB", menu_atten_high_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_reflevel[] = { static const menuitem_t menu_reflevel[] = {
@ -2276,8 +2265,7 @@ const menuitem_t menu_marker_search[] = {
{ MT_CALLBACK, 3, "MAX\n" S_RARROW" RIGHT", menu_marker_search_cb }, { MT_CALLBACK, 3, "MAX\n" S_RARROW" RIGHT", menu_marker_search_cb },
{ MT_ADV_CALLBACK, 0, "ENTER\n%s", menu_enter_marker_acb}, { MT_ADV_CALLBACK, 0, "ENTER\n%s", menu_enter_marker_acb},
{ MT_ADV_CALLBACK, M_TRACKING, "TRACKING",menu_marker_modify_acb }, { MT_ADV_CALLBACK, M_TRACKING, "TRACKING",menu_marker_modify_acb },
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
const menuitem_t menu_marker_modify[] = { const menuitem_t menu_marker_modify[] = {
@ -2289,8 +2277,7 @@ const menuitem_t menu_marker_modify[] = {
{ MT_ADV_CALLBACK, M_AVER, "TRACE\nAVERAGE", menu_marker_modify_acb}, { MT_ADV_CALLBACK, M_AVER, "TRACE\nAVERAGE", menu_marker_modify_acb},
{ MT_SUBMENU, 0, "SEARCH", menu_marker_search}, { MT_SUBMENU, 0, "SEARCH", menu_marker_search},
{ MT_CALLBACK, M_DELETE, "DELETE", menu_marker_delete_cb}, { MT_CALLBACK, M_DELETE, "DELETE", menu_marker_delete_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifdef __LIMITS__ #ifdef __LIMITS__
@ -2299,8 +2286,7 @@ static const menuitem_t menu_limit_modify[] =
{ MT_KEYPAD, KM_LIMIT_FREQ, "END\nFREQUENCY", "End frequency"}, { MT_KEYPAD, KM_LIMIT_FREQ, "END\nFREQUENCY", "End frequency"},
{ MT_KEYPAD, KM_LIMIT_LEVEL, "LEVEL", "Limit level"}, { MT_KEYPAD, KM_LIMIT_LEVEL, "LEVEL", "Limit level"},
{ MT_CALLBACK, 0, "DISABLE", menu_limit_disable_cb}, { MT_CALLBACK, 0, "DISABLE", menu_limit_disable_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
const menuitem_t menu_limit_select[] = { const menuitem_t menu_limit_select[] = {
@ -2310,8 +2296,7 @@ const menuitem_t menu_limit_select[] = {
{ MT_ADV_CALLBACK, 4, "LIMIT %d", menu_limit_select_acb }, { MT_ADV_CALLBACK, 4, "LIMIT %d", menu_limit_select_acb },
{ MT_ADV_CALLBACK, 5, "LIMIT %d", menu_limit_select_acb }, { MT_ADV_CALLBACK, 5, "LIMIT %d", menu_limit_select_acb },
{ MT_ADV_CALLBACK, 6, "LIMIT %d", menu_limit_select_acb }, { MT_ADV_CALLBACK, 6, "LIMIT %d", menu_limit_select_acb },
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2325,8 +2310,7 @@ const menuitem_t menu_marker_sel[] = {
{ MT_CALLBACK, 0, "DELTA", menu_marker_sel_cb }, { MT_CALLBACK, 0, "DELTA", menu_marker_sel_cb },
{ MT_CALLBACK, 0, "NOISE", menu_marker_sel_cb }, { MT_CALLBACK, 0, "NOISE", menu_marker_sel_cb },
{ MT_CALLBACK, 0, "TRACKING", menu_marker_sel_cb }, { MT_CALLBACK, 0, "TRACKING", menu_marker_sel_cb },
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2347,8 +2331,7 @@ const menuitem_t menu_marker_select[] = {
#if MARKER_COUNT >= 8 #if MARKER_COUNT >= 8
{ MT_ADV_CALLBACK, 8, "MARKER %d", menu_marker_select_acb }, { MT_ADV_CALLBACK, 8, "MARKER %d", menu_marker_select_acb },
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_marker_ref_select[] = { static const menuitem_t menu_marker_ref_select[] = {
@ -2368,8 +2351,7 @@ static const menuitem_t menu_marker_ref_select[] = {
#if MARKER_COUNT >= 8 #if MARKER_COUNT >= 8
{ MT_ADV_CALLBACK, 8, "MARKER %d", menu_marker_ref_select_acb }, { MT_ADV_CALLBACK, 8, "MARKER %d", menu_marker_ref_select_acb },
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
const menuitem_t menu_marker_ops[] = { const menuitem_t menu_marker_ops[] = {
@ -2378,8 +2360,7 @@ const menuitem_t menu_marker_ops[] = {
{ MT_CALLBACK, ST_CENTER, S_RARROW" CENTER", menu_marker_op_cb }, { MT_CALLBACK, ST_CENTER, S_RARROW" CENTER", menu_marker_op_cb },
{ MT_CALLBACK, ST_SPAN, S_RARROW" SPAN", menu_marker_op_cb }, { MT_CALLBACK, ST_SPAN, S_RARROW" SPAN", menu_marker_op_cb },
{ MT_CALLBACK, 4, S_RARROW" REF LEVEL",menu_marker_op_cb }, { MT_CALLBACK, 4, S_RARROW" REF LEVEL",menu_marker_op_cb },
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_marker[] = { static const menuitem_t menu_marker[] = {
@ -2388,15 +2369,13 @@ static const menuitem_t menu_marker[] = {
{ MT_SUBMENU, 0, "MARKER\nOPS", menu_marker_ops}, { MT_SUBMENU, 0, "MARKER\nOPS", menu_marker_ops},
{ MT_SUBMENU, 0, "SEARCH\nMARKER", menu_marker_search}, { MT_SUBMENU, 0, "SEARCH\nMARKER", menu_marker_search},
{ MT_CALLBACK, 0, "RESET\nMARKERS", menu_markers_reset_cb}, { MT_CALLBACK, 0, "RESET\nMARKERS", menu_markers_reset_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifndef TINYSA4 #ifndef TINYSA4
static const menuitem_t menu_dfu[] = { static const menuitem_t menu_dfu[] = {
{ MT_FORM | MT_CALLBACK, 0, "ENTER DFU", menu_dfu_cb}, { MT_FORM | MT_CALLBACK, 0, "ENTER DFU", menu_dfu_cb},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2408,8 +2387,7 @@ static const menuitem_t menu_harmonic[] =
{ MT_ADV_CALLBACK, 3, "3", menu_harmonic_acb}, { MT_ADV_CALLBACK, 3, "3", menu_harmonic_acb},
{ MT_ADV_CALLBACK, 4, "4", menu_harmonic_acb}, { MT_ADV_CALLBACK, 4, "4", menu_harmonic_acb},
{ MT_ADV_CALLBACK, 5, "5", menu_harmonic_acb}, { MT_ADV_CALLBACK, 5, "5", menu_harmonic_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2420,10 +2398,9 @@ static const menuitem_t menu_scanning_speed[] =
// { MT_ADV_CALLBACK, SD_PRECISE, PRECISE", menu_scanning_speed_acb}, // { MT_ADV_CALLBACK, SD_PRECISE, PRECISE", menu_scanning_speed_acb},
// { MT_ADV_CALLBACK | MT_LOW,SD_FAST, "FAST", menu_scanning_speed_acb}, // { MT_ADV_CALLBACK | MT_LOW,SD_FAST, "FAST", menu_scanning_speed_acb},
// { MT_KEYPAD | MT_LOW,KM_FAST_SPEEDUP, "FAST\nSPEEDUP", "2..20"}, // { MT_KEYPAD | MT_LOW,KM_FAST_SPEEDUP, "FAST\nSPEEDUP", "2..20"},
{ MT_KEYPAD, KM_SAMPLETIME, "SAMPLE\nDELAY", "250..10000, 0=auto"}, // This must be item 4 to match highlighting { MT_KEYPAD, KM_SAMPLETIME, "SAMPLE\nDELAY", "250..10000, 0=auto"}, // This must be item 4 to match highlighting
{ MT_KEYPAD, KM_OFFSET_DELAY, "OFFSET\nDELAY", "250..10000, 0=auto"}, // This must be item 5 to match highlighting { MT_KEYPAD, KM_OFFSET_DELAY, "OFFSET\nDELAY", "250..10000, 0=auto"}, // This must be item 5 to match highlighting
{ MT_CANCEL, 0, "\032 BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_sweep_points[] = { static const menuitem_t menu_sweep_points[] = {
@ -2435,8 +2412,7 @@ static const menuitem_t menu_sweep_points[] = {
{ MT_ADV_CALLBACK, 4, "%3d point", menu_points_acb }, { MT_ADV_CALLBACK, 4, "%3d point", menu_points_acb },
{ MT_ADV_CALLBACK, 5, "%3d point", menu_points_acb }, { MT_ADV_CALLBACK, 5, "%3d point", menu_points_acb },
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_sweep_points_form[] = { static const menuitem_t menu_sweep_points_form[] = {
@ -2448,8 +2424,7 @@ static const menuitem_t menu_sweep_points_form[] = {
{ MT_FORM | MT_ADV_CALLBACK, 4, "%3d point", menu_points_acb }, { MT_FORM | MT_ADV_CALLBACK, 4, "%3d point", menu_points_acb },
{ MT_FORM | MT_ADV_CALLBACK, 5, "%3d point", menu_points_acb }, { MT_FORM | MT_ADV_CALLBACK, 5, "%3d point", menu_points_acb },
#endif #endif
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_sweep_speed[] = static const menuitem_t menu_sweep_speed[] =
@ -2468,8 +2443,7 @@ static const menuitem_t menu_sweep_speed[] =
#else #else
{ MT_KEYPAD | MT_LOW,KM_FAST_SPEEDUP,"FAST\nSPEEDUP", "2..20, 0=disable"}, { MT_KEYPAD | MT_LOW,KM_FAST_SPEEDUP,"FAST\nSPEEDUP", "2..20, 0=disable"},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifdef TINYSA4 #ifdef TINYSA4
@ -2506,9 +2480,8 @@ static const menuitem_t menu_settings3[] =
#ifdef __HAM_BAND__ #ifdef __HAM_BAND__
{ MT_ADV_CALLBACK, 0, "HAM\nBANDS", menu_settings_ham_bands}, { MT_ADV_CALLBACK, 0, "HAM\nBANDS", menu_settings_ham_bands},
#endif #endif
#endif // TINYSA4 #endif // TINYSA4
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifdef TINYSA4 #ifdef TINYSA4
static const menuitem_t menu_settings4[] = static const menuitem_t menu_settings4[] =
@ -2532,8 +2505,7 @@ static const menuitem_t menu_settings4[] =
{ MT_SUBMENU,0, "HARMONIC", menu_harmonic}, { MT_SUBMENU,0, "HARMONIC", menu_harmonic},
#endif #endif
// { MT_SUBMENU, 0, S_RARROW" MORE", menu_settings3}, // { MT_SUBMENU, 0, S_RARROW" MORE", menu_settings3},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2553,8 +2525,7 @@ static const menuitem_t menu_settings2[] =
{ MT_KEYPAD, KM_30MHZ, "ACTUAL\n30MHz*100", "Enter actual 30MHz * 100"}, { MT_KEYPAD, KM_30MHZ, "ACTUAL\n30MHz*100", "Enter actual 30MHz * 100"},
#endif #endif
{ MT_SUBMENU, 0, S_RARROW" MORE", menu_settings3}, { MT_SUBMENU, 0, S_RARROW" MORE", menu_settings3},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifdef TINYSA4 #ifdef TINYSA4
@ -2565,8 +2536,7 @@ static const menuitem_t menu_curve3[] = {
{ MT_FORM | MT_ADV_CALLBACK, 17, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 17, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_ADV_CALLBACK, 18, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 18, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_ADV_CALLBACK, 19, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 19, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_curve2[] = { static const menuitem_t menu_curve2[] = {
@ -2578,8 +2548,7 @@ static const menuitem_t menu_curve2[] = {
{ MT_FORM | MT_ADV_CALLBACK, 12, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 12, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_ADV_CALLBACK, 13, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 13, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_SUBMENU, 0, S_RARROW" MORE", menu_curve3}, { MT_FORM | MT_SUBMENU, 0, S_RARROW" MORE", menu_curve3},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_curve[] = { static const menuitem_t menu_curve[] = {
@ -2591,8 +2560,7 @@ static const menuitem_t menu_curve[] = {
{ MT_FORM | MT_ADV_CALLBACK, 5, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 5, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_ADV_CALLBACK, 6, MT_CUSTOM_LABEL, menu_curve_acb }, { MT_FORM | MT_ADV_CALLBACK, 6, MT_CUSTOM_LABEL, menu_curve_acb },
{ MT_FORM | MT_SUBMENU, 0, S_RARROW" MORE", menu_curve2}, { MT_FORM | MT_SUBMENU, 0, S_RARROW" MORE", menu_curve2},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_curve_confirm[] = { static const menuitem_t menu_curve_confirm[] = {
@ -2612,8 +2580,7 @@ static const menuitem_t menu_actual_power[] =
{ MT_CALLBACK, 0, "LNA\nCURVE", menu_lna_curve_prepare_cb}, { MT_CALLBACK, 0, "LNA\nCURVE", menu_lna_curve_prepare_cb},
{ MT_CALLBACK, 0, "OUTPUT\nCURVE", menu_output_curve_prepare_cb}, { MT_CALLBACK, 0, "OUTPUT\nCURVE", menu_output_curve_prepare_cb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -2636,8 +2603,7 @@ static const menuitem_t menu_settings[] =
{ MT_SUBMENU | MT_LOW,0, "MIXER\nDRIVE", menu_lo_drive}, { MT_SUBMENU | MT_LOW,0, "MIXER\nDRIVE", menu_lo_drive},
#endif #endif
{ MT_SUBMENU, 0, S_RARROW" MORE", menu_settings2}, { MT_SUBMENU, 0, S_RARROW" MORE", menu_settings2},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_measure2[] = { static const menuitem_t menu_measure2[] = {
@ -2656,8 +2622,7 @@ static const menuitem_t menu_measure2[] = {
#ifdef __FFT_DECONV__ #ifdef __FFT_DECONV__
{ MT_ADV_CALLBACK, M_DECONV, "DECONV", menu_measure_acb}, { MT_ADV_CALLBACK, M_DECONV, "DECONV", menu_measure_acb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_measure[] = { static const menuitem_t menu_measure[] = {
@ -2668,8 +2633,7 @@ static const menuitem_t menu_measure[] = {
{ MT_ADV_CALLBACK, M_SNR, "SNR", menu_measure_acb}, { MT_ADV_CALLBACK, M_SNR, "SNR", menu_measure_acb},
{ MT_ADV_CALLBACK, M_PASS_BAND, "-3dB\nWIDTH", menu_measure_acb}, { MT_ADV_CALLBACK, M_PASS_BAND, "-3dB\nWIDTH", menu_measure_acb},
{ MT_SUBMENU, 0, S_RARROW" MORE", menu_measure2}, { MT_SUBMENU, 0, S_RARROW" MORE", menu_measure2},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#ifdef __CALIBRATE__ #ifdef __CALIBRATE__
@ -2678,8 +2642,7 @@ static const menuitem_t menu_calibrate[] =
{ MT_FORM | MT_TITLE, 0, "Connect HIGH and LOW", NULL}, { MT_FORM | MT_TITLE, 0, "Connect HIGH and LOW", NULL},
{ MT_FORM | MT_CALLBACK, 0, "CALIBRATE", menu_calibrate_cb}, { MT_FORM | MT_CALLBACK, 0, "CALIBRATE", menu_calibrate_cb},
{ MT_FORM | MT_CALLBACK, 0, "RESET CALBRATION", menu_calibrate_cb}, { MT_FORM | MT_CALLBACK, 0, "RESET CALBRATION", menu_calibrate_cb},
{ MT_FORM | MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_FORM | MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
@ -2695,24 +2658,21 @@ const menuitem_t menu_serial_speed[] = {
{ MT_ADV_CALLBACK, 7, "%u", menu_serial_speed_acb }, { MT_ADV_CALLBACK, 7, "%u", menu_serial_speed_acb },
{ MT_ADV_CALLBACK, 8, "%u", menu_serial_speed_acb }, { MT_ADV_CALLBACK, 8, "%u", menu_serial_speed_acb },
{ MT_ADV_CALLBACK, 9, "%u", menu_serial_speed_acb }, { MT_ADV_CALLBACK, 9, "%u", menu_serial_speed_acb },
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_connection[] = { static const menuitem_t menu_connection[] = {
{ MT_ADV_CALLBACK, _MODE_USB, "USB", menu_connection_acb }, { MT_ADV_CALLBACK, _MODE_USB, "USB", menu_connection_acb },
{ MT_ADV_CALLBACK, _MODE_SERIAL, "SERIAL", menu_connection_acb }, { MT_ADV_CALLBACK, _MODE_SERIAL, "SERIAL", menu_connection_acb },
{ MT_SUBMENU, 0, "SERIAL\nSPEED", menu_serial_speed }, { MT_SUBMENU, 0, "SERIAL\nSPEED", menu_serial_speed },
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
#endif #endif
const menuitem_t menu_touch[] = { const menuitem_t menu_touch[] = {
{ MT_CALLBACK, CONFIG_MENUITEM_TOUCH_CAL, "TOUCH CAL", menu_config_cb}, { MT_CALLBACK, CONFIG_MENUITEM_TOUCH_CAL, "TOUCH CAL", menu_config_cb},
{ MT_CALLBACK, CONFIG_MENUITEM_TOUCH_TEST, "TOUCH TEST", menu_config_cb}, { MT_CALLBACK, CONFIG_MENUITEM_TOUCH_TEST, "TOUCH TEST", menu_config_cb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_config[] = { static const menuitem_t menu_config[] = {
@ -2735,8 +2695,7 @@ static const menuitem_t menu_config[] = {
#ifdef __LCD_BRIGHTNESS__ #ifdef __LCD_BRIGHTNESS__
{ MT_CALLBACK, 0, "BRIGHTNESS", menu_brightness_cb}, { MT_CALLBACK, 0, "BRIGHTNESS", menu_brightness_cb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_storage[] = { static const menuitem_t menu_storage[] = {
@ -2748,8 +2707,7 @@ static const menuitem_t menu_storage[] = {
{ MT_ADV_CALLBACK,4, "ACTUAL\n"S_RARROW"SD", menu_storage_acb}, { MT_ADV_CALLBACK,4, "ACTUAL\n"S_RARROW"SD", menu_storage_acb},
{ MT_ADV_CALLBACK,5, "STORED\n"S_RARROW"SD", menu_storage_acb}, { MT_ADV_CALLBACK,5, "STORED\n"S_RARROW"SD", menu_storage_acb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_display[] = { static const menuitem_t menu_display[] = {
@ -2771,9 +2729,7 @@ static const menuitem_t menu_display[] = {
// { MT_ADV_CALLBACK,0, "SEND\nDISPLAY", menu_send_display_acb}, // { MT_ADV_CALLBACK,0, "SEND\nDISPLAY", menu_send_display_acb},
//#endif //#endif
// { MT_KEYPAD, KM_SWEEP_TIME, "SWEEP\nTIME", NULL}, // { MT_KEYPAD, KM_SWEEP_TIME, "SWEEP\nTIME", NULL},
{ MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_unit[] = static const menuitem_t menu_unit[] =
@ -2785,8 +2741,7 @@ static const menuitem_t menu_unit[] =
//{ MT_ADV_CALLBACK,U_UVOLT, S_MICRO"Volt", menu_unit_acb}, //{ MT_ADV_CALLBACK,U_UVOLT, S_MICRO"Volt", menu_unit_acb},
{ MT_ADV_CALLBACK,U_WATT, "Watt", menu_unit_acb}, { MT_ADV_CALLBACK,U_WATT, "Watt", menu_unit_acb},
//{ MT_ADV_CALLBACK,U_UWATT, S_MICRO"Watt", menu_unit_acb}, //{ MT_ADV_CALLBACK,U_UWATT, S_MICRO"Watt", menu_unit_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_trigger[] = { static const menuitem_t menu_trigger[] = {
@ -2798,8 +2753,7 @@ static const menuitem_t menu_trigger[] = {
{ MT_ADV_CALLBACK, T_UP, "UP\nEDGE", menu_trigger_acb}, { MT_ADV_CALLBACK, T_UP, "UP\nEDGE", menu_trigger_acb},
{ MT_ADV_CALLBACK, T_DOWN, "DOWN\nEDGE", menu_trigger_acb}, { MT_ADV_CALLBACK, T_DOWN, "DOWN\nEDGE", menu_trigger_acb},
{ MT_ADV_CALLBACK, T_MODE, "%s\nTRIGGER", menu_trigger_acb}, { MT_ADV_CALLBACK, T_MODE, "%s\nTRIGGER", menu_trigger_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_level[] = { static const menuitem_t menu_level[] = {
@ -2817,8 +2771,7 @@ static const menuitem_t menu_level[] = {
#ifdef __LISTEN__ #ifdef __LISTEN__
{ MT_ADV_CALLBACK, 0, "LISTEN", menu_listen_acb}, { MT_ADV_CALLBACK, 0, "LISTEN", menu_listen_acb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK",NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_stimulus[] = { static const menuitem_t menu_stimulus[] = {
@ -2830,8 +2783,7 @@ static const menuitem_t menu_stimulus[] = {
{ MT_KEYPAD, KM_VAR, "JOG STEP\n%s","0 - AUTO"}, { MT_KEYPAD, KM_VAR, "JOG STEP\n%s","0 - AUTO"},
{ MT_SUBMENU,0, "RBW", menu_rbw}, { MT_SUBMENU,0, "RBW", menu_rbw},
{ MT_ADV_CALLBACK,0, "SHIFT\nFREQ", menu_shift_acb}, { MT_ADV_CALLBACK,0, "SHIFT\nFREQ", menu_shift_acb},
{ MT_CANCEL, 0, S_LARROW" BACK", NULL }, { MT_NONE, 0, NULL, menu_back} // next-> menu_back
{ MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_mode[] = { static const menuitem_t menu_mode[] = {
@ -2864,20 +2816,6 @@ static const menuitem_t menu_top[] = {
#define ACTIVE_COLOR RGBHEX(0x007FFF) #define ACTIVE_COLOR RGBHEX(0x007FFF)
static bool menu_is_form(const menuitem_t *menu)
{
#if 1
// Not good set only one item as form and others as normal
return menu[0].type & MT_FORM;
#else
int i;
for (i = 0; MT_MASK(menu[i].type) != MT_NONE; i++)
if (menu[i].type & MT_FORM)
return (true);
return(false);
#endif
}
static void menu_item_modify_attribute( static void menu_item_modify_attribute(
const menuitem_t *menu, int item, ui_button_t *button) const menuitem_t *menu, int item, ui_button_t *button)
{ {

Loading…
Cancel
Save

Powered by TurnKey Linux.