summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:15:59 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:15:59 +0900
commit09b55d5ca98747a3c33b6fca10541104626bc2c3 (patch)
tree3e7f64ec87b1c574549a8a80c4dd3f40921c57b5 /device-functions.c
parentc42275085f4256ff608421f098c7b806d1f8c55c (diff)
Rename piece-wise-linear variables for clarity, dropping reference to obsolete 12bit values
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c302
1 files changed, 151 insertions, 151 deletions
diff --git a/device-functions.c b/device-functions.c
index 037d30e..1cc4322 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -851,7 +851,7 @@ int Set_Delay(int check_possible_only,int word_override,int range_override,int c
} else {
/* won't work for all values if apparent fixed delay is less than minimum variable delay */
- min_one_shot_delay = globals.Flash.delay_pwl_time[channel][0][0][0];
+ min_one_shot_delay = globals.Flash.delay_pwl[channel][0][0][0];
if ( !globals.Flash.volt_ctrl_delay[channel] &&
(globals.Flash.delay_shrink[channel] > 0.0) &&
(globals.Flash.delay_shrink[channel] < min_one_shot_delay)) {
@@ -1691,8 +1691,8 @@ int Set_Amp_Calib(int channel,float meas_ampl)
}
for (i=0; i<10; ++i)
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]=
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]*change_ratio;
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]=
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]*change_ratio;
/* see if new data prevents min/max from being obtained */
@@ -1701,12 +1701,12 @@ int Set_Amp_Calib(int channel,float meas_ampl)
if (status) {
/* revert to original calibration */
for (i=0; i<10; ++i)
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]=
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]/change_ratio;
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]=
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]/change_ratio;
}
- eprom_loc = (char *) &(globals.Flash.ampl_pwl_amp) - (char *) &(globals.Flash.flash_start);
- writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.ampl_pwl_amp));
+ eprom_loc = (char *) &(globals.Flash.ampl_pwl) - (char *) &(globals.Flash.flash_start);
+ writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.ampl_pwl));
return status;
}
@@ -1792,7 +1792,7 @@ int Set_OS_Calib(int channel,float meas_ampl)
}
for (i=0; i<10; ++i) {
- globals.Flash.os_pwl_amp[channel][0][0][i]=globals.Flash.os_pwl_amp[channel][0][0][i]*change_ratio;
+ globals.Flash.os_pwl[channel][0][0][i]=globals.Flash.os_pwl[channel][0][0][i]*change_ratio;
}
@@ -1802,12 +1802,12 @@ int Set_OS_Calib(int channel,float meas_ampl)
if (status) {
/* revert to original calibration */
for (i=0; i<10; ++i) {
- globals.Flash.os_pwl_amp[channel][0][0][i]=globals.Flash.os_pwl_amp[channel][0][0][i]/change_ratio;
+ globals.Flash.os_pwl[channel][0][0][i]=globals.Flash.os_pwl[channel][0][0][i]/change_ratio;
}
}
- eprom_loc = (char *) &(globals.Flash.os_pwl_amp) - (char *) &(globals.Flash.flash_start);
- writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.os_pwl_amp));
+ eprom_loc = (char *) &(globals.Flash.os_pwl) - (char *) &(globals.Flash.flash_start);
+ writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.os_pwl));
return status;
}
@@ -2051,11 +2051,11 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
switch (parameter) {
case (pwl_ampl_values):
- nominal_val=globals.Flash.ampl_pwl_amp[channel][range][polarity][entry];
+ nominal_val=globals.Flash.ampl_pwl[channel][range][polarity][entry];
if (polarity) {
nominal_val=-nominal_val;
}
- nominal_wordout=globals.Flash.ampl_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.ampl_dacval[channel][range][polarity][entry];
if (Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.min_ampl[channel],0) || Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.max_ampl[channel],0)) {
/* confirm that timing settings can support min/max ampl settings */
return CalibrationTimingProblem;
@@ -2071,40 +2071,40 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
}
break;
case (pwl_os_values):
- nominal_val=globals.Flash.os_pwl_amp[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.os_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.os_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.os_dacval[channel][range][polarity][entry];
break;
case pwl_pw_values:
- nominal_val=globals.Flash.pw_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.pw_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.pw_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.pw_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_delay_values:
- nominal_val=globals.Flash.delay_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.delay_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.delay_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.delay_dacval[channel][range][polarity][entry];
disable_errors=1;
if (!globals.Flash.volt_ctrl_delay[channel]) {
reset_state=1;
}
break;
case pwl_period_values:
- nominal_val=globals.Flash.period_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.period_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.period_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.period_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_burst_values:
- nominal_val=globals.Flash.burst_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.burst_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.burst_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.burst_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_rise_time_values:
- nominal_val=globals.Flash.rise_time_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.rise_time_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.rise_time_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.rise_time_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_slew_values:
- nominal_val=globals.Flash.slew_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.slew_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.slew_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.slew_dacval[channel][range][polarity][entry];
break;
}
@@ -2265,7 +2265,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
float nom_ampl;
int index;
int max_points,max_polarity,max_ranges;
- float *pwl_amp;
+ float *pwl;
int true_channel;
true_channel=channel;
@@ -2277,42 +2277,42 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
case (pwl_ampl_values):
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_amp=&globals.Flash.ampl_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.ampl_pwl[0][0][0][0];
break;
case (pwl_os_values):
max_polarity=os_polarities;
max_ranges=os_ranges;
- pwl_amp=&globals.Flash.os_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.os_pwl[0][0][0][0];
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.pw_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.pw_pwl[0][0][0][0];
break;
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.delay_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.delay_pwl[0][0][0][0];
break;
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.period_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.period_pwl[0][0][0][0];
break;
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.burst_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.burst_pwl[0][0][0][0];
break;
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_amp=&globals.Flash.rise_time_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.rise_time_pwl[0][0][0][0];
break;
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.slew_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.slew_pwl[0][0][0][0];
break;
}
index=true_channel*max_ranges*max_polarity*max_points
@@ -2320,7 +2320,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
+polarity*max_points
+entry;
- nom_ampl=pwl_amp[index];
+ nom_ampl=pwl[index];
switch (parameter) {
case (pwl_ampl_values):
@@ -2384,14 +2384,14 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
cal_point=fabs(cal_point);
}
- *(float *)(&pwl_amp[index])=cal_point;
+ *(float *)(&pwl[index])=cal_point;
/* see if new point prevents min/max from being obtained */
status=Check_MinMax_Cal(channel,parameter);
if (status) {
/* revert to original value if required */
- *(float *)(&pwl_amp[index])=nom_ampl;
+ *(float *)(&pwl[index])=nom_ampl;
}
Set_Cal_Nom(channel,calibration_point_number,parameter,NULL);
@@ -2399,7 +2399,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
Main_update_shift_registers();
Show_Main_Menu();
- eprom_loc = (char *) (&pwl_amp[index]) - (char *) &(globals.Flash.flash_start);
+ eprom_loc = (char *) (&pwl[index]) - (char *) &(globals.Flash.flash_start);
writeUserBlock(&globals.Flash, eprom_loc, sizeof(nom_ampl));
globals.Flags.extended_ampl_min_max=NO;
@@ -2427,66 +2427,66 @@ int Set_VI_Del_Cal(int parameter,int channel,int calibration_point_number)
case (pwl_ampl_values):
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_short1=&globals.Flash.ampl_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.ampl_pwl_amp[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.ampl_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.ampl_pwl_amp);
+ pointer_short1=&globals.Flash.ampl_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.ampl_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.ampl_dacval);
+ size_of_float1=sizeof(globals.Flash.ampl_pwl);
break;
case (pwl_os_values):
max_polarity=os_polarities;
max_ranges=os_ranges;
- pointer_short1=&globals.Flash.os_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.os_pwl_amp[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.os_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.os_pwl_amp);
+ pointer_short1=&globals.Flash.os_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.os_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.os_dacval);
+ size_of_float1=sizeof(globals.Flash.os_pwl);
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.pw_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.pw_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.pw_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.pw_pwl_time);
+ pointer_short1=&globals.Flash.pw_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.pw_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.pw_dacval);
+ size_of_float1=sizeof(globals.Flash.pw_pwl);
break;
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.delay_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.delay_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.delay_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.delay_pwl_time);
+ pointer_short1=&globals.Flash.delay_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.delay_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.delay_dacval);
+ size_of_float1=sizeof(globals.Flash.delay_pwl);
break;
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.period_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.period_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.period_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.period_pwl_time);
+ pointer_short1=&globals.Flash.period_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.period_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.period_dacval);
+ size_of_float1=sizeof(globals.Flash.period_pwl);
break;
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.burst_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.burst_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.burst_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.burst_pwl_time);
+ pointer_short1=&globals.Flash.burst_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.burst_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.burst_dacval);
+ size_of_float1=sizeof(globals.Flash.burst_pwl);
break;
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_short1=&globals.Flash.rise_time_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.rise_time_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.rise_time_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.rise_time_pwl_time);
+ pointer_short1=&globals.Flash.rise_time_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.rise_time_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.rise_time_dacval);
+ size_of_float1=sizeof(globals.Flash.rise_time_pwl);
break;
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.slew_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.slew_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.slew_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.slew_pwl_time);
+ pointer_short1=&globals.Flash.slew_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.slew_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.slew_dacval);
+ size_of_float1=sizeof(globals.Flash.slew_pwl);
break;
}
@@ -2585,8 +2585,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
float min_ampl_in_range,max_ampl_in_range;
int max_points,max_polarity,max_ranges;
- float *pwl_amp;
- short *pwl_vc;
+ float *pwl;
+ short *pwl_dacval;
int index,use_range;
int range_i,entry_i;
int pw_polarity;
@@ -2622,8 +2622,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_vc=&globals.Flash.ampl_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.ampl_pwl_amp[0][0][0][0];
+ pwl_dacval=&globals.Flash.ampl_dacval[0][0][0][0];
+ pwl=&globals.Flash.ampl_pwl[0][0][0][0];
if (new_ampl<0.0) {
*actual_pol=1;
*UseNegData=1;
@@ -2645,7 +2645,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
if ( globals.Flash.switchable_load[channel] &&
(globals.ChannelState[channel].load_type>globals.Flash.low_load_type[channel]) &&
- globals.Flash.ampl_pwl_Vc_norm4095[channel][3][*actual_pol][1] > 0) {
+ globals.Flash.ampl_dacval[channel][3][*actual_pol][1] > 0) {
starting_range=3;
top_range_only=0;
}
@@ -2689,16 +2689,16 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
decreasing_values_allowed=YES; /* allows Vc=0 to corresponds to most + OS, and Vc=10V to give most - OS */
max_polarity=os_polarities;
max_ranges=os_ranges;
- pwl_vc=&globals.Flash.os_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.os_pwl_amp[0][0][0][0];
+ pwl_dacval=&globals.Flash.os_dacval[0][0][0][0];
+ pwl=&globals.Flash.os_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.pw_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.pw_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.pw_dacval[0][0][0][0];
+ pwl=&globals.Flash.pw_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
@@ -2753,8 +2753,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.delay_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.delay_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.delay_dacval[0][0][0][0];
+ pwl=&globals.Flash.delay_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
@@ -2765,8 +2765,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.period_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.period_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.period_dacval[0][0][0][0];
+ pwl=&globals.Flash.period_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
reciprocal_relationship=YES;
@@ -2774,8 +2774,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.burst_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.burst_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.burst_dacval[0][0][0][0];
+ pwl=&globals.Flash.burst_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
reciprocal_relationship=YES;
@@ -2783,8 +2783,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_vc=&globals.Flash.rise_time_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.rise_time_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.rise_time_dacval[0][0][0][0];
+ pwl=&globals.Flash.rise_time_pwl[0][0][0][0];
if (globals.ChannelState[channel].amplitude<0.0) {
*actual_pol=*UseNegData=1;
} else {
@@ -2796,8 +2796,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.slew_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.slew_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.slew_dacval[0][0][0][0];
+ pwl=&globals.Flash.slew_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
reciprocal_relationship=NO;
@@ -2889,8 +2889,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
// floats seems to generate instructions that can't work on unaligned
// data and these are unaligned.
float pwlamp1, pwlamp2;
- memcpy(&pwlamp1, &pwl_amp[index], sizeof(pwlamp1));
- memcpy(&pwlamp2, &pwl_amp[index+1], sizeof(pwlamp2));
+ memcpy(&pwlamp1, &pwl[index], sizeof(pwlamp1));
+ memcpy(&pwlamp2, &pwl[index+1], sizeof(pwlamp2));
if ( (fabs(pwlamp1-pwlamp2)>smallest_allowed_number)
&&
@@ -2903,11 +2903,11 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
if ((parameter==pwl_ampl_values) && globals.Flash.ampl_os_ranges_related[channel]) {
for (i=0; i<points_in_range; i++) {
- if (max_os_in_range<globals.Flash.os_pwl_amp[channel][range_i][0][i]) {
- max_os_in_range=globals.Flash.os_pwl_amp[channel][range_i][0][i];
+ if (max_os_in_range<globals.Flash.os_pwl[channel][range_i][0][i]) {
+ max_os_in_range=globals.Flash.os_pwl[channel][range_i][0][i];
}
- if (min_os_in_range>globals.Flash.os_pwl_amp[channel][range_i][0][i]) {
- min_os_in_range=globals.Flash.os_pwl_amp[channel][range_i][0][i];
+ if (min_os_in_range>globals.Flash.os_pwl[channel][range_i][0][i]) {
+ min_os_in_range=globals.Flash.os_pwl[channel][range_i][0][i];
}
}
if ((globals.ChannelState[channel].offset<min_os_in_range) || (globals.ChannelState[channel].offset>max_os_in_range)) {
@@ -2917,11 +2917,11 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
if ((parameter==pwl_os_values) && globals.Flash.ampl_os_ranges_related[channel]) {
for (i=0; i<points_in_range; i++) {
- if (max_ampl_in_range<globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i]) {
- max_ampl_in_range=globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i];
+ if (max_ampl_in_range<globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i]) {
+ max_ampl_in_range=globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i];
}
- if (min_ampl_in_range>globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i]) {
- min_ampl_in_range=globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i];
+ if (min_ampl_in_range>globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i]) {
+ min_ampl_in_range=globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i];
}
}
if ((fabs(globals.ChannelState[channel].amplitude)<min_ampl_in_range) || (fabs(globals.ChannelState[channel].amplitude)>max_ampl_in_range)) {
@@ -2935,14 +2935,14 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
/* check for linear voltage-controlled PW */
if ( (parameter==pwl_pw_values)
&& globals.Flash.volt_ctrl_pw[channel]
- && (pwl_vc[index] < pwl_vc[index+1])) {
+ && (pwl_dacval[index] < pwl_dacval[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])) {
+ && (pwl_dacval[index] < pwl_dacval[index+1])) {
reciprocal_relationship=NO;
}
@@ -2950,9 +2950,9 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
// Normally just the first range is voltage-controlled.
if (reciprocal_relationship) {
- *word_out = inverse_interpolation (pwl_vc[index], pwl_vc[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
+ *word_out = inverse_interpolation (pwl_dacval[index], pwl_dacval[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
} else {
- *word_out = linear_interpolation (pwl_vc[index], pwl_vc[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
+ *word_out = linear_interpolation (pwl_dacval[index], pwl_dacval[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
}
}
}
@@ -2979,7 +2979,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
index=true_channel*max_ranges*max_polarity*max_points
+(range_i)*max_polarity*max_points
+(*UseNegData)*max_points;
- if (pwl_amp[index]>smallest_allowed_number && pwl_amp[index]<tweaked_use_ampl) {
+ if (pwl[index]>smallest_allowed_number && pwl[index]<tweaked_use_ampl) {
use_range=range_i;
}
}
@@ -2995,14 +2995,14 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
+(entry_i);
/* find the last two non-zero entries, and extrapolate from them */
- if ( (fabs(pwl_amp[index])>smallest_allowed_number)
- && (fabs(pwl_amp[index+1])>smallest_allowed_number)
- && (fabs(pwl_amp[index]-pwl_amp[index+1])>smallest_allowed_number) ) {
+ if ( (fabs(pwl[index])>smallest_allowed_number)
+ && (fabs(pwl[index+1])>smallest_allowed_number)
+ && (fabs(pwl[index]-pwl[index+1])>smallest_allowed_number) ) {
*point_found=1;
*relay_range=use_range;
*entry=entry_i;
- *word_out = inverse_interpolation (pwl_vc[index], pwl_vc[index+1], pwl_amp[index], pwl_amp[index+1], tweaked_use_ampl);
+ *word_out = inverse_interpolation (pwl_dacval[index], pwl_dacval[index+1], pwl[index], pwl[index+1], tweaked_use_ampl);
}
}
}
@@ -3059,10 +3059,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_x_short=&globals.Flash.ampl_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.ampl_pwl_amp[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.ampl_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.ampl_pwl_amp);
+ pointer_x_short=&globals.Flash.ampl_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.ampl_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.ampl_dacval);
+ size_of_y_float=sizeof(globals.Flash.ampl_pwl);
Set_VI_Control(pwl_ampl_values,channel,globals.ChannelState[channel].amplitude,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3079,10 +3079,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case (pwl_os_values):
max_polarity=os_polarities;
max_ranges=os_ranges;
- pointer_x_short=&globals.Flash.os_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.os_pwl_amp[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.os_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.os_pwl_amp);
+ pointer_x_short=&globals.Flash.os_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.os_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.os_dacval);
+ size_of_y_float=sizeof(globals.Flash.os_pwl);
old_val=globals.ChannelState[channel].offset;
Set_VI_Control(pwl_os_values,channel,old_val,&point_found,
@@ -3091,10 +3091,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.pw_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.pw_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.pw_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.pw_pwl_time);
+ pointer_x_short=&globals.Flash.pw_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.pw_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.pw_dacval);
+ size_of_y_float=sizeof(globals.Flash.pw_pwl);
old_val=globals.ChannelState[channel].pw;
Set_VI_Control(pwl_pw_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3102,10 +3102,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.delay_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.delay_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.delay_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.delay_pwl_time);
+ pointer_x_short=&globals.Flash.delay_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.delay_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.delay_dacval);
+ size_of_y_float=sizeof(globals.Flash.delay_pwl);
old_val=globals.ChannelState[channel].delay;
Set_VI_Control(pwl_delay_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3113,10 +3113,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.period_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.period_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.period_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.period_pwl_time);
+ pointer_x_short=&globals.Flash.period_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.period_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.period_dacval);
+ size_of_y_float=sizeof(globals.Flash.period_pwl);
old_val=1.0/globals.ChannelState[channel].frequency;
Set_VI_Control(pwl_period_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3124,10 +3124,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.burst_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.burst_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.burst_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.burst_pwl_time);
+ pointer_x_short=&globals.Flash.burst_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.burst_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.burst_dacval);
+ size_of_y_float=sizeof(globals.Flash.burst_pwl);
old_val=globals.ChannelState[channel].burst_time;
Set_VI_Control(pwl_burst_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3135,10 +3135,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_x_short=&globals.Flash.rise_time_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.rise_time_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.rise_time_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.rise_time_pwl_time);
+ pointer_x_short=&globals.Flash.rise_time_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.rise_time_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.rise_time_dacval);
+ size_of_y_float=sizeof(globals.Flash.rise_time_pwl);
old_val=globals.ChannelState[channel].rise_time;
Set_VI_Control(pwl_rise_time_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3146,10 +3146,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.slew_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.slew_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.slew_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.slew_pwl_time);
+ pointer_x_short=&globals.Flash.slew_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.slew_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.slew_dacval);
+ size_of_y_float=sizeof(globals.Flash.slew_pwl);
old_val=globals.ChannelState[channel].slew;
Set_VI_Control(pwl_slew_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3332,42 +3332,42 @@ int Get_VI_Rng_Info(int parameter, int channel, int calibration_point_number, in
case pwl_ampl_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl=&globals.Flash.ampl_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.ampl_pwl[0][0][0][0];
break;
case pwl_os_values:
max_polarity=os_polarities;
max_ranges=os_ranges;
- pwl=&globals.Flash.os_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.os_pwl[0][0][0][0];
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.pw_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.pw_pwl[0][0][0][0];
break;
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.delay_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.delay_pwl[0][0][0][0];
break;
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.period_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.period_pwl[0][0][0][0];
break;
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.burst_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.burst_pwl[0][0][0][0];
break;
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl=&globals.Flash.rise_time_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.rise_time_pwl[0][0][0][0];
break;
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.slew_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.slew_pwl[0][0][0][0];
break;
}
@@ -4713,7 +4713,7 @@ int number_of_fixed_ampl_points(int channel)
gboolean non_zero_first_ampl_point (int channel)
{
- return (globals.Flash.ampl_pwl_amp[channel][0][0][0] != 0.0);
+ return (globals.Flash.ampl_pwl[channel][0][0][0] != 0.0);
}