From b69ba4a8be5b0410c9d93537be4824658904040e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Jan 1970 09:45:30 +0900 Subject: limit maximum PRF if offset is high in 101x-OT units --- error_utils.c | 40 ++++++++++++++++++++++++++++++++++++++++ flash.c | 3 +++ globals.h | 4 ++++ 3 files changed, 47 insertions(+) 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(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 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]) { + report_error=PRF_limited_by_offset; + } + } + } + /* ------------------------------- */ } } diff --git a/flash.c b/flash.c index b2bd2f8..5801daa 100644 --- a/flash.c +++ b/flash.c @@ -814,6 +814,9 @@ static void initFlashValues(FlashStruct *mem) mem->atten_percent_max_ampl[i] = 0.93; mem->force_monotonic_ext_trig_delay[i] = 0; + + mem->max_freq_for_high_ot[i] = 0.0; + mem->high_ot[i] = 0.0; } mem->relay_delay_in_sec=0.5; diff --git a/globals.h b/globals.h index f9c9644..891aa2e 100644 --- a/globals.h +++ b/globals.h @@ -90,6 +90,7 @@ #define Startup_Not_Finished 76 #define DelayRangeError 77 #define ExternalModeDelayError 78 +#define PRF_limited_by_offset 79 #define YES 1 #define NO 0 @@ -725,6 +726,9 @@ typedef struct { char force_monotonic_ext_trig_delay[max_channels]; /* addr 10152 - maybe for AVL-5-B-PN-TR-DP-KMPD */ + float max_freq_for_high_ot[max_channels]; /* addr 10154, for 1011-OT */ + float high_ot[max_channels]; /* addr 10162, for 1011-OT */ + char flash_end; } FlashStruct; -- cgit