From f4aec9a5ea2e8cf5181b7631adc7c1d05088aa30 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 00:39:55 +0900 Subject: reduce ampl_zero_equiv by a factor of 10 in -LV attenuator mode --- device-functions.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'device-functions.c') 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 ( (-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; +} -- cgit