diff options
author | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:45:30 +0900 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:45:30 +0900 |
commit | b69ba4a8be5b0410c9d93537be4824658904040e (patch) | |
tree | 9198a9d69144dd4d07b1efde106f2975845e031f | |
parent | 92572cdd82ef8cce33eb52359f14ab0f2b13bd12 (diff) |
limit maximum PRF if offset is high in 101x-OT unitsINSTRUMENT_6_0_2d
-rw-r--r-- | error_utils.c | 40 | ||||
-rw-r--r-- | flash.c | 3 | ||||
-rw-r--r-- | globals.h | 4 |
3 files changed, 47 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; + } + } + } + /* ------------------------------- */ } } @@ -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; @@ -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; |