summaryrefslogtreecommitdiff
path: root/menus.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:29:12 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:29:12 -0500
commitd4e6f5a091c4c8aee14abf48a099b7a579d73f07 (patch)
tree15dca6165bb378599d4ef69697d2f0bb91968e33 /menus.c
parent35a83c19cb1052b363ca24950d296185a799cd2e (diff)
fixed remote mode reporting on main menu
Diffstat (limited to 'menus.c')
-rw-r--r--menus.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/menus.c b/menus.c
index 01970d6..109a9bf 100644
--- a/menus.c
+++ b/menus.c
@@ -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);