home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Antennas
/
Antennas_CD-ROM_Walnut_Creek_September_1996.iso
/
mininec
/
amiga
/
plotprnt.asc
< prev
next >
Wrap
Text File
|
1996-06-30
|
7KB
|
245 lines
2 ON ERROR GOTO 60000
10 PRINT" ************************************************"
20 PRINT" * PLOT PROGRAM FOR MININEC3 PATTERN DATA *"
30 PRINT" * TO OUTPUT PATTERN TO PRINTER AS HARD COPY *"
40 PRINT" * DESIGNED FOR EPSOM COMPATABLE PRINTERS *"
50 PRINT" * R.P.HAVILAND, W4MB *"
60 PRINT" * PROGRAM COPYRIGHT 1990 *"
70 PRINT" * MINILAB BOOKS *"
80 PRINT" * DAYTONA BEACH, FL 32121-1086 *"
90 PRINT" ************************************************"
99 REM SETUP
100 INPUT "SEE DIRECTORY,Y/N";T$
110 IF T$<>"Y" THEN 200
120 INPUT "FILEPATH TO USE,- INCLUDE ANY : AND / ";T$
130 CLS
140 PRINT "PRESS RETURN TO CONTINUE"
150 FILES T$
160 INPUT T$
199 REM GET FILED DATA
200 INPUT "ENTER NAME OF FILE; .PAT IS ADDED";NA$
210 INPUT "ENTER FILEPATH TO USE- INCLUDE ANY : AND / ";FP$
220 OPEN FP$+NA$+".PAT" FOR INPUT AS #3
230 INPUT #3,LE,GA,TY$
240 DIM A(LE,5)
250 FOR N=1 TO LE
260 A(N,0)=N
270 FOR M=1 TO 5
280 INPUT #3,A(N,M)
290 NEXT M
300 NEXT N
310 CLOSE 3
399 REM UV/M TO DB/M
400 IF TY$="D" THEN 500
410 FOR N=1 TO LE
420 FOR M=3 TO 5
430 A(N,M)=20*LOG(A(N,M))
440 NEXT M
450 NEXT N
499 REM GET MAX VALUES
500 MX=-999
510 FOR N=1 TO LE
520 FOR M=3 TO 5
530 IF MX < A(N,M) THEN MX=A(N,M)
540 NEXT M
550 IF MV < A(N,1) THEN MV=A(N,1)
560 IF MH < A(N,2) THEN MH=A(N,2)
570 NEXT N
600 DIM BIT%(660,66),MASK%(6)
610 FOR N= 7 TO 2 STEP -1
620 MASK%(8-N)=2^N
630 NEXT N
640 PI=3.14159:DRAD=2*PI/360
799 REM ADJUST PLOT VALUES
800 FOR N=1 TO LE
810 FOR M=3 TO 5
820 A(N,M)=A(N,M)-MX
830 IF A(N,M)<-100 THEN A(N,M)=-100
840 NEXT M
850 NEXT N
999 REM PLOT QUANTITY SELECT
1000 PRINT " ENTER 1=VERTICAL POLARIZATION COMPONENT"
1010 PRINT " 2=HORIZONTAL POLARIZATION COMPONENT"
1020 PRINT " 3=TOTAL COMPONENT"
1030 INPUT PC
1040 IF ABS(PC-2)>1 THEN 1000
1050 IF PC=1 THEN PC$="VERTICAL COMPONENT"
1060 IF PC=2 THEN PC$="HORIZONTAL COMPONENT"
1070 IF PC=3 THEN PC$="TOTAL COMPONENT"
1100 PC=PC+2
1110 PRINT " ENTER V=VERTICAL PLANE PLOT (ZENITH-NADIR)"
1120 PRINT " H=HORIZONTAL PLANE PLOT (ANGLES FROM ZERO DEGREES)"
1130 INPUT PT$
1140 IF PT$="V" THEN 3000
1150 IF PT$<>"H" THEN 1100
1999 REM DO H-PLANE
2000 CLS
2010 PRINT "ANGLES FROM ZENITH ARE:"
2020 FOR N=1 TO LE
2030 PRINT A(N,1);" ";
2040 NEXT N
2050 PRINT
2060 PRINT "**** PLOT ANGLE MUST BE A VALUE FROM THIS TABLE ****"
2070 INPUT " PLOT ANGLE (90-ANGLE ABOVE HORIZON)";PAH
2080 IF MH <> 90 THEN IF MH <> 180 THEN 2200
2090 INPUT " ENTER 90 OR 180 TO COMPLETE PLOT BY SYMMETRY,OR 0 "; CPS
2100 PRINT "PRESS RETURN TO TERMINATE PLOT"
2110 IF CPS=O THEN LIM=0:GOTO 2200
2120 LIM= 360/CPS-1
2130 PRINT " WAIT- PREPARING BIT-MAP, COORDINATES AND DATA"
2199 REM PREPARE ARRAY
2200 GOSUB 5000
2210 FOR J=0 TO LIM
2220 REP=0
2230 FOR K=1 TO LE
2240 IF A(K,1)<>PAH THEN 2380
2250 RV=A(K,PC)
2260 AV=(-1)^(J)*A(K,2)-180*(J>1)
2270 GOSUB 6000
2380 NEXT K
2390 NEXT J
2400 GOTO 4000 'FOR OUTPUT
2999 REM DO V-PLANE
3000 CLS
3010 PRINT " AZIMUTH ANGLES ARE:"
3020 FOR N=1 TO 100
3030 PRINT A(N,2);" ";
3040 NEXT N
3050 PRINT
3060 PRINT "**** PLOT ANGLE MUST BE A VALUE FROM THIS TABLE ****"
3070 INPUT "ENTER AZIMUTH ANGLE TO PLOT";PAZ
3080 IF MH <> 90 THEN IF MH <> 180 THEN 3200
3090 INPUT " ENTER 90 OR 180 TO COMPLETE PLOT BY SYMMETRY,OR 0 "; CPS
3100 PRINT "PRESS CTRL-C TO TERMINATE PLOT"
3110 IF CPS=O THEN LIM=0:GOTO 3130
3120 LIM= 360/CPS-1
3130 PRINT " WAIT- PREPARING BIT-MAP, COORDINATES AND DATA"
3199 REM PREPARE ARRAY
3200 GOSUB 5000 'FOR COORDINATES
3210 FOR J=0 TO LIM
3220 REP=0
3230 FOR K=1 TO LE
3240 IF A(K,2)<>PAZ THEN 3280
3250 RV=A(K,PC)
3260 AV=(-1)^(J)*A(K,1)-180*(J>1)
3270 GOSUB 6000 'FOR DATA POINT
3280 NEXT K
3290 NEXT J
3999 REM PLOT TO PRINTER
4000 OPEN "PAR:" FOR OUTPUT AS #1
4010 PRINT #1,CHR$(27);"@"
4020 PRINT #1,CHR$(27);"A";CHR$(6)
4030 FOR ROW =O TO 60
4040 A$=""
4050 PRINT #1,CHR$(27);"L";CHR$(150);CHR$(2);
4060 FOR COL =0 TO 660
4070 PRINT #1,CHR$(BIT%(COL,ROW));
4080 NEXT COL
4090 PRINT #1,CHR$(0)
4100 NEXT ROW
4110 PRINT #1,
4120 PRINT #1,CHR$(27);"@"
4130 CLOSE 1
4400 GOTO 7000
4999 REM DO COORDINATES
5000 CIR=200
5010 GOSUB 5800
5020 CIR=168
5030 GOSUB 5800
5040 CIR=112
5050 GOSUB 5800
5060 CIR=35
5070 GOSUB 5800
5099 REM SET H,V AXES
5100 X1=0:Y1=200:X2=400:Y2=200
5110 GOSUB 6500
5120 X1=200:Y1=0:X2=200:Y2=400
5130 GOSUB 6500
5199 REM SET 45 DEG AXES
5260 CSX=200*SIN(PI/4)
5270 CSY=200*SIN(PI/4)
5300 X1=200-CSX:Y1=200-CSY:X2=200+CSX:Y2=200+CSY
5310 GOSUB 6500
5320 X1=200-CSX:Y1=200+CSY:X2=200+CSX:Y2=200-CSY
5330 GOSUB 6500
5340 RETURN
5799 REM SET CIRCLES
5800 FOR ANG=0 TO 6.283 STEP .06283
5810 R1=ANG
5820 R2=(ANG+.06283)
5830 X1=200-CIR*COS(R1):Y1=200-CIR*SIN(R1)
5840 X2=200-CIR*COS(R2):Y2=200-CIR*SIN(R2)
5850 GOSUB 6500
5860 NEXT ANG
5870 RETURN
6000 REP=REP+1
6010 RPV1=.89125^(-RV/2)
6020 XPV1=200+200*RPV1*COS(AV*DRAD)
6030 YPV1=200-200*RPV1*SIN(AV*DRAD)
6040 IF REP=1 THEN 6070
6050 X1=XPV2:Y1=YPV2:X2=XPV1:Y2=YPV1
6060 GOSUB 6500 'POINT TO ARRAY
6070 XPV2=XPV1
6080 YPV2=YPV1
6090 RETURN
6499 REM SET LINE INCREMENT
6500 XL=X2-X1:YL=Y2-Y1
6510 NX=ABS(XL):NY=ABS(YL)
6520 IF NX<NY THEN NX=NY
6530 NS%=INT(NX+1)
6540 DX=XL/NS%:DY=YL/NS%
6550 FOR I=1 TO NS%
6560 X1=X1+DX:Y1=Y1+DY
6570 GOSUB 6800
6580 NEXT I
6590 RETURN
6799 REM SET PRINTER PIN VALUE
6800 XX=X1*1.5:YY=Y1*.9 'SCALE FACTORS ARE 1.5,.9
6810 COL=INT(XX)+1
6820 ROW=INT (YY/6)
6830 XIT%=INT(YY-(6*ROW))+1
6840 BIT%(COL,ROW)=BIT%(COL,ROW) OR MASK%(XIT%)
6890 RETURN
6999 REM DO LEGEND
7000 OPEN "PRT:" FOR OUTPUT AS #1
7010 PRINT #1,:PRINT #1, PC$;" PATTERN FOR ";NA$
7020 PRINT #1,"PATTERN IS FOR THE ":PRINT #1,PT$;"-PLANE"
7030 IF PT$="H" THEN PRINT #1," FOR";90-PAH:PRINT #1," DEGREES ABOVE HORIZON"
7040 IF PT$="V" THEN PRINT #1," AT AN AIMUTH OF":PRINT #1,PAZ;" DEGREES":PRINT
7050 PRINT #1,"PLOT REFERENCE GAIN=":PRINT #1,MX;"DB U/V"
7060 PRINT #1,"= LARGEST LOBE GAIN
7070 PRINT #1,"RELATIVE TO ISOTROPIC"
7080 IF PT$="V" THEN PRINT #1," TOP IS ZENITH"
7090 IF PT$="H" THEN PRINT #1," TOP IS 90 DEGREES"
7100 PRINT #1,:PRINT #1,
7110 PRINT #1,"SCALE,CENTER-OUT"
7120 PRINT #1," -100 DB"
7130 PRINT #1," - 30 DB"
7140 PRINT #1," -10 DB"
7150 PRINT #1," -3 DB"
7160 PRINT #1," 0 DB"
7170 PRINT #1,"RELATIVE TO"
7180 PRINT #1," REFERENCE GAIN"
7190 PRINT #1,:PRINT #1,
7200 CLOSE 1
7210 PRINT "TO PREPARE LABELLED PLOT,USE "CUT AND PASTE" OF PLOT"
7400 RETURN
8999 REM DO CLEANUP
9000 PRINT " ENTER P=REPLOT"
9010 PRINT " R=ANOTHER RUN"
9020 PRINT " Q=QUIT
9030 INPUT T$
9200 IF T$="Q" THEN STOP
9210 IF T$="P" THEN G0SUB 7000:GOSUB 4000
9220 IF T$<>"R" THEN 9000
9230 ERASE A
9240 GOTO 100
9250 END
60000 PRINT "ERROR ";ERR;" AT LINE ";ERL
60010 IF ERL=150 THEN RESUME 100
60020 IF ERL=220 THEN RESUME 200
60030 IF ERL=3130 THEN ERASE BIT%: RESUME 3130
60040 GOTO 9000