summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2013-01-28 12:33:02 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2013-01-28 12:33:02 -0500
commit27c33a2f42363b28f3ec7e5179fcba51cf3c3e7b (patch)
tree014ceb593a4f716a56c7f0f9f7c007f9680c5269
parent5153f39a6bbeee5b5c4ba01f95e9c91834f1d4f7 (diff)
added vxi remote/local functionality
-rw-r--r--globals.h1
-rw-r--r--menus.c19
-rw-r--r--vxi11_server.c2
3 files changed, 12 insertions, 10 deletions
diff --git a/globals.h b/globals.h
index 6840edb..135b915 100644
--- a/globals.h
+++ b/globals.h
@@ -783,6 +783,7 @@ typedef struct {
int vxi_service_request;
int gpib_remote;
int gpib_lock;
+ int vxi_panel_lock;
} RemoteStruct;
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;
diff --git a/vxi11_server.c b/vxi11_server.c
index f5204e5..08e0d94 100644
--- a/vxi11_server.c
+++ b/vxi11_server.c
@@ -375,6 +375,7 @@ device_remote_1_svc(Device_GenericParms *argp, struct svc_req *rqstp) {
else {
touchlink(argp->lid);
result.error = 0;
+ globals.Remote.vxi_panel_lock = 1;
}
}
return &result;
@@ -396,6 +397,7 @@ device_local_1_svc(Device_GenericParms *argp, struct svc_req *rqstp) {
else {
touchlink(argp->lid);
result.error = 0;
+ globals.Remote.vxi_panel_lock = 0;
}
}
return &result;