From 27c33a2f42363b28f3ec7e5179fcba51cf3c3e7b Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Mon, 28 Jan 2013 12:33:02 -0500 Subject: added vxi remote/local functionality --- menus.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'menus.c') diff --git a/menus.c b/menus.c index 105b78d..0602a34 100644 --- a/menus.c +++ b/menus.c @@ -213,8 +213,7 @@ static void Nonstd_menu_network(void); static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower_encoder_val); -#define GPIB_REMOTE_AND_UNLOCKED (globals.Remote.gpib_remote && !globals.Remote.gpib_lock) -#define GPIB_REMOTE_AND_LOCKED (globals.Remote.gpib_remote && globals.Remote.gpib_lock) +#define VXI_OR_GPIB_LOCK_ACTIVE ((globals.Remote.gpib_remote && globals.Remote.gpib_lock) || globals.Remote.vxi_panel_lock) static void update_remote_mode () @@ -882,7 +881,7 @@ void Show_Main_Menu(void) GString *raw_str = g_string_new (""); - if (!GPIB_REMOTE_AND_LOCKED) { + if (!VXI_OR_GPIB_LOCK_ACTIVE) { raw_str = g_string_append (raw_str, "LOCAL+"); } @@ -1472,7 +1471,7 @@ static void Submenu_Display(int change_selection) case Submenu1_rem_loc: - if (GPIB_REMOTE_AND_UNLOCKED) { + 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; @@ -2201,7 +2200,7 @@ static void Submenu_Service_Encoder(int encoder_change) /* quit if RWLS mode */ update_remote_mode (); - if (GPIB_REMOTE_AND_LOCKED) { + if (VXI_OR_GPIB_LOCK_ACTIVE) { return; } @@ -2830,7 +2829,7 @@ void Menu_Check_Buttons(void) update_remote_mode(); if (!(button_port_val & Change_Button)) { /* ----- CHANGE BUTTON --------- */ - if (GPIB_REMOTE_AND_LOCKED) { + if (VXI_OR_GPIB_LOCK_ACTIVE) { // front panel is locked out Show_Main_Menu(); } else { @@ -2855,28 +2854,28 @@ void Menu_Check_Buttons(void) Submenu_Move_Pointer(); } } else if (!(button_port_val & Mult10_Button)) { /* ----- X10 BUTTON ------------ */ - if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !GPIB_REMOTE_AND_LOCKED) { + if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !VXI_OR_GPIB_LOCK_ACTIVE) { if (globals.MenuStatus.Error_Screen==YES) { Submenu_Display(NO); } queue_error_and_display_on_LCD(Submenu_Mult_Value(10.0)); } } else if (!(button_port_val & Div10_Button)) { /* ----- /10 BUTTON ------------ */ - if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !GPIB_REMOTE_AND_LOCKED) { + if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !VXI_OR_GPIB_LOCK_ACTIVE) { if (globals.MenuStatus.Error_Screen==YES) { Submenu_Display(NO); } queue_error_and_display_on_LCD(Submenu_Mult_Value(0.1)); } } else if (!(button_port_val & Plus_Minus_Button)) { /* ----- +/- BUTTON ------------ */ - if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !GPIB_REMOTE_AND_LOCKED) { + if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !VXI_OR_GPIB_LOCK_ACTIVE) { if (globals.MenuStatus.Error_Screen==YES) { Submenu_Display(NO); } queue_error_and_display_on_LCD(Submenu_Mult_Value(-1.0)); } } else if (!(button_port_val & Extra_Fine_Button)) { /* ----- EXTRA FINE BUTTON ----- */ - if (globals.MenuStatus.Type_Of_Menu==Submenu_On && globals.MenuStatus.Nonstd_Display==NO && globals.MenuStatus.Error_Screen==NO && !GPIB_REMOTE_AND_LOCKED) { + if (globals.MenuStatus.Type_Of_Menu==Submenu_On && globals.MenuStatus.Nonstd_Display==NO && globals.MenuStatus.Error_Screen==NO && !VXI_OR_GPIB_LOCK_ACTIVE) { if (Submenu_extra_fine==YES) { g_usleep (250e3); Submenu_extra_fine=NO; -- cgit