diff options
-rw-r--r-- | device-functions.c | 9 | ||||
-rw-r--r-- | globals.h | 1 | ||||
-rw-r--r-- | parser.c | 39 |
3 files changed, 42 insertions, 7 deletions
diff --git a/device-functions.c b/device-functions.c index 56a6205..ef764b4 100644 --- a/device-functions.c +++ b/device-functions.c @@ -2423,18 +2423,15 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float case pwl_burst_values: case pwl_rise_time_values: case pwl_slew_values: - /* exclude relative changes of 45% or more unless < 15 ns */ - if ( (fabs(cal_point-nom_ampl)/nom_ampl > 0.45) && (fabs(cal_point-nom_ampl)>15e-9)) { - return CalibrationPercentError; - } if (cal_point<0.0) { return Negative_Not_Allowed; } - break; + // no break here, continue - delay can be negative case pwl_delay_values: /* exclude relative changes of 45% or more unless < 15 ns */ - if ( (fabs(cal_point-nom_ampl)/nom_ampl > 0.45) && (fabs(cal_point-nom_ampl)>15e-9)) { + if ( (fabs(cal_point-nom_ampl)/nom_ampl > 0.45) && (fabs(cal_point-nom_ampl)>15e-9) && !globals.Sys.disable_timing_cal_percent_check) { + // this check can be temporarily disabled for convenience return CalibrationPercentError; } break; @@ -892,6 +892,7 @@ typedef struct { int shutdown_started; int flash_write_in_progress; int startup_complete; + int disable_timing_cal_percent_check; } SysFlagStruct; @@ -119,6 +119,8 @@ static int Go_atten_103(gchar** response, int channel, char *parameter,char *uni static int Go_eprom_resize_105(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_eprom_resize_ampl_106(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_eprom_resize_offset_107(gchar** response, int channel, char *parameter,char *units,int command_type); +static int Go_cal_checking_disable_108(gchar** response, int channel, char *parameter,char *units,int command_type); + static int Parser_id_word(char *id_me, int *channel, int *with_id_code) { @@ -360,6 +362,10 @@ static int Parser_id_word(char *id_me, int *channel, int *with_id_code) id_code = 110; } else if (!strcmp(id_me,"resize")) { id_code = 111; + } else if (!strcmp(id_me,"check")) { + id_code = 112; + } else if (!strcmp(id_me,"disable")) { + id_code = 113; } else { id_code = 9999; } @@ -489,7 +495,8 @@ static int Parser_find_commands(int commands[], int command_depth) {23,32,110,88,93}, /* diag:ampl:distort:calib:point - 104 */ {23,57,111}, /* diag:eprom:resize - 105 */ {23,57,111,32}, /* diag:eprom:resize:ampl - 106 */ - {23,57,111,33} /* diag:eprom:resize:offset - 107 */ + {23,57,111,33}, /* diag:eprom:resize:offset - 107 */ + {23,88,112,113} /* diag:cal:check:disable - 108 */ }; @@ -1081,6 +1088,9 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer case 107: error_num=Go_eprom_resize_offset_107(&response,channel,parameter,units,command_type); break; + case 108: + error_num=Go_cal_checking_disable_108(&response,channel,parameter,units,command_type); + break; case 9999: // was only whitespace, ignore @@ -4301,3 +4311,30 @@ static int Go_eprom_resize_offset_107(gchar** response, int channel, char *param return ThisShouldntHappen; } + + +static int Go_cal_checking_disable_108(gchar** response, int channel, char *parameter,char *units,int command_type) +{ + int on_off, status; + + switch (command_type) { + case command_withparam: + if (status=process_on_off (parameter, &on_off)) { + return status; + } + globals.Sys.disable_timing_cal_percent_check = on_off; + + return OK; + break; + + case query_simple: + return query_int (response, globals.Sys.disable_timing_cal_percent_check); + break; + + default: + return SyntaxError; + break; + } + + return ThisShouldntHappen; +} |