diff options
Diffstat (limited to 'error_utils.c')
-rw-r--r-- | error_utils.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/error_utils.c b/error_utils.c index 5515181..0a77019 100644 --- a/error_utils.c +++ b/error_utils.c @@ -480,6 +480,10 @@ void get_error_text(gchar **response, int error_num) format_error_text(response,-221,"If ampl > 0, ampl+offset must be > 0, if ampl < 0, ampl+offset must be < 0."); break; + case PRF_limited_by_offset: + format_error_text(response,-221,"Offset too high for this PRF."); + break; + case PW_Distort_Error: format_error_text(response,-240,"Not possible with the current PW distortion settings."); break; @@ -761,6 +765,19 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels]) report_error=freq_upper_limit; } + if ( (globals.Flash.max_freq_for_high_ot[i] > 0.0) && + (fabs(ChannelStateToTest[i].offset) > globals.Flash.high_ot[i])) { + + temp = globals.Flash.max_freq_for_high_ot[i]; + if (temp<globals.Constraints.err_max_freq[i]) { + globals.Constraints.err_max_freq[i]=temp; + if (ChannelStateToTest[i].frequency>(1.001*globals.Constraints.err_max_freq[i])) { + report_error=PRF_limited_by_offset; + } + } + + } + if (fabs(ChannelStateToTest[i].delay)>1.0e-15) { temp=0.95/fabs(ChannelStateToTest[i].delay); if (temp<globals.Constraints.err_max_freq[i]) { @@ -1205,6 +1222,17 @@ 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])) { + + 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; + } + } + } /* ------------------------------- */ @@ -1239,6 +1267,18 @@ 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])) { + + 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; + } + } + } + /* ------------------------------- */ } } |