aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/splot/mktitle.x
blob: 554599bf0f6a04c6d3625f9f6d6fa7c2b599e909 (plain) (blame)
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
include	<pkg/gtools.h>
include	<smw.h>
include	<units.h>

# MKTITLE -- Make a spectrum title (IIDS style)

procedure mktitle (sh, gt)

pointer	sh, gt

pointer	sp, str

begin
	# Do nothing if the GTOOLS pointer is undefined.
	if (gt == NULL)
	    return

	call smark (sp)
	call salloc (str, SZ_LINE, TY_CHAR)

	call sprintf (Memc[str], SZ_LINE,
	    "[%s%s]: %s %.2s ap:%d beam:%d")
	    call pargstr (IMNAME(sh))
	    call pargstr (IMSEC(sh))
	    call pargstr (TITLE(sh))
	    call pargr (IT(sh))
	    call pargi (AP(sh))
	    call pargi (BEAM(sh))

	# Set GTOOLS labels.
	call gt_sets (gt, GTTITLE, Memc[str])
	if (UN_LABEL(UN(sh)) != EOS) {
	    call gt_sets (gt, GTXLABEL, UN_LABEL(UN(sh)))
	    call gt_sets (gt, GTXUNITS, UN_UNITS(UN(sh)))
	} else {
	    call gt_sets (gt, GTXLABEL, LABEL(sh))
	    call gt_sets (gt, GTXUNITS, UNITS(sh))
	}

	call sfree (sp)
end