diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-15 08:21:51 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-15 08:21:51 -0400 |
commit | 9241a81f454f8ad98207b7b88c5c0b9ec8852987 (patch) | |
tree | cd781dfcdf311b3392f4d79424b0450a4c0c12d0 /menus.c | |
parent | 68791fff3f9dce335821b87f5404803e488de85d (diff) |
simplified the menu updating scheme
Diffstat (limited to 'menus.c')
-rw-r--r-- | menus.c | 137 |
1 files changed, 29 insertions, 108 deletions
@@ -216,13 +216,6 @@ static void Nonstd_menu_network(void); static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower_encoder_val); -void Menu_Refresh() -{ - globals.Changes.update_whole_main_menu = YES; - Show_Main_Menu(); -} - - static int Menu_Is_Item_Visible(int LCD_entry) { return ((LCD_entry/LCD_max_entries_per_page)==(menu_cursor_pos/LCD_max_entries_per_page)); @@ -254,7 +247,6 @@ void Show_Main_Menu(void) (globals.MenuStatus.Error_Screen == YES) || (globals.MenuStatus.Nonstd_Display == YES) ) { LCD_clear(); - globals.Changes.update_whole_main_menu = TRUE; } LCD_entry=-1; @@ -308,9 +300,6 @@ void Show_Main_Menu(void) for (chan=0; chan<(globals.Flash.ChanKey_frequency?globals.Flash.channels:1); ++chan) { if (globals.ChannelState[chan].func_mode!=amp_mode_on) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_freq+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_freq+chan; /* keep track of what is displayed */ LCD_row=LCD_entry % LCD_rows; /* find next available row */ LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; /* find next available column */ @@ -338,7 +327,7 @@ void Show_Main_Menu(void) strcat(a_string,":"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_freq) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1); } } @@ -347,9 +336,6 @@ void Show_Main_Menu(void) for (chan=0; chan<(globals.Flash.ChanKey_func_mode?globals.Flash.channels:1); ++chan) { if (globals.Flash.is_func_gen[chan]) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_func+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_func+chan; /* keep track of what is displayed */ LCD_row=LCD_entry % LCD_rows; /* find next available row */ LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; /* find next available column */ @@ -373,7 +359,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_func) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1); } } @@ -386,9 +372,6 @@ void Show_Main_Menu(void) || (globals.ChannelState[chan].func_mode==dc_mode_on)) ) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_delay+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_delay+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -404,7 +387,7 @@ void Show_Main_Menu(void) } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_delay) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_delay+chan,sig_dig-globals.Flash.ChanKey_delay,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_delay+chan,sig_dig-globals.Flash.ChanKey_delay,LCD_col_width-1); } @@ -418,9 +401,6 @@ void Show_Main_Menu(void) ) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_pw+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_pw+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -462,7 +442,7 @@ void Show_Main_Menu(void) } strcat(a_string,": DC"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_pw) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_pw,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_pw,LCD_col_width-1); } } @@ -477,9 +457,6 @@ void Show_Main_Menu(void) ) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_rise_time+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_rise_time+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -491,7 +468,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_rise_time) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_rise_time,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_rise_time,LCD_col_width-1); } } @@ -501,9 +478,6 @@ void Show_Main_Menu(void) for (chan=0; chan<(globals.Flash.ChanKey_amplitude?globals.Flash.channels:1); ++chan) { if ((globals.Flash.voltage_enabled[chan] || globals.Flash.current_enabled[chan]) ) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_amp+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_amp+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -533,7 +507,7 @@ void Show_Main_Menu(void) } strcat(a_string,":AMPLFY"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_amp) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_amplitude,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_amplitude,LCD_col_width-1); } } @@ -543,9 +517,6 @@ void Show_Main_Menu(void) if (globals.Flash.enable_avrq_extra_ampls) { for (chan=2; chan<5; ++chan) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_avrq+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_avrq+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -555,7 +526,7 @@ void Show_Main_Menu(void) sprintf(b_string, "%d", chan+1); strcat(a_string,b_string); strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_amp) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-1,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-1,LCD_col_width-1); } } @@ -565,9 +536,6 @@ void Show_Main_Menu(void) if (globals.Flash.soft_current_limit_enabled[chan]) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_soft_current_limit+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_soft_current_limit+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -579,7 +547,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_soft_current_limit) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_current_limit,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_current_limit,LCD_col_width-1); } } @@ -591,9 +559,6 @@ void Show_Main_Menu(void) if ( globals.Flash.curr_slew[chan] ) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_slew+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_slew+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -605,7 +570,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_slew) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_slew,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_slew,LCD_col_width-1); } } @@ -616,9 +581,6 @@ void Show_Main_Menu(void) if (globals.Flash.max_burst_count[chan]>1) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_burst_count+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_burst_count+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -630,7 +592,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_burst_count) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1); } } @@ -642,9 +604,6 @@ void Show_Main_Menu(void) if ((globals.Flash.max_burst_count[chan]>1) && !globals.Flash.burst_func[chan]) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_burst_time+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_burst_time+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -656,7 +615,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_burst_time) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_Burst_Time,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_Burst_Time,LCD_col_width-1); } } @@ -668,9 +627,6 @@ void Show_Main_Menu(void) if ((globals.Flash.voltage_offset_enabled[chan] || globals.Flash.current_offset_enabled[chan]) && (globals.ChannelState[chan].amp_mode!=amp_mode_amplify)) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_offset+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_offset+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -693,7 +649,7 @@ void Show_Main_Menu(void) } strcat(a_string,":EXT"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_os) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_offset,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_offset,LCD_col_width-1); } } @@ -724,9 +680,6 @@ void Show_Main_Menu(void) for (chan=0; chan<(globals.Flash.ChanKey_zout?globals.Flash.channels:1); ++chan) { if (globals.Flash.switchable_zout[chan] && !globals.Flash.volt_ctrl_pw[chan]) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_zout+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_zout+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -748,7 +701,7 @@ void Show_Main_Menu(void) } g_free (temp); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_zout) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_zout,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_zout,LCD_col_width-1); } } @@ -757,9 +710,6 @@ void Show_Main_Menu(void) for (chan=0; chan<(globals.Flash.ChanKey_load_type?globals.Flash.channels:1); ++chan) { if (globals.Flash.switchable_load[chan]) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_loadtype+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_loadtype+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -771,7 +721,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_load) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_load_type,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_load_type,LCD_col_width-1); } } @@ -781,9 +731,6 @@ void Show_Main_Menu(void) if (globals.Flash.on_off_used) for (chan=0; chan<(globals.Flash.ChanKey_output_state?globals.Flash.channels:1); ++chan) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_output_state+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_output_state+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -802,7 +749,7 @@ void Show_Main_Menu(void) strcat(a_string,"OFF"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_output) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_output_state,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_output_state,LCD_col_width-1); } /*----- display primary routing, as appropriate -----*/ @@ -811,9 +758,6 @@ void Show_Main_Menu(void) if (globals.Flash.routing_required[chan] > 0) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_route_primary+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_route_primary+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -831,7 +775,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_routes) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1); } } @@ -842,9 +786,6 @@ void Show_Main_Menu(void) if (globals.Flash.routing_required[chan] == 2) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_route_secondary+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_route_secondary+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -858,7 +799,7 @@ void Show_Main_Menu(void) strcat(a_string,b_string); } strcat(a_string,":"); - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_routes) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1); } } @@ -868,9 +809,6 @@ void Show_Main_Menu(void) for (chan=0; chan<(globals.Flash.ChanKey_polarity?globals.Flash.channels:1); ++chan) { if (globals.Flash.invert_allowed[chan]) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_invert+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_invert+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -888,7 +826,7 @@ void Show_Main_Menu(void) strcat(a_string,"YES"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_inv) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_polarity,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_polarity,LCD_col_width-1); } } @@ -897,9 +835,6 @@ void Show_Main_Menu(void) if (globals.Flash.logic_level_enabled) { for (chan=0; chan<(globals.Flash.ChanKey_logic_level?globals.Flash.channels:1); ++chan) { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_logic_level+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_logic_level+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -916,7 +851,7 @@ void Show_Main_Menu(void) strcat(a_string,"ECL"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_logic_level) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_logic_level,LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_logic_level,LCD_col_width-1); } } @@ -927,9 +862,6 @@ void Show_Main_Menu(void) if (!globals.Flash.is_func_gen[chan]) { { ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_gate+chan) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_gate+chan; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -951,16 +883,13 @@ void Show_Main_Menu(void) strcat(a_string,"ASY,HI"); } - Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_gate) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number, sig_dig-(globals.Flash.ChanKey_gate_level | globals.Flash.ChanKey_gate_type),LCD_col_width-1); + Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number, sig_dig-(globals.Flash.ChanKey_gate_level | globals.Flash.ChanKey_gate_type),LCD_col_width-1); } } /*----- display remote/local, always -----*/ ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_rem_loc) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_rem_loc; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; @@ -996,7 +925,7 @@ void Show_Main_Menu(void) } printf ("control mode: %s\n", ctrl_str); // FIXME - delete - if (globals.Changes.update_whole_main_menu && Menu_Is_Item_Visible(LCD_entry)) { + if (Menu_Is_Item_Visible(LCD_entry)) { LCD_write_padded_spaces(LCD_row,LCD_col,ctrl_str,LCD_col_width); } @@ -1005,14 +934,11 @@ void Show_Main_Menu(void) /*----- display memory, always -----*/ ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_memory) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_memory; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; - if (globals.Changes.update_whole_main_menu && Menu_Is_Item_Visible(LCD_entry)) { + if (Menu_Is_Item_Visible(LCD_entry)) { LCD_write_padded_spaces(LCD_row,LCD_col,"Memory menu",LCD_col_width); } @@ -1020,14 +946,11 @@ void Show_Main_Menu(void) /*----- display setup, always -----*/ ++LCD_entry; - if (Main_Menu_Structure[LCD_entry]!=Submenu1_setup) { - globals.Changes.update_whole_main_menu=YES; - } Main_Menu_Structure[LCD_entry]=Submenu1_setup; LCD_row=LCD_entry % LCD_rows; LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1; - if (globals.Changes.update_whole_main_menu && Menu_Is_Item_Visible(LCD_entry)) { + if (Menu_Is_Item_Visible(LCD_entry)) { LCD_write_padded_spaces(LCD_row,LCD_col,"Setup menu",LCD_col_width); } @@ -1058,8 +981,6 @@ void Show_Main_Menu(void) LCD_col=(i / LCD_rows) * LCD_col_width + 1; LCD_write_padded_spaces(LCD_row,LCD_col,"",LCD_col_width); } - - globals.Changes.update_whole_main_menu=NO; } @@ -1112,7 +1033,7 @@ static void Menu_Move_Pointer(int move_amount) new_page=menu_cursor_pos / LCD_max_entries_per_page; if (new_page!=old_page) { - Menu_Refresh(); + Show_Main_Menu(); } } @@ -1120,6 +1041,11 @@ static void Menu_Move_Pointer(int move_amount) static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,char *start_string,int Show_What, int significant_digits, int width_of_column) { + + if (!Is_Item_Visible) { + return; + } + gchar *units = NULL; int channel; @@ -1270,10 +1196,6 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch strcpy(LCD_string,start_string); } - if (Is_Item_Visible) { - LCD_write_padded_spaces(LCD_row, LCD_col, LCD_string, width_of_column); - } - g_free (units); } @@ -3327,7 +3249,6 @@ static int Submenu_Implement_Changes(void) Main_update_shift_registers(); /* update values in pulse generator circuit */ if (call_new_submenu==NO) { - globals.Changes.update_whole_main_menu=YES; Show_Main_Menu(); } |