diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 00:52:54 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 00:52:54 +0900 |
commit | 6c221c9e3ca75b6e7012e9c15cf69e69e4b2c4c8 (patch) | |
tree | 9b0bf0f9906bb2c79a5473b0a0b5a41466396397 | |
parent | bb55b0eb5240c5f84856d2fac235c898582c8440 (diff) |
Disable frequency-related error checking if not in internal modeINSTRUMENT_6_4_37
-rw-r--r-- | error_utils.c | 317 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 171 insertions, 148 deletions
diff --git a/error_utils.c b/error_utils.c index 0db61fc..009e4ae 100644 --- a/error_utils.c +++ b/error_utils.c @@ -922,47 +922,52 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) /* --- check maximum frequency --- */ check_initial_max_value (globals.Flash.max_freq[i], &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, freq_upper_limit, &report_error); - if ((globals.Flash.max_freq_for_high_ot[i] > 0.0) && (fabs(ChannelStateToTest[i].offset) > globals.Flash.high_ot[i])) { - check_another_max_value (globals.Flash.max_freq_for_high_ot[i], &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, PRF_limited_by_offset, &report_error); - } + if (ChannelStateToTest[i].trigger_source == source_internal) { + if ((globals.Flash.max_freq_for_high_ot[i] > 0.0) && (fabs(ChannelStateToTest[i].offset) > globals.Flash.high_ot[i])) { + check_another_max_value (globals.Flash.max_freq_for_high_ot[i], &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, PRF_limited_by_offset, &report_error); + } - if (fabs(ChannelStateToTest[i].delay) > 0.0) { - check_another_max_value (0.95/fabs(ChannelStateToTest[i].delay), &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Delay_Exceeds_95Period, &report_error); + if (fabs(ChannelStateToTest[i].delay) > 0.0) { + check_another_max_value (0.95/fabs(ChannelStateToTest[i].delay), &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Delay_Exceeds_95Period, &report_error); + } } if (globals.Flash.min_pw[i] > 0.0) { - check_another_max_value (1/ChannelStateToTest[i].pw, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, PW_Exceeds_Period, &report_error); + if (ChannelStateToTest[i].trigger_source == source_internal) { - if ( (ChannelStateToTest[i].burst_count>1) - && (globals.Flash.max_burst_count[i]>1) - && !globals.Flash.burst_func[i]) { - check_another_max_value (1/(ChannelStateToTest[i].burst_count * (ChannelStateToTest[i].pw+ChannelStateToTest[i].burst_time)), - &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Burst_Exceeds_Period, &report_error); - } + check_another_max_value (1/ChannelStateToTest[i].pw, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, PW_Exceeds_Period, &report_error); - check_another_max_value ((1/ChannelStateToTest[i].pw)*(ampl_fixed_max_duty/duty_scale), - &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, duty_cycle_upper_limit, &report_error); + if ( (ChannelStateToTest[i].burst_count>1) + && (globals.Flash.max_burst_count[i]>1) + && !globals.Flash.burst_func[i]) { + check_another_max_value (1/(ChannelStateToTest[i].burst_count * (ChannelStateToTest[i].pw+ChannelStateToTest[i].burst_time)), + &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Burst_Exceeds_Period, &report_error); + } - if (ChannelStateToTest[i].double_pulse==double_on) { - // pulse sep must be less than one half-period - check_another_max_value (0.5 / ChannelStateToTest[i].delay, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Double_Separation_Too_Large, &report_error); - } + check_another_max_value ((1/ChannelStateToTest[i].pw)*(ampl_fixed_max_duty/duty_scale), + &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, duty_cycle_upper_limit, &report_error); - if ((globals.Flash.max_avg_ampl[i]) > 0.0 && (fabs(ChannelStateToTest[i].amplitude)) > 0.0) { - temp=100.0 * globals.Flash.max_avg_ampl[i] / (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].pw * duty_scale); - check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Average_Amplitude_Too_High, &report_error); - } + if (ChannelStateToTest[i].double_pulse==double_on) { + // pulse sep must be less than one half-period + check_another_max_value (0.5 / ChannelStateToTest[i].delay, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Double_Separation_Too_Large, &report_error); + } - if ((globals.Flash.hvps_avg_curr_limit[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0) && (ChannelStateToTest[i].pw > 0.0)) { - temp=(100.0 / duty_scale) * globals.Flash.hvps_avg_curr_limit[i] * ChannelStateToTest[i].load_type / - (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].pw); - check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, HVPS_Current_Too_High, &report_error); - } + if ((globals.Flash.max_avg_ampl[i]) > 0.0 && (fabs(ChannelStateToTest[i].amplitude)) > 0.0) { + temp=100.0 * globals.Flash.max_avg_ampl[i] / (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].pw * duty_scale); + check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, Average_Amplitude_Too_High, &report_error); + } - if ((globals.Flash.max_avg_power[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0)) { - temp = (globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type) / (ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].pw); - check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, average_power_limit, &report_error); + if ((globals.Flash.hvps_avg_curr_limit[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0) && (ChannelStateToTest[i].pw > 0.0)) { + temp=(100.0 / duty_scale) * globals.Flash.hvps_avg_curr_limit[i] * ChannelStateToTest[i].load_type / + (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].pw); + check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, HVPS_Current_Too_High, &report_error); + } + + if ((globals.Flash.max_avg_power[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0)) { + temp = (globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type) / (ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].pw); + check_another_max_value (temp, &globals.Constraints.err_max_freq[i], ChannelStateToTest[i].frequency, average_power_limit, &report_error); + } } } /* ------------------------------- */ @@ -997,37 +1002,39 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } } - check_another_max_value ((1/ChannelStateToTest[i].frequency) - globals.Flash.dead_time[i], - &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, Dead_Time_Error, &report_error); + if (ChannelStateToTest[i].trigger_source == source_internal) { + check_another_max_value ((1/ChannelStateToTest[i].frequency) - globals.Flash.dead_time[i], + &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, Dead_Time_Error, &report_error); - check_another_max_value (1/ChannelStateToTest[i].frequency, &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, PW_Exceeds_Period, &report_error); + check_another_max_value (1/ChannelStateToTest[i].frequency, &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, PW_Exceeds_Period, &report_error); - if ( (ChannelStateToTest[i].burst_count>1) - && (globals.Flash.max_burst_count[i]>1) - && !globals.Flash.burst_func[i]) { + if ( (ChannelStateToTest[i].burst_count>1) + && (globals.Flash.max_burst_count[i]>1) + && !globals.Flash.burst_func[i]) { - check_another_max_value ((1/ChannelStateToTest[i].frequency)/ChannelStateToTest[i].burst_count - ChannelStateToTest[i].burst_time, - &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, Burst_Exceeds_Period, &report_error); - } + check_another_max_value ((1/ChannelStateToTest[i].frequency)/ChannelStateToTest[i].burst_count - ChannelStateToTest[i].burst_time, + &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, Burst_Exceeds_Period, &report_error); + } - check_another_max_value ((1/ChannelStateToTest[i].frequency)*(ampl_fixed_max_duty/duty_scale), - &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, duty_cycle_upper_limit, &report_error); + check_another_max_value ((1/ChannelStateToTest[i].frequency)*(ampl_fixed_max_duty/duty_scale), + &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, duty_cycle_upper_limit, &report_error); - if ((globals.Flash.max_avg_ampl[i]) > 0.0 && (fabs(ChannelStateToTest[i].amplitude)) > 0.0) { - check_another_max_value (100.0 * globals.Flash.max_avg_ampl[i] / (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].frequency * duty_scale), - &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, Average_Amplitude_Too_High, &report_error); - } + if ((globals.Flash.max_avg_ampl[i]) > 0.0 && (fabs(ChannelStateToTest[i].amplitude)) > 0.0) { + check_another_max_value (100.0 * globals.Flash.max_avg_ampl[i] / (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].frequency * duty_scale), + &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, Average_Amplitude_Too_High, &report_error); + } - if ((globals.Flash.hvps_avg_curr_limit[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0) && (ChannelStateToTest[i].frequency > 0.0)) { - check_another_max_value ((100.0 / duty_scale) * globals.Flash.hvps_avg_curr_limit[i] * ChannelStateToTest[i].load_type / - (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].frequency), - &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, HVPS_Current_Too_High, &report_error); - } + if ((globals.Flash.hvps_avg_curr_limit[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0) && (ChannelStateToTest[i].frequency > 0.0)) { + check_another_max_value ((100.0 / duty_scale) * globals.Flash.hvps_avg_curr_limit[i] * ChannelStateToTest[i].load_type / + (fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].frequency), + &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, HVPS_Current_Too_High, &report_error); + } - if ((globals.Flash.max_avg_power[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0)) { - check_another_max_value (globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type / - (ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].frequency), - &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, average_power_limit, &report_error); + if ((globals.Flash.max_avg_power[i] > 0.0) && (fabs(ChannelStateToTest[i].amplitude) > 0.0)) { + check_another_max_value (globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type / + (ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].frequency), + &globals.Constraints.err_max_pw[i], ChannelStateToTest[i].pw, average_power_limit, &report_error); + } } /* ------------------------------- */ @@ -1049,7 +1056,9 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } check_initial_min_value (temp, &globals.Constraints.err_min_delay[i], ChannelStateToTest[i].delay, delay_lower_limit, &report_error); - check_another_min_value (-0.95/ChannelStateToTest[i].frequency, &globals.Constraints.err_min_delay[i], ChannelStateToTest[i].delay, Delay_Exceeds_95Period, &report_error); + if (ChannelStateToTest[i].trigger_source == source_internal) { + check_another_min_value (-0.95/ChannelStateToTest[i].frequency, &globals.Constraints.err_min_delay[i], ChannelStateToTest[i].delay, Delay_Exceeds_95Period, &report_error); + } if (ChannelStateToTest[i].double_pulse==double_on) { @@ -1064,16 +1073,23 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) /* --- check maximum delay ------- */ check_initial_max_value (globals.Flash.max_delay[i], &globals.Constraints.err_max_delay[i], ChannelStateToTest[i].delay, delay_upper_limit, &report_error); - check_another_max_value (0.95/ChannelStateToTest[i].frequency, &globals.Constraints.err_max_delay[i], ChannelStateToTest[i].delay, Delay_Exceeds_95Period, &report_error); + if (ChannelStateToTest[i].trigger_source == source_internal) { - if (ChannelStateToTest[i].double_pulse==double_on) { - // one half-period - check_another_max_value (0.5 / ChannelStateToTest[i].frequency, &globals.Constraints.err_max_delay[i], ChannelStateToTest[i].delay, Double_Separation_Too_Large, &report_error); + check_another_max_value (0.95/ChannelStateToTest[i].frequency, &globals.Constraints.err_max_delay[i], ChannelStateToTest[i].delay, Delay_Exceeds_95Period, &report_error); + + if (ChannelStateToTest[i].double_pulse==double_on) { + // one half-period + check_another_max_value (0.5 / ChannelStateToTest[i].frequency, &globals.Constraints.err_max_delay[i], ChannelStateToTest[i].delay, Double_Separation_Too_Large, &report_error); + } } /* ------------------------------- */ // calculate duty cycle for later use - duty_cycle=ChannelStateToTest[i].pw*ChannelStateToTest[i].frequency*100.0; /* calculate duty cycle */ + if (ChannelStateToTest[i].trigger_source == source_internal) { + duty_cycle = ChannelStateToTest[i].pw*ChannelStateToTest[i].frequency*100.0; /* calculate duty cycle */ + } else { + duty_cycle = 0.0; + } /* disable amplitude checks if amplitude calibration is in progress */ if (!globals.Flags.extended_ampl_min_max) { @@ -1143,59 +1159,60 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) check_another_min_value (temp, &globals.Constraints.err_min_ampl[i], ChannelStateToTest[i].amplitude, peak_power_limit, &report_error); } - if (globals.Flash.max_avg_power[i] > 0.0) { - temp = sqrt(globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type / (ChannelStateToTest[i].pw * ChannelStateToTest[i].frequency)); - // temp is positive at this point - check_another_max_value (temp, &globals.Constraints.err_max_ampl[i], ChannelStateToTest[i].amplitude, average_power_limit, &report_error); - - temp = temp * -1.0; // check negative possibility - check_another_min_value (temp, &globals.Constraints.err_min_ampl[i], ChannelStateToTest[i].amplitude, average_power_limit, &report_error); - } - - if (globals.Flash.min_pw[i] > 0.0) { - /* Check average amplitude */ - if (globals.Flash.max_avg_ampl[i] > 0.0) { - temp = 100.0 * globals.Flash.max_avg_ampl[i] / (ChannelStateToTest[i].frequency * ChannelStateToTest[i].pw * duty_scale); + if (ChannelStateToTest[i].trigger_source == source_internal) { + if (globals.Flash.max_avg_power[i] > 0.0) { + temp = sqrt(globals.Flash.max_avg_power[i] * ChannelStateToTest[i].load_type / (ChannelStateToTest[i].pw * ChannelStateToTest[i].frequency)); // temp is positive at this point - check_another_max_value (temp, &globals.Constraints.err_max_ampl[i], ChannelStateToTest[i].amplitude, Average_Amplitude_Too_High, &report_error); + check_another_max_value (temp, &globals.Constraints.err_max_ampl[i], ChannelStateToTest[i].amplitude, average_power_limit, &report_error); temp = temp * -1.0; // check negative possibility - check_another_min_value (temp, &globals.Constraints.err_min_ampl[i], ChannelStateToTest[i].amplitude, Average_Amplitude_Too_High, &report_error); + check_another_min_value (temp, &globals.Constraints.err_min_ampl[i], ChannelStateToTest[i].amplitude, average_power_limit, &report_error); } - if ((globals.Flash.hvps_avg_curr_limit[i] > 0.0) && (fabs(ChannelStateToTest[i].frequency) > 0.0) && (ChannelStateToTest[i].pw > 0.0)) { - temp=(100.0 / duty_scale) * globals.Flash.hvps_avg_curr_limit[i] * ChannelStateToTest[i].load_type / - (ChannelStateToTest[i].frequency * ChannelStateToTest[i].pw); - // temp is positive at this point - check_another_max_value (temp, &globals.Constraints.err_max_ampl[i], ChannelStateToTest[i].amplitude, HVPS_Current_Too_High, &report_error); + if (globals.Flash.min_pw[i] > 0.0) { + /* Check average amplitude */ + if (globals.Flash.max_avg_ampl[i] > 0.0) { + temp = 100.0 * globals.Flash.max_avg_ampl[i] / (ChannelStateToTest[i].frequency * ChannelStateToTest[i].pw * duty_scale); + // temp is positive at this point + check_another_max_value (temp, &globals.Constraints.err_max_ampl[i], ChannelStateToTest[i].amplitude, Average_Amplitude_Too_High, &report_error); + + temp = temp * -1.0; // check negative possibility + check_another_min_value (temp, &globals.Constraints.err_min_ampl[i], ChannelStateToTest[i].amplitude, Average_Amplitude_Too_High, &report_error); + } - temp = temp * -1.0; // check negative possibility - if (temp > globals.Constraints.err_min_ampl[i]) { - globals.Constraints.err_min_ampl[i]=temp; - if (ChannelStateToTest[i].amplitude<(1.001*globals.Constraints.err_min_ampl[i])) { - report_error=HVPS_Current_Too_High; + if ((globals.Flash.hvps_avg_curr_limit[i] > 0.0) && (fabs(ChannelStateToTest[i].frequency) > 0.0) && (ChannelStateToTest[i].pw > 0.0)) { + temp=(100.0 / duty_scale) * globals.Flash.hvps_avg_curr_limit[i] * ChannelStateToTest[i].load_type / + (ChannelStateToTest[i].frequency * ChannelStateToTest[i].pw); + // temp is positive at this point + check_another_max_value (temp, &globals.Constraints.err_max_ampl[i], ChannelStateToTest[i].amplitude, HVPS_Current_Too_High, &report_error); + + temp = temp * -1.0; // check negative possibility + if (temp > globals.Constraints.err_min_ampl[i]) { + globals.Constraints.err_min_ampl[i]=temp; + if (ChannelStateToTest[i].amplitude<(1.001*globals.Constraints.err_min_ampl[i])) { + report_error=HVPS_Current_Too_High; + } } } - } - if (duty_cycle>(100.0*ampl_fixed_max_duty/duty_scale)) - /* set at crossover voltage */ - { - // FIXME to use check_ functions - temp=globals.Flash.duty_ampl[i]; - - if (temp<globals.Constraints.err_max_ampl[i]) { - globals.Constraints.err_max_ampl[i]=temp; - if ( ( (globals.Constraints.err_max_ampl[i]>=0.0 && ChannelStateToTest[i].amplitude>(1.001*globals.Constraints.err_max_ampl[i])) - || (globals.Constraints.err_max_ampl[i]<0.0 && ChannelStateToTest[i].amplitude>(0.999*globals.Constraints.err_max_ampl[i])) - ) - && (duty_cycle > 1.001*(100.0*max_duty_high_ampl/duty_scale)) - ) { - report_error=duty_cycle_upper_limit; + if (duty_cycle>(100.0*ampl_fixed_max_duty/duty_scale)) + /* set at crossover voltage */ + { + // FIXME to use check_ functions + temp=globals.Flash.duty_ampl[i]; + + if (temp<globals.Constraints.err_max_ampl[i]) { + globals.Constraints.err_max_ampl[i]=temp; + if ( ( (globals.Constraints.err_max_ampl[i]>=0.0 && ChannelStateToTest[i].amplitude>(1.001*globals.Constraints.err_max_ampl[i])) + || (globals.Constraints.err_max_ampl[i]<0.0 && ChannelStateToTest[i].amplitude>(0.999*globals.Constraints.err_max_ampl[i])) + ) + && (duty_cycle > 1.001*(100.0*max_duty_high_ampl/duty_scale)) + ) { + report_error=duty_cycle_upper_limit; + } } } } - } /* ------------------------------- */ @@ -1223,14 +1240,16 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } } - if ( (globals.Flash.max_freq_for_high_ot[i] > 0.0) && - (ChannelStateToTest[i].frequency > globals.Flash.max_freq_for_high_ot[i])) { + if (ChannelStateToTest[i].trigger_source == source_internal) { + if ( (globals.Flash.max_freq_for_high_ot[i] > 0.0) && + (ChannelStateToTest[i].frequency > globals.Flash.max_freq_for_high_ot[i])) { - temp = -globals.Flash.high_ot[i]; - if (temp>globals.Constraints.err_min_offset[i]) { - globals.Constraints.err_min_offset[i]=temp; - if (ChannelStateToTest[i].offset<=globals.Constraints.err_min_offset[i]) { - report_error=PRF_limited_by_offset; + temp = -globals.Flash.high_ot[i]; + if (temp>globals.Constraints.err_min_offset[i]) { + globals.Constraints.err_min_offset[i]=temp; + if (ChannelStateToTest[i].offset<=globals.Constraints.err_min_offset[i]) { + report_error=PRF_limited_by_offset; + } } } } @@ -1258,17 +1277,19 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } } - if ( (globals.Flash.max_freq_for_high_ot[i] > 0.0) && - (ChannelStateToTest[i].frequency > globals.Flash.max_freq_for_high_ot[i])) { + if (ChannelStateToTest[i].trigger_source == source_internal) { + if ( (globals.Flash.max_freq_for_high_ot[i] > 0.0) && + (ChannelStateToTest[i].frequency > globals.Flash.max_freq_for_high_ot[i])) { - temp = globals.Flash.high_ot[i]; - if (temp<globals.Constraints.err_max_offset[i]) { - globals.Constraints.err_max_offset[i]=temp; - if (ChannelStateToTest[i].offset>=globals.Constraints.err_max_offset[i]) { - report_error=PRF_limited_by_offset; - } - } - } + temp = globals.Flash.high_ot[i]; + if (temp<globals.Constraints.err_max_offset[i]) { + globals.Constraints.err_max_offset[i]=temp; + if (ChannelStateToTest[i].offset>=globals.Constraints.err_max_offset[i]) { + report_error=PRF_limited_by_offset; + } + } + } + } /* ------------------------------- */ } @@ -1306,32 +1327,32 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) if (!globals.Flash.burst_func[i]) { - if (globals.Flash.min_pw[i] > 0.0) { - temp = (ChannelStateToTest[i].frequency * ampl_fixed_max_duty) / - (ChannelStateToTest[i].pw * 100.0); - - if (temp < (float) globals.Constraints.err_max_burst_count[i]) { - globals.Constraints.err_max_burst_count[i] = (int) temp; - if ( (ChannelStateToTest[i].burst_count>globals.Constraints.err_max_burst_count[i]) - && (ChannelStateToTest[i].burst_count>1)) { - report_error=max_burst_count_error; + if (ChannelStateToTest[i].trigger_source == source_internal) { + if (globals.Flash.min_pw[i] > 0.0) { + temp = (ChannelStateToTest[i].frequency * ampl_fixed_max_duty) / + (ChannelStateToTest[i].pw * 100.0); + + if (temp < (float) globals.Constraints.err_max_burst_count[i]) { + globals.Constraints.err_max_burst_count[i] = (int) temp; + if ( (ChannelStateToTest[i].burst_count>globals.Constraints.err_max_burst_count[i]) + && (ChannelStateToTest[i].burst_count>1)) { + report_error=max_burst_count_error; + } } - } - - temp = (1.0/ChannelStateToTest[i].frequency) / - (ChannelStateToTest[i].pw+ChannelStateToTest[i].burst_time); + temp = (1.0/ChannelStateToTest[i].frequency) / + (ChannelStateToTest[i].pw+ChannelStateToTest[i].burst_time); - if (temp < (float) globals.Constraints.err_max_burst_count[i]) { - globals.Constraints.err_max_burst_count[i] = (int) temp; - if ( (ChannelStateToTest[i].burst_count>globals.Constraints.err_max_burst_count[i]) - && (ChannelStateToTest[i].burst_count>1)) { - report_error=Burst_Exceeds_Period; + if (temp < (float) globals.Constraints.err_max_burst_count[i]) { + globals.Constraints.err_max_burst_count[i] = (int) temp; + if ( (ChannelStateToTest[i].burst_count>globals.Constraints.err_max_burst_count[i]) + && (ChannelStateToTest[i].burst_count>1)) { + report_error=Burst_Exceeds_Period; + } } } } - /* --- check minimum burst gap settings --- */ // FIXME - update with new check_ routines, but only report error if count>1 @@ -1431,21 +1452,23 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) &globals.Constraints.err_min_load_type[i], ChannelStateToTest[i].load_type, pw_rc_limit, &report_error); } - if (globals.Flash.hvps_avg_curr_limit[i] > 0.0) { - check_another_min_value ((duty_scale / 100.0) * fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].pw * ChannelStateToTest[i].frequency / - globals.Flash.hvps_avg_curr_limit[i], - &globals.Constraints.err_min_load_type[i], ChannelStateToTest[i].load_type, HVPS_Current_Too_High, &report_error); - } - if (globals.Flash.max_peak_power[i] > 0.0) { check_another_min_value (ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude / globals.Flash.max_peak_power[i], &globals.Constraints.err_min_load_type[i], ChannelStateToTest[i].load_type, peak_power_limit, &report_error); } - if (globals.Flash.max_avg_power[i] > 0.0) { - check_another_min_value ((ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].pw * ChannelStateToTest[i].frequency) / - globals.Flash.max_avg_power[i], - &globals.Constraints.err_min_load_type[i], ChannelStateToTest[i].load_type, average_power_limit, &report_error); + if (ChannelStateToTest[i].trigger_source == source_internal) { + if (globals.Flash.hvps_avg_curr_limit[i] > 0.0) { + check_another_min_value ((duty_scale / 100.0) * fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].pw * ChannelStateToTest[i].frequency / + globals.Flash.hvps_avg_curr_limit[i], + &globals.Constraints.err_min_load_type[i], ChannelStateToTest[i].load_type, HVPS_Current_Too_High, &report_error); + } + + if (globals.Flash.max_avg_power[i] > 0.0) { + check_another_min_value ((ChannelStateToTest[i].amplitude * ChannelStateToTest[i].amplitude * ChannelStateToTest[i].pw * ChannelStateToTest[i].frequency) / + globals.Flash.max_avg_power[i], + &globals.Constraints.err_min_load_type[i], ChannelStateToTest[i].load_type, average_power_limit, &report_error); + } } check_initial_max_value (globals.Flash.high_load_type[i], &globals.Constraints.err_max_load_type[i], ChannelStateToTest[i].load_type, max_load_type_error, &report_error); @@ -1,2 +1,2 @@ -#define FW_VERSION "6.4.36" +#define FW_VERSION "6.4.37" #define SCPI_version "1996.0" |