`DEFSNG Z
`
`DECLARE SUB ds (s$)
`COMMON SHARED fs, fsize, xcol, yrow, ycsize, sizex, sizey
`DECLARE SUB plot ()
`DECLARE SUB aposition (a, B, c)
`COMMON SHARED xcsize
`COMMON SHARED black, blue, green, cyan, red, MAGENTA, brown
`COMMON SHARED white, gray, lblue, LGREEN, lcyan, lred,
`lmagenta
`COMMON SHARED yellow, hiwhite
`COMMON SHARED foreground, background
`DECLARE SUB waitkey ()
`COMMON SHARED a$, up, down, left, right
`' $INCLUDE: 'struct.bas'
`DECLARE SUB acqfile (srecord AS ANY, arecord AS ANY, wfile$,
`xfile$, yfile$, zfile$, tfile$)
`DIM srecord AS alertcon, arecord AS peakdata
`COMMON SHARED arecord() AS peakdata
`DIM a(10, 20), B(10, 20), z(20), rset1(20), rset5(20),
`energy(20)
`DIM qstick(20), p1(20), p2(20)
`DIM des$(400)
`COMMON SHARED a(), B()
`
`' $INCLUDE: 'fontb.bi'
`
`
`' Set up the file I/O
`CALL acqfile(srecord, arecord, wfile$, xfile$, yfile$, zfile
`$, tfile$)
`
`' Get 'define functions'
`' $INCLUDE: 'fun.bas'
`
`' Constants
`' $INCLUDE: 'dcon.bas'
`
`' Init the graphics
`
`black = 0: blue = 1: green = 2: cyan = 3
`red = 4: MAGENTA = 5: brown = 6: white = 7
`gray = 8: lblue = 9: LGREEN = 10: lcyan = 11
`lred = 12: lmagenta = 13: yellow = 14: hiwhite = 15
`
`foreground = white
`background = cyan
`border = blue
`xchars = 80: ychars = 30
`ycsize = 16: xcsize = 8
`sizex = xchars * xcsize - 1
`sizey = ychars * ycsize - 1
`
`1
`
`Escort Ex. 2062, pg. 1
`
`
`
`xcenter = (sizex + 1) \ 2
`ycenter = (sizey + 1) \ 2
`xchar2 = xchars \ 2
`
`full = fnr(xchar2 - 1): zfull = full
`
`hoff = 10' Horizontal offset
`'''''''hsize = sizex - hoff - 25' Horizontal
`
`size
`
`iindex = 0
`
`r% = RegisterFonts("\bc7\src\helvb.fon")
`l% = LoadFont("n1/n2/n3/n4")
`
`'*****> File 'wfile$' contains total # of records
`OPEN wfile$ FOR INPUT AS #4
`INPUT #4, records
`CLOSE #4
`
`'*****> File 'tfile$' contains descriptive information
`
`ON ERROR RESUME NEXT ' If no description
`
`OPEN tfile$ FOR INPUT AS #4' don't complain about an
`
`file
`
`error
`
`IF ERR = 53 THEN
`PRINT "There is no description file"
`GOTO nodescrip
`END IF
`FOR i = 1 TO records
`INPUT #4, n, des$(i)
`PRINT USING "###. "; i; : PRINT des$(i)
`NEXT i
`waitkey
`CLOSE #4
`
`nodescrip: ON ERROR GOTO 0
`
`' Open third file here & display 'image7' & 'theversion' to
`record radio
`' settup information such as power up threshold.
`
`OPEN zfile$ FOR INPUT AS #2
`INPUT #2, theversion
`INPUT #2, image7
`CLOSE #2
`
`CLS
`PRINT "Software Version "; HEX$(theversion)
`thresh = image7 AND 3
`
`2
`
`Escort Ex. 2062, pg. 2
`
`
`
`PRINT "Threshold Option "; thresh;
`IF thresh = 3 THEN PRINT " the Least Sensitive Option"
`IF thresh = 2 THEN PRINT " the Second level sensitivity
`option"
`IF thresh = 1 THEN PRINT " the Most sensitive option"
`weakk = image7 AND 4
`PRINT "Weak K Processing ";
`IF weakk THEN PRINT "enabled" ELSE PRINT "disabled"
`iflash = image7 AND 8
`PRINT "Interfering flash ";
`IF iflash THEN PRINT "disabled" ELSE PRINT "enabled"
`upeak = image7 AND 16
`PRINT "Unpaired Peak Detection Enabled ";
`IF upeak THEN PRINT "enabled" ELSE PRINT "disabled"
`
`recnum = 1' Initialize record number
`
`twait:
`OPEN xfile$ FOR RANDOM AS #3 LEN = LEN(srecord)
`GET #3, recnum, srecord
`
`d$ = srecord.date
`t$ = srecord.time
`
`set1 = srecord.rset1
`set2 = srecord.rset2' Configuration
`set3 = srecord.rset3' Diagnostics
`set4 = srecord.rset4'
`set6 = srecord.rset6'
`set7 = srecord.rset7'
`set8 = srecord.rset8'
`set9 = srecord.rset9' Alert type
`bad = srecord.bad
`sbad = srecord.sbad
`tbad = srecord.tbad' Transfer Diagnostics
`images = srecord.rimages
`CLOSE #3
`xdetect = set1 AND 1: IF xdetect THEN xdetect = -1
`kdetect = set1 AND 2: IF kdetect THEN kdetect = -1
`kadetect = set1 AND 4: IF kadetect THEN kadetect = -1
`IF kadetect THEN xdetect = 0: kdetect = 0
`xkdetect = xdetect OR kdetect
`
`OPEN yfile$ FOR RANDOM AS #4 LEN = LEN(arecord)
`maxval = &H1000' Assign initial max value
`zratio = .85' Initial plot tilt
`z2 = zratio
`
`FOR id = 0 TO glast1
`zpoint = id + glast * (CSNG(recnum) - 1) + 1
`
`3
`
`Escort Ex. 2062, pg. 3
`
`
`
`GET #4, zpoint, arecord
`a(0, id) = arecord.a0
`a(1, id) = arecord.a1
`a(2, id) = arecord.a2
`a(3, id) = arecord.a3
`a(4, id) = arecord.a4
`a(5, id) = arecord.a5
`a(6, id) = arecord.a6
`a(7, id) = arecord.a7
`a(8, id) = arecord.a8
`a(9, id) = arecord.a9
`B(0, id) = arecord.b0
`B(1, id) = arecord.b1
`B(2, id) = arecord.b2
`B(3, id) = arecord.b3
`B(4, id) = arecord.b4
`B(5, id) = arecord.b5
`B(6, id) = arecord.b6
`B(7, id) = arecord.b7
`B(8, id) = arecord.b8
`B(9, id) = arecord.b9
`swcnt1 = arecord.swcnt1
`swcnt2 = arecord.swcnt2
`v = swcnt1 AND &H7FFF' # of sweeps
`z = 65536 * swcnt2 + v
`IF swcnt1 < 0 THEN z = z + 32768
`z(id) = z
`rset1(id) = arecord.rset1
`rset5(id) = arecord.rset5
`energy(id) = arecord.energy
`qstick(id) = arecord.qstick
`p1(id) = arecord.p1
`p2(id) = arecord.p2
`NEXT id
`
`IF xkdetect THEN GOTO doxkd
`
`' Handle Ka data display here
`finalindex = 2604' Final index
`thresh = kathresh
`label$ = "Ka"
`GOTO water
`' Handle x/k data display here
`doxkd: finalindex = 781' Final index
`thresh = xthresh
`label$ = "x/k"
`water:
`
`x1 = 10 * xcsize' Lower left picture
`coordinates
`y1 = 3 * ycsize' in character positions
`x2 = 3 * xcsize' Upper right picture
`coordinates
`
`4
`
`Escort Ex. 2062, pg. 4
`
`
`
`y2 = 3 * ycsize' in character positions
`
`q1 = sizey - y2 - y1' Total plot domain
`z1 = .3' vsize is z1% of plot domain q1
`vsize = z1 * q1
`dy = sizey - (y1 + y2 + vsize)
`q2 = sizex - x1 - x2' Total plot range
`
`redisplay:
`waterfall:
`
`mthresh = maxtran: pclose = tclose
`
`' Redefine iindex & finalindex based on p1,p2
`id = 10' at alert generating location
`zpoint = id + glast * (CSNG(recnum) - 1) + 1
`GET #4, zpoint, arecord
`p1 = arecord.p1
`p2 = arecord.p2
`IF p2 = 0 THEN p2 = p1
`pc = (p1 + p2) / 2
`iwindow = 780
`
`i1 = pc - iwindow: IF i1 < 0 THEN i1 = 0: i2 = 2 * iwindow:
`GOTO qr
`i2 = pc + iwindow: IF i2 > finalindex THEN i2 = finalindex:
`i1 = i2 - 2 * iwindow
`qr:
`
`iindex = i1
`findex = i2
`
`red:
`
`SCREEN 12
`VIEW (1, 1)-(sizex - 1, sizey - 1), background, border
`WINDOW (1, 1)-(sizex - 1, sizey - 1)
`COLOR foreground', background
`
`fsize = 4
`setgtextcolor hiwhite
`xcol = 1
`yrow = sizey
`a$ = "No Band"
`xdetect = set1 AND 1
`IF xdetect THEN xdetect = -1: a$ = "x band"
`kdetect = set1 AND 2
`IF kdetect THEN kdetect = -1: a$ = "k band"
`kadetect = set1 AND 4
`IF kadetect THEN kadetect = -1: a$ = "Ka band"
`xkdetect = xdetect OR kdetect
`IF kadetect THEN
`IF set4 AND 2 THEN
`a$ = a$ + " Not in False Region"
`
`ELSE
`
`a$ = a$ + " In False Region"
`
`5
`
`Escort Ex. 2062, pg. 5
`
`
`
`END IF
`END IF
`c$ = "Record #" + STR$(recnum) + " of " + STR$(records)
`de$ = " " + CHR$(0) + " "
`ds d$ + de$ + t$ + de$ + a$ + de$ + c$
`ds des$(recnum)
`
`''''''''''''Detail information section
`setgtextcolor yellow
`fsize = 1
`IF set2 AND 1 THEN B$ = "rd304"
`IF set2 AND 2 THEN B$ = "rd306"
`IF set2 AND 4 THEN B$ = "ep3100/3110"
`IF set2 AND 8 THEN B$ = "ep3200/3500"
`IF set7 AND 1 THEN a$ = "Ka sweep only"
`IF set7 AND 2 THEN a$ = "Three band mode: slow
`
`response"
`
`IF set7 AND 4 THEN a$ = "x/k sweep only"
`IF set7 AND 8 THEN a$ = "Three band mode: fast
`
`response"
`ds B$ + de$ + a$
`ds "Version " + HEX$(theversion)
`
`thr = image7 AND 3
`IF thr = 3 THEN ds "Least Sensitive Level 3"
`IF thr = 2 THEN ds "Second Level Sensitivity 2"
`IF thr = 1 THEN ds "Most Sensitive Level 1"
`
`IF images AND 4 THEN
`ds "Highway Mode"
`ELSE
`ds "City Mode"
`END IF
`
`IF set3 AND 128 THEN
`ds "Weak Signal"
`ELSE
`ds "Strong Signal"
`END IF
`a$ = "Undefined "
`IF set8 AND 1 THEN a$ = "Averaged x Paired"
`IF set8 AND 2 THEN a$ = "Averaged x Unpaired"
`IF set8 AND 4 THEN a$ = "Averaged k"
`IF set8 AND 8 THEN a$ = "Averaged Ka in False Band"
`IF set8 AND 16 THEN a$ = "Averaged Ka Outside False
`
`IF set8 AND &H20 THEN a$ = "Transient x Paired"
`IF set8 AND &H40 THEN a$ = "Transient k"
`IF set8 AND &H80 THEN a$ = "Transient Ka in False
`
`IF set9 AND 1 THEN a$ = "Transient Ka Outside False
`
`Band"
`
`Band"
`
`Band"
`
`6
`
`Escort Ex. 2062, pg. 6
`
`
`
`IF set9 AND 2 THEN a$ = "Weak Signal"
`
`ds a$
`upeak = rset5(10) AND 64
` IF upeak THEN ds "Unpaired Peak Detection " ELSE ds "Paired Peak
`Detection"
`
`setgtextcolor hiwhite
`fsize = 2
`ds ""
`ds "Legend"
`setgtextcolor yellow
`ds "Blue: Signal Energy"
`ds "Red: Undetected Lines"
`ds "White: Detected Lines"
`ds "Dots: Detection Threshold"
`
`' hsize is z2% of plot range q2
`hsize = z2 * q2
`dx = sizex - (x1 + x2 + hsize)
`
`' Show connecting lines
`connect = hiwhite
`LINE (x1, y1)-(x1 + dx, y1 + dy), connect
`LINE (x1 + hsize, y1)-(x1 + hsize + dx, y1 + dy), connect
`LINE (x1, y1 + vsize)-(x1 + dx, y1 + dy + vsize), connect
`LINE (x1 + hsize, y1 + vsize)-(x1 + hsize + dx, y1 + dy +
`vsize), connect
`
` FOR id = 0 TO glast1
`zf = id / glast1
`xoff = x1 + zf * dx
`yoff = y1 + zf * dy
`it = yellow' Threshold color indicator
`ic = lred
`GOSUB tplot
`NEXT id
`fsize = 3
`xcol = x1: yrow = y1: ds STR$(iindex)
`xcol = x1 + hsize: yrow = y1: ds STR$(findex) + " / " + STR
`$(finalindex)
`
`GOTO endx
`
`'****************************************************************
`************
`' Plot 9 element index array: at a(xx,id), magnitude array:
`at b(xx,id)
`
`' '
`
` Assumes index values are
`ordered
`' from largest to smallest
`
`7
`
`Escort Ex. 2062, pg. 7
`
`
`
`' id: vertical plot number
`' ic: bar color unless alert & detection element
`' it: threshold color
`' p1,p2: indicies of stick enable peaks
`' alert: true if active alert for this display
`' voff: Vertical offset
`' vsize: Vertical size
`' hsize: Horizontal size
`' hoff: Horizontal offset
`' findex: Final index number
`' iindex: Inital index number
`' maxval: Max value of data in plot
`' thresh: Display detection threshold
`' mthresh: Transient threshold
`' label$: Label
`
`' '
`
` pair:
`' pclose: Illuminate region within close of pair
`'****************************************************************
`***********
`tplot:
`
`IF id = 0 OR id = 10 OR id = glast1 THEN
` LINE (xoff, yoff)-(xoff + hsize, yoff + vsize),
`
`hiwhite, B
`
`END IF
`
`'Find mapping values
`zx = hsize / (findex - iindex): zy = vsize / maxval
`
`tupdate:
`FOR i = 0 TO peaks - 1' Map peaks into display
`
`array
`
`display
`
`sweep?
`
`position?
`
`ind = a(i, id)
`IF ind < iindex THEN GOTO ibl
`IF ind > findex THEN GOTO ibl
`x = fnx(ind - iindex)' Map x coor of index ->
`
`r = B(i, id)
`IF r < 0 THEN r = 0
`IF r > maxval THEN r = maxval
`y = fny(r)
`alrt = rset1(id) AND 7' Alert in this
`
`near1 = ABS(p1(id) - ind) - 8
`near2 = ABS(p2(id) - ind) - 8
`match = (near1 < 0) OR (near2 < 0)' detect
`
`IF alrt AND match THEN
`LINE (x, yoff)-(x, y), hiwhite: it = red
`ELSE
`LINE (x, yoff)-(x, y), ic
`
`8
`
`Escort Ex. 2062, pg. 8
`
`
`
`END IF
`
`y = fny(thresh)
`PSET (x, y), it' Show threshold
`ibl: NEXT i
`y = fny(energy(id)): x = fnx(0)
`LINE (x, yoff)-(x, y), lblue
`
`y = fny(CSNG(qstick(id)) * CSNG(maxval) / 32): x = fnx
`(findex - iindex)
`LINE (x, yoff)-(x, y), lred
`
`RETURN
`
`'********************plot completed, now add supporting
`information
`endx:
`' Show the position of alert in overall sweep.
`CALL aposition(iindex, findex, finalindex)
`
`'************Wait for user input
`waitnext: waitkey
`IF up THEN maxval = maxval / 2: GOTO redisplay
`IF down THEN maxval = maxval * 2: GOTO redisplay
`zstp = .1
`IF left THEN
`
`z2 = z2 - zstp
`IF z2 < zstp THEN z2 = zstp
`GOTO redisplay
`
`END IF
`IF right THEN
`z2 = z2 + zstp
`IF z2 > 1 THEN z2 = 1
`GOTO redisplay
`
`END IF
`IF a$ = "D" OR a$ = "d" THEN GOSUB ddump: GOTO flake
`IF a$ = "B" OR a$ = "b" THEN
`recnum = recnum - 1
`IF recnum = 0 THEN recnum = records
`GOTO flake
`END IF
`IF a$ = "r" OR a$ = "R" THEN
`rrec: INPUT "Record number"; recnum
`IF recnum > records THEN PRINT "Max record number is": GOTO
`
`rrec
`
`GOTO flake
`END IF
`IF a$ = "h" OR a$ = "H" THEN
`SCREEN 0
`
`PRINT "d: Data dump"
`
`9
`
`Escort Ex. 2062, pg. 9
`
`
`
`PRINT "b: Back up to previous record"
`PRINT "r: Enter record number"
`PRINT "j: Shift window to left"
`PRINT "k: Shift window to right"
`PRINT "h: This help menu"
`PRINT CHR$(24) + ": Increase Gain"
`PRINT CHR$(25) + ": Decrease Gain"
`PRINT CHR$(26) + ": Rotate toward vertical view"
`PRINT CHR$(27) + ": Rotate toward side view"
`GOTO waitnext
`END IF
`
`IF a$ = "k" OR a$ = "K" THEN
`iindex = iindex + iwindow: findex = findex + iwindow: GOTO
`
`wqt
`
`END IF
`IF a$ = "j" OR a$ = "J" THEN
`iindex = iindex - iwindow: findex = findex - iwindow
`wqt: IF iindex < 0 THEN iindex = finalindex - 2 * iwindow:
`findex = finalindex
`IF findex > finalindex THEN iindex = 0: findex = 2 * iwindow
`GOTO red
`
`END IF
`'****************************************************************
`****
`
`recnum = recnum + 1' Advance Record Number
`
`flake: IF recnum < 1 THEN recnum = 0
`IF recnum > records THEN recnum = 1
`
`CLOSE #4
`GOTO twait
`
`'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
`''''
`' Group Information Section
`'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
`'''''
`ddump:
`
`SCREEN 0
`PRINT "Record "; recnum; " of "; records
`PRINT d$
`PRINT t$
`PRINT "Fiber Errors "; bad
`PRINT "Serial Transfer Errors "; sbad
`PRINT "Timeouts "; tbad
`IF set3 AND 128 THEN PRINT "Weak Signal Detection"
`IF set3 AND &H10 THEN PRINT "BAD ASIC"
`IF set3 AND 8 THEN PRINT "BAD RAM"
`IF set2 AND 1 THEN PRINT "rd304"
`
`10
`
`Escort Ex. 2062, pg. 10
`
`
`
`IF set2 AND 2 THEN PRINT "rd306"
`IF set2 AND 4 THEN PRINT "ep3000"
`IF set2 AND 8 THEN PRINT "ep3100"
`IF images AND 4 THEN PRINT "Highway Mode" ELSE PRINT "City
`
`Mode"
`
`IF set4 AND 1 THEN
`PRINT "Data follows xk sweep"
`ELSE
`PRINT "Data follows Ka sweep"
`END IF
`' "set1" contents are recorded in two of the acquisition files.
`' This reference indicates the initial alert type from xfile$.
`' Yfile$ later gives alert type for each sweep.
`PRINT "Initial Alert type was ";
`IF xdetect THEN PRINT "x band"
`IF kdetect THEN PRINT "k band"
`IF kadetect THEN PRINT "Ka band"
`IF kadetect THEN
`IF set4 AND 2 THEN
`PRINT "Outside False Region"
`
`ELSE
`
`PRINT "Inside False Region"
`END IF
`
`END IF
`IF set4 AND 32 THEN PRINT "OVERRUN"
`IF set7 AND 1 THEN PRINT "Ka sweep only"
`IF set7 AND 2 THEN PRINT "Three band mode: slow
`
`IF set7 AND 4 THEN PRINT "x/k sweep only"
`IF set7 AND 8 THEN PRINT "Three band mode: fast
`
`IF set7 AND &H20 THEN PRINT "Diagnostic Mode enabled"
`IF set7 AND &H40 THEN PRINT "Hyperception Display Mode
`
`IF set8 AND 1 THEN PRINT "Averaged x paired"
`IF set8 AND 2 THEN PRINT "Averaged x unpaired"
`IF set8 AND 4 THEN PRINT "Averaged k"
`IF set8 AND 8 THEN PRINT "Averaged Ka in false band"
`IF set8 AND 16 THEN PRINT "Averaged Ka outside false
`
`IF set8 AND &H20 THEN PRINT "Transient x paired"
`IF set8 AND &H40 THEN PRINT "Transient k"
`IF set8 AND &H80 THEN PRINT "Transient Ka in false
`
`IF set9 AND 1 THEN PRINT "Transient Ka outside false
`
`response"
`
`response"
`
`enabled"
`
`band"
`
`band"
`
`band"
`
`IF set9 AND 2 THEN PRINT "Weak signal"
`
`waitkey' Wait for key input to continue
`
`11
`
`Escort Ex. 2062, pg. 11
`
`
`
`'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
`''''''''''''
`' Numeric Data Dump Section
`
`' '
`
`''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
`''''''''''''
`CLS
`SCREEN 0
`q$ = "#### "
`' Heading Section
`PRINT " ";
`FOR i = 0 TO keep - 1
`PRINT USING q$; i;
`NEXT i
`FOR i = 0 TO glast1' # of records in queue
`
`zpoint = i + glast * (CSNG(recnum) - 1) + 1
`GET #4, zpoint, arecord
`a(0, i) = arecord.a0
`a(1, i) = arecord.a1
`a(2, i) = arecord.a2
`a(3, i) = arecord.a3
`a(4, i) = arecord.a4
`a(5, i) = arecord.a5
`a(6, i) = arecord.a6
`a(7, i) = arecord.a7
`a(8, i) = arecord.a8
`a(9, i) = arecord.a9
`B(0, i) = arecord.b0
`B(1, i) = arecord.b1
`B(2, i) = arecord.b2
`B(3, i) = arecord.b3
`B(4, i) = arecord.b4
`B(5, i) = arecord.b5
`B(6, i) = arecord.b6
`B(7, i) = arecord.b7
`B(8, i) = arecord.b8
`B(9, i) = arecord.b9
`swcnt1 = arecord.swcnt1
`swcnt2 = arecord.swcnt2
`v = swcnt1 AND 255''''''''''''&H7FFF' # of sweeps
`z = v'''''''''''''65536 * swcnt2 + v
`''''''''''''''IF swcnt1 < 0 THEN z = z + 32768
`PRINT USING q$; z;
`
`rset1 = arecord.rset1
`rset5 = arecord.rset5
`energy = arecord.energy
`qstick = arecord.qstick
`p1 = arecord.p1
`p2 = arecord.p2
`
`12
`
`Escort Ex. 2062, pg. 12
`
`
`
` PRINT USING "## "; i;
`i$ = " -"
`IF (rset1 AND 1) THEN i$ = " x"
`IF (rset1 AND 2) THEN i$ = " k"
`IF (rset1 AND 4) THEN i$ = "Ka"
`PRINT i$;
`i$ = "a"
`IF (rset5 AND &H38) THEN i$ = "t"
`PRINT i$;
`i$ = "p"
`IF xdetect AND (rset5 AND &H40) THEN i$ = "u"
`IF (rset1 AND 7) = 0 THEN i$ = " "
`PRINT i$;
`i$ = "h "
`IF (rset5 AND &H80) THEN i$ = "L "
`PRINT i$;
`
` FOR k = 0 TO keep - 1' # of peaks
`PRINT USING q$; a(k, i);
` NEXT k
`PRINT USING q$; p1; p2; energy
`'PRINT HEX$(rset1)
`NEXT i
`waitkey' Wait for user to advance
`'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
`'''''''''''''
`RETURN
`
`SUB acqfile (srecord AS alertcon, arecord AS peakdata, wfile$,
`xfile$, yfile$, zfile$, tfile$)
`
`' xfile$ = "tt": GOTO nu
`
`rtry: CLS
`INPUT "Enter Root name for the '.dat' data collection file";
`xfile$
`
`IF LEN(xfile$) < 8 THEN GOTO fok
`PRINT "File name must be less than 7 characters"
`GOTO rtry
`
`nu:
`fok: IF xfile$ = "" THEN
`Default$ = "ROAD"
`PRINT "Using default file name "; Default$
`xfile$ = Default$
`END IF
`
`' Four files are used to store sweep data
`d$ = ".dat"
`wfile$ = xfile$ + "w" + d$
`yfile$ = xfile$ + "y" + d$
`zfile$ = xfile$ + "z" + d$
`
`13
`
`Escort Ex. 2062, pg. 13
`
`
`
`tfile$ = xfile$ + ".txt"
`xfile$ = xfile$ + d$
`
`END SUB
`
`SUB aposition (a, B, total)
`' Show the alert position
`x1 = 3 * xcsize: x2 = sizex - x1
`range = x2 - x1
`y1 = ycsize: y2 = y1 + 3
`LINE (x1, y1)-(x2, y2), red, BF
`v = 5
`LINE (x1, y1 - v)-(x1 + v, y2 + v), red, B
`LINE (x2 - v, y1 - v)-(x2, y2 + v), red, B
`
`' Show the usage regions
`zm = range / total
`ax = zm * a + x1: bx = zm * B + x1
`LINE (ax, y1)-(bx, y2), hiwhite, BF
`
`END SUB
`
`SUB ds (s$)
`DIM Font AS FontInfo
`IF fsize <> fs THEN
`SelectFont fsize
`CALL GetRFontInfo(fsize, Font)
`ycsize = Font.PixHeight
`fs = fsize
`END IF
`t = OutGText(CSNG(xcol), CSNG(yrow), s$)
`yrow = yrow - ycsize
`WINDOW (1, 1)-(sizex - 1, sizey - 1)
`' de$ = " " + CHR$(0) + " "
`' FOR i = 0 TO 15
`' a$ = ""
`' FOR j = 0 TO 15
`' a$ = a$ + CHR$(j + 8 * i)
`' NEXT j
`' ds (a$)
`' NEXT i
`END SUB
`
`SUB waitkey
`down = false: up = false: left = false: right = false
`a$ = ""
`WHILE LEN(a$) = 0
`a$ = INKEY$
`IF a$ = CHR$(27) THEN STOP
`WEND
`IF LEN(a$) = 2 THEN
`up = INSTR(a$, CHR$(&H48))
`down = INSTR(a$, CHR$(&H50))
`
`14
`
`Escort Ex. 2062, pg. 14
`
`
`
`left = INSTR(a$, CHR$(75))
`right = INSTR(a$, CHR$(&H4D))
`END IF
`END SUB
`
`15
`
`Escort Ex. 2062, pg. 15