aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/tv/iis/src/display.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/images/tv/iis/src/display.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/images/tv/iis/src/display.x')
-rw-r--r--pkg/images/tv/iis/src/display.x104
1 files changed, 104 insertions, 0 deletions
diff --git a/pkg/images/tv/iis/src/display.x b/pkg/images/tv/iis/src/display.x
new file mode 100644
index 00000000..d04b1365
--- /dev/null
+++ b/pkg/images/tv/iis/src/display.x
@@ -0,0 +1,104 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <ctotok.h>
+include <ctype.h>
+include "../lib/ids.h"
+
+# DISPLAY -- Turn frames on or off
+
+procedure display(command)
+
+char command[ARB]
+
+int tok
+char token[SZ_LINE]
+short color[IDS_MAXGCOLOR+1]
+short frames[IDS_MAXIMPL+1]
+short quad[5]
+short instruction
+int escape
+include "cv.com"
+
+begin
+ if (command[1] == 'i')
+ escape = IDS_DISPLAY_I
+ else if (command[1] == 'g')
+ escape = IDS_DISPLAY_G
+ else {
+ call eprintf ("Only 'di' or 'dg' are understood\n")
+ return
+ }
+
+ instruction = ERR
+ frames[1] = ERR
+ color[1] = ERR
+ quad[1] = IDS_EOD
+
+ repeat {
+ call gargtok (tok, token, SZ_LINE)
+ call strlwr (token)
+ if ( tok == TOK_IDENTIFIER) {
+ switch (token[1]) {
+ case 'c':
+ call cv_color (token[2], color)
+ if (color[1] == ERR)
+ return
+
+ case 'f':
+ call cv_frame (token[2], frames)
+ if (frames[1] == ERR)
+ return
+
+
+ case 'o':
+ if (token[2] == 'n')
+ instruction = IDS_ON
+ else if (token[2] == 'f')
+ instruction = IDS_OFF
+
+ case 'q':
+ call cv_quad (token[2], quad)
+ if (quad[1] == ERR)
+ return
+ }
+ } else if (tok == TOK_NUMBER) {
+ call cv_frame (token[1], frames)
+ if (frames[1] == ERR)
+ return
+ }
+ } until ( tok == TOK_NEWLINE )
+
+
+ # Require a frame number, but allow default of color and quad to "all".
+ # But, for graphics, default the frame and require a color.
+ # In either case, for OFF, allow all defaults.
+ if (escape == IDS_DISPLAY_I) {
+ if ((instruction == IDS_OFF) && (frames[1] == ERR))
+ frames[1] = IDS_EOD
+ if ( color[1] == ERR)
+ color[1] = IDS_EOD
+ } else {
+ if ((instruction == IDS_OFF) && ( color[1] == ERR) )
+ color[1] = IDS_EOD
+ if ( frames[1] == ERR)
+ frames[1] = IDS_EOD
+ }
+
+ if (frames[1] == ERR) {
+ call eprintf ("Frame specification required\n")
+ return
+ }
+ if (color[1] == ERR) {
+ call eprintf ("Color specification required\n")
+ return
+ }
+
+ # if neither "on" nor "off", then turn off all, and turn
+ # on the specified frames
+ if (instruction == ERR) {
+ call cvdisplay (IDS_OFF , escape, short(IDS_EOD),
+ short(IDS_EOD), short(IDS_EOD))
+ instruction = IDS_ON
+ }
+ call cvdisplay (instruction, escape, frames, color, quad)
+end