diff options
author | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 10:00:12 +0900 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 10:00:12 +0900 |
commit | 795d2a07dedf3b0e89548effbf619d12de18ef0b (patch) | |
tree | 57895b1b372c1aa03eee6b1724083cfec7158e14 /device-functions.c | |
parent | e543ca1b79ffaa919d58593103296d037c126a0f (diff) |
use delay magnitude to set test PRF since it can be negative, and simplify extrapolation
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/device-functions.c b/device-functions.c index 310d945..5be0be3 100644 --- a/device-functions.c +++ b/device-functions.c @@ -2091,7 +2091,7 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n } break; case pwl_delay_values: - other_setting=0.08/nominal_val; + other_setting=0.08/fabs(nominal_val); if (other_setting > 500e3) { other_setting=500e3; } @@ -2485,7 +2485,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int int index,use_range; int range_i,entry_i; float inverse_word_out; - int timing_extrapolation_allowed; int pw_polarity; float pw_distort_val; @@ -2504,7 +2503,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int top_range_only=0; starting_range=0; max_points=points_in_range; - timing_extrapolation_allowed=NO; reciprocal_relationship=NO; decreasing_values_allowed=NO; min_os_in_range=max_os_in_range=0.0; @@ -2644,8 +2642,9 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int use_ampl=use_ampl+globals.Flash.pw_shift_below_ampl_by[channel]; } - reciprocal_relationship=YES; - timing_extrapolation_allowed=YES; + if (!globals.Flash.volt_ctrl_pw[channel]) { + reciprocal_relationship=YES; + } break; case pwl_delay_values: max_polarity=timing_polarities; @@ -2654,8 +2653,10 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int pwl_amp=&globals.Flash.delay_pwl_time[0][0][0][0]; *UseNegData=0; use_ampl=new_ampl; - reciprocal_relationship=YES; - timing_extrapolation_allowed=YES; + + if (!globals.Flash.volt_ctrl_delay[channel]) { + reciprocal_relationship=YES; + } break; case pwl_period_values: max_polarity=timing_polarities; @@ -2664,7 +2665,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int pwl_amp=&globals.Flash.period_pwl_time[0][0][0][0]; *UseNegData=0; use_ampl=new_ampl; - timing_extrapolation_allowed=YES; reciprocal_relationship=YES; break; case pwl_burst_values: @@ -2675,7 +2675,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int *UseNegData=0; use_ampl=new_ampl; reciprocal_relationship=YES; - timing_extrapolation_allowed=YES; break; case pwl_rise_time_values: max_polarity=ampl_polarities; @@ -2689,7 +2688,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int } use_ampl=new_ampl; reciprocal_relationship=NO; - timing_extrapolation_allowed=NO; break; case pwl_slew_values: max_polarity=timing_polarities; @@ -2699,7 +2697,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int *UseNegData=0; use_ampl=new_ampl; reciprocal_relationship=NO; - timing_extrapolation_allowed=NO; top_range_only=YES; /* higher drive voltage = lower ripple in slew */ break; } @@ -2813,20 +2810,6 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int *relay_range=range_i; *entry=entry_i; - /* check for linear voltage-controlled PW */ - if ( (parameter==pwl_pw_values) - && globals.Flash.volt_ctrl_pw[channel] - && (pwl_vc[index] < pwl_vc[index+1])) { - reciprocal_relationship=NO; - } - - /* check for linear voltage-controlled delay */ - if ( (parameter==pwl_delay_values) - && globals.Flash.volt_ctrl_delay[channel] - && (pwl_vc[index] < pwl_vc[index+1])) { - reciprocal_relationship=NO; - } - if (reciprocal_relationship) { inverse_word_out = fraction * (1.0/((float) pwl_vc[index]) - 1.0/((float) pwl_vc[index+1])); inverse_word_out+=1/((float) pwl_vc[index]); @@ -2845,7 +2828,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int /* because the reciprocal relationship allows an asymptotic extension to infinity, */ /* at the expense of lower resolution */ - if (*word_out<0 && timing_extrapolation_allowed) { + if (*word_out<0 && reciprocal_relationship) { *point_found=0; use_range=-1; |