diff options
-rw-r--r-- | menus.c | 56 |
1 files changed, 28 insertions, 28 deletions
@@ -152,6 +152,8 @@ #define mode_load_exit 9500 #define mode_save_exit 9600 +#define mode_gpib_talklisten 9700 + #define Submenu_maximum_entries 10 /* what parameter to adjust */ @@ -1243,7 +1245,7 @@ static void Submenu_Display(int change_selection) globals.MenuStatus.Nonstd_Display=NO; Submenu_Numeric_Parameter=Show_No_Number; - Submenu_max_entry=0; + Submenu_max_entry=-1; channel=globals.MenuStatus.Selected_Submenu%100; @@ -1258,16 +1260,14 @@ static void Submenu_Display(int change_selection) title = g_strdup ("Trigger Menu"); } - if (globals.Flash.is_func_gen[channel]) { - Submenu_max_entry=0; - } else if (globals.Flash.ext2_enabled[channel]) { + if (globals.Flash.ext2_enabled[channel]) { Submenu_max_entry=4; Submenu_Structure[0]=mode_freq_int; Submenu_Structure[1]=mode_freq_ext; Submenu_Structure[2]=mode_freq_ext2; Submenu_Structure[3]=mode_freq_man; Submenu_Structure[4]=mode_freq_hold; - } else { + } else if (!globals.Flash.is_func_gen[channel]) { Submenu_max_entry=3; Submenu_Structure[0]=mode_freq_int; Submenu_Structure[1]=mode_freq_ext; @@ -1302,8 +1302,6 @@ static void Submenu_Display(int change_selection) Submenu_max_entry=1; Submenu_Structure[0]=mode_delay_norm; Submenu_Structure[1]=mode_delay_dbl; - } else { - Submenu_max_entry=0; } @@ -1364,14 +1362,14 @@ static void Submenu_Display(int change_selection) } if (globals.Flash.ea_enabled[channel]) { - ++Submenu_max_entry; + Submenu_max_entry=1; Submenu_Structure[0]=mode_amp_normal; - Submenu_Structure[Submenu_max_entry]=mode_amp_ea; + Submenu_Structure[1]=mode_amp_ea; } if (globals.Flash.ext_amplify_enabled[channel]) { - ++Submenu_max_entry; + Submenu_max_entry=1; Submenu_Structure[0]=mode_amp_normal; - Submenu_Structure[Submenu_max_entry]=mode_amp_amplify; + Submenu_Structure[1]=mode_amp_amplify; } if (globals.Flash.ignore_ampl_polarity[channel]) { @@ -1382,13 +1380,11 @@ static void Submenu_Display(int change_selection) case Submenu1_burst_count: title = title_with_channel("Pulses per burst",globals.Flash.ChanKey_Burst_Count,channel); Submenu_Numeric_Parameter=Show_Burst_Count+channel; - Submenu_max_entry=0; break; case Submenu1_burst_time: title = title_with_channel("Burst Spacing",globals.Flash.ChanKey_Burst_Time,channel); Submenu_Numeric_Parameter=Show_Burst_Time+channel; - Submenu_max_entry=0; break; case Submenu1_rise_time: @@ -1400,20 +1396,17 @@ static void Submenu_Display(int change_selection) Submenu_Structure[1]=mode_rise_time_max; } else { Submenu_Numeric_Parameter=Show_rise_time+channel; - Submenu_max_entry=0; } break; case Submenu1_slew: title = title_with_channel("Slew Rate",globals.Flash.ChanKey_slew,channel); Submenu_Numeric_Parameter=Show_slew+channel; - Submenu_max_entry=0; break; case Submenu1_soft_current_limit: title = title_with_channel("Current Limit",globals.Flash.ChanKey_current_limit,channel); Submenu_Numeric_Parameter=Show_soft_current_limit+channel; - Submenu_max_entry=0; break; case Submenu1_zout: @@ -1426,7 +1419,6 @@ static void Submenu_Display(int change_selection) case Submenu1_loadtype: title = title_with_channel("Load Impedance",globals.Flash.ChanKey_load_type,channel); Submenu_Numeric_Parameter=Show_load_type+channel; - Submenu_max_entry=0; break; case Submenu1_offset: @@ -1440,14 +1432,11 @@ static void Submenu_Display(int change_selection) Submenu_max_entry=1; Submenu_Structure[0]=mode_os_normal; Submenu_Structure[1]=mode_os_eo; - } else { - Submenu_max_entry=0; } break; case Submenu1_mon: - Submenu_max_entry=0; title = title_with_channel("Monitor",globals.Flash.ChanKey_Curr_Mon_value,channel); if (globals.ChannelState[channel].pw<globals.Flash.mon_pw_threshold[channel]) { LCD_write(2,2,"*PW too narrow for accurate reading."); @@ -1498,14 +1487,14 @@ static void Submenu_Display(int change_selection) case Submenu1_rem_loc: + title = g_strdup ("GPIB Remote:"); + if (globals.Remote.gpib_remote && !VXI_OR_GPIB_LOCK_ACTIVE) { Submenu_max_entry=1; - title = g_strdup ("GPIB Remote:"); Submenu_Structure[0]=mode_go_to_local; Submenu_Structure[1]=mode_exit_normal_submenu; } else { Submenu_max_entry=0; - title = g_strdup ("GPIB interface already in local mode."); Submenu_Structure[0]=mode_exit_normal_submenu; } break; @@ -1594,6 +1583,9 @@ static void Submenu_Display(int change_selection) case Submenu2_gpib_address: title = g_strdup ("GPIB Address:"); Submenu_Numeric_Parameter=Show_gpib_address+channel; + + Submenu_max_entry=0; + Submenu_Structure[0]=mode_gpib_talklisten; break; case Submenu1_route_primary: @@ -1610,14 +1602,12 @@ static void Submenu_Display(int change_selection) Submenu_Structure[1]=mode_route2; } else { Submenu_Numeric_Parameter=Show_route_primary+channel; - Submenu_max_entry=0; } break; case Submenu1_route_secondary: title = g_strdup ("Cathode pin:"); Submenu_Numeric_Parameter=Show_route_secondary+channel; - Submenu_max_entry=0; break; @@ -1635,7 +1625,7 @@ static void Submenu_Display(int change_selection) Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width); LCD_write(3,0,Press_Change_Message); - if (Submenu_max_entry>0) { + if (Submenu_max_entry>=0) { GPtrArray *gparray = g_ptr_array_new (); @@ -1998,6 +1988,11 @@ static void Submenu_Display(int change_selection) } break; + case mode_gpib_talklisten: + mode_name = g_strdup("Talk/Listen"); + current_operating_mode=i; // always used + break; + case mode_route1: mode_name = g_strdup("1"); if (globals.ChannelState[channel].route_primary == 1) { @@ -2139,7 +2134,7 @@ static void Submenu_Display(int change_selection) static void Submenu_Move_Pointer(void) { - if (Submenu_max_entry>0) { + if (Submenu_max_entry>=0) { LCD_write(Submenu_Selected_Item-base_entry,25," "); ++Submenu_Selected_Item; @@ -2750,7 +2745,7 @@ static void Submenu_Service_Encoder(int encoder_change) break; case Show_gpib_address: - GPIB_change_address(new_int_value); + globals.Flash.gpib_address = new_int_value; // must press CHANGE to take effect, through "talklisten" mode choice, to avoid flash write delays error_num=OK; break; @@ -3020,7 +3015,7 @@ static int Submenu_Implement_Changes(void) /* this routine changes the pulse generator parameters, as chosen by the submenu settings */ - if (Submenu_max_entry==0) { + if (Submenu_max_entry==-1) { Show_Main_Menu(); return OK; } @@ -3300,6 +3295,11 @@ static int Submenu_Implement_Changes(void) } break; + case mode_gpib_talklisten: + // just one entry in this menu, so the address is only updated when CHANGE is pressed, not as encoder is turned + GPIB_change_address(globals.Flash.gpib_address); + break; + case mode_route1: if (error_num=Set_Route(channel,ROUTE_PRIMARY,1)) { return error_num; |