home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
438.ALERT3.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-05-27
|
7KB
|
198 lines
CLS
REM ALERT3.BAS SATELLITE VISIBILITY ALERTING PROGRAM Ver 5.1
REM Copyright 1992,1993 by John W. Gardner, Jr.
REM Note of thanks to Walter Nissen for his ideas used in program
KEY(1) ON
ON KEY(1) GOSUB 1830
SCREEN 0
COLOR 6, 0
REM 'QBASIC Microsoft ver 1.0
SHELL "A3B.COM"
LOCATE 24, 12
INPUT "Type 1 to abort program else press ENTER to continue "; A$
IF A$ <> "1" THEN 140 ELSE 1850
140 CLS
ON ERROR GOTO 1050
PRINT " Enter TRAKSAT BATCH MODE output file for tonight's observations. IF you DO"
PRINT " NOT designated a file, previously created SAT_VIEW.FIL will automatically "
INPUT " be used if located in the current directory. "; A$
IF A$ = "" THEN A$ = "SAT_VIEW.FIL"
OPEN A$ FOR INPUT AS #1
IF A$ <> "SAT_VIEW.FIL" THEN 330
A = LOF(1)
B = A / 44
V = INT(B)
LOCATE 5, 5
PRINT "You're using a previously created satellite notification file. NO viewing"
PRINT " parameter changes other than prompts to set site UTC time are offered."
PRINT " Since program will LOCK ON to satellite that is already visible, the "
PRINT " file's 1st satellite visibility time must be LATER than current UTC time."
PRINT
INPUT " Press ENTER if this was intentional or press 1 to abort. "; B$
IF B$ = "" THEN 520 ELSE 1830
330 OPEN "X2UID.CVU" FOR OUTPUT AS #2
CLS
LOCATE 2, 6
PRINT "Program allows you to exclude one area of the sky blocked by high trees"
INPUT " or buildings. Simply press ENTER for no problems - else press 1 "; B$
IF B$ <> "1" THEN B = 0 AND C = 360 ELSE 400
GOTO 450
400 LOCATE 5, 6
PRINT "By excluding a section of the sky you are instructing the program to"
PRINT " ignore all objects within an azimuth degree range regardless of its"
PRINT " elevation or direction of travel. To exclude an area enter compass"
INPUT " degree headings with higher degree first then the lower. ( 27,5 ) "; B, C
450 LOCATE 10, 6
PRINT "Enter minimum elevation rising sat must be for notification. Make sure"
INPUT " to enter a realistic figure based on seeing conditions ( 15 ) "; M$
IF M$ = "" THEN M$ = "15"
IF VAL(M$) >= 90 THEN 450
V = 0: G = 0
J$ = "TGIF"
520 CLS
LOCATE 3, 2
INPUT "Is computer set to Day Light Saving, Standard, or UTC time (D=1 S=2 U=3)"; P
IF P = 1 THEN X = X - 1
IF P > 2 THEN Y = 0 ELSE 580
GOTO 630
580 LOCATE 5, 5
PRINT "In order to sync your computer time with UTC time, please enter how many"
PRINT " hours your time zone is from the O° Greenwich Meridian. If you are east"
INPUT " of it your entry would be a negative number ( 5 or -2 ) "; Y
IF X = -1 THEN Y = Y - 1
630 LOCATE 5, 4
IF A$ = "SAT_VIEW.FIL" THEN 1130
PRINT "Enter time frame based on 24 hour clock for observation session. Program"
PRINT " accepts ON THE HOUR (no minutes) UTC times only ( 01,05 ). The sample "
INPUT " shown equals 9pm - 1am ( EDT ) in month of MAY east coast U.S.A. "; E, F
LOCATE 10, 4
PRINT "One moment please...any sats remaining below requested elevation during"
PRINT " specified observation period or for obstructions being thrown out."
710 IF EOF(1) THEN 990
LINE INPUT #1, C$
IF MID$(C$, 79, 1) <> "Y" THEN 710
D$ = MID$(C$, 2, 13)
E$ = MID$(C$, 15, 7)
F$ = MID$(C$, 35, 3)
IF VAL(F$) >= C AND VAL(F$) <= B THEN 940
G$ = MID$(C$, 43, 2)
IF G$ < M$ THEN 710
H$ = MID$(C$, 23, 8)
L$ = MID$(H$, 1, 2)
IF VAL(L$) < E OR VAL(L$) >= F THEN 940
I$ = MID$(C$, 51, 4)
IF J$ = D$ THEN 900
850 PRINT #2, D$; ","; E$; ","; H$; ","; F$; ","; G$; ","; I$
V = V + 1
J$ = D$
K$ = L$
GOTO 710
900 IF K$ = L$ THEN 710
IF VAL(L$) = VAL(K$) + 1 AND J$ = D$ THEN 710
IF VAL(L$) < E OR VAL(L$) >= F THEN 710
IF G$ < M$ THEN 710 ELSE 850
940 IF J$ <> D$ THEN 950 ELSE 710
950 G = G + 1
LOCATE 15, 4
PRINT ; G; "oppurtunities have been discarded base on parameters entered"
GOTO 710
990 CLOSE #1
CLOSE #2
SHELL "SORT /+21 < X2UID.CVU > SAT_VIEW.FIL" 'Must be sorted by DOS only
KILL "X2UID.CVU"
OPEN "SAT_VIEW.FIL" FOR INPUT AS #1
GOTO 1130
1050 IF ERR = 52 THEN RESUME 1850 ELSE 1060
1060 IF ERR = 53 THEN RESUME 1070 ELSE 1850
1070 CLS
BEEP
LOCATE 4, 8
PRINT "File "; U$; " not found in current directory. Enter full path."
LOCATE 1, 1
GOTO 140
1130 O = 0
CLS
1150 IF EOF(1) THEN 1880
INPUT #1, A$, B$, C$, D$, E$, F$
LOCATE 1, 16
PRINT "Total of"; V; "observation opportunities remaining "
IF C$ = K$ THEN T = 1 ELSE 1210
GOTO 1430
1210 G$ = TIME$
O$ = "0"
R$ = RIGHT$(G$, 6)
Q$ = MID$(G$, 1, 2)
IF Y = 0 THEN 1320
U = VAL(Q$)
W = U + Y
IF W > 23 THEN W = W - 24
Q$ = STR$(W)
IF VAL(Q$) < 10 THEN Z$ = MID$(Q$, 2, 1) ELSE 1320
Q$ = O$ + Z$
1320 G$ = Q$ + R$
N = LEN(A$)
R = 14 - N
LOCATE 3, 18
PRINT "Based on provided data UTC time is "; G$; SPC(2);
LOCATE 6, 14
PRINT "Satellite "; A$; SPC(R); "for UTC of "; C$; " is next"
LOCATE 7, 18
PRINT "Press F1 key when you wish to exit program"
IF T = 1 THEN 1710
IF G$ <> C$ THEN 1210
1430 BEEP
LOCATE 10, 29
PRINT "SATELLITE NOW VISIBLE"
LOCATE 12, 7
PRINT "SATELLITE DATE TIME AZIMUTH ELEVATION RANGE"
PRINT
N = LEN(A$)
R = 15 - N
PRINT SPC(4); A$; SPC(R); B$; SPC(3); C$; SPC(6); D$; CHR$(248); SPC(10); E$; CHR$(248); SPC(8); F$; SPC(3);
IF O = 0 THEN 1620
LOCATE 17, 27
IF T = 1 THEN PRINT "Multiple satellites read" ELSE PRINT "Previous satellite found"
rem
PRINT
PRINT " Satellite Date Time Azimuth Elevation Range"
PRINT
N = LEN(I$)
R = 15 - N
PRINT SPC(4); I$; SPC(R); J$; SPC(3); K$; SPC(6); L$; CHR$(248); SPC(10); M$; CHR$(248); SPC(8); N$; SPC(3);
1620 I$ = A$
J$ = B$
K$ = C$
L$ = D$
M$ = E$
N$ = F$
O = 1
V = V - 1
GOTO 1150
1710 H = 23
Q$ = MID$(G$, 1, 2)
S$ = MID$(G$, 4, 2)
T$ = MID$(G$, 7, 2)
H$ = MID$(C$, 1, 2)
P$ = MID$(C$, 4, 2)
V$ = MID$(C$, 7, 2)
IF VAL(Q$) < H AND VAL(H$) = H THEN 1810
IF VAL(Q$) >= VAL(H$) THEN 1790 ELSE 1210
1790 IF VAL(S$) >= VAL(P$) THEN 1800 ELSE 1210
1800 IF VAL(T$) > VAL(V$) THEN 1810 ELSE 1210
1810 T = 0
GOTO 1430
1830 CLOSE #1
REM KILL "SAT_VIEW.FIL" 'remove rem if you wish to always delete file
1850 CLS
PRINT " Program aborted by user"
GOTO 1920
1880 LOCATE 23, 1
BEEP: BEEP: BEEP
CLOSE #1
PRINT " PROGRAM COMPLETED NO MORE SATELLITES "
1920 PRINT
PRINT " Type CLS to clear screen"
SYSTEM
END