More UI cleanup and formatting

pull/4/head
DiSlord 5 years ago
parent 4ef8543322
commit 011fa73c72

@ -1770,10 +1770,11 @@ draw_menu_buttons(const menuitem_t *menu)
text_offs = button_start+6+ICON_WIDTH+1; text_offs = button_start+6+ICON_WIDTH+1;
} }
ili9341_drawstring_size(button.text, text_offs, y+(button_height-2*FONT_GET_HEIGHT)/2, 2); ili9341_drawstring_size(button.text, text_offs, y+(button_height-2*FONT_GET_HEIGHT)/2, 2);
// ili9341_drawstring_7x13(button.text, text_offs, y+(button_height-bFONT_GET_HEIGHT)/2);
#ifdef __ICONS__ #ifdef __ICONS__
if (menu[i].type & MT_ICON) { if (menu[i].type & MT_ICON) {
blit16BitWidthBitmap(button_start+MENU_FORM_WIDTH-40 ,y+(button_height-16)/2,16,16,& left_icons[((menu[i].data >>4)&0xf)*16]); blit16BitWidthBitmap(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)*FORM_ICON_HEIGHT]);
blit16BitWidthBitmap(button_start+MENU_FORM_WIDTH-40+16,y+(button_height-16)/2,16,16,&right_icons[((menu[i].data >>0)&0xf)*16]); blit16BitWidthBitmap(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)*FORM_ICON_HEIGHT]);
} }
#endif #endif
} else { } else {

@ -17,100 +17,68 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
const uint16_t left_icons [] = #define FORM_ICON_WIDTH 16
#define FORM_ICON_HEIGHT 16
static const uint16_t left_icons [] =
{ {
#define I_EMPTY 0*16 #define I_EMPTY (0*16)
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
0x0001, 0b0000000000000001,
0x0001, 0b0000000000000001,
0x0001, 0b0000000000000001,
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
0x0001, 0b0000000000000001,
0x0001, 0b0000000000000001,
0x0001, 0b0000000000000001,
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
0x0000, 0b0000000000000000,
#define I_HIGH_INPUT 1*16
/* +-----------------+
| |
| ** |
| *** |
| ************ |
| *** |
| ** |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+-----------------+ */
0x0000,
0x0000,
0x0060,
0x0039,
0x0fff,
0x0039,
0x0060,
0x0000,
0x0000,
0x0000,
0x0001,
0x0001,
0x0001,
0x0000,
0x0000,
0x0000,
#define I_LOW_INPUT 2*16
/* +-----------------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ** |
| **** |
| ************ |
| **** |
| ** |
| |
+-----------------+ */
0x0000,
0x0000,
0x0000,
0x0001,
0x0001,
0x0001,
0x0000,
0x0000,
0x0000,
0x0060,
0x0039,
0x0fff,
0x0039,
0x0060,
0x0000,
0x0000,
#define I_LOW_OUTPUT 3*16
#define I_HIGH_INPUT (1*16)
// +----------------+
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000001100000, // | ** |
0b0000000000111001, // | *** *|
0b0000111111111111, // | *************|
0b0000000000111001, // | *** *|
0b0000000001100000, // | ** |
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000000000001, // | |
0b0000000000000001, // | |
0b0000000000000001, // | |
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000000000000, // | |
// +----------------+
#define I_LOW_INPUT (2*16)
// +----------------+
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000000000001, // | |
0b0000000000000001, // | |
0b0000000000000001, // | |
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000000000000, // | |
0b0000000001100000, // | ** |
0b0000000000111001, // | **** *|
0b0000111111111111, // | *************|
0b0000000000111001, // | **** *|
0b0000000001100000, // | ** |
0b0000000000000000, // | |
0b0000000000000000, // | |
// +----------------+
#define I_LOW_OUTPUT (3*16)
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
@ -128,8 +96,7 @@ const uint16_t left_icons [] =
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
#define I_HIGH_OUTPUT 4*16 #define I_HIGH_OUTPUT (4*16)
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b0000000110000000, 0b0000000110000000,
@ -147,8 +114,7 @@ const uint16_t left_icons [] =
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
#define I_CONNECT 5*16 #define I_CONNECT (5*16)
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
0b0000000000110000, 0b0000000000110000,
@ -165,89 +131,50 @@ const uint16_t left_icons [] =
0b0000000000110000, 0b0000000000110000,
0b0000000000000000, 0b0000000000000000,
0b0000000000000000, 0b0000000000000000,
}; };
const uint16_t right_icons [] = const uint16_t right_icons [] =
{ {
#define I_SA 0 #define I_SA 0
/* Character 0 (0x00): // +----------------+
width 16 0b0000000000000000, // | |
+-----------------+ 0b0111111111111111, // | ***************|
| | 0b0100000000000001, // | * *|
| *************** | 0b1100000000000001, // |** *|
| * * | 0b1100000000000001, // |** * *|
|** * | 0b1100000000000001, // |** * *|
| * * * | 0b0100100000000001, // | * * * *|
| * * * | 0b0100100000000001, // | * * * *|
| * * * * | 0b0100101010001001, // | * * * * *|
| * * * * | 0b0100101010101001, // | * * * * * *|
| * * * * * | 0b1100101010101001, // |** * * * * * *|
| * * * * * * | 0b1101111111111101, // |** * * * * * *|
| * * * * * * * | 0b1100000000000001, // |** *********** *|
| * * * * * * * | 0b0100000000000001, // | * *|
|** *********** * | 0b0111111111111111, // | ***************|
| * * | 0b0000000000000000, // | |
| *************** | // +----------------+
| |
+-----------------+ */
0x0000,
0x7fff,
0x4001,
0xc001,
0xc001,
0xc001,
0x4801,
0x4801,
0x4a89,
0x4aa9,
0xcaa9,
0xdffd,
0xc001,
0x4001,
0x7fff,
0x0000,
#define I_GEN 1 #define I_GEN 1
/* Character 0 (0x00): // +----------------+
width 16 0b0000000000000000, // | |
+-----------------+ 0b0111111111111111, // | ***************|
| | 0b0100000000000001, // | * *|
| *************** | 0b1100000000000001, // |** *|
| * * | 0b1100111110001101, // |** ***** ** *|
|** * | 0b1100100010001001, // |** * * * *|
| * ***** ** * | 0b0100100010001001, // | * * * * *|
| * * * * * | 0b0100100010001001, // | * * * * *|
| * * * * * | 0b0100100010001001, // | * * * * *|
| * * * * * | 0b0100100010001001, // | * * * * *|
| * * * * * | 0b1100100010001001, // |** * * * *|
| * * * * * | 0b1101100011111001, // |** ** ***** *|
| * * * * * | 0b1100000000000001, // |** *|
| * ** ***** * | 0b0100000000000001, // | * *|
|** * | 0b0111111111111111, // | ***************|
| * * | 0b0000000000000000, // | |
| *************** | // +----------------+
| |
+-----------------+ */
0x0000,
0x7fff,
0x4001,
0xc001,
0xcf8d,
0xc889,
0x4889,
0x4889,
0x4889,
0x4889,
0xc889,
0xd8f9,
0xc001,
0x4001,
0x7fff,
0x0000,
#define I_CONFIG 2 #define I_CONFIG 2
0b0000000000000000, 0b0000000000000000,
0b0111111111111111, 0b0111111111111111,
0b0100000000000001, 0b0100000000000001,
@ -266,7 +193,6 @@ const uint16_t right_icons [] =
0b0000000000000000, 0b0000000000000000,
#define I_SINUS 3 #define I_SINUS 3
0b0000000000000000, 0b0000000000000000,
0b0111111111111111, // 1 0b0111111111111111, // 1
0b0100000000000001, // 2 0b0100000000000001, // 2
@ -510,16 +436,17 @@ static const struct {
}; };
// ===[MENU CALLBACKS]========================================================= // ===[MENU CALLBACKS]=========================================================
static const menuitem_t menu_lowoutputmode[];
static const menuitem_t menu_highoutputmode[];
int generator_enabled = false; static const menuitem_t menu_modulation[];
static const menuitem_t menu_top[];
extern const menuitem_t menu_lowoutputmode[]; static const menuitem_t menu_reffer[];
extern const menuitem_t menu_highoutputmode[]; static const menuitem_t menu_modulation[];
extern const menuitem_t menu_modulation[]; static const menuitem_t menu_drive_wide[];
extern const menuitem_t menu_top[]; #ifdef __ULTRA__
extern const menuitem_t menu_tophigh[]; static const menuitem_t menu_tophigh[];
extern const menuitem_t menu_topultra[]; static const menuitem_t menu_topultra[];
#endif
static UI_FUNCTION_ADV_CALLBACK(menu_mode_acb) static UI_FUNCTION_ADV_CALLBACK(menu_mode_acb)
{ {
@ -709,6 +636,16 @@ static UI_FUNCTION_ADV_CALLBACK(menu_modulation_acb)
// draw_cal_status(); // draw_cal_status();
} }
static UI_FUNCTION_ADV_CALLBACK(menu_smodulation_acb){
(void)item;
(void)data;
if(b){
b->param_1.text = menu_modulation_text[setting.modulation];
return;
}
menu_push_submenu(menu_modulation);
}
// 0 1 2 3 4 5 6 7 // 0 1 2 3 4 5 6 7
const char *menu_reffer_text[]={"OFF","30MHz","15MHz","10MHz","4MHz","3MHz","2MHz","1MHz"}; const char *menu_reffer_text[]={"OFF","30MHz","15MHz","10MHz","4MHz","3MHz","2MHz","1MHz"};
static UI_FUNCTION_ADV_CALLBACK(menu_reffer_acb) static UI_FUNCTION_ADV_CALLBACK(menu_reffer_acb)
@ -726,6 +663,16 @@ static UI_FUNCTION_ADV_CALLBACK(menu_reffer_acb)
// draw_cal_status(); // draw_cal_status();
} }
static UI_FUNCTION_ADV_CALLBACK(menu_sreffer_acb){
(void)item;
(void)data;
if(b){
b->param_1.text = menu_reffer_text[setting.refer+1];
return;
}
menu_push_submenu(menu_reffer);
}
const int8_t menu_drive_value[]={-38,-35,-33,-30,-27,-24,-21,-19, -7,-4,-2,1,4,7,10,13}; const int8_t menu_drive_value[]={-38,-35,-33,-30,-27,-24,-21,-19, -7,-4,-2,1,4,7,10,13};
static UI_FUNCTION_ADV_CALLBACK(menu_drive_acb) static UI_FUNCTION_ADV_CALLBACK(menu_drive_acb)
{ {
@ -742,6 +689,16 @@ static UI_FUNCTION_ADV_CALLBACK(menu_drive_acb)
// draw_cal_status(); // draw_cal_status();
} }
static UI_FUNCTION_ADV_CALLBACK(menu_sdrive_acb){
(void)item;
(void)data;
if(b){
b->param_1.i = menu_drive_value[setting.drive];
return;
}
menu_push_submenu(menu_drive_wide);
}
#ifdef __SPUR__ #ifdef __SPUR__
static UI_FUNCTION_ADV_CALLBACK(menu_spur_acb) static UI_FUNCTION_ADV_CALLBACK(menu_spur_acb)
{ {
@ -1056,17 +1013,22 @@ static UI_FUNCTION_ADV_CALLBACK(menu_unit_acb)
menu_move_back_and_leave_ui(); menu_move_back_and_leave_ui();
} }
#if 0
enum { enum {
S_20,S_10,S_5,S_2,S_1,S_P5,S_P2,S_P1,S_P05,S_P02,S_P01 S_20,S_10,S_5,S_2,S_1,S_P5,S_P2,S_P1,S_P05,S_P02,S_P01
}; };
//static const float menu_scale_per_value[11]={20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01}; static const float menu_scale_per_value[11]={20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0.01};
//static void menu_scale_per_cb(int item, uint8_t data) static UI_FUNCTION_ADV_CALLBACK(menu_scale_per_acb)
//{ {
// (void)item; (void)item;
// set_scale(menu_scale_per_value[data]); if(b){
// menu_move_back_and_leave_ui(); return;
//} }
set_scale(menu_scale_per_value[data]);
menu_move_back_and_leave_ui();
}
#endif
static UI_FUNCTION_ADV_CALLBACK(menu_trigger_acb) static UI_FUNCTION_ADV_CALLBACK(menu_trigger_acb)
{ {
@ -1317,7 +1279,7 @@ static const menuitem_t menu_drive_wide[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
const menuitem_t menu_modulation[] = { static const menuitem_t menu_modulation[] = {
{ MT_FORM | MT_TITLE, 0, "MODULATION",NULL}, { MT_FORM | MT_TITLE, 0, "MODULATION",NULL},
{ MT_FORM | MT_ADV_CALLBACK, MO_NONE, "NONE", menu_modulation_acb}, { MT_FORM | MT_ADV_CALLBACK, MO_NONE, "NONE", menu_modulation_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_LOW, MO_AM_1kHz, "AM 1kHz", menu_modulation_acb}, { MT_FORM | MT_ADV_CALLBACK | MT_LOW, MO_AM_1kHz, "AM 1kHz", menu_modulation_acb},
@ -1329,11 +1291,11 @@ const menuitem_t menu_modulation[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
const menuitem_t menu_lowoutputmode[] = { static const menuitem_t menu_lowoutputmode[] = {
{ MT_FORM | MT_ADV_CALLBACK, 0, "LOW OUTPUT %s", menu_outputmode_acb}, { MT_FORM | MT_ADV_CALLBACK, 0, "LOW OUTPUT %s", menu_outputmode_acb},
{ MT_FORM | MT_KEYPAD, KM_CENTER, "FREQ: %s", "10kHz..350MHz"}, { MT_FORM | MT_KEYPAD, KM_CENTER, "FREQ: %s", "10kHz..350MHz"},
{ MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", "-76..-6"}, { MT_FORM | MT_KEYPAD, KM_LOWOUTLEVEL, "LEVEL: %s", "-76..-6"},
{ MT_FORM | MT_SUBMENU, 0, "MODULATION: %s", menu_modulation}, { MT_FORM | MT_ADV_CALLBACK, 0, "MODULATION: %s", menu_smodulation_acb},
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", "0..350MHz"}, { MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", "0..350MHz"},
{ MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", "-70..70"}, { MT_FORM | MT_KEYPAD | MT_LOW, KM_LEVELSWEEP,"LEVEL CHANGE: %s", "-70..70"},
{ 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"},
@ -1341,11 +1303,11 @@ const menuitem_t menu_lowoutputmode[] = {
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
const menuitem_t menu_highoutputmode[] = { static const menuitem_t menu_highoutputmode[] = {
{ MT_FORM | MT_CALLBACK, 0, "HIGH OUTPUT %s", menu_outputmode_acb}, { MT_FORM | MT_CALLBACK, 0, "HIGH OUTPUT %s", menu_outputmode_acb},
{ MT_FORM | MT_KEYPAD, KM_CENTER, "FREQ: %s", "240MHz..960MHz"}, { MT_FORM | MT_KEYPAD, KM_CENTER, "FREQ: %s", "240MHz..960MHz"},
{ MT_FORM | MT_SUBMENU, 0, "LEVEL: %+ddBm", menu_drive_wide}, { MT_FORM | MT_ADV_CALLBACK, 0, "LEVEL: %+ddBm", menu_sdrive_acb},
{ MT_FORM | MT_SUBMENU, 0, "MODULATION: %s", menu_modulation}, { MT_FORM | MT_ADV_CALLBACK, 0, "MODULATION: %s", menu_smodulation_acb},
{ MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", NULL}, { MT_FORM | MT_KEYPAD, KM_SPAN, "SPAN: %s", NULL},
{ 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_CANCEL, 0, "MODE", NULL }, { MT_FORM | MT_CANCEL, 0, "MODE", NULL },
@ -1377,26 +1339,25 @@ static const menuitem_t menu_rbw[] = {
#if 0 #if 0
static const menuitem_t menu_scale_per2[] = { static const menuitem_t menu_scale_per2[] = {
{ MT_CALLBACK, 6, "0.1 /", menu_scale_per_cb}, { MT_ADV_CALLBACK, 6, "0.1 /", menu_scale_per_acb},
{ MT_CALLBACK, 7, "0.2 /", menu_scale_per_cb}, { MT_ADV_CALLBACK, 7, "0.2 /", menu_scale_per_acb},
{ MT_CALLBACK, 8, "0.05/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 8, "0.05/", menu_scale_per_acb},
{ MT_CALLBACK, 9, "0.02/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 9, "0.02/", menu_scale_per_acb},
{ MT_CALLBACK,10, "0.01/", menu_scale_per_cb}, { MT_ADV_CALLBACK,10, "0.01/", menu_scale_per_acb},
// { MT_CALLBACK,11, "0.005/", menu_scale_per_cb}, //{ MT_ADV_CALLBACK,11, "0.005/", menu_scale_per_acb},
// { MT_SUBMENU, 0, "\033 MORE", menu_scale_per2}, //{ MT_SUBMENU, 0, "\033 MORE", menu_scale_per2},
{ MT_CANCEL, 0, "\032 BACK", NULL }, { MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_scale_per[] = { static const menuitem_t menu_scale_per[] = {
{ MT_CALLBACK, 0, " 20/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 0, " 20/", menu_scale_per_acb},
{ MT_CALLBACK, 1, " 10/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 1, " 10/", menu_scale_per_acb},
{ MT_CALLBACK, 2, " 5/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 2, " 5/", menu_scale_per_acb},
{ MT_CALLBACK, 3, " 2/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 3, " 2/", menu_scale_per_acb},
{ MT_CALLBACK, 4, " 1/", menu_scale_per_cb}, { M_ADVT_CALLBACK, 4, " 1/", menu_scale_per_acb},
{ MT_CALLBACK, 5, "0.5/", menu_scale_per_cb}, { MT_ADV_CALLBACK, 5, "0.5/", menu_scale_per_acb},
{ MT_SUBMENU, 0, "\033 MORE", menu_scale_per2}, { MT_SUBMENU, 0, "\033 MORE", menu_scale_per2},
{ MT_CANCEL, 0, "\032 BACK", NULL }, { MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -1427,9 +1388,9 @@ static const menuitem_t menu_reffer[] = {
static const menuitem_t menu_atten[] = { static const menuitem_t menu_atten[] = {
{ MT_ADV_CALLBACK | MT_LOW, 0, "AUTO", menu_atten_acb}, { MT_ADV_CALLBACK | MT_LOW, 0, "AUTO", menu_atten_acb},
{ MT_KEYPAD | MT_LOW, KM_ATTENUATION, "MANUAL", "0..30"}, { 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.5dB..\n40dB", menu_atten_high_acb}, { MT_ADV_CALLBACK | MT_HIGH,30, "22.5 - 40dB", menu_atten_high_acb},
{ MT_CANCEL, 0, "\032 BACK", NULL }, { MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel { MT_FORM | MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -1641,34 +1602,34 @@ static const menuitem_t menu_unit[] =
{ MT_ADV_CALLBACK,U_DBMV, "dBmV", menu_unit_acb}, { MT_ADV_CALLBACK,U_DBMV, "dBmV", menu_unit_acb},
{ MT_ADV_CALLBACK,U_DBUV, "dB"S_MICRO"V", menu_unit_acb}, { MT_ADV_CALLBACK,U_DBUV, "dB"S_MICRO"V", menu_unit_acb},
{ MT_ADV_CALLBACK,U_VOLT, "Volt", menu_unit_acb}, { MT_ADV_CALLBACK,U_VOLT, "Volt", menu_unit_acb},
// { 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, "\032 BACK", NULL }, { MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_trigger[] = { static const menuitem_t menu_trigger[] = {
{ MT_ADV_CALLBACK,T_AUTO, "AUTO", menu_trigger_acb}, { MT_ADV_CALLBACK, T_AUTO, "AUTO", menu_trigger_acb},
{ MT_ADV_CALLBACK,T_NORMAL, "NORMAL", menu_trigger_acb}, { MT_ADV_CALLBACK, T_NORMAL, "NORMAL", menu_trigger_acb},
{ MT_ADV_CALLBACK,T_SINGLE, "SINGLE", menu_trigger_acb}, { MT_ADV_CALLBACK, T_SINGLE, "SINGLE", menu_trigger_acb},
{ MT_KEYPAD, KM_TRIGGER, "TRIGGER\nLEVEL", NULL}, { MT_KEYPAD, KM_TRIGGER, "TRIGGER\nLEVEL", NULL},
{ 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_CANCEL, 0, "\032 BACK",NULL }, { MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
static const menuitem_t menu_level[] = { static const menuitem_t menu_level[] = {
{ MT_SUBMENU, 0, "REF LEVEL", menu_reflevel}, { MT_SUBMENU, 0, "REF LEVEL", menu_reflevel},
// { MT_SUBMENU, 0, "SCALE/\nDIV",menu_scale_per}, //{ MT_SUBMENU, 0, "SCALE/DIV", menu_scale_per},
{ MT_KEYPAD, KM_SCALE, "SCALE/DIV",NULL}, { MT_KEYPAD, KM_SCALE, "SCALE/DIV", NULL},
{ MT_SUBMENU, 0, "ATTENUATE", menu_atten}, { MT_SUBMENU, 0, "ATTENUATE", menu_atten},
{ MT_SUBMENU,0, "CALC", menu_average}, { MT_SUBMENU,0, "CALC", menu_average},
{ MT_SUBMENU, 0, "UNIT", menu_unit}, { MT_SUBMENU, 0, "UNIT", menu_unit},
{ MT_KEYPAD, KM_OFFSET, "EXTERNAL\nAMP",NULL}, { MT_KEYPAD, KM_OFFSET, "EXTERNAL\nAMP",NULL},
{ MT_SUBMENU, 0, "TRIGGER", menu_trigger}, { MT_SUBMENU, 0, "TRIGGER", menu_trigger},
{ MT_CANCEL, 0, "\032 BACK",NULL }, { MT_CANCEL, 0, "\032 BACK", NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel
}; };
@ -1692,7 +1653,7 @@ static const menuitem_t menu_mode[] = {
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_HIGH_INPUT+I_SA, "%s TO HIGH INPUT", menu_mode_acb}, { MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_HIGH_INPUT+I_SA, "%s TO HIGH INPUT", menu_mode_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_LOW_OUTPUT+I_SINUS, "%s TO LOW OUTPUT", menu_mode_acb}, { MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_LOW_OUTPUT+I_SINUS, "%s TO LOW OUTPUT", menu_mode_acb},
{ MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_HIGH_OUTPUT+I_GEN, "%s TO HIGH OUTPUT", menu_mode_acb}, { MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_HIGH_OUTPUT+I_GEN, "%s TO HIGH OUTPUT", menu_mode_acb},
{ MT_FORM | MT_SUBMENU | MT_ICON, I_CONNECT+I_GEN, "CAL OUTPUT: %s", menu_reffer}, { MT_FORM | MT_ADV_CALLBACK | MT_ICON, I_CONNECT+I_GEN, "CAL OUTPUT: %s", menu_sreffer_acb},
#ifdef __ULTRA__ #ifdef __ULTRA__
{ MT_FORM | MT_CALLBACK | MT_ICON, I_LOW_INPUT+I_SA, "ULTRA HIGH INPUT",menu_mode_cb}, { MT_FORM | MT_CALLBACK | MT_ICON, I_LOW_INPUT+I_SA, "ULTRA HIGH INPUT",menu_mode_cb},
#endif #endif
@ -1715,7 +1676,7 @@ const menuitem_t menu_topultra[] = {
}; };
#endif #endif
const menuitem_t menu_top[] = { static const menuitem_t menu_top[] = {
{ MT_SUBMENU, 0, "PRESET", menu_load_preset}, { MT_SUBMENU, 0, "PRESET", menu_load_preset},
{ MT_SUBMENU, 0, "FREQUENCY", menu_stimulus}, { MT_SUBMENU, 0, "FREQUENCY", menu_stimulus},
{ MT_SUBMENU, 0, "LEVEL", menu_level}, { MT_SUBMENU, 0, "LEVEL", menu_level},
@ -1746,15 +1707,7 @@ static void fetch_numeric_target(void);
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)
{ {
if (menu == menu_mode) { if (menu == menu_settings) {
if (item == 4) // CAL OUTPUT menu
button->param_1.text = menu_reffer_text[setting.refer+1];
} else if (menu == menu_highoutputmode && item == 2){ // LEVEL mode
button->param_1.i = menu_drive_value[setting.drive];
} else if (menu == menu_lowoutputmode || menu == menu_highoutputmode) {
if (item == 3)
button->param_1.text = menu_modulation_text[setting.modulation];
} else if (menu == menu_settings) {
if (item == 2) if (item == 2)
button->icon = setting.auto_IF ? BUTTON_ICON_CHECK_AUTO : BUTTON_ICON_CHECK_MANUAL; button->icon = setting.auto_IF ? BUTTON_ICON_CHECK_AUTO : BUTTON_ICON_CHECK_MANUAL;
} else if (menu == menu_scanning_speed) { } else if (menu == menu_scanning_speed) {

Loading…
Cancel
Save

Powered by TurnKey Linux.