From a8d0193faeab4003b7b356df5125b80924c795d9 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 01:39:49 +0900 Subject: limit double pulse mode delay to 50% of period --- error_utils.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/error_utils.c b/error_utils.c index 24a9af5..f146129 100644 --- a/error_utils.c +++ b/error_utils.c @@ -887,7 +887,8 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } if (ChannelStateToTest[i].double_pulse==double_on) { - temp=0.95/(ChannelStateToTest[i].pw+fabs(ChannelStateToTest[i].delay)); + // pulse sep must be less than one half-period + temp = 0.5 / ChannelStateToTest[i].delay; if (temp(1.001*globals.Constraints.err_max_freq[i])) { @@ -954,6 +955,10 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) report_error=Double_Separation_Too_Small; } } + + if (ChannelStateToTest[i].burst_count>1) { + report_error=Cant_Do_Burst_and_Double; + } } if (ChannelStateToTest[i].trigger_source==source_internal) { @@ -994,20 +999,6 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } } - if (ChannelStateToTest[i].double_pulse==double_on) { - temp=(0.95/ChannelStateToTest[i].frequency)-ChannelStateToTest[i].delay; - if (temp(1.001*globals.Constraints.err_max_pw[i])) { - report_error=Double_Separation_Too_Large; - } - } - - if (ChannelStateToTest[i].burst_count>1) { - report_error=Cant_Do_Burst_and_Double; - } - } - 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].frequency * duty_scale); @@ -1104,7 +1095,8 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) } if (ChannelStateToTest[i].double_pulse==double_on) { - temp=(0.95/ChannelStateToTest[i].frequency)-ChannelStateToTest[i].pw; + // one half-period + temp = 0.5 / ChannelStateToTest[i].frequency; if (temp=0.0 && ChannelStateToTest[i].delay>(1.001*globals.Constraints.err_max_delay[i])) -- cgit