From e3fe9a65f8ebbbbb7fffe65f79ffb235bbb8b029 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 31 Dec 1999 21:24:39 -0500 Subject: add config option to force monotonic TRIG-OUT delay when externally triggered. --- device-functions.c | 9 ++++++++- error_utils.c | 8 ++++++++ flash.c | 2 ++ globals.h | 5 +++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/device-functions.c b/device-functions.c index ee62cf1..69d94fa 100644 --- a/device-functions.c +++ b/device-functions.c @@ -757,7 +757,7 @@ int Set_Delay(int check_possible_only,int word_override,int range_override,int c /* won't work for all values if apparent fixed delay is less than minimum variable delay */ min_one_shot_delay = globals.Flash.delay_pwl_time[channel][0][0][0]; if (globals.Flash.delay_shrink[channel] < min_one_shot_delay) { - return HardwareError; + return DelayRangeError; } /* If we need the advance mode for all positive values of delay (for the external trigger @@ -775,6 +775,13 @@ int Set_Delay(int check_possible_only,int word_override,int range_override,int c SYNC pulse. */ + if ( globals.Flash.force_monotonic_ext_trig_delay[channel] && // specials mostly + (globals.Flash.delay_shrink[channel] > 0.0) && // ignore if delay shrink cal not set + (globals.Flash.propagation_delay[channel] > 0.0) && + ((globals.Flash.delay_shrink[channel] - globals.Flash.propagation_delay[channel]) < min_one_shot_delay)) { + return ExternalModeDelayError; + } + /* tweak depending on polarity */ adj_setting = set_delay; diff --git a/error_utils.c b/error_utils.c index 503724d..eb5d337 100644 --- a/error_utils.c +++ b/error_utils.c @@ -484,6 +484,14 @@ void get_error_text(gchar **response, int error_num) format_error_text(response,-240,"Not possible with the current PW distortion settings."); break; + case DelayRangeError: + format_error_text(response,-240,"Gap in possible delay values."); + break; + + case ExternalModeDelayError: + format_error_text(response,-240,"TRIG-OUT delay not monotonic, boost fixed delay or sync delay."); + break; + case burst_duty_error: format_error_text(response,-222,"Duty cycle inside burst is too high."); break; diff --git a/flash.c b/flash.c index 1484bb2..0e05caa 100644 --- a/flash.c +++ b/flash.c @@ -802,6 +802,8 @@ static void initFlashValues(FlashStruct *mem) } mem->atten_percent_max_ampl[i] = 0.93; + + mem->force_monotonic_ext_trig_delay[i] = 0; } mem->relay_delay_in_sec=0.5; diff --git a/globals.h b/globals.h index d7b974c..f9c9644 100644 --- a/globals.h +++ b/globals.h @@ -88,6 +88,8 @@ #define NetworkNotFound 74 #define ThisShouldntHappen 75 #define Startup_Not_Finished 76 +#define DelayRangeError 77 +#define ExternalModeDelayError 78 #define YES 1 #define NO 0 @@ -719,6 +721,9 @@ typedef struct { char ignore_ampl_polarity[max_channels]; /* addr 10148, for AVR-D3-B-MS1 CH2 */ char I2C_port_for_CH2_delay; /* addr 10150, for AVIR-2-B-PN-DP-KMPC-VXI */ + char sparex4; + + char force_monotonic_ext_trig_delay[max_channels]; /* addr 10152 - maybe for AVL-5-B-PN-TR-DP-KMPD */ char flash_end; -- cgit