/* C code for program chirpScan, generated by snc from ../../src/rf/chirpscan.st */ #include #include #include #include #include "seq_snc.h" # line 23 "../../src/rf/chirpscan.st" # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 1 3 4 # 26 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/features.h" 1 3 4 # 368 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/features.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/sys/cdefs.h" 1 3 4 # 410 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/sys/cdefs.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/wordsize.h" 1 3 4 # 411 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/sys/cdefs.h" 2 3 4 # 369 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/features.h" 2 3 4 # 392 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/features.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/gnu/stubs.h" 1 3 4 # 10 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/gnu/stubs.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/gnu/stubs-64.h" 1 3 4 # 11 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/gnu/stubs.h" 2 3 4 # 393 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/features.h" 2 3 4 # 27 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/math-vector.h" 1 3 4 # 25 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/math-vector.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/libm-simd-decl-stubs.h" 1 3 4 # 26 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/math-vector.h" 2 3 4 # 32 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/huge_val.h" 1 3 4 # 36 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/huge_valf.h" 1 3 4 # 38 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/huge_vall.h" 1 3 4 # 39 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/inf.h" 1 3 4 # 42 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/nan.h" 1 3 4 # 45 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathdef.h" 1 3 4 # 28 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathdef.h" 3 4 # 28 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathdef.h" 3 4 typedef float float_t; typedef double double_t; # 49 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 83 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathcalls.h" 1 3 4 # 52 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathcalls.h" 3 4 extern double acos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __acos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double asin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __asin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double atan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double cos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double sin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double tan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __tan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double cosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double sinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double tanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __tanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern void sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__ , __leaf__)); extern void __sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__ , __leaf__)) ; extern double acosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __acosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double asinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __asinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double atanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double exp (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double log (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double log10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern double exp10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double pow10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __pow10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double expm1 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double log1p (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log1p (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double logb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __logb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double exp2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double log2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double pow (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double sqrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double hypot (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double cbrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double ceil (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fabs (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double floor (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fmod (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __isinf (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finite (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int isinf (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int finite (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double drem (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double significand (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __significand (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double copysign (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double nan (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __nan (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnan (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int isnan (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double j0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __j0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double j1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __j1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double jn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double __jn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double y0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __y0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double y1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __y1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double yn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double __yn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double erf (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __erf (double) __attribute__ ((__nothrow__ , __leaf__)); extern double erfc (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __erfc (double) __attribute__ ((__nothrow__ , __leaf__)); extern double lgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __lgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double tgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __tgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double gamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __gamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern double rint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __rint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double nexttoward (double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double remainder (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern int ilogb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double scalbln (double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalbln (double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double nearbyint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __nearbyint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double round (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __round (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double trunc (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __trunc (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern double __remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long int lrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int lround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lround (double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double fdim (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __fdim (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double fmax (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fmax (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fmin (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fmin (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __fpclassify (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbit (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double fma (double __x, double __y, double __z) __attribute__ ((__nothrow__ , __leaf__)); extern double __fma (double __x, double __y, double __z) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignaling (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double scalb (double __x, double __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__ , __leaf__)); # 84 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 104 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathcalls.h" 1 3 4 # 52 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathcalls.h" 3 4 extern float acosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __acosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float asinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __asinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float atanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float cosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __cosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float sinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float tanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __tanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float coshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __coshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float sinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float tanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern void sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__ , __leaf__)); extern void __sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__ , __leaf__)) ; extern float acoshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float asinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float atanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float expf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __expf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float logf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __logf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float log10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern float exp10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __exp10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float pow10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __pow10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float expm1f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float log1pf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float logbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __logbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float exp2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __exp2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float log2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float powf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float cbrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float ceilf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fabsf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float floorf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __isinff (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finitef (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int isinff (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int finitef (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float dremf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float significandf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __significandf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float nanf (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __nanf (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnanf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int isnanf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float j0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __j0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float j1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __j1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float jnf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float __jnf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float y0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __y0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float y1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __y1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float ynf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float __ynf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float erff (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __erff (float) __attribute__ ((__nothrow__ , __leaf__)); extern float erfcf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __erfcf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float lgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __lgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float tgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __tgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float gammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __gammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern float rintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __rintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern int ilogbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float scalblnf (float __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalblnf (float __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float nearbyintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __nearbyintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float roundf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __roundf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float truncf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __truncf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern float __remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long int lrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int lroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float fdimf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __fdimf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float fmaxf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fmaxf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fminf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fminf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __fpclassifyf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbitf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__ , __leaf__)); extern float __fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignalingf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__ , __leaf__)); # 105 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 151 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 # 1 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathcalls.h" 1 3 4 # 52 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/mathcalls.h" 3 4 extern long double acosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double asinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double atanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double cosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double tanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double coshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double sinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double tanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern void sincosl (long double __x, long double *__sinx, long double *__cosx) __attribute__ ((__nothrow__ , __leaf__)); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) __attribute__ ((__nothrow__ , __leaf__)) ; extern long double acoshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double asinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double atanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double expl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double logl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double log10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern long double exp10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __exp10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double pow10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __pow10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double expm1l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double log1pl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double logbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double exp2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __exp2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double log2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double sqrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double cbrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double ceill (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fabsl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double floorl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern int __isinfl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __finitel (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int isinfl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int finitel (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double significandl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double nanl (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __nanl (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __isnanl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int isnanl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double j0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __j0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double j1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __j1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double jnl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double y0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __y0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double y1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __y1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double ynl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double erfl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __erfl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double erfcl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double lgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double tgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double gammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __gammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern long double rintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern int ilogbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double nearbyintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nearbyintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double roundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __roundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double truncl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __truncl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long double __remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long int lrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int lroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); __extension__ extern long long int llroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double fdiml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fdiml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fminl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fminl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __fpclassifyl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int __signbitl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__ , __leaf__)); extern int __issignalingl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double scalbl (long double __x, long double __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalbl (long double __x, long double __n) __attribute__ ((__nothrow__ , __leaf__)); # 152 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 2 3 4 # 168 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 extern int signgam; # 209 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 enum { FP_NAN = 0, FP_INFINITE = 1, FP_ZERO = 2, FP_SUBNORMAL = 3, FP_NORMAL = 4 }; # 347 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_, _ISOC_ } _LIB_VERSION_TYPE; extern _LIB_VERSION_TYPE _LIB_VERSION; # 372 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 struct exception { int type; char *name; double arg1; double arg2; double retval; }; extern int matherr (struct exception *__exc); # 534 "/afs/slac.stanford.edu/package/linuxRT/vol6/buildroot-2016.11.1/host/linux-x86_64/x86_64/usr/x86_64-buildroot-linux-gnu/sysroot/usr/include/math.h" 3 4 # 26 "../../src/rf/chirpscan.st" 2 # 77 "../../src/rf/chirpscan.st" # 77 "../../src/rf/chirpscan.st" TS_STAMP df_ts; TS_STAMP rms_ts; void store_date(char *string, int type) { time_t rawtime; struct tm *tm_p; rawtime = time(NULL); tm_p = localtime(&rawtime); if (type == 0 ) strftime( string, MAX_STRING_SIZE, "%F-%T", tm_p ); else strftime( string, 55, "%Y%m%d_%H%M%S", tm_p ); } void log_message(FILE * filep, char *message, int debugprint, unsigned long fpaddr); void log_flush(FILE * filep, unsigned long fpaddr); void log_close(FILE * filep, int debugprint, unsigned long fpaddr); # line 105 "../../src/rf/chirpscan.st" FILE * fp; # line 187 "../../src/rf/chirpscan.st" static const EF_ID ef_scan_request = 1; # line 190 "../../src/rf/chirpscan.st" static const EF_ID ef_abort_request = 2; # line 484 "../../src/rf/chirpscan.st" static const EF_ID ef_rms = 3; # line 636 "../../src/rf/chirpscan.st" static const EF_ID ef_received_request = 4; # line 637 "../../src/rf/chirpscan.st" static const EF_ID ef_init_search = 5; # line 638 "../../src/rf/chirpscan.st" static const EF_ID ef_init_scan = 6; # line 639 "../../src/rf/chirpscan.st" static const EF_ID ef_build_search = 7; # line 640 "../../src/rf/chirpscan.st" static const EF_ID ef_build_shift = 8; # line 641 "../../src/rf/chirpscan.st" static const EF_ID ef_setup_scan = 9; # line 642 "../../src/rf/chirpscan.st" static const EF_ID ef_start_scan = 10; # line 643 "../../src/rf/chirpscan.st" static const EF_ID ef_start_scan_offset = 11; # line 644 "../../src/rf/chirpscan.st" static const EF_ID ef_get_data_offset = 12; # line 645 "../../src/rf/chirpscan.st" static const EF_ID ef_get_data_point = 13; # line 646 "../../src/rf/chirpscan.st" static const EF_ID ef_get_data_cavity = 14; # line 647 "../../src/rf/chirpscan.st" static const EF_ID ef_store_data_cavity_search = 15; # line 648 "../../src/rf/chirpscan.st" static const EF_ID ef_store_data_cavity_shift = 16; # line 649 "../../src/rf/chirpscan.st" static const EF_ID ef_process_search_results = 17; # line 650 "../../src/rf/chirpscan.st" static const EF_ID ef_post_scan = 18; # line 651 "../../src/rf/chirpscan.st" static const EF_ID ef_post_search = 19; # line 652 "../../src/rf/chirpscan.st" static const EF_ID ef_post_shift = 20; /* Variable declarations */ struct seqg_vars { # line 106 "../../src/rf/chirpscan.st" unsigned long fpaddr; # line 108 "../../src/rf/chirpscan.st" char *pmaclogpref; # line 109 "../../src/rf/chirpscan.st" char *pmaccm; # line 110 "../../src/rf/chirpscan.st" char *pmacrack; # line 111 "../../src/rf/chirpscan.st" int logfile_flag; # line 112 "../../src/rf/chirpscan.st" int logfile_flag_open; # line 113 "../../src/rf/chirpscan.st" char msg[300]; # line 114 "../../src/rf/chirpscan.st" char logpref[200]; # line 115 "../../src/rf/chirpscan.st" char logsuff[55]; # line 116 "../../src/rf/chirpscan.st" char logscantype[10]; # line 117 "../../src/rf/chirpscan.st" char fn[255]; # line 128 "../../src/rf/chirpscan.st" string debug_msg; # line 131 "../../src/rf/chirpscan.st" int debug; # line 136 "../../src/rf/chirpscan.st" int program_stat; # line 137 "../../src/rf/chirpscan.st" int rack_scan_stat; # line 144 "../../src/rf/chirpscan.st" int cavstat[4]; # line 146 "../../src/rf/chirpscan.st" int cavstat_search[4]; # line 152 "../../src/rf/chirpscan.st" int cavstat_shift[4]; # line 163 "../../src/rf/chirpscan.st" double search_progress; # line 171 "../../src/rf/chirpscan.st" int cavsel[4]; # line 178 "../../src/rf/chirpscan.st" int start_request; # line 183 "../../src/rf/chirpscan.st" int abort_request; # line 198 "../../src/rf/chirpscan.st" double freq_thresh; # line 203 "../../src/rf/chirpscan.st" int rack_f_step; # line 207 "../../src/rf/chirpscan.st" double rms_thresh; # line 212 "../../src/rf/chirpscan.st" int search_nacq; # line 221 "../../src/rf/chirpscan.st" double f_start_8pi9; # line 223 "../../src/rf/chirpscan.st" double f_stop_8pi9; # line 231 "../../src/rf/chirpscan.st" int rack_f_start; # line 235 "../../src/rf/chirpscan.st" int rack_f_stop; # line 242 "../../src/rf/chirpscan.st" int f_shift; # line 249 "../../src/rf/chirpscan.st" double offset_exact[50]; # line 253 "../../src/rf/chirpscan.st" double f_pi[4]; # line 259 "../../src/rf/chirpscan.st" double rms_pi[4]; # line 265 "../../src/rf/chirpscan.st" double fitrms_pi[4]; # line 271 "../../src/rf/chirpscan.st" double bw_pi[4]; # line 277 "../../src/rf/chirpscan.st" double amax_pi[4]; # line 283 "../../src/rf/chirpscan.st" int found_pi[4]; # line 289 "../../src/rf/chirpscan.st" string foundts_pi[4]; # line 297 "../../src/rf/chirpscan.st" double f_8pi9[4]; # line 303 "../../src/rf/chirpscan.st" double rms_8pi9[4]; # line 309 "../../src/rf/chirpscan.st" double fitrms_8pi9[4]; # line 315 "../../src/rf/chirpscan.st" double bw_8pi9[4]; # line 321 "../../src/rf/chirpscan.st" double amax_8pi9[4]; # line 327 "../../src/rf/chirpscan.st" int found_8pi9[4]; # line 333 "../../src/rf/chirpscan.st" string foundts_8pi9[4]; # line 341 "../../src/rf/chirpscan.st" double df_bestwf_offs[4][50]; # line 342 "../../src/rf/chirpscan.st" double df_bestwf[4][50]; # line 349 "../../src/rf/chirpscan.st" double rms_bestwf[4][50]; # line 356 "../../src/rf/chirpscan.st" double bw_bestwf[4][50]; # line 363 "../../src/rf/chirpscan.st" double fitrms_bestwf[4][50]; # line 370 "../../src/rf/chirpscan.st" double amax_bestwf[4][50]; # line 377 "../../src/rf/chirpscan.st" int found[4][50]; # line 378 "../../src/rf/chirpscan.st" int found_index[4]; # line 379 "../../src/rf/chirpscan.st" int nfound[4]; # line 391 "../../src/rf/chirpscan.st" double df_live[4]; # line 397 "../../src/rf/chirpscan.st" double rms_live[4]; # line 403 "../../src/rf/chirpscan.st" double fitrms_live[4]; # line 409 "../../src/rf/chirpscan.st" double bw_live[4]; # line 415 "../../src/rf/chirpscan.st" double amax_live[4]; # line 421 "../../src/rf/chirpscan.st" int found_live[4]; # line 427 "../../src/rf/chirpscan.st" string foundts_live[4]; # line 438 "../../src/rf/chirpscan.st" int rfmodectrl[4]; # line 445 "../../src/rf/chirpscan.st" int rfctrl[4]; # line 452 "../../src/rf/chirpscan.st" int rfstate[4]; # line 459 "../../src/rf/chirpscan.st" double df[4]; # line 467 "../../src/rf/chirpscan.st" double amax[4]; # line 478 "../../src/rf/chirpscan.st" double rms[4]; # line 488 "../../src/rf/chirpscan.st" double bw[4]; # line 498 "../../src/rf/chirpscan.st" double fitrms[4]; # line 506 "../../src/rf/chirpscan.st" int cav_f_start[4]; # line 513 "../../src/rf/chirpscan.st" int cav_f_stop[4]; # line 520 "../../src/rf/chirpscan.st" int df_tx_enable[4]; # line 530 "../../src/rf/chirpscan.st" int rack_offset; # line 534 "../../src/rf/chirpscan.st" double offset_rbv[4]; # line 540 "../../src/rf/chirpscan.st" double rack_offset_rbv; # line 545 "../../src/rf/chirpscan.st" int phase_reset_rfs[4]; # line 553 "../../src/rf/chirpscan.st" int phase_step_rfs[4]; # line 560 "../../src/rf/chirpscan.st" int phase_step_h_prc; # line 564 "../../src/rf/chirpscan.st" int phase_reset_prc; # line 571 "../../src/rf/chirpscan.st" int scan_type; # line 572 "../../src/rf/chirpscan.st" int df_sevr; # line 573 "../../src/rf/chirpscan.st" int rms_sevr; # line 574 "../../src/rf/chirpscan.st" int noffset; # line 575 "../../src/rf/chirpscan.st" double offset[50]; # line 577 "../../src/rf/chirpscan.st" double offset_exact_final; # line 578 "../../src/rf/chirpscan.st" double diff; # line 578 "../../src/rf/chirpscan.st" double search_start; # line 578 "../../src/rf/chirpscan.st" double search_stop; # line 579 "../../src/rf/chirpscan.st" int new; # line 582 "../../src/rf/chirpscan.st" int index; # line 583 "../../src/rf/chirpscan.st" int index_pi; # line 584 "../../src/rf/chirpscan.st" int index_8pi9; # line 585 "../../src/rf/chirpscan.st" int index_offset; # line 586 "../../src/rf/chirpscan.st" int index_cavity; # line 588 "../../src/rf/chirpscan.st" char cavstr[4][5]; # line 590 "../../src/rf/chirpscan.st" int df_tx_enable_init[4]; # line 592 "../../src/rf/chirpscan.st" int i; # line 592 "../../src/rf/chirpscan.st" int j; # line 592 "../../src/rf/chirpscan.st" int k; # line 594 "../../src/rf/chirpscan.st" string string_ts; # line 595 "../../src/rf/chirpscan.st" int dds_step_combined; # line 596 "../../src/rf/chirpscan.st" int dds_step_h; # line 598 "../../src/rf/chirpscan.st" int ncavsel; # line 599 "../../src/rf/chirpscan.st" int range; # line 600 "../../src/rf/chirpscan.st" int freq_check; # line 602 "../../src/rf/chirpscan.st" int skip[4]; # line 603 "../../src/rf/chirpscan.st" int nskip; # line 605 "../../src/rf/chirpscan.st" int ntries; # line 605 "../../src/rf/chirpscan.st" int ntries_newdata; # line 605 "../../src/rf/chirpscan.st" int nacq; # line 605 "../../src/rf/chirpscan.st" int nacquired; # line 607 "../../src/rf/chirpscan.st" int match; # line 609 "../../src/rf/chirpscan.st" int now; # line 610 "../../src/rf/chirpscan.st" int then; # line 611 "../../src/rf/chirpscan.st" int timeout; # line 619 "../../src/rf/chirpscan.st" int cav_f_start_init[4]; # line 620 "../../src/rf/chirpscan.st" int cav_f_stop_init[4]; # line 622 "../../src/rf/chirpscan.st" double overlap; # line 628 "../../src/rf/chirpscan.st" int rms_ok; # line 631 "../../src/rf/chirpscan.st" int shift_firstmeas[4]; }; /* Function declarations */ #define seqg_var (*(struct seqg_vars *const *)seqg_env) /* Program init func */ static void seqg_init(PROG_ID seqg_env) { { # line 611 "../../src/rf/chirpscan.st" static int seqg_initvar_timeout = 5; memcpy(&seqg_var->timeout, &seqg_initvar_timeout, sizeof(seqg_initvar_timeout)); } { # line 622 "../../src/rf/chirpscan.st" static double seqg_initvar_overlap = 0.8; memcpy(&seqg_var->overlap, &seqg_initvar_overlap, sizeof(seqg_initvar_overlap)); } } /****** Code for state "init" in state set "main" ******/ /* Entry function for state "init" in state set "main" */ static void seqg_entry_main_0_init(SS_ID seqg_env) { # line 657 "../../src/rf/chirpscan.st" if (seqg_var->debug) { # line 658 "../../src/rf/chirpscan.st" printf("Entered chirp_scan program init\n"); } } /* Event function for state "init" in state set "main" */ static seqBool seqg_event_main_0_init(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 661 "../../src/rf/chirpscan.st" if (seq_pvConnectCount(seqg_env) == seq_pvAssignCount(seqg_env)) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "init" in state set "main" */ static void seqg_action_main_0_init(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 662 "../../src/rf/chirpscan.st" if (seqg_var->debug >= 2) { # line 663 "../../src/rf/chirpscan.st" printf("pvConnect=pvAssign\n"); } # line 666 "../../src/rf/chirpscan.st" strcpy(seqg_var->cavstr[0], seq_macValueGet(seqg_env, "CAVA")); # line 667 "../../src/rf/chirpscan.st" strcpy(seqg_var->cavstr[1], seq_macValueGet(seqg_env, "CAVB")); # line 668 "../../src/rf/chirpscan.st" strcpy(seqg_var->cavstr[2], seq_macValueGet(seqg_env, "CAVC")); # line 669 "../../src/rf/chirpscan.st" strcpy(seqg_var->cavstr[3], seq_macValueGet(seqg_env, "CAVD")); # line 670 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_scan_request); # line 671 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_abort_request); # line 672 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_received_request); # line 673 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_init_search); # line 674 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_init_scan); # line 675 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_build_search); # line 676 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_build_shift); # line 677 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_setup_scan); # line 678 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_start_scan); # line 679 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_start_scan_offset); # line 680 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_rms); # line 681 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_process_search_results); # line 682 "../../src/rf/chirpscan.st" seq_efClear(seqg_env, ef_post_scan); # line 684 "../../src/rf/chirpscan.st" seqg_var->program_stat = 0; # line 685 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 0; # line 686 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 2/*rack_scan_stat*/, DEFAULT, DEFAULT_TIMEOUT); # line 687 "../../src/rf/chirpscan.st" if (seqg_var->debug) { # line 688 "../../src/rf/chirpscan.st" printf("Ready for request\n"); } # line 692 "../../src/rf/chirpscan.st" seqg_var->pmaclogpref = seq_macValueGet(seqg_env, "LOGPREF"); # line 693 "../../src/rf/chirpscan.st" seqg_var->pmaccm = seq_macValueGet(seqg_env, "CM"); # line 694 "../../src/rf/chirpscan.st" seqg_var->pmacrack = seq_macValueGet(seqg_env, "RACK"); # line 695 "../../src/rf/chirpscan.st" if (seqg_var->pmaclogpref == 0 || seqg_var->pmaclogpref[0] == 0) { # line 696 "../../src/rf/chirpscan.st" printf("No macro defined for \"LOGPREF\". No log files will be created.\n"); # line 697 "../../src/rf/chirpscan.st" seqg_var->logfile_flag = 0; } else { # line 700 "../../src/rf/chirpscan.st" seqg_var->logfile_flag = 1; # line 701 "../../src/rf/chirpscan.st" snprintf(seqg_var->logpref, sizeof((seqg_var->logpref)), seqg_var->pmaclogpref); # line 702 "../../src/rf/chirpscan.st" printf("Log files will be written to %s.\n", seqg_var->logpref); } } return; } } /****** Code for state "ready_for_request" in state set "main" ******/ /* Event function for state "ready_for_request" in state set "main" */ static seqBool seqg_event_main_0_ready_for_request(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 708 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_abort_request)) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } # line 719 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 0) && seq_efTestAndClear(seqg_env, ef_scan_request)) { *seqg_pnst = 1; *seqg_ptrn = 1; return TRUE; } return FALSE; } /* Action function for state "ready_for_request" in state set "main" */ static void seqg_action_main_0_ready_for_request(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 709 "../../src/rf/chirpscan.st" if (seqg_var->abort_request == 1) { # line 710 "../../src/rf/chirpscan.st" seqg_var->abort_request = 0; # line 711 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 17/*abort_request*/, DEFAULT, DEFAULT_TIMEOUT); # line 712 "../../src/rf/chirpscan.st" seqg_var->start_request = 0; # line 713 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 16/*start_request*/, DEFAULT, DEFAULT_TIMEOUT); # line 714 "../../src/rf/chirpscan.st" seqg_var->program_stat = 3; # line 715 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_post_scan); } } return; case 1: { # line 721 "../../src/rf/chirpscan.st" seqg_var->scan_type = seqg_var->start_request; # line 722 "../../src/rf/chirpscan.st" seqg_var->start_request = 0; # line 723 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 16/*start_request*/, DEFAULT, DEFAULT_TIMEOUT); # line 724 "../../src/rf/chirpscan.st" seqg_var->abort_request = 0; # line 725 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 17/*abort_request*/, DEFAULT, DEFAULT_TIMEOUT); # line 726 "../../src/rf/chirpscan.st" if ((seqg_var->scan_type == 1) || (seqg_var->scan_type == 2)) { # line 727 "../../src/rf/chirpscan.st" seqg_var->program_stat = 1; # line 729 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag) { # line 731 "../../src/rf/chirpscan.st" seqg_var->logfile_flag_open = 0; # line 732 "../../src/rf/chirpscan.st" store_date(seqg_var->logsuff, 1); # line 733 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 734 "../../src/rf/chirpscan.st" sprintf(seqg_var->logscantype, "SEARCH"); } else { # line 737 "../../src/rf/chirpscan.st" sprintf(seqg_var->logscantype, "SHIFT"); } # line 740 "../../src/rf/chirpscan.st" memset(seqg_var->fn, 0, sizeof((seqg_var->fn))); # line 741 "../../src/rf/chirpscan.st" sprintf(seqg_var->fn, "%s-%s-%s.log", seqg_var->logpref, seqg_var->logscantype, seqg_var->logsuff); # line 742 "../../src/rf/chirpscan.st" fp = fopen(seqg_var->fn, "w"); # line 743 "../../src/rf/chirpscan.st" seqg_var->fpaddr = (unsigned long)fp; # line 745 "../../src/rf/chirpscan.st" if (seqg_var->fpaddr) { # line 746 "../../src/rf/chirpscan.st" seqg_var->logfile_flag_open = 1; # line 747 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Log file %s\n", seqg_var->fn); # line 748 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, 1, seqg_var->fpaddr); } else { # line 751 "../../src/rf/chirpscan.st" printf("Failed to create log file %s\n", seqg_var->fn); # line 752 "../../src/rf/chirpscan.st" fp = 0; # line 753 "../../src/rf/chirpscan.st" seqg_var->fpaddr = 0; } } # line 759 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Initial %s request for %s Rack %s, program_stat %i\n", (seqg_var->scan_type == 1 ? "Search" : seqg_var->scan_type == 2 ? "Shift" : "Unknown"), seqg_var->pmaccm, seqg_var->pmacrack, seqg_var->program_stat); # line 761 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, seqg_var->debug, seqg_var->fpaddr); # line 763 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_received_request); } } return; } } /****** Code for state "init_common" in state set "received_request" ******/ /* Event function for state "init_common" in state set "received_request" */ static seqBool seqg_event_received_request_1_init_common(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 772 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_received_request)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "init_common" in state set "received_request" */ static void seqg_action_received_request_1_init_common(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 773 "../../src/rf/chirpscan.st" seqg_var->ncavsel = 0; # line 774 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 775 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 12/*cavsel*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 776 "../../src/rf/chirpscan.st" seqg_var->ncavsel += seqg_var->cavsel[seqg_var->i]; # line 777 "../../src/rf/chirpscan.st" seqg_var->cavstat[seqg_var->i] = 0; # line 778 "../../src/rf/chirpscan.st" seqg_var->shift_firstmeas[seqg_var->i] = 1; } # line 781 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Processing %s request. Cavity selection:\n", (seqg_var->scan_type == 1 ? "Search" : seqg_var->scan_type == 2 ? "Shift" : "Unknown")); # line 782 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); # line 783 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 785 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s: %s\n", seqg_var->cavstr[seqg_var->i], seqg_var->cavsel[seqg_var->i] ? "Selected" : "Not selected"); # line 786 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); } # line 789 "../../src/rf/chirpscan.st" if (seqg_var->ncavsel > 0) { # line 790 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 791 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_init_search); } else { # line 794 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_init_scan); } } else { # line 798 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 1; # line 799 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 2/*rack_scan_stat*/, DEFAULT, DEFAULT_TIMEOUT); # line 800 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 801 "../../src/rf/chirpscan.st" seqg_var->logfile_flag_open = 0; # line 802 "../../src/rf/chirpscan.st" log_close(fp, seqg_var->debug, seqg_var->fpaddr); } # line 804 "../../src/rf/chirpscan.st" seqg_var->program_stat = 0; } } return; } } /****** Code for state "init_scan" in state set "init_scan_type" ******/ /* Event function for state "init_scan" in state set "init_scan_type" */ static seqBool seqg_event_init_scan_type_2_init_scan(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 813 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_init_search)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } # line 839 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_init_scan)) { *seqg_pnst = 0; *seqg_ptrn = 1; return TRUE; } return FALSE; } /* Action function for state "init_scan" in state set "init_scan_type" */ static void seqg_action_init_scan_type_2_init_scan(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 815 "../../src/rf/chirpscan.st" for (seqg_var->j = 0; seqg_var->j < 50; seqg_var->j++) { # line 816 "../../src/rf/chirpscan.st" seqg_var->offset[seqg_var->j] = -1; # line 817 "../../src/rf/chirpscan.st" seqg_var->offset_exact[seqg_var->j] = -1; # line 818 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 819 "../../src/rf/chirpscan.st" seqg_var->nfound[seqg_var->i] = 0; # line 820 "../../src/rf/chirpscan.st" seqg_var->found[seqg_var->i][seqg_var->j] = 0; # line 821 "../../src/rf/chirpscan.st" seqg_var->df_bestwf[seqg_var->i][seqg_var->j] = -1; # line 822 "../../src/rf/chirpscan.st" seqg_var->rms_bestwf[seqg_var->i][seqg_var->j] = -1; # line 823 "../../src/rf/chirpscan.st" seqg_var->fitrms_bestwf[seqg_var->i][seqg_var->j] = -1; # line 824 "../../src/rf/chirpscan.st" seqg_var->bw_bestwf[seqg_var->i][seqg_var->j] = -1; # line 825 "../../src/rf/chirpscan.st" seqg_var->amax_bestwf[seqg_var->i][seqg_var->j] = -1; # line 826 "../../src/rf/chirpscan.st" seqg_var->found_pi[seqg_var->i] = 0; # line 827 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 48/*found_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 828 "../../src/rf/chirpscan.st" seqg_var->found_8pi9[seqg_var->i] = 0; # line 829 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 76/*found_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } } # line 832 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 833 "../../src/rf/chirpscan.st" seqg_var->cavstat_search[seqg_var->i] = 0; # line 834 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 3/*cavstat_search*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } # line 836 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_build_search); } return; case 1: { # line 840 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 841 "../../src/rf/chirpscan.st" seqg_var->found_live[seqg_var->i] = 0; # line 842 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 128/*found_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 843 "../../src/rf/chirpscan.st" seqg_var->cavstat_shift[seqg_var->i] = 0; # line 844 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 7/*cavstat_shift*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } # line 846 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_build_shift); } return; } } /****** Code for state "build" in state set "build_scan" ******/ /* Event function for state "build" in state set "build_scan" */ static seqBool seqg_event_build_scan_3_build(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 853 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_build_search)) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } # line 884 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_build_shift)) { *seqg_pnst = 1; *seqg_ptrn = 1; return TRUE; } return FALSE; } /* Action function for state "build" in state set "build_scan" */ static void seqg_action_build_scan_3_build(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 854 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 24/*rack_f_start*/, DEFAULT, DEFAULT_TIMEOUT); # line 855 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 25/*rack_f_stop*/, DEFAULT, DEFAULT_TIMEOUT); # line 856 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 19/*rack_f_step*/, DEFAULT, DEFAULT_TIMEOUT); # line 857 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 22/*f_start_8pi9*/, DEFAULT, DEFAULT_TIMEOUT); # line 858 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 23/*f_stop_8pi9*/, DEFAULT, DEFAULT_TIMEOUT); # line 859 "../../src/rf/chirpscan.st" seqg_var->range = seqg_var->rack_f_stop - seqg_var->rack_f_start; # line 862 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Build search: freq start %.1f kHz stop %.1f kHz range %.1f kHz step %.1f kHz\n", (double)(seqg_var->rack_f_start / 1000.0), (double)(seqg_var->rack_f_stop / 1000.0), (double)(seqg_var->range / 1000.0), (double)(seqg_var->rack_f_step / 1000.0)); # line 863 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, seqg_var->debug, seqg_var->fpaddr); # line 868 "../../src/rf/chirpscan.st" seqg_var->freq_check = 0; # line 869 "../../src/rf/chirpscan.st" if ((seqg_var->range > 0) && (seqg_var->rack_f_step > 0)) { # line 870 "../../src/rf/chirpscan.st" seqg_var->freq_check = 1; # line 871 "../../src/rf/chirpscan.st" if (seqg_var->rack_f_step >= seqg_var->range) { # line 872 "../../src/rf/chirpscan.st" seqg_var->noffset = 1; # line 873 "../../src/rf/chirpscan.st" seqg_var->offset[0] = seqg_var->rack_f_start + (seqg_var->range / 2); } else { # line 876 "../../src/rf/chirpscan.st" seqg_var->noffset = round((seqg_var->rack_f_stop - seqg_var->rack_f_start) / (seqg_var->rack_f_step * seqg_var->overlap)); # line 877 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < seqg_var->noffset; seqg_var->i++) { # line 878 "../../src/rf/chirpscan.st" seqg_var->offset[seqg_var->i] = seqg_var->rack_f_start + ((2 * seqg_var->i + 1) * (seqg_var->rack_f_step * seqg_var->overlap / 2)); } } } } return; case 1: { # line 885 "../../src/rf/chirpscan.st" seqg_var->freq_check = 1; # line 886 "../../src/rf/chirpscan.st" seqg_var->noffset = 1; # line 887 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 26/*f_shift*/, DEFAULT, DEFAULT_TIMEOUT); # line 888 "../../src/rf/chirpscan.st" seqg_var->offset[0] = seqg_var->f_shift; } return; } } /****** Code for state "build_common" in state set "build_scan" ******/ /* Event function for state "build_common" in state set "build_scan" */ static seqBool seqg_event_build_scan_3_build_common(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { if (TRUE) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "build_common" in state set "build_scan" */ static void seqg_action_build_scan_3_build_common(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 894 "../../src/rf/chirpscan.st" seqg_var->freq_check = seqg_var->freq_check && (seqg_var->noffset > 0) && (seqg_var->noffset < 50); # line 895 "../../src/rf/chirpscan.st" if (seqg_var->freq_check) { # line 896 "../../src/rf/chirpscan.st" log_message(fp, "Search steps:\n", seqg_var->debug, seqg_var->fpaddr); # line 897 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < seqg_var->noffset; seqg_var->i++) { # line 898 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Scan offset index %i, frequency offset %.1f kHz\n", seqg_var->i, seqg_var->offset[seqg_var->i] / 1000.0); # line 899 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, seqg_var->debug, seqg_var->fpaddr); } # line 901 "../../src/rf/chirpscan.st" seqg_var->search_progress = 0; # line 902 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 11/*search_progress*/, DEFAULT, DEFAULT_TIMEOUT); # line 903 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_setup_scan); } else { # line 906 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 2; # line 907 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 2/*rack_scan_stat*/, DEFAULT, DEFAULT_TIMEOUT); # line 908 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Bad scan parameters, abort\n"); # line 909 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, seqg_var->debug, seqg_var->fpaddr); # line 910 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 911 "../../src/rf/chirpscan.st" seqg_var->logfile_flag_open = 0; # line 912 "../../src/rf/chirpscan.st" log_close(fp, seqg_var->debug, seqg_var->fpaddr); } # line 914 "../../src/rf/chirpscan.st" seqg_var->program_stat = 0; } } return; } } /****** Code for state "setup_cavities" in state set "setup_scan" ******/ /* Event function for state "setup_cavities" in state set "setup_scan" */ static seqBool seqg_event_setup_scan_4_setup_cavities(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 922 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_setup_scan)) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "setup_cavities" in state set "setup_scan" */ static void seqg_action_setup_scan_4_setup_cavities(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 926 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 927 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] == 0) { # line 928 "../../src/rf/chirpscan.st" seqg_var->rfctrl[seqg_var->i] = 0; # line 929 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 140/*rfctrl*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } else { # line 932 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 168/*cav_f_start*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 933 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 172/*cav_f_stop*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 934 "../../src/rf/chirpscan.st" seqg_var->cav_f_start_init[seqg_var->i] = seqg_var->cav_f_start[seqg_var->i]; # line 935 "../../src/rf/chirpscan.st" seqg_var->cav_f_stop_init[seqg_var->i] = seqg_var->cav_f_stop[seqg_var->i]; # line 937 "../../src/rf/chirpscan.st" seqg_var->cav_f_start[seqg_var->i] = -seqg_var->rack_f_step / 2; # line 938 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 168/*cav_f_start*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 939 "../../src/rf/chirpscan.st" seqg_var->cav_f_stop[seqg_var->i] = seqg_var->rack_f_step / 2; # line 940 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 172/*cav_f_stop*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 941 "../../src/rf/chirpscan.st" seqg_var->rfmodectrl[seqg_var->i] = 5; # line 942 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 136/*rfmodectrl*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 943 "../../src/rf/chirpscan.st" seqg_var->rfctrl[seqg_var->i] = 1; # line 944 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 140/*rfctrl*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } } } return; } } /****** Code for state "disable_df_tx" in state set "setup_scan" ******/ /* Event function for state "disable_df_tx" in state set "setup_scan" */ static seqBool seqg_event_setup_scan_4_disable_df_tx(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { if (TRUE) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "disable_df_tx" in state set "setup_scan" */ static void seqg_action_setup_scan_4_disable_df_tx(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 952 "../../src/rf/chirpscan.st" log_message(fp, "Initial detune TX enable settings:\n", (seqg_var->debug >= 3), seqg_var->fpaddr); # line 953 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 954 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 176/*df_tx_enable*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 955 "../../src/rf/chirpscan.st" seqg_var->df_tx_enable_init[seqg_var->i] = seqg_var->df_tx_enable[seqg_var->i]; # line 956 "../../src/rf/chirpscan.st" seqg_var->df_tx_enable[seqg_var->i] = 0; # line 957 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 176/*df_tx_enable*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 959 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s: %s\n", seqg_var->cavstr[seqg_var->i], seqg_var->df_tx_enable_init[seqg_var->i] ? "Enabled" : "Not enabled"); # line 960 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } # line 962 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_start_scan); } return; } } /****** Code for state "start" in state set "start_scan" ******/ /* Event function for state "start" in state set "start_scan" */ static seqBool seqg_event_start_scan_5_start(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 969 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_start_scan)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "start" in state set "start_scan" */ static void seqg_action_start_scan_5_start(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 970 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 971 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 3; } else { # line 974 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 4; } # line 976 "../../src/rf/chirpscan.st" seqg_var->program_stat = 2; # line 977 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 2/*rack_scan_stat*/, DEFAULT, DEFAULT_TIMEOUT); # line 978 "../../src/rf/chirpscan.st" seqg_var->index_offset = 0; # line 979 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_start_scan_offset); } return; } } /****** Code for state "start_scan_offset" in state set "perform_scan_offset" ******/ /* Event function for state "start_scan_offset" in state set "perform_scan_offset" */ static seqBool seqg_event_perform_scan_offset_6_start_scan_offset(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 986 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_start_scan_offset)) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "start_scan_offset" in state set "perform_scan_offset" */ static void seqg_action_perform_scan_offset_6_start_scan_offset(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 988 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Setting up offset index %i at frequency offset %.1f kHz\n", seqg_var->index_offset, seqg_var->offset[seqg_var->index_offset] / 1e3); # line 989 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 990 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 991 "../../src/rf/chirpscan.st" seqg_var->skip[seqg_var->i] = 0; } # line 993 "../../src/rf/chirpscan.st" seqg_var->nskip = 0; } return; } } /****** Code for state "setup_dds_offset" in state set "perform_scan_offset" ******/ /* Event function for state "setup_dds_offset" in state set "perform_scan_offset" */ static seqBool seqg_event_perform_scan_offset_6_setup_dds_offset(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { if (TRUE) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "setup_dds_offset" in state set "perform_scan_offset" */ static void seqg_action_perform_scan_offset_6_setup_dds_offset(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 999 "../../src/rf/chirpscan.st" seqg_var->rack_offset = seqg_var->offset[seqg_var->index_offset]; # line 1000 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 180/*rack_offset*/, DEFAULT, DEFAULT_TIMEOUT); # line 1002 "../../src/rf/chirpscan.st" seqg_var->now = time(NULL); # line 1003 "../../src/rf/chirpscan.st" seqg_var->then = seqg_var->now; # line 1005 "../../src/rf/chirpscan.st" seqg_var->match = 0; # line 1011 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Wait for rack freq %.1f Hz to match %.1f Hz within %.1f Hz, PV severity %i\n", seqg_var->rack_offset_rbv, seqg_var->offset[seqg_var->index_offset], seqg_var->freq_thresh, seq_pvSeverity(seqg_env, 185/*rack_offset_rbv*/)); # line 1012 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); # line 1013 "../../src/rf/chirpscan.st" while ((seqg_var->match == 0) && ((seqg_var->now - seqg_var->then) <= seqg_var->timeout)) { # line 1014 "../../src/rf/chirpscan.st" epicsThreadSleep(0.5); # line 1016 "../../src/rf/chirpscan.st" seqg_var->match = (seq_pvSeverity(seqg_env, 185/*rack_offset_rbv*/) < pvSevrINVALID) && (fabs(seqg_var->rack_offset_rbv - seqg_var->offset[seqg_var->index_offset]) < seqg_var->freq_thresh); # line 1017 "../../src/rf/chirpscan.st" seqg_var->now = time(NULL); } # line 1020 "../../src/rf/chirpscan.st" if (seqg_var->match) { # line 1021 "../../src/rf/chirpscan.st" seqg_var->offset_exact[seqg_var->index_offset] = seqg_var->rack_offset_rbv; # line 1023 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Rack freq successfully shifted: current offset exact %.1f Hz\n", seqg_var->offset_exact[seqg_var->index_offset]); # line 1024 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); } else { # line 1031 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 1032 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i]) { # line 1034 "../../src/rf/chirpscan.st" seqg_var->match = (seq_pvSeverity(seqg_env, 181/*offset_rbv*/ + (CH_ID)(seqg_var->i)) < pvSevrINVALID) && (fabs(seqg_var->offset_rbv[seqg_var->i] - seqg_var->offset[seqg_var->index_offset]) < seqg_var->freq_thresh); # line 1035 "../../src/rf/chirpscan.st" if (!seqg_var->match) { # line 1036 "../../src/rf/chirpscan.st" seqg_var->cavstat[seqg_var->i] = 3; # line 1037 "../../src/rf/chirpscan.st" seqg_var->skip[seqg_var->i] = 1; # line 1038 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " FAIL: Cavity %s frequency offset does not match desired, skip this cavity\n", seqg_var->cavstr[seqg_var->i]); # line 1039 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); } else # line 1042 "../../src/rf/chirpscan.st" if (seqg_var->offset_exact[seqg_var->index_offset] == -1) { # line 1047 "../../src/rf/chirpscan.st" seqg_var->offset_exact[seqg_var->index_offset] = seqg_var->rack_offset_rbv; # line 1049 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Using cavity %s offset exact %f Hz for offset index %in", seqg_var->cavstr[seqg_var->i], seqg_var->offset_exact[seqg_var->index_offset], seqg_var->index_offset); # line 1050 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); } } } } # line 1055 "../../src/rf/chirpscan.st" epicsThreadSleep(1.0); # line 1056 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 1057 "../../src/rf/chirpscan.st" seqg_var->nskip += seqg_var->skip[seqg_var->i]; # line 1058 "../../src/rf/chirpscan.st" if (seqg_var->cavstat[seqg_var->i]) { # line 1059 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 1060 "../../src/rf/chirpscan.st" seqg_var->cavstat_search[seqg_var->i] = seqg_var->cavstat[seqg_var->i]; # line 1061 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 3/*cavstat_search*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } else { # line 1064 "../../src/rf/chirpscan.st" seqg_var->cavstat_shift[seqg_var->i] = seqg_var->cavstat[seqg_var->i]; # line 1065 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 7/*cavstat_shift*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } } } # line 1069 "../../src/rf/chirpscan.st" if (seqg_var->nskip < 4) { # line 1070 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_offset); } else { # line 1073 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_process_search_results); } } return; } } /****** Code for state "offset_init" in state set "scan_offset_init" ******/ /* Event function for state "offset_init" in state set "scan_offset_init" */ static seqBool seqg_event_scan_offset_init_7_offset_init(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1083 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_get_data_offset)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "offset_init" in state set "scan_offset_init" */ static void seqg_action_scan_offset_init_7_offset_init(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1084 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Starting data acquisition\n"); # line 1085 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1087 "../../src/rf/chirpscan.st" seqg_var->nacquired = 0; # line 1088 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_point); } return; } } /****** Code for state "wait" in state set "wait_new_data" ******/ /* Event function for state "wait" in state set "wait_new_data" */ static seqBool seqg_event_wait_new_data_8_wait(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1097 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_get_data_point)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "wait" in state set "wait_new_data" */ static void seqg_action_wait_new_data_8_wait(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1098 "../../src/rf/chirpscan.st" seqg_var->index_cavity = 0; # line 1099 "../../src/rf/chirpscan.st" seqg_var->ntries_newdata = 0; # line 1100 "../../src/rf/chirpscan.st" while ((0 == seq_efTestAndClear(seqg_env, ef_rms)) && (seqg_var->ntries_newdata < 5)) { # line 1101 "../../src/rf/chirpscan.st" epicsThreadSleep(0.2); # line 1102 "../../src/rf/chirpscan.st" seqg_var->ntries_newdata++; } # line 1104 "../../src/rf/chirpscan.st" seqg_var->nacquired++; # line 1105 "../../src/rf/chirpscan.st" if (seqg_var->ntries_newdata >= 5) { # line 1106 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " No new data for acquisition %i, skipping\n", seqg_var->nacquired); # line 1107 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1112 "../../src/rf/chirpscan.st" if ((seqg_var->nacquired >= seqg_var->search_nacq) && (seqg_var->scan_type == 1)) { # line 1113 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " No new data after %i tries, abort\n", seqg_var->search_nacq); # line 1114 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1115 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_post_scan); } else { # line 1118 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_point); } } else { # line 1122 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 1125 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Data acquisition %i out of %i at this offset, waited %.1f s for new data\n", seqg_var->nacquired, seqg_var->search_nacq, seqg_var->ntries_newdata * 0.2); # line 1126 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } else # line 1128 "../../src/rf/chirpscan.st" if ((seqg_var->scan_type == 2) && (seqg_var->shift_firstmeas[0])) { # line 1130 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " First data acquisition, waited %.1f s for new data\n", seqg_var->ntries_newdata * 0.2); # line 1131 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } # line 1133 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_cavity); } } return; } } /****** Code for state "get_data" in state set "get_data_cavity" ******/ /* Event function for state "get_data" in state set "get_data_cavity" */ static seqBool seqg_event_get_data_cavity_9_get_data(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1146 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_abort_request)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } # line 1155 "../../src/rf/chirpscan.st" if ((seqg_var->scan_type == 2) && (seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_scan_request)) { *seqg_pnst = 0; *seqg_ptrn = 1; return TRUE; } # line 1164 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_get_data_cavity)) { *seqg_pnst = 0; *seqg_ptrn = 2; return TRUE; } return FALSE; } /* Action function for state "get_data" in state set "get_data_cavity" */ static void seqg_action_get_data_cavity_9_get_data(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1147 "../../src/rf/chirpscan.st" if (seqg_var->abort_request == 1) { # line 1148 "../../src/rf/chirpscan.st" seqg_var->abort_request = 0; # line 1149 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 17/*abort_request*/, DEFAULT, DEFAULT_TIMEOUT); # line 1150 "../../src/rf/chirpscan.st" seqg_var->program_stat = 3; # line 1151 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_post_scan); } } return; case 1: { # line 1157 "../../src/rf/chirpscan.st" if ((seqg_var->start_request == 2)) { # line 1158 "../../src/rf/chirpscan.st" seqg_var->start_request = 0; # line 1159 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 16/*start_request*/, DEFAULT, DEFAULT_TIMEOUT); # line 1160 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_received_request); } } return; case 2: { # line 1165 "../../src/rf/chirpscan.st" seqg_var->i = seqg_var->index_cavity; # line 1166 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] && !seqg_var->skip[seqg_var->i]) { # line 1167 "../../src/rf/chirpscan.st" seqg_var->ntries = 1; # line 1168 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 152/*amax*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1172 "../../src/rf/chirpscan.st" seqg_var->df_sevr = seq_pvSeverity(seqg_env, 148/*df*/ + (CH_ID)(seqg_var->i)); # line 1173 "../../src/rf/chirpscan.st" seqg_var->rms_sevr = seq_pvSeverity(seqg_env, 156/*rms*/ + (CH_ID)(seqg_var->i)); # line 1174 "../../src/rf/chirpscan.st" if ((seqg_var->scan_type == 1) && ((seqg_var->df_sevr > 2) || (seqg_var->rms_sevr > 2))) { # line 1175 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s no valid data, skip\n", seqg_var->cavstr[seqg_var->i]); # line 1176 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); # line 1177 "../../src/rf/chirpscan.st" seqg_var->skip[seqg_var->i] = 1; } else { # line 1181 "../../src/rf/chirpscan.st" df_ts = seq_pvTimeStamp(seqg_env, 148/*df*/ + (CH_ID)(seqg_var->i)); # line 1182 "../../src/rf/chirpscan.st" rms_ts = seq_pvTimeStamp(seqg_env, 156/*rms*/ + (CH_ID)(seqg_var->i)); # line 1186 "../../src/rf/chirpscan.st" while ((seq_efTestAndClear(seqg_env, ef_rms)) && ((df_ts.secPastEpoch != rms_ts.secPastEpoch) || (df_ts.nsec != rms_ts.nsec)) && (seqg_var->ntries < 5)) { # line 1190 "../../src/rf/chirpscan.st" seq_pvGetTmo(seqg_env, 152/*amax*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1191 "../../src/rf/chirpscan.st" df_ts = seq_pvTimeStamp(seqg_env, 148/*df*/ + (CH_ID)(seqg_var->i)); # line 1192 "../../src/rf/chirpscan.st" rms_ts = seq_pvTimeStamp(seqg_env, 156/*rms*/ + (CH_ID)(seqg_var->i)); # line 1193 "../../src/rf/chirpscan.st" seqg_var->ntries++; } # line 1195 "../../src/rf/chirpscan.st" if (seqg_var->ntries > 1) { # line 1196 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s %i tries to get synchronous data\n", seqg_var->cavstr[seqg_var->i], seqg_var->ntries); # line 1197 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); } # line 1199 "../../src/rf/chirpscan.st" if (seqg_var->ntries >= 5) { # line 1201 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s failed to get synchronous data, skip if in search mode\n", seqg_var->cavstr[seqg_var->i]); # line 1202 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1203 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 1204 "../../src/rf/chirpscan.st" seqg_var->skip[seqg_var->i] = 1; } # line 1206 "../../src/rf/chirpscan.st" seqg_var->cavstat[seqg_var->i] = 4; } else { # line 1213 "../../src/rf/chirpscan.st" seqg_var->cavstat[seqg_var->i] = 0; } } } # line 1217 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 1218 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_store_data_cavity_search); } else { # line 1221 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_store_data_cavity_shift); } } return; } } /****** Code for state "store_data_cavity" in state set "store_data" ******/ /* Event function for state "store_data_cavity" in state set "store_data" */ static seqBool seqg_event_store_data_10_store_data_cavity(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1229 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_store_data_cavity_search)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } # line 1309 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_store_data_cavity_shift)) { *seqg_pnst = 0; *seqg_ptrn = 1; return TRUE; } return FALSE; } /* Action function for state "store_data_cavity" in state set "store_data" */ static void seqg_action_store_data_10_store_data_cavity(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1230 "../../src/rf/chirpscan.st" seqg_var->i = seqg_var->index_cavity; # line 1231 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] && !seqg_var->skip[seqg_var->i]) { # line 1232 "../../src/rf/chirpscan.st" if ((seqg_var->rms[seqg_var->i] < seqg_var->rms_thresh) && (seqg_var->rms[seqg_var->i] > 0)) { # line 1233 "../../src/rf/chirpscan.st" seqg_var->new = (seqg_var->found[seqg_var->i][seqg_var->index_offset] == 0); # line 1234 "../../src/rf/chirpscan.st" if (seqg_var->new) { # line 1235 "../../src/rf/chirpscan.st" seqg_var->nfound[seqg_var->i]++; # line 1236 "../../src/rf/chirpscan.st" seqg_var->found[seqg_var->i][seqg_var->index_offset] = 1; } # line 1241 "../../src/rf/chirpscan.st" if (seqg_var->new || (seqg_var->rms[seqg_var->i] < seqg_var->rms_bestwf[seqg_var->i][seqg_var->nfound[seqg_var->i] - 1])) { # line 1242 "../../src/rf/chirpscan.st" seqg_var->index = seqg_var->nfound[seqg_var->i] - 1; # line 1243 "../../src/rf/chirpscan.st" seqg_var->df_bestwf_offs[seqg_var->i][seqg_var->index] = seqg_var->df[seqg_var->i]; # line 1244 "../../src/rf/chirpscan.st" seqg_var->df_bestwf[seqg_var->i][seqg_var->index] = seqg_var->df[seqg_var->i] + seqg_var->offset_exact[seqg_var->index_offset]; # line 1245 "../../src/rf/chirpscan.st" seqg_var->rms_bestwf[seqg_var->i][seqg_var->index] = seqg_var->rms[seqg_var->i]; # line 1246 "../../src/rf/chirpscan.st" seqg_var->bw_bestwf[seqg_var->i][seqg_var->index] = seqg_var->bw[seqg_var->i]; # line 1247 "../../src/rf/chirpscan.st" seqg_var->fitrms_bestwf[seqg_var->i][seqg_var->index] = seqg_var->fitrms[seqg_var->i]; # line 1248 "../../src/rf/chirpscan.st" seqg_var->amax_bestwf[seqg_var->i][seqg_var->index] = seqg_var->amax[seqg_var->i]; } } # line 1252 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s detune RMS %.1f Hz. Compare to RMS threshold %.1f Hz. Peak found = %s\n", seqg_var->cavstr[seqg_var->i], seqg_var->rms[seqg_var->i], seqg_var->rms_thresh, seqg_var->found[seqg_var->i][seqg_var->index_offset] ? "True" : "False"); # line 1254 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } # line 1258 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] && (seqg_var->cavstat_search[seqg_var->i] != seqg_var->cavstat[seqg_var->i])) { # line 1259 "../../src/rf/chirpscan.st" seqg_var->cavstat_search[seqg_var->i] = seqg_var->cavstat[seqg_var->i]; # line 1260 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 3/*cavstat_search*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } # line 1262 "../../src/rf/chirpscan.st" if ((++seqg_var->index_cavity < 4)) { # line 1263 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_cavity); } else # line 1265 "../../src/rf/chirpscan.st" if ((seqg_var->nacquired < seqg_var->search_nacq)) { # line 1267 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Next data point, nacquired %i, scan type %i, program_stat %i\n", seqg_var->nacquired, seqg_var->scan_type, seqg_var->program_stat); # line 1268 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); # line 1269 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_point); } else { # line 1272 "../../src/rf/chirpscan.st" seqg_var->search_progress = 100.0 * (double)(seqg_var->index_offset + 1) / seqg_var->noffset; # line 1273 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 11/*search_progress*/, DEFAULT, DEFAULT_TIMEOUT); # line 1275 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Offset %i summary:\n", seqg_var->index_offset); # line 1276 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1277 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 1278 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] == 1) { # line 1279 "../../src/rf/chirpscan.st" if (seqg_var->found[seqg_var->i][seqg_var->index_offset]) { # line 1280 "../../src/rf/chirpscan.st" seqg_var->index = seqg_var->nfound[seqg_var->i] - 1; # line 1283 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s bestwf abs DF %.3f kHz rel DF %.3f kHz RMS %.2f Hz BW %.1f Hz\n", seqg_var->cavstr[seqg_var->i], seqg_var->df_bestwf[seqg_var->i][seqg_var->index] / 1e3, seqg_var->df_bestwf_offs[seqg_var->i][seqg_var->index] / 1e3, seqg_var->rms_bestwf[seqg_var->i][seqg_var->index], seqg_var->bw_bestwf[seqg_var->i][seqg_var->index]); # line 1284 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); } else { # line 1288 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s failed to measure valid detune at this offset\n", seqg_var->cavstr[seqg_var->i]); # line 1289 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); } } } # line 1294 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 1295 "../../src/rf/chirpscan.st" log_flush(fp, seqg_var->fpaddr); } # line 1297 "../../src/rf/chirpscan.st" if (++seqg_var->index_offset < seqg_var->noffset) { # line 1299 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Move on to offset index %i, program_stat %i\n", seqg_var->index_offset, seqg_var->program_stat); # line 1300 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); # line 1301 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_start_scan_offset); } else { # line 1304 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_process_search_results); } } } return; case 1: { # line 1310 "../../src/rf/chirpscan.st" seqg_var->i = seqg_var->index_cavity; # line 1311 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] && !seqg_var->skip[seqg_var->i]) { # line 1312 "../../src/rf/chirpscan.st" if (seqg_var->shift_firstmeas[seqg_var->i]) { # line 1314 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Cavity %s\n First measurement: Detune RMS %.1f Hz. Compare to RMS threshold %.1f Hz\n", seqg_var->cavstr[seqg_var->i], seqg_var->rms[seqg_var->i], seqg_var->rms_thresh); # line 1315 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); # line 1316 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " After this, only log message when peak found or peak disappears\n"); # line 1317 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); # line 1318 "../../src/rf/chirpscan.st" seqg_var->shift_firstmeas[seqg_var->i] = 0; # line 1320 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 1321 "../../src/rf/chirpscan.st" log_flush(fp, seqg_var->fpaddr); } } # line 1325 "../../src/rf/chirpscan.st" seqg_var->rms_ok = (seqg_var->cavstat[seqg_var->i] == 0) && (seqg_var->rms[seqg_var->i] < seqg_var->rms_thresh) && (seqg_var->rms[seqg_var->i] > 0) && (seq_pvSeverity(seqg_env, 156/*rms*/ + (CH_ID)(seqg_var->i)) < pvSevrINVALID); # line 1326 "../../src/rf/chirpscan.st" if (seqg_var->rms_ok) { # line 1327 "../../src/rf/chirpscan.st" if (!seqg_var->found_live[seqg_var->i]) { # line 1328 "../../src/rf/chirpscan.st" seqg_var->found_live[seqg_var->i] = 1; # line 1329 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 128/*found_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1331 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Cavity %s: Peak found: detune %.3f kHz, RMS %.2f Hz, BW %.1f Hz\n", seqg_var->cavstr[seqg_var->i], seqg_var->df[seqg_var->i] / 1e3, seqg_var->rms[seqg_var->i], seqg_var->bw[seqg_var->i]); # line 1332 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } # line 1334 "../../src/rf/chirpscan.st" seqg_var->df_live[seqg_var->i] = seqg_var->df[seqg_var->i]; # line 1335 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 108/*df_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1336 "../../src/rf/chirpscan.st" seqg_var->rms_live[seqg_var->i] = seqg_var->rms[seqg_var->i]; # line 1337 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 112/*rms_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1338 "../../src/rf/chirpscan.st" seqg_var->bw_live[seqg_var->i] = seqg_var->bw[seqg_var->i]; # line 1339 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 120/*bw_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1340 "../../src/rf/chirpscan.st" seqg_var->fitrms_live[seqg_var->i] = seqg_var->fitrms[seqg_var->i]; # line 1341 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 116/*fitrms_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1342 "../../src/rf/chirpscan.st" seqg_var->amax_live[seqg_var->i] = seqg_var->amax[seqg_var->i]; # line 1343 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 124/*amax_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1344 "../../src/rf/chirpscan.st" store_date(seqg_var->string_ts, 0); # line 1345 "../../src/rf/chirpscan.st" sprintf(seqg_var->foundts_live[seqg_var->i], seqg_var->string_ts); # line 1346 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 132/*foundts_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } else { # line 1353 "../../src/rf/chirpscan.st" if (seqg_var->cavstat[seqg_var->i] != 4) { # line 1354 "../../src/rf/chirpscan.st" seqg_var->cavstat[seqg_var->i] = 1; } # line 1356 "../../src/rf/chirpscan.st" if (seqg_var->found_live[seqg_var->i]) { # line 1357 "../../src/rf/chirpscan.st" seqg_var->found_live[seqg_var->i] = 0; # line 1358 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 128/*found_live*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1360 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Cavity %s: Peak disappeared: detune %.3f kHz, RMS %.2f Hz, BW %.1f Hz\n", seqg_var->cavstr[seqg_var->i], seqg_var->df[seqg_var->i] / 1e3, seqg_var->rms[seqg_var->i], seqg_var->bw[seqg_var->i]); # line 1361 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } } } # line 1367 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] && (seqg_var->cavstat_shift[seqg_var->i] != seqg_var->cavstat[seqg_var->i])) { # line 1368 "../../src/rf/chirpscan.st" seqg_var->cavstat_shift[seqg_var->i] = seqg_var->cavstat[seqg_var->i]; # line 1369 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 7/*cavstat_shift*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1371 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 1372 "../../src/rf/chirpscan.st" log_flush(fp, seqg_var->fpaddr); } } # line 1376 "../../src/rf/chirpscan.st" if ((++seqg_var->index_cavity < 4)) { # line 1377 "../../src/rf/chirpscan.st" if (seqg_var->shift_firstmeas[seqg_var->index_cavity]) { # line 1379 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Shift mode, move to cavity %s, program_stat %i\n", seqg_var->cavstr[seqg_var->index_cavity], seqg_var->program_stat); # line 1380 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 3), seqg_var->fpaddr); } # line 1382 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_cavity); } else { # line 1385 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_get_data_point); } } return; } } /****** Code for state "process_search_results" in state set "process_results" ******/ /* Entry function for state "process_search_results" in state set "process_results" */ static void seqg_entry_process_results_11_process_search_results(SS_ID seqg_env) { } /* Event function for state "process_search_results" in state set "process_results" */ static seqBool seqg_event_process_results_11_process_search_results(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1395 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 2) && seq_efTestAndClear(seqg_env, ef_process_search_results)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "process_search_results" in state set "process_results" */ static void seqg_action_process_results_11_process_search_results(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1397 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 27/*offset_exact*/, DEFAULT, DEFAULT_TIMEOUT); # line 1398 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Scan done. Results:\n"); # line 1399 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1400 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "-------------------\n"); # line 1401 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1402 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 1403 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 84/*df_bestwf*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1404 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 88/*rms_bestwf*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1405 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 96/*fitrms_bestwf*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1406 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 92/*bw_bestwf*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1407 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 100/*amax_bestwf*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1408 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 104/*nfound*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1409 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Cavity %s, peak found = %s\n", seqg_var->cavstr[seqg_var->i], seqg_var->nfound[seqg_var->i] ? "True" : "False"); # line 1410 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1412 "../../src/rf/chirpscan.st" if (seqg_var->nfound[seqg_var->i] == 0) { # line 1413 "../../src/rf/chirpscan.st" seqg_var->cavstat_search[seqg_var->i] = 1; # line 1414 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 3/*cavstat_search*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } else # line 1416 "../../src/rf/chirpscan.st" if (seqg_var->nfound[seqg_var->i] == 1) { # line 1420 "../../src/rf/chirpscan.st" seqg_var->f_pi[seqg_var->i] = seqg_var->df_bestwf[seqg_var->i][0]; # line 1421 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 28/*f_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1422 "../../src/rf/chirpscan.st" seqg_var->rms_pi[seqg_var->i] = seqg_var->rms_bestwf[seqg_var->i][0]; # line 1423 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 32/*rms_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1424 "../../src/rf/chirpscan.st" seqg_var->fitrms_pi[seqg_var->i] = seqg_var->fitrms_bestwf[seqg_var->i][0]; # line 1425 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 36/*fitrms_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1426 "../../src/rf/chirpscan.st" seqg_var->bw_pi[seqg_var->i] = seqg_var->bw_bestwf[seqg_var->i][0]; # line 1427 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 40/*bw_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1428 "../../src/rf/chirpscan.st" seqg_var->amax_pi[seqg_var->i] = seqg_var->amax_bestwf[seqg_var->i][0]; # line 1429 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 44/*amax_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1430 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Found fundamental mode at %f Hz\n", seqg_var->f_pi[seqg_var->i]); # line 1431 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1432 "../../src/rf/chirpscan.st" seqg_var->found_pi[seqg_var->i] = 1; # line 1433 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 48/*found_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } else # line 1435 "../../src/rf/chirpscan.st" if (seqg_var->nfound[seqg_var->i] == 2) { # line 1441 "../../src/rf/chirpscan.st" seqg_var->diff = fabs(seqg_var->df_bestwf[seqg_var->i][0] - seqg_var->df_bestwf[seqg_var->i][1]); # line 1446 "../../src/rf/chirpscan.st" seqg_var->search_start = ((fabs(seqg_var->f_start_8pi9)) < (fabs(seqg_var->f_stop_8pi9)) ? (fabs(seqg_var->f_start_8pi9)) : (fabs(seqg_var->f_stop_8pi9))); # line 1447 "../../src/rf/chirpscan.st" seqg_var->search_stop = ((fabs(seqg_var->f_start_8pi9)) > (fabs(seqg_var->f_stop_8pi9)) ? (fabs(seqg_var->f_start_8pi9)) : (fabs(seqg_var->f_stop_8pi9))); # line 1450 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " 8PI9 search range start %f stop %f, for comparison start %f stop %f diff %f\n", seqg_var->f_start_8pi9, seqg_var->f_stop_8pi9, seqg_var->search_start, seqg_var->search_stop, seqg_var->diff); # line 1451 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); # line 1453 "../../src/rf/chirpscan.st" if ((seqg_var->diff >= seqg_var->search_start) && (seqg_var->diff <= seqg_var->search_stop)) { # line 1454 "../../src/rf/chirpscan.st" if (seqg_var->df_bestwf[seqg_var->i][0] > seqg_var->df_bestwf[seqg_var->i][1]) { # line 1455 "../../src/rf/chirpscan.st" seqg_var->index_pi = 0; # line 1456 "../../src/rf/chirpscan.st" seqg_var->index_8pi9 = 1; } else { # line 1459 "../../src/rf/chirpscan.st" seqg_var->index_pi = 1; # line 1460 "../../src/rf/chirpscan.st" seqg_var->index_8pi9 = 0; } # line 1462 "../../src/rf/chirpscan.st" seqg_var->f_pi[seqg_var->i] = seqg_var->df_bestwf[seqg_var->i][seqg_var->index_pi]; # line 1463 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 28/*f_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1464 "../../src/rf/chirpscan.st" seqg_var->rms_pi[seqg_var->i] = seqg_var->rms_bestwf[seqg_var->i][seqg_var->index_pi]; # line 1465 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 32/*rms_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1466 "../../src/rf/chirpscan.st" seqg_var->fitrms_pi[seqg_var->i] = seqg_var->fitrms_bestwf[seqg_var->i][seqg_var->index_pi]; # line 1467 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 36/*fitrms_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1468 "../../src/rf/chirpscan.st" seqg_var->bw_pi[seqg_var->i] = seqg_var->bw_bestwf[seqg_var->i][seqg_var->index_pi]; # line 1469 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 40/*bw_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1470 "../../src/rf/chirpscan.st" seqg_var->amax_pi[seqg_var->i] = seqg_var->amax_bestwf[seqg_var->i][seqg_var->index_pi]; # line 1471 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 44/*amax_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1473 "../../src/rf/chirpscan.st" seqg_var->f_8pi9[seqg_var->i] = seqg_var->df_bestwf[seqg_var->i][seqg_var->index_8pi9]; # line 1474 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 56/*f_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1475 "../../src/rf/chirpscan.st" seqg_var->rms_8pi9[seqg_var->i] = seqg_var->rms_bestwf[seqg_var->i][seqg_var->index_8pi9]; # line 1476 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 60/*rms_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1477 "../../src/rf/chirpscan.st" seqg_var->fitrms_8pi9[seqg_var->i] = seqg_var->fitrms_bestwf[seqg_var->i][seqg_var->index_8pi9]; # line 1478 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 64/*fitrms_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1479 "../../src/rf/chirpscan.st" seqg_var->bw_8pi9[seqg_var->i] = seqg_var->bw_bestwf[seqg_var->i][seqg_var->index_8pi9]; # line 1480 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 68/*bw_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1481 "../../src/rf/chirpscan.st" seqg_var->amax_8pi9[seqg_var->i] = seqg_var->amax_bestwf[seqg_var->i][seqg_var->index_8pi9]; # line 1482 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 72/*amax_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1484 "../../src/rf/chirpscan.st" seqg_var->found_pi[seqg_var->i] = 1; # line 1485 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 48/*found_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1486 "../../src/rf/chirpscan.st" seqg_var->found_8pi9[seqg_var->i] = 1; # line 1487 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 76/*found_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1489 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, " Found fundamental mode at %f Hz\n Found 8PI/9 mode at %f Hz\n", seqg_var->f_pi[seqg_var->i], seqg_var->f_8pi9[seqg_var->i]); # line 1490 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); } else { # line 1493 "../../src/rf/chirpscan.st" seqg_var->cavstat_search[seqg_var->i] = 2; # line 1494 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 3/*cavstat_search*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } } else { # line 1501 "../../src/rf/chirpscan.st" seqg_var->cavstat_search[seqg_var->i] = 2; # line 1502 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 3/*cavstat_search*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } } # line 1505 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_post_scan); } return; } } /****** Code for state "post_scan_restore_cavities" in state set "post_scan" ******/ /* Event function for state "post_scan_restore_cavities" in state set "post_scan" */ static seqBool seqg_event_post_scan_12_post_scan_restore_cavities(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1512 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_post_scan)) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "post_scan_restore_cavities" in state set "post_scan" */ static void seqg_action_post_scan_12_post_scan_restore_cavities(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1513 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Restoring states\n"); # line 1514 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1515 "../../src/rf/chirpscan.st" seqg_var->rack_offset = 0.0; # line 1516 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 180/*rack_offset*/, DEFAULT, DEFAULT_TIMEOUT); # line 1518 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 1519 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] == 1) { # line 1520 "../../src/rf/chirpscan.st" seqg_var->rfctrl[seqg_var->i] = 0; # line 1521 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 140/*rfctrl*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1523 "../../src/rf/chirpscan.st" seqg_var->cav_f_start[seqg_var->i] = seqg_var->cav_f_start_init[seqg_var->i]; # line 1524 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 168/*cav_f_start*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1525 "../../src/rf/chirpscan.st" seqg_var->cav_f_stop[seqg_var->i] = seqg_var->cav_f_stop_init[seqg_var->i]; # line 1526 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 172/*cav_f_stop*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1529 "../../src/rf/chirpscan.st" seqg_var->df_tx_enable[seqg_var->i] = seqg_var->df_tx_enable_init[seqg_var->i]; # line 1530 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 176/*df_tx_enable*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1534 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Cavity %s restore df tx enable to %s, chirp freq start to %i Hz, chirp freq stop to %i Hz \n", seqg_var->cavstr[seqg_var->i], seqg_var->df_tx_enable[seqg_var->i] ? "Enabled" : "Not enabled", seqg_var->cav_f_start[seqg_var->i], seqg_var->cav_f_stop[seqg_var->i]); # line 1535 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); } } # line 1539 "../../src/rf/chirpscan.st" seqg_var->now = time(NULL); # line 1540 "../../src/rf/chirpscan.st" seqg_var->then = seqg_var->now; # line 1542 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Wait for rack freq %.1f Hz to restore to 0.0 Hz within %.1f Hz\n", seqg_var->rack_offset_rbv, seqg_var->freq_thresh); # line 1543 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); # line 1544 "../../src/rf/chirpscan.st" seqg_var->match = 0; # line 1545 "../../src/rf/chirpscan.st" while ((seqg_var->match == 0) && ((seqg_var->now - seqg_var->then) <= seqg_var->timeout)) { # line 1546 "../../src/rf/chirpscan.st" epicsThreadSleep(0.5); # line 1548 "../../src/rf/chirpscan.st" seqg_var->match = (seq_pvSeverity(seqg_env, 185/*rack_offset_rbv*/) < pvSevrINVALID) && (fabs(seqg_var->rack_offset_rbv - 0.0) < seqg_var->freq_thresh); # line 1549 "../../src/rf/chirpscan.st" seqg_var->now = time(NULL); } # line 1552 "../../src/rf/chirpscan.st" if ((seqg_var->program_stat == 3) && (seqg_var->scan_type == 1)) { # line 1553 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 6; } else { # line 1556 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 5; } # line 1559 "../../src/rf/chirpscan.st" if (seqg_var->match) { # line 1561 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Successfully restored rack to offset exact %.1f Hz\n", seqg_var->rack_offset_rbv); # line 1562 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug >= 2), seqg_var->fpaddr); } else { # line 1565 "../../src/rf/chirpscan.st" log_message(fp, seqg_var->msg, (seqg_var->debug), seqg_var->fpaddr); # line 1566 "../../src/rf/chirpscan.st" sprintf(seqg_var->msg, "Failed to restore rack frequency offset\n"); # line 1567 "../../src/rf/chirpscan.st" seqg_var->rack_scan_stat = 7; } # line 1569 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 2/*rack_scan_stat*/, DEFAULT, DEFAULT_TIMEOUT); # line 1571 "../../src/rf/chirpscan.st" if (seqg_var->scan_type == 1) { # line 1572 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_post_search); } else { # line 1575 "../../src/rf/chirpscan.st" seq_efSet(seqg_env, ef_post_shift); } } return; } } /****** Code for state "post_scan_restore" in state set "post_scan" ******/ /* Event function for state "post_scan_restore" in state set "post_scan" */ static seqBool seqg_event_post_scan_12_post_scan_restore(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 1581 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_post_search)) { *seqg_pnst = 0; *seqg_ptrn = 0; return TRUE; } # line 1607 "../../src/rf/chirpscan.st" if (seq_efTestAndClear(seqg_env, ef_post_shift)) { *seqg_pnst = 0; *seqg_ptrn = 1; return TRUE; } return FALSE; } /* Action function for state "post_scan_restore" in state set "post_scan" */ static void seqg_action_post_scan_12_post_scan_restore(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 1584 "../../src/rf/chirpscan.st" for (seqg_var->i = 0; seqg_var->i < 4; seqg_var->i++) { # line 1585 "../../src/rf/chirpscan.st" if (seqg_var->cavsel[seqg_var->i] == 1) { # line 1586 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 48/*found_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1587 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 76/*found_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); # line 1588 "../../src/rf/chirpscan.st" store_date(seqg_var->string_ts, 0); # line 1589 "../../src/rf/chirpscan.st" if (seqg_var->found_pi[seqg_var->i]) { # line 1590 "../../src/rf/chirpscan.st" sprintf(seqg_var->foundts_pi[seqg_var->i], seqg_var->string_ts); # line 1591 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 52/*foundts_pi*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } # line 1593 "../../src/rf/chirpscan.st" if (seqg_var->found_8pi9[seqg_var->i]) { # line 1594 "../../src/rf/chirpscan.st" sprintf(seqg_var->foundts_8pi9[seqg_var->i], seqg_var->string_ts); # line 1595 "../../src/rf/chirpscan.st" seq_pvPutTmo(seqg_env, 80/*foundts_8pi9*/ + (CH_ID)(seqg_var->i), DEFAULT, DEFAULT_TIMEOUT); } } } # line 1600 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 1601 "../../src/rf/chirpscan.st" seqg_var->logfile_flag_open = 0; # line 1602 "../../src/rf/chirpscan.st" log_close(fp, seqg_var->debug, seqg_var->fpaddr); } # line 1604 "../../src/rf/chirpscan.st" seqg_var->program_stat = 0; } return; case 1: { # line 1608 "../../src/rf/chirpscan.st" if (seqg_var->logfile_flag_open) { # line 1609 "../../src/rf/chirpscan.st" seqg_var->logfile_flag_open = 0; # line 1610 "../../src/rf/chirpscan.st" log_close(fp, seqg_var->debug, seqg_var->fpaddr); } # line 1612 "../../src/rf/chirpscan.st" seqg_var->program_stat = 0; } return; } } #undef seqg_var /************************ Tables ************************/ /* Channel table */ static seqChan seqg_chans[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"{CM}00:RACK{RACK}:FSCAN:MSG", offsetof(struct seqg_vars, debug_msg), "debug_msg", P_STRING, 1, 21, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:DBG", offsetof(struct seqg_vars, debug), "debug", P_INT, 1, 22, 0, 1, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:STAT", offsetof(struct seqg_vars, rack_scan_stat), "rack_scan_stat", P_INT, 1, 23, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:SEARCHSTAT", offsetof(struct seqg_vars, cavstat_search[0]), "cavstat_search[0]", P_INT, 1, 24, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:SEARCHSTAT", offsetof(struct seqg_vars, cavstat_search[1]), "cavstat_search[1]", P_INT, 1, 25, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:SEARCHSTAT", offsetof(struct seqg_vars, cavstat_search[2]), "cavstat_search[2]", P_INT, 1, 26, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:SEARCHSTAT", offsetof(struct seqg_vars, cavstat_search[3]), "cavstat_search[3]", P_INT, 1, 27, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:SHIFTSTAT", offsetof(struct seqg_vars, cavstat_shift[0]), "cavstat_shift[0]", P_INT, 1, 28, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:SHIFTSTAT", offsetof(struct seqg_vars, cavstat_shift[1]), "cavstat_shift[1]", P_INT, 1, 29, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:SHIFTSTAT", offsetof(struct seqg_vars, cavstat_shift[2]), "cavstat_shift[2]", P_INT, 1, 30, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:SHIFTSTAT", offsetof(struct seqg_vars, cavstat_shift[3]), "cavstat_shift[3]", P_INT, 1, 31, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:PROGRESS", offsetof(struct seqg_vars, search_progress), "search_progress", P_DOUBLE, 1, 32, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:SEL", offsetof(struct seqg_vars, cavsel[0]), "cavsel[0]", P_INT, 1, 33, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:SEL", offsetof(struct seqg_vars, cavsel[1]), "cavsel[1]", P_INT, 1, 34, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:SEL", offsetof(struct seqg_vars, cavsel[2]), "cavsel[2]", P_INT, 1, 35, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:SEL", offsetof(struct seqg_vars, cavsel[3]), "cavsel[3]", P_INT, 1, 36, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:START", offsetof(struct seqg_vars, start_request), "start_request", P_INT, 1, 37, 1, 1, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:ABORT", offsetof(struct seqg_vars, abort_request), "abort_request", P_INT, 1, 38, 2, 1, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:FREQ_THRESH", offsetof(struct seqg_vars, freq_thresh), "freq_thresh", P_DOUBLE, 1, 39, 0, 1, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:FREQ_STEP_SIZE", offsetof(struct seqg_vars, rack_f_step), "rack_f_step", P_INT, 1, 40, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:RMS_THRESH", offsetof(struct seqg_vars, rms_thresh), "rms_thresh", P_DOUBLE, 1, 41, 0, 1, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:NACQ", offsetof(struct seqg_vars, search_nacq), "search_nacq", P_INT, 1, 42, 0, 1, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:8PI9_START", offsetof(struct seqg_vars, f_start_8pi9), "f_start_8pi9", P_DOUBLE, 1, 43, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:8PI9_STOP", offsetof(struct seqg_vars, f_stop_8pi9), "f_stop_8pi9", P_DOUBLE, 1, 44, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:FREQ_START", offsetof(struct seqg_vars, rack_f_start), "rack_f_start", P_INT, 1, 45, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:FREQ_STOP", offsetof(struct seqg_vars, rack_f_stop), "rack_f_stop", P_INT, 1, 46, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:FDES", offsetof(struct seqg_vars, f_shift), "f_shift", P_INT, 1, 47, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSCAN:OFFSETWF", offsetof(struct seqg_vars, offset_exact), "offset_exact", P_DOUBLE, 50, 48, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFMODE", offsetof(struct seqg_vars, f_pi[0]), "f_pi[0]", P_DOUBLE, 1, 49, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFMODE", offsetof(struct seqg_vars, f_pi[1]), "f_pi[1]", P_DOUBLE, 1, 50, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFMODE", offsetof(struct seqg_vars, f_pi[2]), "f_pi[2]", P_DOUBLE, 1, 51, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFMODE", offsetof(struct seqg_vars, f_pi[3]), "f_pi[3]", P_DOUBLE, 1, 52, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFRMS", offsetof(struct seqg_vars, rms_pi[0]), "rms_pi[0]", P_DOUBLE, 1, 53, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFRMS", offsetof(struct seqg_vars, rms_pi[1]), "rms_pi[1]", P_DOUBLE, 1, 54, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFRMS", offsetof(struct seqg_vars, rms_pi[2]), "rms_pi[2]", P_DOUBLE, 1, 55, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFRMS", offsetof(struct seqg_vars, rms_pi[3]), "rms_pi[3]", P_DOUBLE, 1, 56, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFFITRMS", offsetof(struct seqg_vars, fitrms_pi[0]), "fitrms_pi[0]", P_DOUBLE, 1, 57, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFFITRMS", offsetof(struct seqg_vars, fitrms_pi[1]), "fitrms_pi[1]", P_DOUBLE, 1, 58, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFFITRMS", offsetof(struct seqg_vars, fitrms_pi[2]), "fitrms_pi[2]", P_DOUBLE, 1, 59, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFFITRMS", offsetof(struct seqg_vars, fitrms_pi[3]), "fitrms_pi[3]", P_DOUBLE, 1, 60, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFBW", offsetof(struct seqg_vars, bw_pi[0]), "bw_pi[0]", P_DOUBLE, 1, 61, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFBW", offsetof(struct seqg_vars, bw_pi[1]), "bw_pi[1]", P_DOUBLE, 1, 62, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFBW", offsetof(struct seqg_vars, bw_pi[2]), "bw_pi[2]", P_DOUBLE, 1, 63, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFBW", offsetof(struct seqg_vars, bw_pi[3]), "bw_pi[3]", P_DOUBLE, 1, 64, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFAMAX", offsetof(struct seqg_vars, amax_pi[0]), "amax_pi[0]", P_DOUBLE, 1, 65, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFAMAX", offsetof(struct seqg_vars, amax_pi[1]), "amax_pi[1]", P_DOUBLE, 1, 66, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFAMAX", offsetof(struct seqg_vars, amax_pi[2]), "amax_pi[2]", P_DOUBLE, 1, 67, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFAMAX", offsetof(struct seqg_vars, amax_pi[3]), "amax_pi[3]", P_DOUBLE, 1, 68, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFFOUND", offsetof(struct seqg_vars, found_pi[0]), "found_pi[0]", P_INT, 1, 69, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFFOUND", offsetof(struct seqg_vars, found_pi[1]), "found_pi[1]", P_INT, 1, 70, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFFOUND", offsetof(struct seqg_vars, found_pi[2]), "found_pi[2]", P_INT, 1, 71, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFFOUND", offsetof(struct seqg_vars, found_pi[3]), "found_pi[3]", P_INT, 1, 72, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFFOUNDTS", offsetof(struct seqg_vars, foundts_pi[0]), "foundts_pi[0]", P_STRING, 1, 73, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFFOUNDTS", offsetof(struct seqg_vars, foundts_pi[1]), "foundts_pi[1]", P_STRING, 1, 74, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFFOUNDTS", offsetof(struct seqg_vars, foundts_pi[2]), "foundts_pi[2]", P_STRING, 1, 75, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFFOUNDTS", offsetof(struct seqg_vars, foundts_pi[3]), "foundts_pi[3]", P_STRING, 1, 76, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9MODE", offsetof(struct seqg_vars, f_8pi9[0]), "f_8pi9[0]", P_DOUBLE, 1, 77, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9MODE", offsetof(struct seqg_vars, f_8pi9[1]), "f_8pi9[1]", P_DOUBLE, 1, 78, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9MODE", offsetof(struct seqg_vars, f_8pi9[2]), "f_8pi9[2]", P_DOUBLE, 1, 79, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9MODE", offsetof(struct seqg_vars, f_8pi9[3]), "f_8pi9[3]", P_DOUBLE, 1, 80, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9RMS", offsetof(struct seqg_vars, rms_8pi9[0]), "rms_8pi9[0]", P_DOUBLE, 1, 81, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9RMS", offsetof(struct seqg_vars, rms_8pi9[1]), "rms_8pi9[1]", P_DOUBLE, 1, 82, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9RMS", offsetof(struct seqg_vars, rms_8pi9[2]), "rms_8pi9[2]", P_DOUBLE, 1, 83, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9RMS", offsetof(struct seqg_vars, rms_8pi9[3]), "rms_8pi9[3]", P_DOUBLE, 1, 84, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9FITRMS", offsetof(struct seqg_vars, fitrms_8pi9[0]), "fitrms_8pi9[0]", P_DOUBLE, 1, 85, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9FITRMS", offsetof(struct seqg_vars, fitrms_8pi9[1]), "fitrms_8pi9[1]", P_DOUBLE, 1, 86, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9FITRMS", offsetof(struct seqg_vars, fitrms_8pi9[2]), "fitrms_8pi9[2]", P_DOUBLE, 1, 87, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9FITRMS", offsetof(struct seqg_vars, fitrms_8pi9[3]), "fitrms_8pi9[3]", P_DOUBLE, 1, 88, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9BW", offsetof(struct seqg_vars, bw_8pi9[0]), "bw_8pi9[0]", P_DOUBLE, 1, 89, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9BW", offsetof(struct seqg_vars, bw_8pi9[1]), "bw_8pi9[1]", P_DOUBLE, 1, 90, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9BW", offsetof(struct seqg_vars, bw_8pi9[2]), "bw_8pi9[2]", P_DOUBLE, 1, 91, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9BW", offsetof(struct seqg_vars, bw_8pi9[3]), "bw_8pi9[3]", P_DOUBLE, 1, 92, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9AMAX", offsetof(struct seqg_vars, amax_8pi9[0]), "amax_8pi9[0]", P_DOUBLE, 1, 93, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9AMAX", offsetof(struct seqg_vars, amax_8pi9[1]), "amax_8pi9[1]", P_DOUBLE, 1, 94, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9AMAX", offsetof(struct seqg_vars, amax_8pi9[2]), "amax_8pi9[2]", P_DOUBLE, 1, 95, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9AMAX", offsetof(struct seqg_vars, amax_8pi9[3]), "amax_8pi9[3]", P_DOUBLE, 1, 96, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9FOUND", offsetof(struct seqg_vars, found_8pi9[0]), "found_8pi9[0]", P_INT, 1, 97, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9FOUND", offsetof(struct seqg_vars, found_8pi9[1]), "found_8pi9[1]", P_INT, 1, 98, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9FOUND", offsetof(struct seqg_vars, found_8pi9[2]), "found_8pi9[2]", P_INT, 1, 99, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9FOUND", offsetof(struct seqg_vars, found_8pi9[3]), "found_8pi9[3]", P_INT, 1, 100, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:8PI9FOUNDTS", offsetof(struct seqg_vars, foundts_8pi9[0]), "foundts_8pi9[0]", P_STRING, 1, 101, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:8PI9FOUNDTS", offsetof(struct seqg_vars, foundts_8pi9[1]), "foundts_8pi9[1]", P_STRING, 1, 102, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:8PI9FOUNDTS", offsetof(struct seqg_vars, foundts_8pi9[2]), "foundts_8pi9[2]", P_STRING, 1, 103, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:8PI9FOUNDTS", offsetof(struct seqg_vars, foundts_8pi9[3]), "foundts_8pi9[3]", P_STRING, 1, 104, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:DFWF", offsetof(struct seqg_vars, df_bestwf[0]), "df_bestwf[0]", P_DOUBLE, 50, 105, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:DFWF", offsetof(struct seqg_vars, df_bestwf[1]), "df_bestwf[1]", P_DOUBLE, 50, 106, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:DFWF", offsetof(struct seqg_vars, df_bestwf[2]), "df_bestwf[2]", P_DOUBLE, 50, 107, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:DFWF", offsetof(struct seqg_vars, df_bestwf[3]), "df_bestwf[3]", P_DOUBLE, 50, 108, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:RMSWF", offsetof(struct seqg_vars, rms_bestwf[0]), "rms_bestwf[0]", P_DOUBLE, 50, 109, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:RMSWF", offsetof(struct seqg_vars, rms_bestwf[1]), "rms_bestwf[1]", P_DOUBLE, 50, 110, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:RMSWF", offsetof(struct seqg_vars, rms_bestwf[2]), "rms_bestwf[2]", P_DOUBLE, 50, 111, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:RMSWF", offsetof(struct seqg_vars, rms_bestwf[3]), "rms_bestwf[3]", P_DOUBLE, 50, 112, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:BWWF", offsetof(struct seqg_vars, bw_bestwf[0]), "bw_bestwf[0]", P_DOUBLE, 50, 113, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:BWWF", offsetof(struct seqg_vars, bw_bestwf[1]), "bw_bestwf[1]", P_DOUBLE, 50, 114, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:BWWF", offsetof(struct seqg_vars, bw_bestwf[2]), "bw_bestwf[2]", P_DOUBLE, 50, 115, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:BWWF", offsetof(struct seqg_vars, bw_bestwf[3]), "bw_bestwf[3]", P_DOUBLE, 50, 116, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:FITRMSWF", offsetof(struct seqg_vars, fitrms_bestwf[0]), "fitrms_bestwf[0]", P_DOUBLE, 50, 117, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:FITRMSWF", offsetof(struct seqg_vars, fitrms_bestwf[1]), "fitrms_bestwf[1]", P_DOUBLE, 50, 118, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:FITRMSWF", offsetof(struct seqg_vars, fitrms_bestwf[2]), "fitrms_bestwf[2]", P_DOUBLE, 50, 119, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:FITRMSWF", offsetof(struct seqg_vars, fitrms_bestwf[3]), "fitrms_bestwf[3]", P_DOUBLE, 50, 120, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:AMAXWF", offsetof(struct seqg_vars, amax_bestwf[0]), "amax_bestwf[0]", P_DOUBLE, 50, 121, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:AMAXWF", offsetof(struct seqg_vars, amax_bestwf[1]), "amax_bestwf[1]", P_DOUBLE, 50, 122, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:AMAXWF", offsetof(struct seqg_vars, amax_bestwf[2]), "amax_bestwf[2]", P_DOUBLE, 50, 123, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:AMAXWF", offsetof(struct seqg_vars, amax_bestwf[3]), "amax_bestwf[3]", P_DOUBLE, 50, 124, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:NFOUND", offsetof(struct seqg_vars, nfound[0]), "nfound[0]", P_INT, 1, 125, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:NFOUND", offsetof(struct seqg_vars, nfound[1]), "nfound[1]", P_INT, 1, 126, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:NFOUND", offsetof(struct seqg_vars, nfound[2]), "nfound[2]", P_INT, 1, 127, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:NFOUND", offsetof(struct seqg_vars, nfound[3]), "nfound[3]", P_INT, 1, 128, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVEMODE", offsetof(struct seqg_vars, df_live[0]), "df_live[0]", P_DOUBLE, 1, 129, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVEMODE", offsetof(struct seqg_vars, df_live[1]), "df_live[1]", P_DOUBLE, 1, 130, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVEMODE", offsetof(struct seqg_vars, df_live[2]), "df_live[2]", P_DOUBLE, 1, 131, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVEMODE", offsetof(struct seqg_vars, df_live[3]), "df_live[3]", P_DOUBLE, 1, 132, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVERMS", offsetof(struct seqg_vars, rms_live[0]), "rms_live[0]", P_DOUBLE, 1, 133, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVERMS", offsetof(struct seqg_vars, rms_live[1]), "rms_live[1]", P_DOUBLE, 1, 134, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVERMS", offsetof(struct seqg_vars, rms_live[2]), "rms_live[2]", P_DOUBLE, 1, 135, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVERMS", offsetof(struct seqg_vars, rms_live[3]), "rms_live[3]", P_DOUBLE, 1, 136, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVEFITRMS", offsetof(struct seqg_vars, fitrms_live[0]), "fitrms_live[0]", P_DOUBLE, 1, 137, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVEFITRMS", offsetof(struct seqg_vars, fitrms_live[1]), "fitrms_live[1]", P_DOUBLE, 1, 138, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVEFITRMS", offsetof(struct seqg_vars, fitrms_live[2]), "fitrms_live[2]", P_DOUBLE, 1, 139, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVEFITRMS", offsetof(struct seqg_vars, fitrms_live[3]), "fitrms_live[3]", P_DOUBLE, 1, 140, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVEBW", offsetof(struct seqg_vars, bw_live[0]), "bw_live[0]", P_DOUBLE, 1, 141, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVEBW", offsetof(struct seqg_vars, bw_live[1]), "bw_live[1]", P_DOUBLE, 1, 142, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVEBW", offsetof(struct seqg_vars, bw_live[2]), "bw_live[2]", P_DOUBLE, 1, 143, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVEBW", offsetof(struct seqg_vars, bw_live[3]), "bw_live[3]", P_DOUBLE, 1, 144, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVEAMAX", offsetof(struct seqg_vars, amax_live[0]), "amax_live[0]", P_DOUBLE, 1, 145, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVEAMAX", offsetof(struct seqg_vars, amax_live[1]), "amax_live[1]", P_DOUBLE, 1, 146, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVEAMAX", offsetof(struct seqg_vars, amax_live[2]), "amax_live[2]", P_DOUBLE, 1, 147, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVEAMAX", offsetof(struct seqg_vars, amax_live[3]), "amax_live[3]", P_DOUBLE, 1, 148, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVEFOUND", offsetof(struct seqg_vars, found_live[0]), "found_live[0]", P_INT, 1, 149, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVEFOUND", offsetof(struct seqg_vars, found_live[1]), "found_live[1]", P_INT, 1, 150, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVEFOUND", offsetof(struct seqg_vars, found_live[2]), "found_live[2]", P_INT, 1, 151, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVEFOUND", offsetof(struct seqg_vars, found_live[3]), "found_live[3]", P_INT, 1, 152, 0, 0, 0, 0}, {"{CM}{CAVA}0:FSCAN:LIVEFOUNDTS", offsetof(struct seqg_vars, foundts_live[0]), "foundts_live[0]", P_STRING, 1, 153, 0, 0, 0, 0}, {"{CM}{CAVB}0:FSCAN:LIVEFOUNDTS", offsetof(struct seqg_vars, foundts_live[1]), "foundts_live[1]", P_STRING, 1, 154, 0, 0, 0, 0}, {"{CM}{CAVC}0:FSCAN:LIVEFOUNDTS", offsetof(struct seqg_vars, foundts_live[2]), "foundts_live[2]", P_STRING, 1, 155, 0, 0, 0, 0}, {"{CM}{CAVD}0:FSCAN:LIVEFOUNDTS", offsetof(struct seqg_vars, foundts_live[3]), "foundts_live[3]", P_STRING, 1, 156, 0, 0, 0, 0}, {"{CM}{CAVA}0:RFMODECTRL", offsetof(struct seqg_vars, rfmodectrl[0]), "rfmodectrl[0]", P_INT, 1, 157, 0, 0, 0, 0}, {"{CM}{CAVB}0:RFMODECTRL", offsetof(struct seqg_vars, rfmodectrl[1]), "rfmodectrl[1]", P_INT, 1, 158, 0, 0, 0, 0}, {"{CM}{CAVC}0:RFMODECTRL", offsetof(struct seqg_vars, rfmodectrl[2]), "rfmodectrl[2]", P_INT, 1, 159, 0, 0, 0, 0}, {"{CM}{CAVD}0:RFMODECTRL", offsetof(struct seqg_vars, rfmodectrl[3]), "rfmodectrl[3]", P_INT, 1, 160, 0, 0, 0, 0}, {"{CM}{CAVA}0:RFCTRL", offsetof(struct seqg_vars, rfctrl[0]), "rfctrl[0]", P_INT, 1, 161, 0, 0, 0, 0}, {"{CM}{CAVB}0:RFCTRL", offsetof(struct seqg_vars, rfctrl[1]), "rfctrl[1]", P_INT, 1, 162, 0, 0, 0, 0}, {"{CM}{CAVC}0:RFCTRL", offsetof(struct seqg_vars, rfctrl[2]), "rfctrl[2]", P_INT, 1, 163, 0, 0, 0, 0}, {"{CM}{CAVD}0:RFCTRL", offsetof(struct seqg_vars, rfctrl[3]), "rfctrl[3]", P_INT, 1, 164, 0, 0, 0, 0}, {"{CM}{CAVA}0:RFSTATE", offsetof(struct seqg_vars, rfstate[0]), "rfstate[0]", P_INT, 1, 165, 0, 0, 0, 0}, {"{CM}{CAVB}0:RFSTATE", offsetof(struct seqg_vars, rfstate[1]), "rfstate[1]", P_INT, 1, 166, 0, 0, 0, 0}, {"{CM}{CAVC}0:RFSTATE", offsetof(struct seqg_vars, rfstate[2]), "rfstate[2]", P_INT, 1, 167, 0, 0, 0, 0}, {"{CM}{CAVD}0:RFSTATE", offsetof(struct seqg_vars, rfstate[3]), "rfstate[3]", P_INT, 1, 168, 0, 0, 0, 0}, {"{CM}{CAVA}0:CHIRP:DF", offsetof(struct seqg_vars, df[0]), "df[0]", P_DOUBLE, 1, 169, 0, 1, 0, 0}, {"{CM}{CAVB}0:CHIRP:DF", offsetof(struct seqg_vars, df[1]), "df[1]", P_DOUBLE, 1, 170, 0, 1, 0, 0}, {"{CM}{CAVC}0:CHIRP:DF", offsetof(struct seqg_vars, df[2]), "df[2]", P_DOUBLE, 1, 171, 0, 1, 0, 0}, {"{CM}{CAVD}0:CHIRP:DF", offsetof(struct seqg_vars, df[3]), "df[3]", P_DOUBLE, 1, 172, 0, 1, 0, 0}, {"{CM}{CAVA}0:CHIRP:DF_CALC.J", offsetof(struct seqg_vars, amax[0]), "amax[0]", P_DOUBLE, 1, 173, 0, 0, 0, 0}, {"{CM}{CAVB}0:CHIRP:DF_CALC.J", offsetof(struct seqg_vars, amax[1]), "amax[1]", P_DOUBLE, 1, 174, 0, 0, 0, 0}, {"{CM}{CAVC}0:CHIRP:DF_CALC.J", offsetof(struct seqg_vars, amax[2]), "amax[2]", P_DOUBLE, 1, 175, 0, 0, 0, 0}, {"{CM}{CAVD}0:CHIRP:DF_CALC.J", offsetof(struct seqg_vars, amax[3]), "amax[3]", P_DOUBLE, 1, 176, 0, 0, 0, 0}, {"{CM}{CAVA}0:CHIRP:RMS", offsetof(struct seqg_vars, rms[0]), "rms[0]", P_DOUBLE, 1, 177, 3, 1, 0, 0}, {"{CM}{CAVB}0:CHIRP:RMS", offsetof(struct seqg_vars, rms[1]), "rms[1]", P_DOUBLE, 1, 178, 3, 1, 0, 0}, {"{CM}{CAVC}0:CHIRP:RMS", offsetof(struct seqg_vars, rms[2]), "rms[2]", P_DOUBLE, 1, 179, 3, 1, 0, 0}, {"{CM}{CAVD}0:CHIRP:RMS", offsetof(struct seqg_vars, rms[3]), "rms[3]", P_DOUBLE, 1, 180, 3, 1, 0, 0}, {"{CM}{CAVA}0:CHIRP:BW", offsetof(struct seqg_vars, bw[0]), "bw[0]", P_DOUBLE, 1, 181, 0, 1, 0, 0}, {"{CM}{CAVB}0:CHIRP:BW", offsetof(struct seqg_vars, bw[1]), "bw[1]", P_DOUBLE, 1, 182, 0, 1, 0, 0}, {"{CM}{CAVC}0:CHIRP:BW", offsetof(struct seqg_vars, bw[2]), "bw[2]", P_DOUBLE, 1, 183, 0, 1, 0, 0}, {"{CM}{CAVD}0:CHIRP:BW", offsetof(struct seqg_vars, bw[3]), "bw[3]", P_DOUBLE, 1, 184, 0, 1, 0, 0}, {"{CM}{CAVA}0:CHIRP:FITRMS", offsetof(struct seqg_vars, fitrms[0]), "fitrms[0]", P_DOUBLE, 1, 185, 0, 1, 0, 0}, {"{CM}{CAVB}0:CHIRP:FITRMS", offsetof(struct seqg_vars, fitrms[1]), "fitrms[1]", P_DOUBLE, 1, 186, 0, 1, 0, 0}, {"{CM}{CAVC}0:CHIRP:FITRMS", offsetof(struct seqg_vars, fitrms[2]), "fitrms[2]", P_DOUBLE, 1, 187, 0, 1, 0, 0}, {"{CM}{CAVD}0:CHIRP:FITRMS", offsetof(struct seqg_vars, fitrms[3]), "fitrms[3]", P_DOUBLE, 1, 188, 0, 1, 0, 0}, {"{CM}{CAVA}0:CHIRP:FREQ_START", offsetof(struct seqg_vars, cav_f_start[0]), "cav_f_start[0]", P_INT, 1, 189, 0, 0, 0, 0}, {"{CM}{CAVB}0:CHIRP:FREQ_START", offsetof(struct seqg_vars, cav_f_start[1]), "cav_f_start[1]", P_INT, 1, 190, 0, 0, 0, 0}, {"{CM}{CAVC}0:CHIRP:FREQ_START", offsetof(struct seqg_vars, cav_f_start[2]), "cav_f_start[2]", P_INT, 1, 191, 0, 0, 0, 0}, {"{CM}{CAVD}0:CHIRP:FREQ_START", offsetof(struct seqg_vars, cav_f_start[3]), "cav_f_start[3]", P_INT, 1, 192, 0, 0, 0, 0}, {"{CM}{CAVA}0:CHIRP:FREQ_STOP", offsetof(struct seqg_vars, cav_f_stop[0]), "cav_f_stop[0]", P_INT, 1, 193, 0, 0, 0, 0}, {"{CM}{CAVB}0:CHIRP:FREQ_STOP", offsetof(struct seqg_vars, cav_f_stop[1]), "cav_f_stop[1]", P_INT, 1, 194, 0, 0, 0, 0}, {"{CM}{CAVC}0:CHIRP:FREQ_STOP", offsetof(struct seqg_vars, cav_f_stop[2]), "cav_f_stop[2]", P_INT, 1, 195, 0, 0, 0, 0}, {"{CM}{CAVD}0:CHIRP:FREQ_STOP", offsetof(struct seqg_vars, cav_f_stop[3]), "cav_f_stop[3]", P_INT, 1, 196, 0, 0, 0, 0}, {"{CM}{CAVA}0:DF_ENABLE", offsetof(struct seqg_vars, df_tx_enable[0]), "df_tx_enable[0]", P_INT, 1, 197, 0, 0, 0, 0}, {"{CM}{CAVB}0:DF_ENABLE", offsetof(struct seqg_vars, df_tx_enable[1]), "df_tx_enable[1]", P_INT, 1, 198, 0, 0, 0, 0}, {"{CM}{CAVC}0:DF_ENABLE", offsetof(struct seqg_vars, df_tx_enable[2]), "df_tx_enable[2]", P_INT, 1, 199, 0, 0, 0, 0}, {"{CM}{CAVD}0:DF_ENABLE", offsetof(struct seqg_vars, df_tx_enable[3]), "df_tx_enable[3]", P_INT, 1, 200, 0, 0, 0, 0}, {"{CM}00:RACK{RACK}:FSET", offsetof(struct seqg_vars, rack_offset), "rack_offset", P_INT, 1, 201, 0, 0, 0, 0}, {"{CM}{CAVA}0:FREQ_OFFSET", offsetof(struct seqg_vars, offset_rbv[0]), "offset_rbv[0]", P_DOUBLE, 1, 202, 0, 1, 0, 0}, {"{CM}{CAVB}0:FREQ_OFFSET", offsetof(struct seqg_vars, offset_rbv[1]), "offset_rbv[1]", P_DOUBLE, 1, 203, 0, 1, 0, 0}, {"{CM}{CAVC}0:FREQ_OFFSET", offsetof(struct seqg_vars, offset_rbv[2]), "offset_rbv[2]", P_DOUBLE, 1, 204, 0, 1, 0, 0}, {"{CM}{CAVD}0:FREQ_OFFSET", offsetof(struct seqg_vars, offset_rbv[3]), "offset_rbv[3]", P_DOUBLE, 1, 205, 0, 1, 0, 0}, {"{CM}00:RACK{RACK}:FREQ_OFFSET", offsetof(struct seqg_vars, rack_offset_rbv), "rack_offset_rbv", P_DOUBLE, 1, 206, 0, 1, 0, 0}, {"{CM}{CAVA}0:DDS_PHASE_RESET", offsetof(struct seqg_vars, phase_reset_rfs[0]), "phase_reset_rfs[0]", P_INT, 1, 207, 0, 0, 0, 0}, {"{CM}{CAVB}0:DDS_PHASE_RESET", offsetof(struct seqg_vars, phase_reset_rfs[1]), "phase_reset_rfs[1]", P_INT, 1, 208, 0, 0, 0, 0}, {"{CM}{CAVC}0:DDS_PHASE_RESET", offsetof(struct seqg_vars, phase_reset_rfs[2]), "phase_reset_rfs[2]", P_INT, 1, 209, 0, 0, 0, 0}, {"{CM}{CAVD}0:DDS_PHASE_RESET", offsetof(struct seqg_vars, phase_reset_rfs[3]), "phase_reset_rfs[3]", P_INT, 1, 210, 0, 0, 0, 0}, {"{CM}{CAVA}0:DDS_PHASE_STEP", offsetof(struct seqg_vars, phase_step_rfs[0]), "phase_step_rfs[0]", P_INT, 1, 211, 0, 0, 0, 0}, {"{CM}{CAVB}0:DDS_PHASE_STEP", offsetof(struct seqg_vars, phase_step_rfs[1]), "phase_step_rfs[1]", P_INT, 1, 212, 0, 0, 0, 0}, {"{CM}{CAVC}0:DDS_PHASE_STEP", offsetof(struct seqg_vars, phase_step_rfs[2]), "phase_step_rfs[2]", P_INT, 1, 213, 0, 0, 0, 0}, {"{CM}{CAVD}0:DDS_PHASE_STEP", offsetof(struct seqg_vars, phase_step_rfs[3]), "phase_step_rfs[3]", P_INT, 1, 214, 0, 0, 0, 0}, {"{CM}00:PRC{RACK}:DDS_PHASE_STEPH", offsetof(struct seqg_vars, phase_step_h_prc), "phase_step_h_prc", P_INT, 1, 215, 0, 0, 0, 0}, {"{CM}00:PRC{RACK}:DDS_PHASE_RESET", offsetof(struct seqg_vars, phase_reset_prc), "phase_reset_prc", P_INT, 1, 216, 0, 0, 0, 0}, }; /* Event masks for state set "main" */ static const seqMask seqg_mask_main_0_init[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; static const seqMask seqg_mask_main_0_ready_for_request[] = { 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "main" */ static seqState seqg_states_main[] = { { /* state name */ "init", /* action function */ seqg_action_main_0_init, /* event function */ seqg_event_main_0_init, /* entry function */ seqg_entry_main_0_init, /* exit function */ 0, /* event mask array */ seqg_mask_main_0_init, /* state options */ (0) }, { /* state name */ "ready_for_request", /* action function */ seqg_action_main_0_ready_for_request, /* event function */ seqg_event_main_0_ready_for_request, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_main_0_ready_for_request, /* state options */ (0) }, }; /* Event masks for state set "received_request" */ static const seqMask seqg_mask_received_request_1_init_common[] = { 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "received_request" */ static seqState seqg_states_received_request[] = { { /* state name */ "init_common", /* action function */ seqg_action_received_request_1_init_common, /* event function */ seqg_event_received_request_1_init_common, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_received_request_1_init_common, /* state options */ (0) }, }; /* Event masks for state set "init_scan_type" */ static const seqMask seqg_mask_init_scan_type_2_init_scan[] = { 0x00000060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "init_scan_type" */ static seqState seqg_states_init_scan_type[] = { { /* state name */ "init_scan", /* action function */ seqg_action_init_scan_type_2_init_scan, /* event function */ seqg_event_init_scan_type_2_init_scan, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_init_scan_type_2_init_scan, /* state options */ (0) }, }; /* Event masks for state set "build_scan" */ static const seqMask seqg_mask_build_scan_3_build[] = { 0x00000180, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; static const seqMask seqg_mask_build_scan_3_build_common[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "build_scan" */ static seqState seqg_states_build_scan[] = { { /* state name */ "build", /* action function */ seqg_action_build_scan_3_build, /* event function */ seqg_event_build_scan_3_build, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_build_scan_3_build, /* state options */ (0) }, { /* state name */ "build_common", /* action function */ seqg_action_build_scan_3_build_common, /* event function */ seqg_event_build_scan_3_build_common, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_build_scan_3_build_common, /* state options */ (0) }, }; /* Event masks for state set "setup_scan" */ static const seqMask seqg_mask_setup_scan_4_setup_cavities[] = { 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; static const seqMask seqg_mask_setup_scan_4_disable_df_tx[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "setup_scan" */ static seqState seqg_states_setup_scan[] = { { /* state name */ "setup_cavities", /* action function */ seqg_action_setup_scan_4_setup_cavities, /* event function */ seqg_event_setup_scan_4_setup_cavities, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_setup_scan_4_setup_cavities, /* state options */ (0) }, { /* state name */ "disable_df_tx", /* action function */ seqg_action_setup_scan_4_disable_df_tx, /* event function */ seqg_event_setup_scan_4_disable_df_tx, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_setup_scan_4_disable_df_tx, /* state options */ (0) }, }; /* Event masks for state set "start_scan" */ static const seqMask seqg_mask_start_scan_5_start[] = { 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "start_scan" */ static seqState seqg_states_start_scan[] = { { /* state name */ "start", /* action function */ seqg_action_start_scan_5_start, /* event function */ seqg_event_start_scan_5_start, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_start_scan_5_start, /* state options */ (0) }, }; /* Event masks for state set "perform_scan_offset" */ static const seqMask seqg_mask_perform_scan_offset_6_start_scan_offset[] = { 0x00000800, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; static const seqMask seqg_mask_perform_scan_offset_6_setup_dds_offset[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "perform_scan_offset" */ static seqState seqg_states_perform_scan_offset[] = { { /* state name */ "start_scan_offset", /* action function */ seqg_action_perform_scan_offset_6_start_scan_offset, /* event function */ seqg_event_perform_scan_offset_6_start_scan_offset, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_perform_scan_offset_6_start_scan_offset, /* state options */ (0) }, { /* state name */ "setup_dds_offset", /* action function */ seqg_action_perform_scan_offset_6_setup_dds_offset, /* event function */ seqg_event_perform_scan_offset_6_setup_dds_offset, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_perform_scan_offset_6_setup_dds_offset, /* state options */ (0) }, }; /* Event masks for state set "scan_offset_init" */ static const seqMask seqg_mask_scan_offset_init_7_offset_init[] = { 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "scan_offset_init" */ static seqState seqg_states_scan_offset_init[] = { { /* state name */ "offset_init", /* action function */ seqg_action_scan_offset_init_7_offset_init, /* event function */ seqg_event_scan_offset_init_7_offset_init, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_scan_offset_init_7_offset_init, /* state options */ (0) }, }; /* Event masks for state set "wait_new_data" */ static const seqMask seqg_mask_wait_new_data_8_wait[] = { 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "wait_new_data" */ static seqState seqg_states_wait_new_data[] = { { /* state name */ "wait", /* action function */ seqg_action_wait_new_data_8_wait, /* event function */ seqg_event_wait_new_data_8_wait, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_wait_new_data_8_wait, /* state options */ (0) }, }; /* Event masks for state set "get_data_cavity" */ static const seqMask seqg_mask_get_data_cavity_9_get_data[] = { 0x00004006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "get_data_cavity" */ static seqState seqg_states_get_data_cavity[] = { { /* state name */ "get_data", /* action function */ seqg_action_get_data_cavity_9_get_data, /* event function */ seqg_event_get_data_cavity_9_get_data, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_get_data_cavity_9_get_data, /* state options */ (0) }, }; /* Event masks for state set "store_data" */ static const seqMask seqg_mask_store_data_10_store_data_cavity[] = { 0x00018000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "store_data" */ static seqState seqg_states_store_data[] = { { /* state name */ "store_data_cavity", /* action function */ seqg_action_store_data_10_store_data_cavity, /* event function */ seqg_event_store_data_10_store_data_cavity, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_store_data_10_store_data_cavity, /* state options */ (0) }, }; /* Event masks for state set "process_results" */ static const seqMask seqg_mask_process_results_11_process_search_results[] = { 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "process_results" */ static seqState seqg_states_process_results[] = { { /* state name */ "process_search_results", /* action function */ seqg_action_process_results_11_process_search_results, /* event function */ seqg_event_process_results_11_process_search_results, /* entry function */ seqg_entry_process_results_11_process_search_results, /* exit function */ 0, /* event mask array */ seqg_mask_process_results_11_process_search_results, /* state options */ (0) }, }; /* Event masks for state set "post_scan" */ static const seqMask seqg_mask_post_scan_12_post_scan_restore_cavities[] = { 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; static const seqMask seqg_mask_post_scan_12_post_scan_restore[] = { 0x00180000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "post_scan" */ static seqState seqg_states_post_scan[] = { { /* state name */ "post_scan_restore_cavities", /* action function */ seqg_action_post_scan_12_post_scan_restore_cavities, /* event function */ seqg_event_post_scan_12_post_scan_restore_cavities, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_post_scan_12_post_scan_restore_cavities, /* state options */ (0) }, { /* state name */ "post_scan_restore", /* action function */ seqg_action_post_scan_12_post_scan_restore, /* event function */ seqg_event_post_scan_12_post_scan_restore, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_post_scan_12_post_scan_restore, /* state options */ (0) }, }; /* State set table */ static seqSS seqg_statesets[] = { { /* state set name */ "main", /* states */ seqg_states_main, /* number of states */ 2 }, { /* state set name */ "received_request", /* states */ seqg_states_received_request, /* number of states */ 1 }, { /* state set name */ "init_scan_type", /* states */ seqg_states_init_scan_type, /* number of states */ 1 }, { /* state set name */ "build_scan", /* states */ seqg_states_build_scan, /* number of states */ 2 }, { /* state set name */ "setup_scan", /* states */ seqg_states_setup_scan, /* number of states */ 2 }, { /* state set name */ "start_scan", /* states */ seqg_states_start_scan, /* number of states */ 1 }, { /* state set name */ "perform_scan_offset", /* states */ seqg_states_perform_scan_offset, /* number of states */ 2 }, { /* state set name */ "scan_offset_init", /* states */ seqg_states_scan_offset_init, /* number of states */ 1 }, { /* state set name */ "wait_new_data", /* states */ seqg_states_wait_new_data, /* number of states */ 1 }, { /* state set name */ "get_data_cavity", /* states */ seqg_states_get_data_cavity, /* number of states */ 1 }, { /* state set name */ "store_data", /* states */ seqg_states_store_data, /* number of states */ 1 }, { /* state set name */ "process_results", /* states */ seqg_states_process_results, /* number of states */ 1 }, { /* state set name */ "post_scan", /* states */ seqg_states_post_scan, /* number of states */ 2 }, }; /* Program table (global) */ seqProgram chirpScan = { /* magic number */ 2002004, /* program name */ "chirpScan", /* channels */ seqg_chans, /* num. channels */ 196, /* state sets */ seqg_statesets, /* num. state sets */ 13, /* user var size */ sizeof(struct seqg_vars), /* param */ "", /* num. event flags */ 20, /* encoded options */ (0 | OPT_CONN | OPT_DEBUG | OPT_NEWEF | OPT_REENT), /* init func */ seqg_init, /* entry func */ 0, /* exit func */ 0, /* num. queues */ 0 }; # line 1618 "../../src/rf/chirpscan.st" void log_message(FILE * filep, char *message, int debugprint, unsigned long fpaddr) { if (fp) { fprintf((FILE *)fpaddr,message); } if (debugprint) { printf("%s",message); } } void log_close(FILE * filep, int debugprint, unsigned long fpaddr) { if (fp) { fclose((FILE *)fpaddr); } } void log_flush(FILE * filep, unsigned long fpaddr) { if (fp) { fflush((FILE *)fpaddr); } } /* Register sequencer commands and program */ #include "epicsExport.h" static void chirpScanRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&chirpScan); } epicsExportRegistrar(chirpScanRegistrar);