1
/*===========================================================================
2
Copyright (C) 1993-2009 European Southern Observatory (ESO)
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of
7
the License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the Free
16
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
19
Corresponding concerning ESO-MIDAS should be addressed as follows:
20
Internet e-mail: midas@eso.org
21
Postal address: European Southern Observatory
22
Data Management Division
23
Karl-Schwarzschild-Strasse 2
24
D 85748 Garching bei Muenchen
26
===========================================================================*/
28
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30
.AUTHOR R.M. van Hees IPG-ESO Garching
31
.KEYWORDS plot software, additional information
32
.PURPOSE plot minimal information around a graph, outside the axis
33
input: int plmode plot mode, see PMODE in PLISTAT
34
char *lstrng string plotted above graph in left corner
35
char *rstrng string plotted above graph in right corner
37
.COMMENTS this routine only works when PMODE == 1
38
.ENVIRONment MIDAS and AGL
39
#include <agl.h> Prototypes for AGL application programs
40
#include <midas_def.h> Prototypes for MIDAS interfaces
42
.VERSION 1.0 26-Sep-1993 FORTRAN --> ANSI-C RvH
45
------------------------------------------------------------*/
47
* Define _POSIX_SOURCE to indicate
48
* that this is a POSIX program
50
#define _POSIX_SOURCE 1
53
* definition of the used functions
59
#include <midas_def.h>
62
* define some macros and constants
64
#define NCTIME 5 /* we write hh:mm in variable TIM */
69
void PLIDEN( plmode, lstrng, rstrng )
71
char *lstrng, *rstrng;
75
float scale, tsize, xl[3], yl[3], clpl[4];
76
char tim[6], dattim[41], buff[81], text[81];
79
* check if PMODE is one, else retrun
81
if ( plmode != 1 ) return;
84
* get character dimension, from the MIDAS keywords
85
* and scaling from AGL
87
(void) AG_RGET( "scale", &scale );
88
PCKRDR( "TSIZE", 1, &actvals, &tsize );
89
AG_TGET( "M", xl, yl );
95
(void) AG_RGET( "clpl", clpl );
100
(void) strcpy( text, "~^" );
101
(void) strcat( text, lstrng );
103
AG_GTXT( clpl[0], clpl[3] + yl[2], text, 1 );
105
(void) strcpy( text, "~^" );
106
(void) strcat( text, rstrng );
108
AG_GTXT( clpl[1], clpl[3] + yl[2], text, 3 );
111
* set character height and write from up to down (instead of left to right)
113
AG_SSET( "scale=1.0;chdi=1.0,1.0" );
117
* which MIDAS version is used ?
119
(void) SCKGETC( "MID$SESS", 16, 5, &actvals, buff );
120
(void) strcpy( text, "~-~-eso-midas version: " );
121
(void) strcat( text, buff );
126
(void) SCKGETC( "DATTIM", 1, 40, &actvals, dattim );
127
(void) strcat( text, " date: " );
130
if ( strchr( dattim, ',' ) == 0 )
131
{ *(dattim+20) = '\0';
132
(void) strncpy( tim, dattim+12, NCTIME );
134
(void) strcat( text, dattim );
137
{ *(dattim+26) = '\0';
138
(void) strncpy( tim, dattim+18, NCTIME );
140
(void) strcat( text, dattim );
142
(void) strcat( text, " " );
143
(void) strncat( text, tim, NCTIME );
144
AG_GTXT( 1.0, 1.0, text, 23 );
147
* get the username, and write it
150
(void) strcat( strcpy( text, "~-~-" ), buff );
151
AG_GTXT( 1.0, 0.0, text, 17 );
154
* reset if necessary the symbol and text size
157
(void) sprintf( text, "scale=%-.3f;chdi=%-.3f,%-.3f", scale, tsize, tsize );