diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 00:39:55 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 00:39:55 +0900 |
commit | f4aec9a5ea2e8cf5181b7631adc7c1d05088aa30 (patch) | |
tree | 899d9d1d2739ac7cfbb1f4348867d0df2d023817 /device-functions.c | |
parent | 82da255c8a0c4ab78cc131f829e68e27ea5bb6f6 (diff) |
reduce ampl_zero_equiv by a factor of 10 in -LV attenuator modeINSTRUMENT_6_4_27c
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/device-functions.c b/device-functions.c index 5fd8a98..c864791 100644 --- a/device-functions.c +++ b/device-functions.c @@ -1719,7 +1719,7 @@ int Set_Amp_Calib(int channel,float meas_ampl) /* use for all channels */ - if (fabs(globals.ChannelState[channel].amplitude)<globals.Flash.ampl_zero_equiv[channel]) { + if (fabs(globals.ChannelState[channel].amplitude) < get_ampl_zero_equiv(channel)) { return NeedNonZeroAmpl; } @@ -2872,12 +2872,12 @@ int Set_VI_Control(int parameter,int channel,float new_ampl) } /* clamping distortion below "zero equiv" amplitude */ - if (ampl_for_distort_calc < globals.Flash.ampl_zero_equiv[channel]) { - ampl_for_distort_calc = globals.Flash.ampl_zero_equiv[channel]; + if (ampl_for_distort_calc < get_ampl_zero_equiv(channel)) { + ampl_for_distort_calc = get_ampl_zero_equiv(channel); } /* prohit values of Y that would cause divide-by-zero error */ - if ( (-globals.Flash.distort_Y[channel]) > globals.Flash.ampl_zero_equiv[channel]) { + if ( (-globals.Flash.distort_Y[channel]) > get_ampl_zero_equiv(channel)) { return PW_Distort_Error; } @@ -4975,7 +4975,7 @@ float rst_ampl_value (int channel) // For AVRQ -AHV, -XHV options, where valids ampls may be // 1.0 to 1.5 kV, positive or negative - return globals.Flash.ampl_zero_equiv[channel]; + return get_ampl_zero_equiv(channel); } else if (max == 0) { @@ -5058,3 +5058,20 @@ void get_min_max_fixed_ampls (int channel, float *min_ampl, float *max_ampl) { if (use_ampl < *min_ampl) *min_ampl = use_ampl; } } + + +float get_ampl_zero_equiv(int channel) +{ + float result; + result = globals.Flash.ampl_zero_equiv[channel]; + + if (globals.Flash.switchable_zout[channel] + && attenuator_count(channel) + && (globals.ChannelState[channel].zout==globals.Flash.zout_max[channel]) ) { + + // lower min equiv ampl if attenuators are in use in -LV units */ + result /= 10.0; + } + + return result; +} |