diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 00:23:17 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 00:23:17 +0900 |
commit | e12558f1ed16d3bdb96f7f0fbd05b48eb7558a0e (patch) | |
tree | 6115cb3a9b6f61e0295715bfa5d3daf3928ce835 | |
parent | bee40b77fc98991b4b6ef33b1e738915bc989ff0 (diff) |
replace pol_norm and pol_complement with NO/YES for clarity
-rw-r--r-- | device-functions.c | 16 | ||||
-rw-r--r-- | error_utils.c | 10 | ||||
-rw-r--r-- | flash.c | 2 | ||||
-rw-r--r-- | globals.h | 2 | ||||
-rw-r--r-- | menus.c | 10 | ||||
-rw-r--r-- | parser.c | 6 |
6 files changed, 22 insertions, 24 deletions
diff --git a/device-functions.c b/device-functions.c index 9f9c012..037d30e 100644 --- a/device-functions.c +++ b/device-functions.c @@ -1001,17 +1001,17 @@ void Set_Mux(int channel) { int mux_out; - if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].inverted==pol_norm) { + if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].inverted==NO) { mux_out=4; - } else if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].inverted!=pol_norm) { + } else if (globals.ChannelState[channel].func_mode==dc_mode_on && globals.ChannelState[channel].inverted!=NO) { mux_out=5; - } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].inverted==pol_norm) { + } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].inverted==NO) { mux_out=2; - } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].inverted!=pol_norm) { + } else if (globals.ChannelState[channel].pw_ctrl_mode!=pw_in_out && globals.ChannelState[channel].inverted!=NO) { mux_out=3; - } else if (globals.ChannelState[channel].inverted==pol_norm) { + } else if (globals.ChannelState[channel].inverted==NO) { mux_out=0; - } else if (globals.ChannelState[channel].inverted!=pol_norm) { + } else if (globals.ChannelState[channel].inverted!=NO) { mux_out=1; } @@ -2148,7 +2148,7 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n other_setting=0.4; } - Set_Inverted(channel,pol_norm); + Set_Inverted(channel,NO); Set_Delay(0,0,0,channel,0.0); status=Set_frequency(0,0,0,globals.Flash.ChanKey_frequency?channel:0,other_setting); @@ -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].inverted pol_norm 0, pol_complement 1 + globals.ChannelState[i].inverted NO 0, YES 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 diff --git a/error_utils.c b/error_utils.c index f29341c..7d4dc25 100644 --- a/error_utils.c +++ b/error_utils.c @@ -822,7 +822,7 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) report_error=freq_lower_limit; } - if ((ChannelStateToTest[i].inverted!=pol_norm) && (globals.Flash.min_pw[i]>0.0)) { + if ((ChannelStateToTest[i].inverted!=NO) && (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].inverted==pol_norm) { + if (ChannelStateToTest[i].inverted==NO) { 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].inverted!=pol_norm) { + if (ChannelStateToTest[i].inverted!=NO) { 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].inverted==pol_norm) { + if (ChannelStateToTest[i].inverted==NO) { 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].inverted!=pol_norm) { + if (ChannelStateToTest[i].inverted!=NO) { duty_cycle=100-duty_cycle; /* account for inversion */ } @@ -830,7 +830,7 @@ static void initFlashValues(FlashStruct *mem) mem->hard_current_limit_enabled[i]=0; mem->soft_current_limit_enabled[i]=0; - mem->invert_by_default[i]=pol_norm; + mem->invert_by_default[i]=NO; mem->max_avg_ampl[i]=0.0; @@ -153,8 +153,6 @@ #define pw_ew_ext 2 #define double_on 1 #define double_off 0 -#define pol_norm 0 -#define pol_complement 1 #define hold_width 0 #define hold_duty 1 #define output_off 0 @@ -869,7 +869,7 @@ void Show_Main_Menu(void) } menu_string = g_string_append (menu_string, ":"); - if (globals.ChannelState[chan].inverted==pol_norm) { + if (globals.ChannelState[chan].inverted==NO) { menu_string = g_string_append (menu_string, "NO"); } else { menu_string = g_string_append (menu_string, "YES"); @@ -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].inverted==pol_norm) { + if (globals.ChannelState[channel].inverted==NO) { current_operating_mode=i; } break; case mode_inv_yes: mode_name = g_strdup("YES (inverted)"); - if (globals.ChannelState[channel].inverted==pol_complement) { + if (globals.ChannelState[channel].inverted==YES) { 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_Inverted(channel,pol_norm)) { + if (error_num=Set_Inverted(channel,NO)) { return error_num; } break; case mode_inv_yes: - if (error_num=Set_Inverted(channel,pol_complement)) { + if (error_num=Set_Inverted(channel,YES)) { return error_num; } break; @@ -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_Inverted(channel,pol_norm); + return Set_Inverted(channel,NO); } else if (!strcmp(parameter,"comp") || !strcmp(parameter,"complement") || !strcmp(parameter,"inv") || !strcmp(parameter,"inverted") ) { - return Set_Inverted(channel,pol_complement); + return Set_Inverted(channel,YES); } else { return SyntaxError; } break; case query_simple: - if (globals.ChannelState[channel].inverted==pol_norm) { + if (globals.ChannelState[channel].inverted==NO) { return query_string(response, "NORM"); } else { return query_string(response, "COMP"); |