summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device-functions.c38
-rw-r--r--device-functions.h2
-rw-r--r--error_utils.c14
-rw-r--r--flash.c2
-rw-r--r--globals.h4
-rw-r--r--menus.c16
-rw-r--r--parser.c8
7 files changed, 42 insertions, 42 deletions
diff --git a/device-functions.c b/device-functions.c
index a13deb5..9f9c012 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -153,7 +153,7 @@ void Main_Rst (void)
globals.ChannelState[i].double_pulse = double_off;
globals.ChannelState[i].pw_ctrl_mode = pw_normal;
globals.ChannelState[i].func_mode = pulse_mode_on;
- globals.ChannelState[i].polarity = globals.Flash.invert_by_default[i];
+ globals.ChannelState[i].inverted = globals.Flash.invert_by_default[i];
globals.ChannelState[i].output_state = output_off;
globals.ChannelState[i].gate_type = gate_sync;
globals.ChannelState[i].trigger_source = source_internal;
@@ -180,7 +180,7 @@ void Main_Rst (void)
Set_Double(i,globals.ChannelState[i].double_pulse);
Set_Pwmode(i,globals.ChannelState[i].pw_ctrl_mode);
Set_Func(i,globals.ChannelState[i].func_mode);
- Set_Pol(i,globals.ChannelState[i].polarity);
+ Set_Inverted(i,globals.ChannelState[i].inverted);
Set_Gate_Sync(i,globals.ChannelState[i].gate_type);
Set_Gate_Level(i,globals.ChannelState[i].gate_level);
Set_EA(i,globals.ChannelState[i].amp_mode);
@@ -1001,17 +1001,17 @@ void Set_Mux(int channel)
{
int mux_out;
- if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].polarity==pol_norm) {
+ if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].inverted==pol_norm) {
mux_out=4;
- } else if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].polarity!=pol_norm) {
+ } else if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].inverted!=pol_norm) {
mux_out=5;
- } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].polarity==pol_norm) {
+ } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].inverted==pol_norm) {
mux_out=2;
- } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].polarity!=pol_norm) {
+ } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].inverted!=pol_norm) {
mux_out=3;
- } else if (globals.ChannelState[channel].polarity==pol_norm) {
+ } else if (globals.ChannelState[channel].inverted==pol_norm) {
mux_out=0;
- } else if (globals.ChannelState[channel].polarity!=pol_norm) {
+ } else if (globals.ChannelState[channel].inverted!=pol_norm) {
mux_out=1;
}
@@ -1086,12 +1086,12 @@ int Set_Func(int channel,int mode)
}
-int Set_Pol(int channel,int mode)
+int Set_Inverted(int channel,int mode)
{
int error_num, i;
/* abandon if high channel selected by user but not enabled by firmware */
- if (channel && !globals.Flash.ChanKey_polarity) {
+ if (channel && !globals.Flash.ChanKey_inverted) {
return InvalidChannel;
}
@@ -1099,12 +1099,12 @@ int Set_Pol(int channel,int mode)
for (i=0; i<max_channels; ++i) {
TestState[i]=globals.ChannelState[i];
}
- TestState[channel].polarity=mode;
+ TestState[channel].inverted=mode;
if ((error_num=Error_check(TestState))) {
return error_num;
}
- globals.ChannelState[channel].polarity=mode;
+ globals.ChannelState[channel].inverted=mode;
Set_Mux(channel);
Set_Update_Chans();
@@ -1621,8 +1621,8 @@ int Set_Update_Chans(void)
if (!globals.Flash.ChanKey_func_mode) for (i=1; i<num_of_chan; ++i) {
globals.ChannelState[i].func_mode=globals.ChannelState[0].func_mode;
}
- if (!globals.Flash.ChanKey_polarity) for (i=1; i<num_of_chan; ++i) {
- globals.ChannelState[i].polarity=globals.ChannelState[0].polarity;
+ if (!globals.Flash.ChanKey_inverted) for (i=1; i<num_of_chan; ++i) {
+ globals.ChannelState[i].inverted=globals.ChannelState[0].inverted;
}
if (!globals.Flash.ChanKey_output_state) for (i=1; i<num_of_chan; ++i) {
globals.ChannelState[i].output_state=globals.ChannelState[0].output_state;
@@ -2148,7 +2148,7 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
other_setting=0.4;
}
- Set_Pol(channel,pol_norm);
+ Set_Inverted(channel,pol_norm);
Set_Delay(0,0,0,channel,0.0);
status=Set_frequency(0,0,0,globals.Flash.ChanKey_frequency?channel:0,other_setting);
@@ -4309,7 +4309,7 @@ void Set_Rcl(int setting_num)
globals.ChannelState[i].hold_setting = (temp >> 1) & 1;
globals.ChannelState[i].double_pulse = (temp >> 2) & 1;
globals.ChannelState[i].pw_ctrl_mode = (temp >> 3) & 3;
- globals.ChannelState[i].polarity = (temp >> 5) & 1;
+ globals.ChannelState[i].inverted = (temp >> 5) & 1;
globals.ChannelState[i].output_state = (temp >> 6) & 1;
globals.ChannelState[i].gate_type = (temp >> 7) & 1;
globals.ChannelState[i].trigger_source = (temp >> 8) & 7;
@@ -4335,7 +4335,7 @@ void Set_Rcl(int setting_num)
Set_Pwmode(i,globals.ChannelState[i].pw_ctrl_mode);
Set_Func(i,globals.ChannelState[i].func_mode);
- Set_Pol(i,globals.ChannelState[i].polarity);
+ Set_Inverted(i,globals.ChannelState[i].inverted);
Set_Gate_Sync(i,globals.ChannelState[i].gate_type);
Set_Gate_Level(i,globals.ChannelState[i].gate_level);
Set_EA(i,globals.ChannelState[i].amp_mode);
@@ -4406,7 +4406,7 @@ void Set_Sav(int setting_num)
globals.ChannelState[i].double_pulse double_on 1, double_off 0
globals.ChannelState[i].pw_ctrl_mode pw_normal 1, pw_in_out 0
globals.ChannelState[i].func_mode pulse_mode_on 0, dc_mode_on 1
- globals.ChannelState[i].polarity pol_norm 0, pol_complement 1
+ globals.ChannelState[i].inverted pol_norm 0, pol_complement 1
globals.ChannelState[i].output_state output_off 0,output_on 1
globals.ChannelState[i].gate_type gate_sync 0, gate_async 1
globals.ChannelState[i].trigger_source source_internal 0, source_external 1, source_manual 2, source_hold 3, source_immediate 4
@@ -4423,7 +4423,7 @@ void Set_Sav(int setting_num)
temp |= globals.ChannelState[i].hold_setting << 1;
temp |= globals.ChannelState[i].double_pulse << 2;
temp |= globals.ChannelState[i].pw_ctrl_mode << 3;
- temp |= globals.ChannelState[i].polarity << 5;
+ temp |= globals.ChannelState[i].inverted << 5;
temp |= globals.ChannelState[i].output_state << 6;
temp |= globals.ChannelState[i].gate_type << 7;
temp |= globals.ChannelState[i].trigger_source << 8;
diff --git a/device-functions.h b/device-functions.h
index 4597b40..3b62398 100644
--- a/device-functions.h
+++ b/device-functions.h
@@ -20,7 +20,7 @@ int Set_Double(int channel,int new_setting);
void Ctrl_PRF_Limiter(int enable);
void Set_Mux(int channel);
int Set_Func(int channel,int mode);
-int Set_Pol(int channel,int mode);
+int Set_Inverted(int channel,int mode);
int Set_Hold(int channel,int mode);
int Set_Output_State(int channel,int mode);
int Set_Trig_Source(int channel,int mode);
diff --git a/error_utils.c b/error_utils.c
index 9dd45b0..f29341c 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -673,8 +673,8 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
if (!globals.Flash.ChanKey_func_mode) for (i=1; i<num_of_chan; ++i) {
ChannelStateToTest[i].func_mode=ChannelStateToTest[0].func_mode;
}
- if (!globals.Flash.ChanKey_polarity) for (i=1; i<num_of_chan; ++i) {
- ChannelStateToTest[i].polarity=ChannelStateToTest[0].polarity;
+ if (!globals.Flash.ChanKey_inverted) for (i=1; i<num_of_chan; ++i) {
+ ChannelStateToTest[i].inverted=ChannelStateToTest[0].inverted;
}
if (!globals.Flash.ChanKey_output_state) for (i=1; i<num_of_chan; ++i) {
ChannelStateToTest[i].output_state=ChannelStateToTest[0].output_state;
@@ -822,7 +822,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
report_error=freq_lower_limit;
}
- if ((ChannelStateToTest[i].polarity!=pol_norm) && (globals.Flash.min_pw[i]>0.0)) {
+ if ((ChannelStateToTest[i].inverted!=pol_norm) && (globals.Flash.min_pw[i]>0.0)) {
temp=(1/ChannelStateToTest[i].pw)*( 1.0- ampl_fixed_max_duty/duty_scale );
if (temp>globals.Constraints.err_min_freq[i]) {
globals.Constraints.err_min_freq[i]=temp;
@@ -886,7 +886,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
}
- if (ChannelStateToTest[i].polarity==pol_norm) {
+ if (ChannelStateToTest[i].inverted==pol_norm) {
temp=(1/ChannelStateToTest[i].pw)*(ampl_fixed_max_duty/duty_scale);
if (temp<globals.Constraints.err_max_freq[i]) {
globals.Constraints.err_max_freq[i]=temp;
@@ -943,7 +943,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
/* negative-pw units are special, ignore PRF / duty cycle / PW conflicts */
if (globals.Constraints.err_min_pw[i]>=0.0) {
if (ChannelStateToTest[i].trigger_source==source_internal) {
- if (ChannelStateToTest[i].polarity!=pol_norm) {
+ if (ChannelStateToTest[i].inverted!=pol_norm) {
temp=(1/ChannelStateToTest[i].frequency)*( 1.0 - ampl_fixed_max_duty/duty_scale );
if (temp>globals.Constraints.err_min_pw[i]) {
globals.Constraints.err_min_pw[i]=temp;
@@ -1012,7 +1012,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
}
- if (ChannelStateToTest[i].polarity==pol_norm) {
+ if (ChannelStateToTest[i].inverted==pol_norm) {
temp=(1/ChannelStateToTest[i].frequency)*(ampl_fixed_max_duty/duty_scale);
if (temp<globals.Constraints.err_max_pw[i]) {
globals.Constraints.err_max_pw[i]=temp;
@@ -1250,7 +1250,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
duty_cycle=ChannelStateToTest[i].pw*ChannelStateToTest[i].frequency*100; /* calculate duty cycle */
- if (ChannelStateToTest[i].polarity!=pol_norm) {
+ if (ChannelStateToTest[i].inverted!=pol_norm) {
duty_cycle=100-duty_cycle; /* account for inversion */
}
diff --git a/flash.c b/flash.c
index 4f16634..26b12f9 100644
--- a/flash.c
+++ b/flash.c
@@ -495,7 +495,7 @@ static void initFlashValues(FlashStruct *mem)
mem->ChanKey_slew=0;
mem->ChanKey_func_mode=0;
- mem->ChanKey_polarity=0;
+ mem->ChanKey_inverted=0;
mem->ChanKey_output_state=0;
mem->ChanKey_gate_type=0;
mem->ChanKey_trigger_source=0;
diff --git a/globals.h b/globals.h
index 7a71ee7..bcb8fd4 100644
--- a/globals.h
+++ b/globals.h
@@ -353,7 +353,7 @@ typedef struct {
int double_pulse; /* 1=on, 0=off */
int pw_ctrl_mode; /* a/b mode */
int func_mode; /* dc or pulse */
- int polarity; /* noninverted or inverted */
+ int inverted; /* noninverted or inverted */
int output_state; /* on or off */
int gate_type; /* lo=sync, hi=async */
int trigger_source; /* int, ext, or manual */
@@ -432,7 +432,7 @@ typedef struct {
char ChanKey_double_pulse; /* 183 */
char ChanKey_unused; /* 184 */
char ChanKey_func_mode; /* 185 */
- char ChanKey_polarity; /* 186 */
+ char ChanKey_inverted; /* 186 */
char ChanKey_output_state; /* 187 */
char ChanKey_gate_type; /* 188 */
char ChanKey_trigger_source; /* 189 */
diff --git a/menus.c b/menus.c
index 538819d..9ca3cd9 100644
--- a/menus.c
+++ b/menus.c
@@ -856,7 +856,7 @@ void Show_Main_Menu(void)
/*----- display inverted state, if allowed -----*/
- for (chan=0; chan<(globals.Flash.ChanKey_polarity?globals.Flash.channels:1); ++chan) {
+ for (chan=0; chan<(globals.Flash.ChanKey_inverted?globals.Flash.channels:1); ++chan) {
if (globals.Flash.invert_allowed[chan]) {
++LCD_entry;
Main_Menu_Structure[LCD_entry]=Submenu1_invert+chan;
@@ -864,12 +864,12 @@ void Show_Main_Menu(void)
LCD_col=((LCD_entry % LCD_max_entries_per_page) / LCD_rows) * LCD_col_width + 1;
menu_string = g_string_append (menu_string, "INVERT");
- if (globals.Flash.ChanKey_polarity) {
+ if (globals.Flash.ChanKey_inverted) {
g_string_append_printf (menu_string, "%d", chan+1);
}
menu_string = g_string_append (menu_string, ":");
- if (globals.ChannelState[chan].polarity==pol_norm) {
+ if (globals.ChannelState[chan].inverted==pol_norm) {
menu_string = g_string_append (menu_string, "NO");
} else {
menu_string = g_string_append (menu_string, "YES");
@@ -1465,7 +1465,7 @@ static void Submenu_Display(int change_selection)
break;
case Submenu1_invert:
- title = title_with_channel("Inverted Mode",globals.Flash.ChanKey_polarity,channel);
+ title = title_with_channel("Inverted Mode",globals.Flash.ChanKey_inverted,channel);
Submenu_max_entry=1;
Submenu_Structure[0]=mode_inv_no;
@@ -1776,13 +1776,13 @@ static void Submenu_Display(int change_selection)
break;
case mode_inv_no:
mode_name = g_strdup("NO (normal)");
- if (globals.ChannelState[channel].polarity==pol_norm) {
+ if (globals.ChannelState[channel].inverted==pol_norm) {
current_operating_mode=i;
}
break;
case mode_inv_yes:
mode_name = g_strdup("YES (inverted)");
- if (globals.ChannelState[channel].polarity==pol_complement) {
+ if (globals.ChannelState[channel].inverted==pol_complement) {
current_operating_mode=i;
}
break;
@@ -3156,12 +3156,12 @@ static int Submenu_Implement_Changes(void)
GPIB_go_to_local();
break;
case mode_inv_no:
- if (error_num=Set_Pol(channel,pol_norm)) {
+ if (error_num=Set_Inverted(channel,pol_norm)) {
return error_num;
}
break;
case mode_inv_yes:
- if (error_num=Set_Pol(channel,pol_complement)) {
+ if (error_num=Set_Inverted(channel,pol_complement)) {
return error_num;
}
break;
diff --git a/parser.c b/parser.c
index 5ce7efe..04ff5bc 100644
--- a/parser.c
+++ b/parser.c
@@ -2128,7 +2128,7 @@ static int Go_polarity_42(gchar** response, int channel, char *parameter,char *u
{
int status;
- if (status = check_channel_ok (channel, globals.Flash.channels, globals.Flash.ChanKey_polarity)) {
+ if (status = check_channel_ok (channel, globals.Flash.channels, globals.Flash.ChanKey_inverted)) {
return status;
}
if (!(globals.Flash.invert_allowed[channel])) {
@@ -2138,19 +2138,19 @@ static int Go_polarity_42(gchar** response, int channel, char *parameter,char *u
switch (command_type) {
case command_withparam:
if (!strcmp(parameter,"norm") || !strcmp(parameter,"normal")) {
- return Set_Pol(channel,pol_norm);
+ return Set_Inverted(channel,pol_norm);
} else if (!strcmp(parameter,"comp") || !strcmp(parameter,"complement")
|| !strcmp(parameter,"inv") || !strcmp(parameter,"inverted") )
{
- return Set_Pol(channel,pol_complement);
+ return Set_Inverted(channel,pol_complement);
} else {
return SyntaxError;
}
break;
case query_simple:
- if (globals.ChannelState[channel].polarity==pol_norm) {
+ if (globals.ChannelState[channel].inverted==pol_norm) {
return query_string(response, "NORM");
} else {
return query_string(response, "COMP");