|
|
|
|
@ -115,14 +115,28 @@ static int8_t selection = 0;
|
|
|
|
|
#define MT_CALLBACK 0x03
|
|
|
|
|
#define MT_CANCEL 0x04
|
|
|
|
|
#define MT_CLOSE 0x05
|
|
|
|
|
//#define MT_ADV_CALLBACK 0x06
|
|
|
|
|
#define MT_ADV_CALLBACK 0x06
|
|
|
|
|
|
|
|
|
|
#define BUTTON_ICON_NONE -1
|
|
|
|
|
#define BUTTON_ICON_NOCHECK 0
|
|
|
|
|
#define BUTTON_ICON_CHECK 1
|
|
|
|
|
#define BUTTON_ICON_GROUP 2
|
|
|
|
|
#define BUTTON_ICON_GROUP_CHECKED 3
|
|
|
|
|
|
|
|
|
|
typedef struct Button{
|
|
|
|
|
uint16_t bg;
|
|
|
|
|
uint16_t fg;
|
|
|
|
|
uint16_t border_color;
|
|
|
|
|
uint8_t border;
|
|
|
|
|
int8_t icon;
|
|
|
|
|
} button_t;
|
|
|
|
|
|
|
|
|
|
// Call back functions for MT_CALLBACK type
|
|
|
|
|
typedef void (*menuaction_cb_t)(int item, uint16_t data);
|
|
|
|
|
#define UI_FUNCTION_CALLBACK(ui_function_name) void ui_function_name(int item, uint16_t data)
|
|
|
|
|
|
|
|
|
|
//typedef void (*menuaction_acb_t)(int item, uint16_t data, uint16_t cmd);
|
|
|
|
|
//#define UI_FUNCTION_ADV_CALLBACK(ui_function_name) void ui_function_name(int item, uint16_t data, uint16_t cmd)
|
|
|
|
|
typedef void (*menuaction_acb_t)(int item, uint16_t data, button_t *b);
|
|
|
|
|
#define UI_FUNCTION_ADV_CALLBACK(ui_function_name) void ui_function_name(int item, uint16_t data, button_t *b)
|
|
|
|
|
|
|
|
|
|
// Set structure align as WORD (save flash memory)
|
|
|
|
|
#pragma pack(push, 2)
|
|
|
|
|
@ -500,8 +514,17 @@ select_lever_mode(int mode)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_calop_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_calop_acb)
|
|
|
|
|
{
|
|
|
|
|
if (b){
|
|
|
|
|
if ((data == CAL_OPEN && (cal_status & CALSTAT_OPEN))
|
|
|
|
|
|| (data == CAL_SHORT && (cal_status & CALSTAT_SHORT))
|
|
|
|
|
|| (data == CAL_LOAD && (cal_status & CALSTAT_LOAD))
|
|
|
|
|
|| (data == CAL_ISOLN && (cal_status & CALSTAT_ISOLN))
|
|
|
|
|
|| (data == CAL_THRU && (cal_status & CALSTAT_THRU)))
|
|
|
|
|
b->icon = BUTTON_ICON_CHECK;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
cal_collect(data);
|
|
|
|
|
selection = item+1;
|
|
|
|
|
draw_cal_status();
|
|
|
|
|
@ -520,9 +543,13 @@ static UI_FUNCTION_CALLBACK(menu_caldone_cb)
|
|
|
|
|
menu_push_submenu(menu_save);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_cal2_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_cal2_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)data;
|
|
|
|
|
if (b){
|
|
|
|
|
if (item == 3) b->icon = (cal_status&CALSTAT_APPLY) ? BUTTON_ICON_CHECK : BUTTON_ICON_NOCHECK;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
switch (item) {
|
|
|
|
|
case 2: // RESET
|
|
|
|
|
cal_status = 0;
|
|
|
|
|
@ -604,9 +631,18 @@ choose_active_trace(void)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_trace_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_trace_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if (b){
|
|
|
|
|
if (trace[data].enabled){
|
|
|
|
|
b->bg = config.trace_color[data];
|
|
|
|
|
if (data == selection) b->fg = ~config.trace_color[data];
|
|
|
|
|
b->icon = BUTTON_ICON_CHECK;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (trace[data].enabled) {
|
|
|
|
|
if (data == uistat.current_trace) {
|
|
|
|
|
// disable if active trace is selected
|
|
|
|
|
@ -640,41 +676,61 @@ static UI_FUNCTION_CALLBACK(menu_channel_cb)
|
|
|
|
|
menu_move_back(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_transform_window_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_transform_window_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
// TODO
|
|
|
|
|
if(b){
|
|
|
|
|
b->icon = (domain_mode & TD_WINDOW) == data ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
domain_mode = (domain_mode & ~TD_WINDOW) | data;
|
|
|
|
|
ui_mode_normal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_transform_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_transform_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
(void)data;
|
|
|
|
|
if(b){
|
|
|
|
|
if (domain_mode & DOMAIN_TIME) b->icon = BUTTON_ICON_CHECK;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
domain_mode ^= DOMAIN_TIME;
|
|
|
|
|
select_lever_mode(LM_MARKER);
|
|
|
|
|
ui_mode_normal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_transform_filter_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_transform_filter_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if(b){
|
|
|
|
|
b->icon = (domain_mode & TD_FUNC) == data ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
domain_mode = (domain_mode & ~TD_FUNC) | data;
|
|
|
|
|
ui_mode_normal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_bandwidth_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_bandwidth_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if (b){
|
|
|
|
|
b->icon = config.bandwidth == data ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
config.bandwidth = data;
|
|
|
|
|
draw_frequencies();
|
|
|
|
|
draw_menu();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_points_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_points_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if (b){
|
|
|
|
|
b->icon = sweep_points == data ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
set_sweep_points(data);
|
|
|
|
|
draw_menu();
|
|
|
|
|
}
|
|
|
|
|
@ -706,10 +762,14 @@ static UI_FUNCTION_CALLBACK(menu_keyboard_cb)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_pause_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_pause_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
(void)data;
|
|
|
|
|
if (b){
|
|
|
|
|
b->icon = sweep_mode&SWEEP_ENABLE ? BUTTON_ICON_NOCHECK : BUTTON_ICON_CHECK;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
toggle_sweep();
|
|
|
|
|
//menu_move_back();
|
|
|
|
|
//ui_mode_normal();
|
|
|
|
|
@ -795,9 +855,6 @@ static UI_FUNCTION_CALLBACK(menu_marker_search_cb)
|
|
|
|
|
i = marker_search_right(markers[active_marker].index);
|
|
|
|
|
uistat.marker_tracking = false;
|
|
|
|
|
break;
|
|
|
|
|
case 4: /* tracking */
|
|
|
|
|
uistat.marker_tracking = !uistat.marker_tracking;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (i != -1)
|
|
|
|
|
markers[active_marker].index = i;
|
|
|
|
|
@ -806,9 +863,25 @@ static UI_FUNCTION_CALLBACK(menu_marker_search_cb)
|
|
|
|
|
select_lever_mode(LM_SEARCH);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_marker_smith_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_marker_tracking_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
(void)data;
|
|
|
|
|
if (b){
|
|
|
|
|
b->icon = uistat.marker_tracking ? BUTTON_ICON_CHECK : BUTTON_ICON_NOCHECK;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
uistat.marker_tracking = !uistat.marker_tracking;
|
|
|
|
|
draw_menu();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_marker_smith_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)item;
|
|
|
|
|
if (b){
|
|
|
|
|
b->icon = marker_smith_format == data ? BUTTON_ICON_GROUP_CHECKED : BUTTON_ICON_GROUP;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
marker_smith_format = data;
|
|
|
|
|
redraw_marker(active_marker);
|
|
|
|
|
draw_menu();
|
|
|
|
|
@ -830,10 +903,15 @@ active_marker_select(int item)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UI_FUNCTION_CALLBACK(menu_marker_sel_cb)
|
|
|
|
|
static UI_FUNCTION_ADV_CALLBACK(menu_marker_sel_acb)
|
|
|
|
|
{
|
|
|
|
|
(void)data;
|
|
|
|
|
int t;
|
|
|
|
|
if (b){
|
|
|
|
|
if (item < 4 && markers[item].enabled) b->icon = BUTTON_ICON_CHECK;
|
|
|
|
|
else if (item == 5) b->icon = uistat.marker_delta ? BUTTON_ICON_CHECK : BUTTON_ICON_NOCHECK;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (item >= 0 && item < MARKERS_MAX) {
|
|
|
|
|
if (markers[item].enabled) {
|
|
|
|
|
if (item == active_marker) {
|
|
|
|
|
@ -952,11 +1030,11 @@ static const menuitem_t menu_sdcard[] = {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static const menuitem_t menu_calop[] = {
|
|
|
|
|
{ MT_CALLBACK, CAL_OPEN, "OPEN", menu_calop_cb },
|
|
|
|
|
{ MT_CALLBACK, CAL_SHORT, "SHORT", menu_calop_cb },
|
|
|
|
|
{ MT_CALLBACK, CAL_LOAD, "LOAD", menu_calop_cb },
|
|
|
|
|
{ MT_CALLBACK, CAL_ISOLN, "ISOLN", menu_calop_cb },
|
|
|
|
|
{ MT_CALLBACK, CAL_THRU, "THRU", menu_calop_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, CAL_OPEN, "OPEN", menu_calop_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, CAL_SHORT, "SHORT", menu_calop_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, CAL_LOAD, "LOAD", menu_calop_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, CAL_ISOLN, "ISOLN", menu_calop_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, CAL_THRU, "THRU", menu_calop_acb },
|
|
|
|
|
{ MT_CALLBACK, 0, "DONE", menu_caldone_cb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
@ -975,17 +1053,17 @@ const menuitem_t menu_save[] = {
|
|
|
|
|
const menuitem_t menu_cal[] = {
|
|
|
|
|
{ MT_SUBMENU, 0, "CALIBRATE", menu_calop },
|
|
|
|
|
{ MT_SUBMENU, 0, "SAVE", menu_save },
|
|
|
|
|
{ MT_CALLBACK, 0, "RESET", menu_cal2_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "APPLY", menu_cal2_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "RESET", menu_cal2_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "APPLY", menu_cal2_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_trace[] = {
|
|
|
|
|
{ MT_CALLBACK, 0, "TRACE 0", menu_trace_cb },
|
|
|
|
|
{ MT_CALLBACK, 1, "TRACE 1", menu_trace_cb },
|
|
|
|
|
{ MT_CALLBACK, 2, "TRACE 2", menu_trace_cb },
|
|
|
|
|
{ MT_CALLBACK, 3, "TRACE 3", menu_trace_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "TRACE 0", menu_trace_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 1, "TRACE 1", menu_trace_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 2, "TRACE 2", menu_trace_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 3, "TRACE 3", menu_trace_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
@ -1031,18 +1109,18 @@ const menuitem_t menu_channel[] = {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_transform_window[] = {
|
|
|
|
|
{ MT_CALLBACK, TD_WINDOW_MINIMUM, "MINIMUM", menu_transform_window_cb },
|
|
|
|
|
{ MT_CALLBACK, TD_WINDOW_NORMAL, "NORMAL", menu_transform_window_cb },
|
|
|
|
|
{ MT_CALLBACK, TD_WINDOW_MAXIMUM, "MAXIMUM", menu_transform_window_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, TD_WINDOW_MINIMUM, "MINIMUM", menu_transform_window_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, TD_WINDOW_NORMAL, "NORMAL", menu_transform_window_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, TD_WINDOW_MAXIMUM, "MAXIMUM", menu_transform_window_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_transform[] = {
|
|
|
|
|
{ MT_CALLBACK, 0, "TRANSFORM\nON", menu_transform_cb },
|
|
|
|
|
{ MT_CALLBACK, TD_FUNC_LOWPASS_IMPULSE, "LOW PASS\nIMPULSE", menu_transform_filter_cb },
|
|
|
|
|
{ MT_CALLBACK, TD_FUNC_LOWPASS_STEP, "LOW PASS\nSTEP", menu_transform_filter_cb },
|
|
|
|
|
{ MT_CALLBACK, TD_FUNC_BANDPASS, "BANDPASS", menu_transform_filter_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "TRANS\nFORM ON", menu_transform_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, TD_FUNC_LOWPASS_IMPULSE, "LOW PASS\nIMPULSE", menu_transform_filter_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, TD_FUNC_LOWPASS_STEP, "LOW PASS\nSTEP", menu_transform_filter_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, TD_FUNC_BANDPASS, "BANDPASS", menu_transform_filter_acb },
|
|
|
|
|
{ MT_SUBMENU, 0, "WINDOW", menu_transform_window },
|
|
|
|
|
{ MT_CALLBACK, KM_VELOCITY_FACTOR, "VELOCITY\nFACTOR", menu_keyboard_cb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
@ -1050,12 +1128,12 @@ const menuitem_t menu_transform[] = {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_bandwidth[] = {
|
|
|
|
|
{ MT_CALLBACK, BANDWIDTH_2000, "2 kHz", menu_bandwidth_cb },
|
|
|
|
|
{ MT_CALLBACK, BANDWIDTH_1000, "1 kHz", menu_bandwidth_cb },
|
|
|
|
|
{ MT_CALLBACK, BANDWIDTH_333, "333 Hz", menu_bandwidth_cb },
|
|
|
|
|
{ MT_CALLBACK, BANDWIDTH_100, "100 Hz", menu_bandwidth_cb },
|
|
|
|
|
{ MT_CALLBACK, BANDWIDTH_30, "30 Hz", menu_bandwidth_cb },
|
|
|
|
|
{ MT_CALLBACK, BANDWIDTH_10, "10 Hz", menu_bandwidth_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, BANDWIDTH_2000, "2 kHz", menu_bandwidth_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, BANDWIDTH_1000, "1 kHz", menu_bandwidth_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, BANDWIDTH_333, "333 Hz", menu_bandwidth_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, BANDWIDTH_100, "100 Hz", menu_bandwidth_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, BANDWIDTH_30, "30 Hz", menu_bandwidth_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, BANDWIDTH_10, "10 Hz", menu_bandwidth_acb },
|
|
|
|
|
{ MT_CANCEL, 255, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
@ -1072,8 +1150,8 @@ const menuitem_t menu_display[] = {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_sweep_points[] = {
|
|
|
|
|
{ MT_CALLBACK, POINTS_SET_51, " 51 pt", menu_points_cb },
|
|
|
|
|
{ MT_CALLBACK, POINTS_SET_101, "101 pt", menu_points_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, POINTS_SET_51, " 51 pt", menu_points_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, POINTS_SET_101, "101 pt", menu_points_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
@ -1084,18 +1162,18 @@ const menuitem_t menu_stimulus[] = {
|
|
|
|
|
{ MT_CALLBACK, KM_CENTER, "CENTER", menu_keyboard_cb },
|
|
|
|
|
{ MT_CALLBACK, KM_SPAN, "SPAN", menu_keyboard_cb },
|
|
|
|
|
{ MT_CALLBACK, KM_CW, "CW FREQ", menu_keyboard_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "PAUSE\nSWEEP", menu_pause_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "PAUSE\nSWEEP", menu_pause_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_marker_sel[] = {
|
|
|
|
|
{ MT_CALLBACK, 1, "MARKER 1", menu_marker_sel_cb },
|
|
|
|
|
{ MT_CALLBACK, 2, "MARKER 2", menu_marker_sel_cb },
|
|
|
|
|
{ MT_CALLBACK, 3, "MARKER 3", menu_marker_sel_cb },
|
|
|
|
|
{ MT_CALLBACK, 4, "MARKER 4", menu_marker_sel_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "ALL OFF", menu_marker_sel_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "DELTA", menu_marker_sel_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 1, "MARKER 1", menu_marker_sel_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 2, "MARKER 2", menu_marker_sel_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 3, "MARKER 3", menu_marker_sel_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 4, "MARKER 4", menu_marker_sel_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "ALL OFF", menu_marker_sel_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "DELTA", menu_marker_sel_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
@ -1116,17 +1194,17 @@ const menuitem_t menu_marker_search[] = {
|
|
|
|
|
{ MT_CALLBACK, 0, "MINIMUM", menu_marker_search_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "SEARCH\n" S_LARROW" LEFT", menu_marker_search_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "SEARCH\n" S_RARROW" RIGHT", menu_marker_search_cb },
|
|
|
|
|
{ MT_CALLBACK, 0, "TRACKING", menu_marker_search_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, 0, "TRACKING", menu_marker_tracking_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const menuitem_t menu_marker_smith[] = {
|
|
|
|
|
{ MT_CALLBACK, MS_LIN, "LIN", menu_marker_smith_cb },
|
|
|
|
|
{ MT_CALLBACK, MS_LOG, "LOG", menu_marker_smith_cb },
|
|
|
|
|
{ MT_CALLBACK, MS_REIM,"Re+Im", menu_marker_smith_cb },
|
|
|
|
|
{ MT_CALLBACK, MS_RX, "R+jX", menu_marker_smith_cb },
|
|
|
|
|
{ MT_CALLBACK, MS_RLC, "R+L/C", menu_marker_smith_cb },
|
|
|
|
|
{ MT_ADV_CALLBACK, MS_LIN, "LIN", menu_marker_smith_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, MS_LOG, "LOG", menu_marker_smith_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, MS_REIM,"Re+Im", menu_marker_smith_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, MS_RX, "R+jX", menu_marker_smith_acb },
|
|
|
|
|
{ MT_ADV_CALLBACK, MS_RLC, "R+L/C", menu_marker_smith_acb },
|
|
|
|
|
{ MT_CANCEL, 0, S_LARROW" BACK", NULL },
|
|
|
|
|
{ MT_NONE, 0, NULL, NULL } // sentinel
|
|
|
|
|
};
|
|
|
|
|
@ -1255,12 +1333,14 @@ menu_invoke(int item)
|
|
|
|
|
|
|
|
|
|
case MT_CALLBACK: {
|
|
|
|
|
menuaction_cb_t cb = (menuaction_cb_t)menu->reference;
|
|
|
|
|
if (cb == NULL)
|
|
|
|
|
return;
|
|
|
|
|
(*cb)(item, menu->data);
|
|
|
|
|
if (cb) (*cb)(item, menu->data);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case MT_ADV_CALLBACK: {
|
|
|
|
|
menuaction_acb_t cb = (menuaction_acb_t)menu->reference;
|
|
|
|
|
if (cb) (*cb)(item, menu->data, NULL);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case MT_SUBMENU:
|
|
|
|
|
menu_push_submenu((const menuitem_t*)menu->reference);
|
|
|
|
|
break;
|
|
|
|
|
@ -1363,30 +1443,18 @@ static const keypads_list keypads_mode_tbl[KM_NONE] = {
|
|
|
|
|
{keypads_time , "DELAY" } // scale of delay
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define BUTTON_FLAG_NONE 0
|
|
|
|
|
#define BUTTON_FLAG_CHECK 1
|
|
|
|
|
#define BUTTON_FLAG_GROUP 2
|
|
|
|
|
#define BUTTON_FLAG_CHECKED 4
|
|
|
|
|
|
|
|
|
|
typedef struct Button{
|
|
|
|
|
uint16_t bg;
|
|
|
|
|
uint16_t fg;
|
|
|
|
|
uint16_t border_color;
|
|
|
|
|
uint8_t border;
|
|
|
|
|
uint8_t flag;
|
|
|
|
|
} button_t;
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
draw_button(uint16_t x, uint16_t y, uint16_t w, uint16_t h, button_t *b)
|
|
|
|
|
{
|
|
|
|
|
// background
|
|
|
|
|
uint16_t bw = b->border;
|
|
|
|
|
uint16_t bc = b->border_color;
|
|
|
|
|
uint16_t bcr = RGB565(255,255,255);//b->border_color;
|
|
|
|
|
uint16_t bcd = RGB565(196,196,196);//b->border_color;
|
|
|
|
|
ili9341_fill(x + bw, y + bw, w - (bw * 2), h - (bw * 2), b->bg);
|
|
|
|
|
ili9341_fill(x, y, w, bw, bc); // top
|
|
|
|
|
ili9341_fill(x + w - bw, y, bw, h, bc); // right
|
|
|
|
|
ili9341_fill(x, y, bw, h, bc); // left
|
|
|
|
|
ili9341_fill(x, y + h - bw, w, bw, bc); // bottom
|
|
|
|
|
ili9341_fill(x, y, w, bw, bcr); // top
|
|
|
|
|
ili9341_fill(x + w - bw, y, bw, h, bcr); // right
|
|
|
|
|
ili9341_fill(x, y, bw, h, bcd); // left
|
|
|
|
|
ili9341_fill(x, y + h - bw, w, bw, bcd); // bottom
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
@ -1399,7 +1467,7 @@ draw_keypad(void)
|
|
|
|
|
button.border_color = DEFAULT_GRID_COLOR;
|
|
|
|
|
while (keypads[i].c != KP_NONE) {
|
|
|
|
|
|
|
|
|
|
button.bg = config.menu_normal_color;
|
|
|
|
|
button.bg = RGB565(230,230,230);//config.menu_normal_color;
|
|
|
|
|
button.border_color = DEFAULT_GRID_COLOR;
|
|
|
|
|
if (i == selection)
|
|
|
|
|
button.bg = config.menu_active_color;
|
|
|
|
|
@ -1475,6 +1543,7 @@ menu_is_multiline(const char *label)
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
static void
|
|
|
|
|
menu_item_modify_attribute(const menuitem_t *menu, int item, button_t *b)
|
|
|
|
|
{
|
|
|
|
|
@ -1528,11 +1597,12 @@ menu_item_modify_attribute(const menuitem_t *menu, int item, button_t *b)
|
|
|
|
|
|| (item == 2 && (domain_mode & TD_WINDOW) == TD_WINDOW_MAXIMUM)
|
|
|
|
|
) swap = true;
|
|
|
|
|
}
|
|
|
|
|
if (swap) b->flag|=BUTTON_FLAG_CHECK|BUTTON_FLAG_CHECKED;
|
|
|
|
|
if (swap) b->icon = BUTTON_ICON_CHECK;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define CHECK_BOX_WIDTH 16
|
|
|
|
|
#define CHECK_BOX_HEIGHT 11
|
|
|
|
|
#define ICON_WIDTH 16
|
|
|
|
|
#define ICON_HEIGHT 11
|
|
|
|
|
static const uint16_t check_box[] = {
|
|
|
|
|
0b0011111111110000,
|
|
|
|
|
0b0010000000010000,
|
|
|
|
|
@ -1556,7 +1626,31 @@ static const uint16_t check_box[] = {
|
|
|
|
|
0b0010011100010000,
|
|
|
|
|
0b0010001000010000,
|
|
|
|
|
0b0010000000010000,
|
|
|
|
|
0b0011111111110000
|
|
|
|
|
0b0011111111110000,
|
|
|
|
|
|
|
|
|
|
0b0000000000000000,
|
|
|
|
|
0b0000001111000000,
|
|
|
|
|
0b0000010000100000,
|
|
|
|
|
0b0000100000010000,
|
|
|
|
|
0b0001000000001000,
|
|
|
|
|
0b0001000000001000,
|
|
|
|
|
0b0001000000001000,
|
|
|
|
|
0b0001000000001000,
|
|
|
|
|
0b0000100000010000,
|
|
|
|
|
0b0000010000100000,
|
|
|
|
|
0b0000001111000000,
|
|
|
|
|
|
|
|
|
|
0b0000000000000000,
|
|
|
|
|
0b0000001111000000,
|
|
|
|
|
0b0000010000100000,
|
|
|
|
|
0b0000100000010000,
|
|
|
|
|
0b0001000110001000,
|
|
|
|
|
0b0001001111001000,
|
|
|
|
|
0b0001001111001000,
|
|
|
|
|
0b0001000110001000,
|
|
|
|
|
0b0000100000010000,
|
|
|
|
|
0b0000010000100000,
|
|
|
|
|
0b0000001111000000,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
@ -1570,16 +1664,20 @@ draw_menu_buttons(const menuitem_t *menu)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
button_t button;
|
|
|
|
|
button.bg = config.menu_normal_color;
|
|
|
|
|
button.bg = RGB565(230,230,230);//config.menu_normal_color;
|
|
|
|
|
button.fg = DEFAULT_MENU_TEXT_COLOR;
|
|
|
|
|
button.border_color = DEFAULT_GRID_COLOR;
|
|
|
|
|
button.flag = BUTTON_FLAG_NONE;
|
|
|
|
|
button.icon = BUTTON_ICON_NONE;
|
|
|
|
|
button.border = MENU_BUTTON_BORDER;
|
|
|
|
|
// focus only in MENU mode but not in KEYPAD mode
|
|
|
|
|
if (ui_mode == UI_MENU && i == selection)
|
|
|
|
|
button.bg = config.menu_active_color;
|
|
|
|
|
|
|
|
|
|
menu_item_modify_attribute(menu, i, &button);
|
|
|
|
|
// menu_item_modify_attribute(menu, i, &button);
|
|
|
|
|
if (menu[i].type == MT_ADV_CALLBACK){
|
|
|
|
|
menuaction_acb_t cb = (menuaction_acb_t)menu[i].reference;
|
|
|
|
|
if (cb) (*cb)(i, menu[i].data, &button);
|
|
|
|
|
}
|
|
|
|
|
ili9341_set_foreground(button.fg);
|
|
|
|
|
ili9341_set_background(button.bg);
|
|
|
|
|
|
|
|
|
|
@ -1587,9 +1685,9 @@ draw_menu_buttons(const menuitem_t *menu)
|
|
|
|
|
|
|
|
|
|
int lines = menu_is_multiline(menu[i].label);
|
|
|
|
|
uint16_t text_offs = LCD_WIDTH-MENU_BUTTON_WIDTH+MENU_BUTTON_BORDER + 5;
|
|
|
|
|
if (button.flag&BUTTON_FLAG_CHECKED){
|
|
|
|
|
blit16BitWidthBitmap(LCD_WIDTH-MENU_BUTTON_WIDTH+MENU_BUTTON_BORDER + 4, y+(MENU_BUTTON_HEIGHT-CHECK_BOX_HEIGHT)/2, CHECK_BOX_WIDTH, CHECK_BOX_HEIGHT, &check_box[1*CHECK_BOX_HEIGHT]);
|
|
|
|
|
text_offs=LCD_WIDTH-MENU_BUTTON_WIDTH+MENU_BUTTON_BORDER+4+CHECK_BOX_WIDTH;
|
|
|
|
|
if (button.icon >=0){
|
|
|
|
|
blit16BitWidthBitmap(LCD_WIDTH-MENU_BUTTON_WIDTH+MENU_BUTTON_BORDER + 1, y+(MENU_BUTTON_HEIGHT-ICON_HEIGHT)/2, ICON_WIDTH, ICON_HEIGHT, &check_box[button.icon*ICON_HEIGHT]);
|
|
|
|
|
text_offs=LCD_WIDTH-MENU_BUTTON_WIDTH+MENU_BUTTON_BORDER+1+ICON_WIDTH;
|
|
|
|
|
}
|
|
|
|
|
ili9341_drawstring(menu[i].label, text_offs, y+(MENU_BUTTON_HEIGHT-lines*FONT_GET_HEIGHT)/2);
|
|
|
|
|
}
|
|
|
|
|
|