Debian Codegraph @

libsrc/idi/fidi/deanza/gd8i1.for

raw
1 C @(#)gd8i1.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 + GD8037(DISPLAY,INTATY,INTAID,OBJTY,OBJID,INTAOP,EXTRIG,IDST)
31 C
32 C++++++++++++++++++++++++++++++++++++++++++++++++++
33 C
34 C.IDENTIFICATION
35 C subroutine IIIENI version 1.20 880929
36 C K. Banse ESO - Garching
37 C
38 C.KEYWORDS
39 C Image Display, cursor boards
40 C
41 C.PURPOSE
42 C fulfill the requirements as described in the IDI document
43 C
44 C.ALGORITHM
45 C use DeAnza level-0 software
46 C
47 C.INPUT/OUTPUT
48 C call as IIIENI(DISPLAY,INTATY,INTAID,OBJTY,OBJID,INTAOP,EXTRIG,IDST)
49 C
50 C input par:
51 C DISPLAY: I*4 Display Unit
52 C INTATY: I*4 Interactor type
53 C INTAID: I*4 Interactor identifier
54 C OBJTY: I*4 Object type
55 C OBJID: I*4 Object identifier
56 C INTAOP: I*4 interactive operation
57 C EXTRIG: I*4 exit trigger number
58 C
59 C output par:
60 C IDST: I*4 return status
61 C
62 C--------------------------------------------------
63 C
64 IMPLICIT NONE
65 C
66 INTEGER*4 DISPLAY,INTATY,INTAID,OBJTY,OBJID
67 INTEGER*4 INTAOP,EXTRIG,IDST
68 INTEGER*4 ITY,N,TRGLIM
69 C
70 INTEGER*2 UNIT,ENTER,CONTROL
71 INTEGER*2 LPR
72 C
73 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
74 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
75 C
76 EXTERNAL LPR
77 C
78 DATA TRGLIM /10/
79 C
80 C get unit
81 UNIT = DISPLAY
82 IDST = 0
83 C
84 IF (INTAOP.GT.1) RETURN
85 C
86 C test input for interaction (we do not support everything yet...)
87 C and determine internal number ITY
88 C
89 IF (INTATY.EQ.5) THEN !Trigger handling
90 IF (OBJTY.EQ.0) THEN !no visible effect
91 ITY = 5 + INTAID !EXIT or ENTER button/trigger
92 ELSE
93 IDST = 403
94 RETURN
95 ENDIF
96 C
97 ELSE IF (INTATY.EQ.0) THEN !Locator handling
98 IF (OBJTY.EQ.1) THEN !Cursor
99 ITY = 1 + OBJID !curor #0 or cursor #1
100 ELSE IF (OBJTY.EQ.0) THEN !no visible effect
101 ITY = 4 !just use locator (joystick/trackball)
102 ELSE IF (OBJTY.EQ.4) THEN !ROI (= 2 cursors)
103 ITY = 3
104 ELSE
105 IDST = 403 !wrong object type
106 RETURN
107 ENDIF
108 C
109 ELSE
110 IDST = 401 !wrong interaction type
111 RETURN
112 ENDIF
113 C
114 C we do not use interrupts...
115 CALL IP8QW(LPR,UNIT,DZIOSB,,,1,2,0,1) !set CL bit (bit 0)
116 C
117 DO N=1,TRGLIM
118 IF (DZTRIG(1,N).LE.0) THEN
119 DZTRIG(1,N) = ITY
120 DZTRIG(2,N) = INTAOP
121 RETURN
122 ENDIF
123 ENDDO
124 C
125 C let's get the hell out of here...
126 RETURN
127 END
128
129 SUBROUTINE GD8038(DISPLAY,TRIGSTAT,IDST)
130 C
131 C++++++++++++++++++++++++++++++++++++++++++++++++++
132 C
133 C.IDENTIFICATION
134 C subroutine IIIEIW version 1.20 880915
135 C K. Banse ESO - Garching
136 C 1.30 890104 1.40 900327
137 C
138 C.KEYWORDS
139 C Image Display, event flags, cursor boards
140 C
141 C.PURPOSE
142 C fulfill the requirements as described in the IDI document
143 C
144 C.ALGORITHM
145 C use DeAnza level-0 software
146 C
147 C.INPUT/OUTPUT
148 C call as IIIEIW(DISPLAY,TRIGSTAT,IDST)
149 C
150 C input par:
151 C DISPLAY: I*4 Display Unit
152 C
153 C output par:
154 C TRIGSTAT: I*4 array trigger status array, each element = 0 or 1
155 C IDST: I*4 return status
156 C
157 C.VERSIONS
158 C 1.30 provide also for trigger status for EXECUTE button,
159 C even though only used in X Windows
160 C 1.40 increase size of DZTRIG and TRIGSTAT to 10
161 C
162 C--------------------------------------------------
163 C
164 IMPLICIT NONE
165 C
166 INTEGER*4 DISPLAY,TRIGSTAT(1),IDST
167 INTEGER*4 ISS,KK(10),PUSH,N,TRGLIM
168 C
169 INTEGER*2 UNIT
170 C
171 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
172 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
173 INCLUDE 'MID_INCLUDE:IDIDEV.INC'
174 C
175 DATA TRGLIM /10/ !KK needs same dimension...
176 C
177 UNIT = DISPLAY
178 IDST = 0
179 DO N=1,TRGLIM
180 TRIGSTAT(N) = 0
181 ENDDO
182 C
183 500 N = -1
184 CALL DAZWAI(N) !force synchro loop (delay from DAZHOLD(12)
185 C
186 C main loop over all TRGLIM (currently = 10) slots
187 C
188 DO 1000 N=1,TRGLIM
189 KK(N) = 0
190 IF (DZTRIG(1,N).LE.0) GOTO 1000
191 C
192 C get cursor status + info about ENTER button
193 C
194 IF (QJOYFL.EQ.0) THEN !we have a joystick
195 IF (DZTRIG(1,1).EQ.1) THEN
196 ISS = "000400 !cursor no. 0
197 ELSE IF (DZTRIG(1,1).EQ.2) THEN
198 ISS = "001000 !cursor no. 1
199 ELSE
200 ISS = "001400 !cursor no. 0 or 1
201 ENDIF
202 CALL JOYPSH(UNIT,PUSH,ISS)
203 C
204 ELSE !we have a trackball
205 IF (DZTRIG(1,1).EQ.1) THEN
206 ISS = 0 !cursor no. 0
207 ELSE IF (DZTRIG(1,1).EQ.2) THEN
208 ISS = 1 !cursor no. 1
209 ELSE
210 ISS = 2 !cursor no. 0 or 1
211 ENDIF
212 CALL TRKPSH(UNIT,PUSH,ISS)
213 ENDIF
214 C
215 C find out, if ENTER pressed
216 C
217 IF (PUSH.EQ.1) THEN
218 IF (ISS.EQ.0) THEN !cursor(s) off => this means EXIT
219 TRIGSTAT(1) = 1
220 ELSE
221 TRIGSTAT(2) = 1
222 ENDIF
223 KK(N) = 1 !idicate reason to leave loop...
224 ELSE
225 IF (DZTRIG(2,N).EQ.0) KK(N) = 1 !for inter. op. = 0, we leave anyway
226 ENDIF
227 C
228 1000 ENDDO !end of main loop
229 C
230 C
231 C check, if something came in, so we can leave ...
232 C
233 DO N=1,TRGLIM
234 IF (KK(N).NE.0) RETURN
235 ENDDO
236 C
237 GOTO 500 !loop more
238 C
239 END
240
241 SUBROUTINE GD8039(DISPLAY,IDST)
242 C
243 C++++++++++++++++++++++++++++++++++++++++++++++++++
244 C
245 C.IDENTIFICATION
246 C subroutine IIISTI version 1.20 880915
247 C K. Banse ESO - Garching
248 C
249 C.KEYWORDS
250 C Image Display
251 C
252 C.PURPOSE
253 C fulfill the requirements as described in the IDI document
254 C
255 C.ALGORITHM
256 C use DeAnza level-0 software
257 C
258 C.INPUT/OUTPUT
259 C call as IIISTI(DISPLAY,IDST)
260 C
261 C input par:
262 C DISPLAY: I*4 Display Unit
263 C
264 C output par:
265 C IDST: I*4 return status
266 C
267 C.VERSIONS
268 C
269 C--------------------------------------------------
270 C
271 IMPLICIT NONE
272 C
273 INTEGER*4 DISPLAY,IDST
274 INTEGER*4 N,TRGLIM
275 C
276 INCLUDE 'MID_INCLUDE:DEANZAH.INC'
277 INCLUDE 'MID_INCLUDE:DEANZAS.INC'
278 C
279 DATA TRGLIM /10/
280 C
281 IDST = 0
282 C
283 DO N=1,TRGLIM
284 DZTRIG(1,N) = 0
285 ENDDO
286 C
287 RETURN
288 END
289
290 SUBROUTINE GD8040(DISPLAY,INTATY,INTAID,DEVDSC,LL,IDST)
291 C
292 C++++++++++++++++++++++++++++++++++++++++++++++++++
293 C
294 C.IDENTIFICATION
295 C subroutine IIIQID version 1.00 880205
296 C K. Banse ESO - Garching
297 C
298 C.KEYWORDS
299 C Image Display
300 C
301 C.PURPOSE
302 C fulfill the requirements as described in the IDI document
303 C
304 C.ALGORITHM
305 C use DeAnza level-0 software
306 C
307 C.INPUT/OUTPUT
308 C call as IIIQID(DISPLAY,INTATY,INTAID,DEVDSC,LL,IDST)
309 C
310 C input par:
311 C DISPLAY: I*4 Display Unit
312 C
313 C output par:
314 C IDST: I*4 return status
315 C
316 C.VERSIONS
317 C
318 C--------------------------------------------------
319 C
320 IMPLICIT NONE
321 C
322 INTEGER*4 DISPLAY,INTATY,INTAID,LL,IDST
323 INTEGER*4 KK
324 C
325 CHARACTER*(*) DEVDSC
326 C
327 INCLUDE 'MID_INCLUDE:IDIDEV.INC'
328 C
329 IF (INTATY.EQ.0) GOTO 1000
330 IF (INTATY.EQ.5) GOTO 2000
331 C
332 IDST = 404
333 RETURN
334 C
335 C we return info about the locator
336 1000 IF (QJOYFL.EQ.0) THEN
337 DEVDSC(1:) = 'Joystick '
338 LL = 8
339 ELSE
340 DEVDSC(1:) = 'Trackball '
341 LL = 9
342 ENDIF
343 GOTO 9000
344 C
345 C we return info about the ENTER button at the locator
346 2000 IF (QJOYFL.EQ.0) THEN
347 DEVDSC(1:) = 'ENTER button (= lowest b.) '
348 LL = 26
349 ELSE
350 DEVDSC(1:) = 'ENTER button (= rightmost b.) '
351 LL = 29
352 ENDIF
353 GOTO 9000
354 C
355 9000 KK = LEN(DEVDSC)
356 IF (KK.LT.LL) LL = KK
357 IDST = 0
358 C
359 RETURN
360 END