Debian Codegraph @

libsrc/idi/fidi/deanza/gd8g.for

raw
1 C @(#)gd8g.for 19.1 (ES0-DMD) 02/25/03 13:55:08
2 C===========================================================================
3 C Copyright (C) 1995 European Southern Observatory (ESO)
4 C
5 C This program is free software; you can redistribute it and/or
6 C modify it under the terms of the GNU General Public License as
7 C published by the Free Software Foundation; either version 2 of
8 C the License, or (at your option) any later version.
9 C
10 C This program is distributed in the hope that it will be useful,
11 C but WITHOUT ANY WARRANTY; without even the implied warranty of
12 C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 C GNU General Public License for more details.
14 C
15 C You should have received a copy of the GNU General Public
16 C License along with this program; if not, write to the Free
17 C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
18 C MA 02139, USA.
19 C
20 C Corresponding concerning ESO-MIDAS should be addressed as follows:
21 C Internet e-mail: [email protected]
22 C Postal address: European Southern Observatory
23 C Data Management Division
24 C Karl-Schwarzschild-Strasse 2
25 C D 85748 Garching bei Muenchen
26 C GERMANY
27 C===========================================================================
28 C
29 SUBROUTINE
30 + GD8021(DISPLAY,CHAN,XFIG,YFIG,NDIM,INTENS,STYLE,IDST)
31 C
32 C++++++++++++++++++++++++++++++++++++++++++++++++++
33 C
34 C.IDENTIFICATION
35 C subroutine IIGPLY version 1.00 880627
36 C K. Banse ESO - Garching
37 C 1.20 890215
38 C
39 C.KEYWORDS
40 C DeAnza, overlay graphics
41 C
42 C.PURPOSE
43 C draw a graph in graphics memory according to IDI decoument (Feb. 86)
44 C.ALGORITHM
45 C use 'write+update instruction' to draw (via IP8QW call with WV)
46 C
47 C.INPUT/OUTPUT
48 C call as IDI_PL(DISPLAY,CHAN,XFIG,YFIG,NDIM,INTENS,STYLE,IDST)
49 C
50 C input par:
51 C DISPLAY: I*4 unit no.
52 C CHAN: I*4 no. of memory board used as overlay channel
53 C if = -1, no overlay channel existing
54 C XFIG: I*4 array contains the x-coordinates
55 C YFIG: I*4 array contains the y-coordinates
56 C NDIM: I*4 dimension of XFIG and YFIG
57 C INTENS: I*4 intensity for drawing (0 - 255)
58 C STYLE: I*4 line style, currently ignored (always straight line)
59 C
60 C output par:
61 C IDST: I*4 return status
62 C
63 C.VERSIONS
64 C 1.20 make it work for "unlimited" polygon length
65 C
66 C--------------------------------------------------
67 C
68 IMPLICIT NONE
69 C
70 INTEGER*4 DISPLAY,CHAN,XFIG(1),YFIG(1),NDIM,IDST
71 INTEGER*4 INTENS,STYLE,IPI
72 INTEGER*4 N,NN,REM
73 C
74 INTEGER*2 FIGURE(2,1000)
75 INTEGER*2 UNIT,INTNS
76 INTEGER*2 RI,LR,RR,WV
77 C
78 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
79 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
80 INCLUDE 'MID_INCLUDE:IDIDEV.INC'
81 C
82 EXTERNAL RI,LR,RR,WV
83 C
84 UNIT = DISPLAY
85 C
86 C set RESOLUTION register (reg 11) to 2 bytes transfer
87 CALL IP8QW(RR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
88 SYSREG(12) = IAND(SYSREG(12),"177677)
89 CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(12),2,0,11)
90 C
91 SYSREG(33) = 2**CHAN
92 CALL IP8QW(LR,UNIT,DZIOSB,,,SYSREG(33),4,1,32)
93 C
94 C at the moment the colours red, green, blue, ... are not supported
95 IF ( (INTENS.GT.1) .AND. (INTENS.LE.8) ) THEN
96 INTNS = 255 !map all to white
97 ELSE
98 INTNS = INTENS
99 ENDIF
100 C
101 C copy figure
102 REM = 0
103 C
104 1000 NN = NDIM - REM
105 IF (NN.GT.1000) NN = 1000
106 C
107 DO N=1,NN
108 IPI = XFIG(N+REM)
109 IF (IPI.GE.QMSZX) THEN
110 IPI = QMSZX - 1
111 ELSE
112 IF (IPI.LT.0) IPI = 0
113 ENDIF
114 FIGURE(1,N) = IPI
115 IPI = YFIG(N+REM)
116 IF (IPI.GE.QMSZY) THEN
117 IPI = QMSZY - 1
118 ELSE
119 IF (IPI.LT.0) IPI = 0
120 ENDIF
121 FIGURE(2,N) = IPI
122 ENDDO
123 C
124 C now draw the vector
125 DO N=1,NN-1
126 CALL IP8QW(WV,UNIT,DZIOSB,,,FIGURE(1,N),8,0,INTNS)
127 ENDDO
128 C
129 C test, if we are finished
130 IF ((REM+NN).LT.NDIM) THEN
131 REM = REM + NN
132 GOTO 1000
133 ENDIF
134 C
135 IDST = 0
136 RETURN
137 END
138
139 SUBROUTINE GD8022(DISPLAY,CHAN,STRING,XPOS,YPOS,PATH,
140 + ORIENT,INTENS,HT,IDST)
141 C
142 C++++++++++++++++++++++++++++++++++++++++++++++++++
143 C
144 C.IDENTIFICATION
145 C subroutine IIGTXT version 1.00 880513
146 C K. Banse ESO - Garching
147 C
148 C.KEYWORDS
149 C DeAnza, overlay channel, alphabet
150 C
151 C.PURPOSE
152 C fulfill the requirements as defined in the IDI document
153 C
154 C.ALGORITHM
155 C characters are built in a 7*8 matrix (x:0-6, y:0-7)
156 C use IDI_PL to plot the stuff in the overlay plane
157 C
158 C.INPUT/OUTPUT
159 C call as IIGTXT(DISPLAY,CHAN,STRING,XPOS,YPOS,PATH,ORIENT,INTENS,HT,IDST)
160 C
161 C input par:
162 C DISPLAY: I*4 unit no.
163 C CHAN: I*4 memory id
164 C STRING: char. expr. character string to be displayed
165 C XPOS: I*4 x-position
166 C YPOS: I*4 y-position
167 C PATH: I*4 text path:
168 C INTENS: I*4 intensity
169 C HT: I*4 text height, currently not supported
170 C characters are built in a 7*8 matrix
171 C or fixed in the alphanumerics memory
172 C
173 C output par:
174 C IDST: I*4 return status
175 C
176 C--------------------------------------------------
177 C
178 IMPLICIT NONE
179 C
180 INTEGER*4 DISPLAY,CHAN,ORIENT
181 INTEGER*4 INTENS,XPOS,YPOS,PATH,HT,IDST
182 INTEGER*4 LSTR
183 C
184 CHARACTER*(*) STRING
185 C
186 LSTR = LEN(STRING)
187 C
188 IF (CHAN.LT.90) THEN
189 CALL KKGRA(DISPLAY,CHAN,STRING,LSTR,XPOS,YPOS,PATH,
190 + ORIENT,INTENS,HT,IDST)
191
192 ELSE
193 CALL KKALP(DISPLAY,STRING,LSTR,XPOS,YPOS,INTENS,IDST)
194 ENDIF
195 C
196 RETURN
197 END