summaryrefslogtreecommitdiff
path: root/ipl/gprogs/isd2grid.icn
blob: 6563622edbda51eb9d1fd381904a3a00b48bf124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
############################################################################
#
#	File:     isd2grid.icn
#
#	Subject:  Program to create grid plots for ISDs
#
#	Author:   Ralph E. Griswold
#
#	Date:     May 25, 2002
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  NOTE:  The drawdown code is patched in from code in pfd2ill.icn and
#  uses a different method than the others.  One way or another, the
#  methods should be made consonant.
#
#  The option -n s allows a basename to be specified for the image file.
#  It defaults to the name in the ISD.
#
############################################################################
#
#  Requires:  Version 9 graphics and large integers
#
############################################################################
#
#  Links:  isdplot, options, wopen, xcode
#
############################################################################
#
#  Note:  The include file may contain link declarations.
#
############################################################################

link isdplot
link options
link wopen
link xcode

procedure main(args)
   local draft, win, opts

   opts := options(args, "n:")

   isd			# hands off, linker!

   draft := xdecode(&input) | stop("*** cannot decode draft")

   draft.name := \opts["n"]

   win := plot(draft) | stop("*** plot() failed")

   WAttrib(win, "canvas=normal")

   repeat case Event(win) of {		# process low-level user events
      !"qQ" :  exit()
      "s"   :  WriteImage(win, draft.name || "_d.gif")
      }
end