summaryrefslogtreecommitdiff
path: root/error_utils.c
diff options
context:
space:
mode:
authormjc <mjc@avtechpulse.com>1970-01-01 10:36:31 +0900
committermjc <mjc@avtechpulse.com>1970-01-01 10:36:31 +0900
commit3a7e097b05c1283e2a1dc344799cd3bf9bd96969 (patch)
tree1a88fb90ec3f18fe200b1fbc04551c3e902dfa69 /error_utils.c
parent2b750070dc78edaed92b8900c152ac899c385c47 (diff)
Enforce minimum ampl magnitude (based on zero_equiv_ampl) in AVRQ -AHV, -XHV options
Diffstat (limited to 'error_utils.c')
-rw-r--r--error_utils.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/error_utils.c b/error_utils.c
index 6361065..9965b23 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -43,6 +43,7 @@ void set_gpib_error_flags (int error_num)
case ThisShouldntHappen:
case obsolete_feature:
case zero_equiv_ampl_too_large:
+ case zero_equiv_ampl_negative:
GPIB_Set_Command_Error();
break;
case query_error_interrupted:
@@ -377,6 +378,10 @@ void get_error_text(gchar **response, int error_num)
format_error_text(response,-222,"Amplitude too high.");
break;
+ case amplitude_gap:
+ format_error_text(response,-222,"Amplitude magnitude too low.");
+ break;
+
case peak_power_limit:
format_error_text(response,-222,"Peak power too high.");
break;
@@ -553,6 +558,10 @@ void get_error_text(gchar **response, int error_num)
format_error_text(response,-200,"Ampl zero equivalent is too high. Reprogram it.");
break;
+ case zero_equiv_ampl_negative:
+ format_error_text(response,-200,"Ampl zero equivalent can't be negative.");
+ break;
+
default:
format_error_text(response,-200,"Specific problem unknown.");
}
@@ -708,10 +717,14 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
break;
}
- if (fabs(globals.Flash.ampl_zero_equiv[i] > 200.0)) {
+ if (fabs(globals.Flash.ampl_zero_equiv[i] > 2000.0)) {
report_error = zero_equiv_ampl_too_large;
}
+ if (globals.Flash.ampl_zero_equiv[i] < 0.0) {
+ report_error = zero_equiv_ampl_negative;
+ }
+
/* calculate maximum duty cycle based on amplitude and load, for later use */
max_duty_high_ampl=globals.Flash.max_duty_high[i];
@@ -1088,6 +1101,18 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
/* ------------------------------- */
+
+ /* --- check gaps in ampl range, AVRQ -AHV/-XHV ---- */
+ if (non_zero_first_ampl_point(i)) {
+ if (fabs(ChannelStateToTest[i].amplitude) < globals.Flash.ampl_zero_equiv[i]) {
+ report_error=amplitude_gap;
+ }
+ }
+
+ /* ------------------------------------------------- */
+
+
+
/* --- check minimum amplitude --- */
if (uses_fixed_ampl && (min_fixed_ampl > globals.Flash.min_ampl[i])) {