diff options
Diffstat (limited to 'menus.c')
-rw-r--r-- | menus.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -215,10 +215,8 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower #define RM_NOT_LOCK 0 #define RM_NOT_REM 0 -#define RM_NOT_TERM 0 #define RM_LOCK 1 #define RM_REM 2 -#define RM_TERM 4 #define GPIB_REMOTE_AND_UNLOCKED ((globals.Remote.mode & RM_REM) && !(globals.Remote.mode & RM_LOCK)) #define GPIB_REMOTE_AND_LOCKED ((globals.Remote.mode & RM_REM) && (globals.Remote.mode & RM_LOCK)) @@ -236,10 +234,6 @@ static void update_remote_mode () if (gpib_remote) { globals.Remote.mode += RM_REM; } - if (globals.Remote.terminal_connections > 0) { - globals.Remote.mode += RM_TERM; - } - } @@ -910,15 +904,19 @@ void Show_Main_Menu(void) raw_str = g_string_append (raw_str, "GPIB+"); } - if (globals.Remote.mode & RM_TERM) { + if (globals.Remote.terminal_connections > 0) { g_string_append_printf (raw_str, "%dTER", globals.Remote.terminal_connections); } + if (globals.Remote.vxi_connections > 0) { + g_string_append_printf (raw_str, "%dVXI", globals.Remote.vxi_connections); + } + gchar *step1 = g_strdup (raw_str->str); g_string_free (raw_str, TRUE); // remove semicolon at end - gchar *step2 = conditional_regex_replace (TRUE, step1, "+$", ""); + gchar *step2 = conditional_regex_replace (TRUE, step1, "\\+$", ""); g_free (step1); // shorten as required @@ -933,9 +931,13 @@ void Show_Main_Menu(void) gchar *step5 = conditional_regex_replace (strlen(step4) > LCD_col_width, step4, "GPIB", "GP"); g_free (step4); + // shorten as required + gchar *step6 = conditional_regex_replace (strlen(step5) > LCD_col_width, step5, "VXI", "V"); + g_free (step5); + // finish - gchar *ctrl_str = g_strdup (step5); - g_free (step5); + gchar *ctrl_str = g_strdup (step6); + g_free (step6); if (Menu_Is_Item_Visible(LCD_entry)) { LCD_write_padded_spaces(LCD_row,LCD_col,ctrl_str,LCD_col_width); |