Download EzCapture
Transcript
2 EZ-CAPTURE: MANUAL DATA CAPTURE 16 case (c): value in CALA -> return (c-tiny, c+tiny, alphaAlo, alphaAhi, minlo, minhi) value in CALB -> return (c-tiny, c+tiny, alphaBlo, alphaBhi, minlo, minhi) value in CALC -> return (c-tiny, c+tiny, alphaClo, alphaBhi, minlo, minhi) default: fail(Bad calibration value) end routine TestYCal routine TesttCal (t, c): StoretCal(t,c) if (t < 5) or (t > 1000) -> fail(Bad time base) # arbitrary Nos. end routine TesttCal Main data processing Here’s the main data-processing and storing routine: routine ProcessDatum (t, y) if y in ZERO -> y2 <- ReadLine if y2 in ZERO -> # 0,0 signals datum NA Store(t, NA) return (t+5) if y2 in MAXVAL -> # 0, MAXVAL = end of run, recalibrate Recalibrate() idx <- idx +1 # global: signal new variable return (0) # back to start time! if y2 > MAXVAL -> # meaningless fail (Bad Y calibration value) if y2 <= MINVAL -> # special signal to store LOW values: Store(t, y2) default -> fail (Bad special datum value) if y in ALPHA -> y2 <- ReadLine ALPHAm <- (ALPHAh + ALPHAl)/2 toff <- round( (5*y2)/ALPHAm ) Store(t + toff, y2) return(t) # do NOT advance
Related documents