'SUB4CD ' reads in the engineering data from their SUB4 ASCII files ' and plots them on the screen. ' 'SPACE pauses scan until any other key . (NumLock must be OFF) 'F2 toggles sound of the pressure signal DECLARE SUB shownumbers () DECLARE SUB label () DECLARE FUNCTION timetext! (A$, x!, y!, couleur!) DECLARE SUB params () DECLARE SUB adjpres () DECLARE SUB readit () DECLARE SUB readsub4 () 'new for sub4 DECLARE SUB plotit () DECLARE SUB checktime () DECLARE SUB stamp () DECLARE SUB grid () DECLARE SUB timetic () DECLARE SUB soundit () DECLARE SUB incrument () COMMON SHARED xsc, csx, pinch, ivar, nvar, plot AS INTEGER COMMON SHARED l, llast, x, xoff, temps, temps1, eff, mtemp AS SINGLE COMMON SHARED lastp, zeit1, e2%, e3% COMMON SHARED e$, ctd%, infile$, file$, file%, filebeg%, filend%, scr, snd, num nvar = 9 DIM SHARED y%(nvar), clrs%(nvar), ysc(nvar), nmvar$(nvar) DIM SHARED m0%(nvar) DIM SHARED m%(nvar) l = 20 lstp = 0 ctd% = 0 scr = 0 snd = 0 sd = 0 sn = 0 first = 1 default$ = "..\sub4eng\data" 'The directory where the files are.. PRINT "4-digit number of the first file to be plotted " INPUT "From ? (1285 to 1351)", filebeg% file% = filebeg% INPUT "Last file =", filend% PRINT " Numbers display toggle, F3(OFF) & F4(ON) :"; " SPACE = STOP": 'INPUT "Press RETURN to begin ..", nonsense 10 row = INT(RND * 20) + 5: col = INT(RND * 55) + 5 file$ = MID$(STR$(file%), 2) infile$ = default$ + file$ + ".dat" B$ = infile$ SCREEN 12, 2 PALETTE 2, 12 params OPEN infile$ FOR INPUT AS #1 LEN = 60 'The records are between 1283 and 1351 IF ctr = 1 THEN GOTO 30 ELSE ctr = 1 xsc = .166 ' determines cruise time per PC screen; .5 in ssplot.asc 'for 2 cycles/screen, use .166, screen = 12 min. 'for 1 cycles/screen, use .333, screen = 6 min.,etc. time0$ = times$ 'checktime temps0 = temps: temps1 = temps0 label '-----------------------------start main loop--------------------- DO IF EOF(1) THEN GOTO 15 ELSE GOTO 20 15 CLOSE (1) 'infile$) incrument GOTO 10 20 checktime x = xsc * (temps - temps0) l = 20 + (x - xoff) IF l > 619 THEN xoff = xoff + 600 '''LOCATE 1, 1: PRINT zeit1 COLOR 11 LOCATE 29, 1: PRINT "PLOTTING FILE "; file%; " JUNE "; zeit1; " 1993"; LOCATE 30, 1: PRINT "Background colors keys 3 - 0:"; " F3(ON) & F4(OFF) Toggle numbers:"; " SPACE = STOP"; grid END IF 30 readsub4 IF first = 1 THEN COLOR 11 LOCATE 29, 1: PRINT "PLOTTING FILE "; file%; " JUNE "; zeit1; " 1993"; PRINT " F1 = Blue and Brown Screen"; LOCATE 30, 1: PRINT "Background colors keys 3 - 0:"; PRINT " F3(OFF) & F4(ON) Toggle numbers:"; " SPACE = STOP"; first = 0 END IF ' ON KEY(5) GOSUB 32 ' KEY(5) ON 'GOTO 35 '32 LOCATE 42, 70: PRINT y%(2)'''e1% '35 ON KEY(3) GOSUB 32 KEY(3) ON ON KEY(4) GOSUB 34 KEY(4) ON GOTO 35 32 sn = 0: GOTO 35 34 sn = 1 35 IF sn = 1 THEN shownumbers ELSE GOTO 39 39 ON KEY(2) GOSUB 70 'plotit KEY(2) ON 'Key (2) is the code for F2 ' and toggles the sound IF snd = 1 THEN GOTO 75 ELSE GOTO 80 40 GOTO 80 70 IF snd = 1 THEN snd = 0 ELSE snd = 1 ' soundon 75 soundit 77 GOTO 90 80 plotit 90 ON KEY(1) GOSUB 110 'key(1) is the code for F1 KEY(1) ON 'and F1 toggles the blues 100 GOTO 120 110 IF scr = 2 THEN scr = 1 ELSE scr = 2 120 '57 is the scan code for SPACE KEY 15, CHR$(0) + CHR$(57) ON KEY(15) GOSUB 210 KEY(15) ON GOTO 220 210 WHILE (INKEY$ = "") STOP' SLEEP (1) WEND 220 key$ = INKEY$ IF key$ = "b" THEN scr = 9 IF key$ = "1" THEN scr = 1 'light blue IF key$ = "2" THEN scr = 2 IF key$ = "3" THEN scr = 3 IF key$ = "4" THEN scr = 4 IF key$ = "5" THEN scr = 5 IF key$ = "6" THEN scr = 6 IF key$ = "7" THEN scr = 7 'gray IF key$ = "8" THEN scr = 8 IF key$ = "9" THEN scr = 9 'dark blue IF key$ = "0" THEN scr = 0 'black IF key$ = "g" THEN scr = 10 'green IF key$ = "c" THEN scr = 11 'cyan IF key$ = "r" THEN scr = 12 IF key$ = "m" THEN scr = 13 IF key$ = "y" THEN scr = 14 'yellow IF key$ = "w" THEN scr = 15 'white LINE (20, 241)-(620, 241), 8 'draws a center line at 1 pixel below 0 LOOP '-----------------------------end main loop--------------------- SUB checktime ' substitute for the original checktime temps = temps + 1 END SUB SUB grid 'grid, original from ssplot3.asc LINE (20, 240)-(620, 240), 8 LINE (20, 40)-(620, 440), 8, B FOR x = 20 TO 620 STEP 10 FOR ytemp = -5 TO 5 dot = 15 IF scr = 7 THEN dot = 0 IF scr = 10 THEN dot = 0 IF scr = 11 THEN dot = 0 IF scr = 14 THEN dot = 0 IF scr = 15 THEN dot = 0 mtemp = 240 + ytemp * 40: PSET (x, mtemp), dot NEXT: NEXT '''LOCATE 29, 55: PRINT USING "grid: ####.# sec"; 10 / xsc; FOR ivar = 1 TO nvar NEXT IF scr = 2 THEN abc = 1 ELSE IF scr = 1 THEN scr = 2 ELSE IF abc = 1 THEN scr = 1 ELSE ''' scr = scr + 1 'changes colors automatically IF scr > 15 THEN scr = 0 END SUB SUB incrument ' CLS 'PRINT 'PRINT file% = file% + 1 IF file% = 1289 THEN file% = 1295 IF file% > filend% THEN file% = filebeg% l = 0 lstp = 0 ctd% = 0 END SUB SUB label 'label, shortened from original in ssplot3.asc CLS FOR ivar = 1 TO nvar LOCATE 1, 2 + 7 * ivar COLOR clrs%(ivar) PRINT nmvar$(ivar); NEXT COLOR 11 LOCATE 1, 73: PRINT "pvolts"; IF ctd% = 1 THEN LOCATE 2, 74: PRINT "p-ctd"; ELSE LOCATE 2, 74: PRINT "p-eng " END IF A$ = "Plotting " B$ = infile$ LOCATE 2, 1 END SUB SUB params 'used settings from sub3 'ssplot8 clrs%(1) = 10: nmvar$(1) = "p-eng": m0%(1) = 40: ysc(1) = -.8 clrs%(2) = 10: nmvar$(2) = "p-ctd": m0%(2) = 240: ysc(2) = 1 clrs%(4) = 11: nmvar$(4) = "pitch": m0%(4) = 240: ysc(4) = .3 clrs%(3) = 12: nmvar$(3) = " roll": m0%(3) = 240: ysc(3) = .3 clrs%(5) = 13: nmvar$(5) = " wing": m0%(5) = 240: ysc(5) = .4 clrs%(6) = 14: nmvar$(6) = " RPM": m0%(6) = 440: ysc(6) = 1 clrs%(7) = 15: nmvar$(7) = "tensn": m0%(7) = 440: ysc(7) = .4 clrs%(8) = 7: nmvar$(8) = "valve ": m0%(8) = 240: ysc(8) = -1 clrs%(9) = 6: nmvar$(9) = " CMD": m0%(9) = 40: ysc(9) = .8 'ssplot7 clrs%(1) = 10: nmvar$(1) = "p-eng": m0%(1) = 40: ysc(1) = -.8 clrs%(2) = 10: nmvar$(2) = "p-ctd": m0%(2) = 40: ysc(2) = -.8 clrs%(4) = 11: nmvar$(4) = "pitch": m0%(4) = 240: ysc(4) = .3 clrs%(3) = 12: nmvar$(3) = " roll": m0%(3) = 240: ysc(3) = .3 clrs%(5) = 5: nmvar$(5) = " wing": m0%(5) = 240: ysc(5) = .04'.4 clrs%(6) = 14: nmvar$(6) = " RPM": m0%(6) = 440: ysc(6) = 1 clrs%(7) = 15: nmvar$(7) = "tensn": m0%(7) = 440: ysc(7) = .4 clrs%(8) = 7: nmvar$(8) = "valve": m0%(8) = 240: ysc(8) = -2'.5 '.25 clrs%(9) = 6: nmvar$(9) = " CMD": m0%(9) = 40: ysc(9) = .7'''1.3'.8 END SUB SUB plotit 'plotit as in ssplot3.asc 'one change: taken out if-loop checking pvar LINE (llast + 1, 40)-(llast + 1, 440), scr 'scr = 9 draws a lt blue screen 'LINE (l + 1, 40)-(l + 1, 440), 15 ' draws a white leader FOR ivar = 1 TO nvar m%(ivar) = m0%(ivar) - ysc(ivar) * y%(ivar) PSET (l, m%(ivar)), clrs%(ivar) NEXT ' IF (l > 20) AND (l < 21) THEN ' stamp ' END IF ' IF l >= 340 AND llast < 340 THEN ' stamp ' END IF llast = l END SUB SUB readit ' reads in the data from the original data file e1% = VAL(MID$(e$, 1, 2)) e2% = VAL(MID$(e$, 4, 2)) e3% = VAL(MID$(e$, 6, 2)) e4% = VAL(MID$(e$, 9, 2)) zeit1 = e1% + (e2% / 24) + (e3% / 24 / 60) + (e4% / 24! / 60! / 60!) y%(1) = VAL(MID$(e$, 11, 3)) y%(2) = VAL(MID$(e$, 14, 3)) y%(3) = VAL(MID$(e$, 17, 4)) y%(4) = VAL(MID$(e$, 21, 4)) y%(5) = VAL(MID$(e$, 25, 4)) y%(6) = VAL(MID$(e$, 29, 4)) y%(7) = VAL(MID$(e$, 33, 4)) y%(8) = VAL(MID$(e$, 37, 4)) y%(9) = VAL(MID$(e$, 41, 4)) END SUB SUB readsub4 ' reads the ASCII format used for subduction 4. '''IF EOF(1) THEN GOTO incrument ELSE INPUT #1, e1%, y%(1), y%(2), y%(3), y%(4), y%(5), y%(6), y%(7), y%(8), y%(9) 'INPUT #1, e1%, e2%, e3%, e4%, y%(1), y%(2), y%(3), y%(4), y%(5), y%(6), y%(7), y%(8), y%(9) zeit1 = e1% + (e2% / 24) + (e3% / 24 / 60) + (e4% / 24! / 60! / 60!) END SUB SUB shownumbers ' LOCATE 1, 2 ' PRINT "time" ' LOCATE 2, 2 ' PRINT USING "##"; e2%; e3% FOR ivar = 1 TO nvar IF ivar = 1 THEN LOCATE 2, 2 + 4 * ivar PRINT USING "#######"; y%(ivar); NEXT END SUB SUB soundit 'plotit as in ssplot3.asc with color and sound LINE (llast + 1, 40)-(llast + 1, 440), scr 'scr = 9 draws a lt blue screen LINE (l + 1, 40)-(l + 1, 440), 15 ' draws a white leader FOR ivar = 1 TO nvar m%(ivar) = m0%(ivar) - ysc(ivar) * y%(ivar) PSET (l, m%(ivar)), clrs%(ivar) IF ivar = 1 THEN FREQ = INT(m%(ivar) * 1) + 25 '+ 100 FREQ = INT(ABS((100000 / FREQ)) - 50) '50 ''PRINT FREQ; SOUND FREQ, .15 END IF NEXT ' IF (l > 20) AND (l < 21) THEN ' stamp ' END IF ' IF l >= 340 AND llast < 340 THEN ' stamp ' END IF llast = l END SUB SUB stamp 'stamp writes time stamp as in ssplot3.asc LINE (l + 1, 447)-(l + 68, 459), 0, BF LINE (l, 446)-(l + 69, 460), 14, B LINE (l, 407)-(l, 450), 15: eff = timetext(TIME$, l - 7, 450, 15) END SUB FUNCTION timetext (A$, x, ytemp, couleur) ' as in ssplot3.asc DEF SEG = &HFFA6 FOR i = 1 TO LEN(A$) addr = 8 * ASC(MID$(A$, i)) + 14 FOR j = 0 TO 7 LINE (x + 7 + 8 * i, ytemp + j)-(x + 8 * i, ytemp + j), couleur, , PEEK(addr + j) * 128 NEXT NEXT timetext = 0 END FUNCTION SUB timetic PRINT e1$ END SUB