Init
This commit is contained in:
26
ucbcmd/plot/libplot/aed/Makefile
Executable file
26
ucbcmd/plot/libplot/aed/Makefile
Executable file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
#ident "@(#)Makefile 1.2 92/12/16 SMI"
|
||||
#
|
||||
# Copyright (c) 1989 by Sun Microsystems, Inc.
|
||||
#
|
||||
|
||||
LIBRARY= ../libaed.a
|
||||
|
||||
OBJECTS = arc.o box.o circle.o close.o cont.o dot.o erase.o label.o \
|
||||
line.o linemod.o move.o open.o point.o space.o subr.o
|
||||
|
||||
# include library definitions
|
||||
include ../../../../lib/Makefile.lib
|
||||
|
||||
BUILD.AR = $(AR) $(ARFLAGS) $@ `$(LORDER) $(AROBJS) | $(TSORT)`
|
||||
|
||||
# TXTS allows the AT&T makefile to be bootstrapped into the NSE.
|
||||
|
||||
CLOBBERFILES= $(LIBRARY)
|
||||
|
||||
.KEEP_STATE:
|
||||
|
||||
all: $(LIBS)
|
||||
|
||||
include ../../../../lib/Makefile.targ
|
||||
|
||||
39
ucbcmd/plot/libplot/aed/aed.h
Executable file
39
ucbcmd/plot/libplot/aed/aed.h
Executable file
@@ -0,0 +1,39 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)aed.h 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Displays plot files on an AED512 graphics terminal.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sgtty.h>
|
||||
|
||||
extern char dbuf[BUFSIZ]; /* Used to buffer display characters */
|
||||
extern struct sgttyb sgttyb; /* Used to save terminal control bits */
|
||||
extern curx, cury; /* Current screen position */
|
||||
extern int xbot, ybot; /* Coordinates of screen lower-left corner */
|
||||
extern int scale; /* The number of pixels per 2**12 units
|
||||
* of world coordinates.
|
||||
*/
|
||||
|
||||
/* The following variables describe the screen. */
|
||||
|
||||
#define GRXMAX 511 /* Maximum x-coordinate of screen */
|
||||
#define GRYMAX 482 /* Maximum y-coordinate of screen */
|
||||
23
ucbcmd/plot/libplot/aed/arc.c
Executable file
23
ucbcmd/plot/libplot/aed/arc.c
Executable file
@@ -0,0 +1,23 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)arc.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
arc(){
|
||||
}
|
||||
30
ucbcmd/plot/libplot/aed/box.c
Executable file
30
ucbcmd/plot/libplot/aed/box.c
Executable file
@@ -0,0 +1,30 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)box.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
box(x0, y0, x1, y1)
|
||||
{
|
||||
move(x0, y0);
|
||||
cont(x0, y1);
|
||||
cont(x1, y1);
|
||||
cont(x1, y0);
|
||||
cont(x0, y0);
|
||||
move(x1, y1);
|
||||
}
|
||||
44
ucbcmd/plot/libplot/aed/circle.c
Executable file
44
ucbcmd/plot/libplot/aed/circle.c
Executable file
@@ -0,0 +1,44 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)circle.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Circle draws a circle.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* A circle of radius r is drawn at (x,y).
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
circle(x, y, r)
|
||||
int x, y, r;
|
||||
{
|
||||
char buf[3];
|
||||
setcolor("01");
|
||||
putc('Q', stdout);
|
||||
outxy20(x, y);
|
||||
putc('O', stdout);
|
||||
chex((r*scale)>>12, buf, 2);
|
||||
fputs(buf, stdout);
|
||||
(void) fflush(stdout);
|
||||
}
|
||||
39
ucbcmd/plot/libplot/aed/close.c
Executable file
39
ucbcmd/plot/libplot/aed/close.c
Executable file
@@ -0,0 +1,39 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)close.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Closepl does whatever is necessary to reset the characteristics
|
||||
* of the AED512 after the program is finished.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* The graphics display modes are reset.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
closepl()
|
||||
{
|
||||
fputs("Q00204\6", stdout);
|
||||
(void) fflush(stdout);
|
||||
(void) stty(fileno(stdout), &sgttyb);
|
||||
}
|
||||
35
ucbcmd/plot/libplot/aed/cont.c
Executable file
35
ucbcmd/plot/libplot/aed/cont.c
Executable file
@@ -0,0 +1,35 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)cont.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Cont plots a line between (curx, cury) and (x, y).
|
||||
*
|
||||
* Results: None.
|
||||
* Side Effects: As above.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
cont(x, y)
|
||||
int x, y;
|
||||
{
|
||||
line(curx, cury, x, y);
|
||||
}
|
||||
23
ucbcmd/plot/libplot/aed/dot.c
Executable file
23
ucbcmd/plot/libplot/aed/dot.c
Executable file
@@ -0,0 +1,23 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)dot.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
dot(){
|
||||
}
|
||||
39
ucbcmd/plot/libplot/aed/erase.c
Executable file
39
ucbcmd/plot/libplot/aed/erase.c
Executable file
@@ -0,0 +1,39 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)erase.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This routine erases the screen.
|
||||
*
|
||||
* Results: None.
|
||||
* Side Effects: The screen is cleared.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
erase()
|
||||
{
|
||||
setcolor("FF");
|
||||
putc('\14', stdout);
|
||||
putc('\33', stdout);
|
||||
putc('Q', stdout);
|
||||
outxy20(curx, cury);
|
||||
(void) fflush(stdout);
|
||||
}
|
||||
46
ucbcmd/plot/libplot/aed/label.c
Executable file
46
ucbcmd/plot/libplot/aed/label.c
Executable file
@@ -0,0 +1,46 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)label.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This routine places a label starting at the current
|
||||
* position.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* The string indicated by s starting at (curx, cury).
|
||||
* The current position is updated accordingly.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
label(s)
|
||||
char *s;
|
||||
{
|
||||
setcolor("02");
|
||||
putc('Q', stdout);
|
||||
outxy20(curx + (4096/scale), cury + (4096/scale));
|
||||
putc('\6', stdout);
|
||||
fputs(s, stdout);
|
||||
putc('\33', stdout);
|
||||
(void) fflush(stdout);
|
||||
curx += ((6*4096*strlen(s)) + 4000)/scale;
|
||||
}
|
||||
37
ucbcmd/plot/libplot/aed/line.c
Executable file
37
ucbcmd/plot/libplot/aed/line.c
Executable file
@@ -0,0 +1,37 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)line.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Line draws a line between two points.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* A line is drawn on the screen between (x1, y1) and (x2, y2).
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
line(x1, y1, x2, y2)
|
||||
int x1, y1, x2, y2;
|
||||
{
|
||||
setcolor("01");
|
||||
putc('Q', stdout);
|
||||
outxy20(x1, y1);
|
||||
putc('A', stdout);
|
||||
outxy20(x2, y2);
|
||||
(void) fflush(stdout);
|
||||
curx = x2;
|
||||
cury = y2;
|
||||
}
|
||||
48
ucbcmd/plot/libplot/aed/linemod.c
Executable file
48
ucbcmd/plot/libplot/aed/linemod.c
Executable file
@@ -0,0 +1,48 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)linemod.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Linemod sets the current line drawing style.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* The AED line style is set based on string s which
|
||||
* must be one of "dotted", "solid", "longdashed", "shortdashed",
|
||||
* or "dotdashed". If s isn't recognized, then "solid" is used.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
linemod(s)
|
||||
char *s;
|
||||
{
|
||||
if (strcmp(s, "dotted") == 0)
|
||||
fputs("1AAFF", stdout);
|
||||
else if (strcmp(s, "longdashed") == 0)
|
||||
fputs("1F055", stdout);
|
||||
else if (strcmp(s, "shortdashed") == 0)
|
||||
fputs("1F0FF", stdout);
|
||||
else if (strcmp(s, "dotdashed") == 0)
|
||||
fputs("1E4FF", stdout);
|
||||
else fputs("1FFFF", stdout);
|
||||
(void) fflush(stdout);
|
||||
}
|
||||
36
ucbcmd/plot/libplot/aed/move.c
Executable file
36
ucbcmd/plot/libplot/aed/move.c
Executable file
@@ -0,0 +1,36 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)move.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This routine moves the current point to (x,y).
|
||||
*
|
||||
* Results: None.
|
||||
* Side Effects: As above.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
move(x, y)
|
||||
int x, y;
|
||||
{
|
||||
curx = x;
|
||||
cury = y;
|
||||
}
|
||||
91
ucbcmd/plot/libplot/aed/open.c
Executable file
91
ucbcmd/plot/libplot/aed/open.c
Executable file
@@ -0,0 +1,91 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)open.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Displays plot files on a AED512 graphics terminal.
|
||||
*/
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
char dbuf[BUFSIZ]; /* Used to buffer display characters */
|
||||
struct sgttyb sgttyb; /* Used to save terminal control bits */
|
||||
int curx, cury; /* Current screen position */
|
||||
int xbot, ybot; /* Coordinates of screen lower-left corner */
|
||||
int scale; /* The number of pixels per 2**12 units
|
||||
* of world coordinates.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following is the color map, containing reg, green, and blue
|
||||
* values for color locations 0 and 1.
|
||||
*/
|
||||
|
||||
static int colors[] = {200, 200, 200, 0, 0, 125, 125, 0, 0, 125, 0, 0};
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Openpl initializes the graphics display and clears its screen.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* The display is re-initialized and the file is remembered for
|
||||
* use in all subsequent calls to this module. The display's
|
||||
* color map is reset. The display is put into raw mode, but
|
||||
* the previous mode bits are saved.
|
||||
*
|
||||
* Errors: None.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
openpl()
|
||||
{
|
||||
int flags, *p, i;
|
||||
char dum[4];
|
||||
|
||||
/* First, grab up the display modes, then reset them to put it
|
||||
* into cooked mode. Also, lock the terminal.
|
||||
*/
|
||||
|
||||
(void) gtty(fileno(stdout), &sgttyb);
|
||||
flags = sgttyb.sg_flags;
|
||||
sgttyb.sg_flags = (sgttyb.sg_flags & ~(RAW)) | EVENP | ODDP;
|
||||
(void) stty(fileno(stdout), &sgttyb);
|
||||
sgttyb.sg_flags = flags;
|
||||
|
||||
/* Save the file pointer around for later use, then output an
|
||||
* initialization string to the display. The initialization
|
||||
* string resets the terminal, sets formats, clears the display,
|
||||
* initializes the read and write masks, and sets the color map.
|
||||
*/
|
||||
|
||||
setbuf(stdout, dbuf);
|
||||
fputs("\33\33G1HHHN[00LFFCFFMFFFFFFFF", stdout);
|
||||
fputs("K0004", stdout);
|
||||
p = colors;
|
||||
for (i=0; i<12; i++)
|
||||
{
|
||||
chex(*p++, dum, 2);
|
||||
fputs(dum, stdout);
|
||||
}
|
||||
fputs("^15060AL", stdout);
|
||||
scale = 1<<12;
|
||||
curx = cury = xbot = ybot = 0;
|
||||
(void) fflush(stdout);
|
||||
}
|
||||
44
ucbcmd/plot/libplot/aed/point.c
Executable file
44
ucbcmd/plot/libplot/aed/point.c
Executable file
@@ -0,0 +1,44 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)point.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This routine plots a single point.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* A single point is displayed on the screen.
|
||||
* The point is made the current point.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
point(x, y)
|
||||
int x, y;
|
||||
{
|
||||
setcolor("01");
|
||||
putc('Q', stdout);
|
||||
outxy20(x, y);
|
||||
fputs("O01", stdout);
|
||||
(void) fflush(stdout);
|
||||
curx = x;
|
||||
cury = y;
|
||||
}
|
||||
49
ucbcmd/plot/libplot/aed/space.c
Executable file
49
ucbcmd/plot/libplot/aed/space.c
Executable file
@@ -0,0 +1,49 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)space.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Space sets up the world-to-screen transformation so
|
||||
* that the rectangular area described by (x0, y0) and
|
||||
* (x1, y1) will all be on-screen.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* Our own variables scale, xbot, and ybot are changed.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
space(x0, y0, x1, y1)
|
||||
int x0, y0, x1, y1;
|
||||
{
|
||||
int xscale, yscale, xsize, ysize;
|
||||
xscale = (GRXMAX<<12)/(x1-x0);
|
||||
yscale = (GRYMAX<<12)/(y1-y0);
|
||||
if (xscale > yscale) scale = yscale;
|
||||
else scale = xscale;
|
||||
scale = (scale*9)/10 - 1;
|
||||
if (scale<1) scale = 1;
|
||||
xsize = (2048*GRXMAX)/scale + 1;
|
||||
xbot = (x1+x0)/2 - xsize;
|
||||
ysize = (2048*GRYMAX)/scale + 1;
|
||||
ybot = (y1+y0)/2 - ysize;
|
||||
}
|
||||
108
ucbcmd/plot/libplot/aed/subr.c
Executable file
108
ucbcmd/plot/libplot/aed/subr.c
Executable file
@@ -0,0 +1,108 @@
|
||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||
/* All Rights Reserved */
|
||||
|
||||
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
||||
/* The copyright notice above does not evidence any */
|
||||
/* actual or intended publication of such source code. */
|
||||
|
||||
#ident "@(#)subr.c 1.1 90/08/19 SMI" /* SVr4.0 1.1 */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980 Regents of the University of California.
|
||||
* All rights reserved. The Berkeley software License Agreement
|
||||
* specifies the terms and conditions for redistribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "aed.h"
|
||||
|
||||
/*
|
||||
* The following table is used to convert numbers to hex. We cannot use
|
||||
* standard C library conversion because it generates lower case letters
|
||||
* which are bad news to the AED512.
|
||||
*/
|
||||
|
||||
static char hex[] = "0123456789ABCDEF";
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This is a local routine that converts an integer to a string
|
||||
* of hexadecimal characters.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* The string contains the value of the low-order nchars 4-bit chunks
|
||||
* of val, as represented in hexadecimal. String is zero-filled.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
chex(val, string, nchars)
|
||||
int val; /* Integer value to be converted. */
|
||||
char *string; /* Pointer to area for converted result. */
|
||||
int nchars; /* Number of characters to be converted. */
|
||||
{
|
||||
string = &(string[nchars]);
|
||||
*string = '\0';
|
||||
for (; nchars>0 ; nchars--)
|
||||
{
|
||||
*(--string) = hex[val & 017];
|
||||
val >>= 4;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This local routine outputs an x-y coordinate pair in the standard
|
||||
* format required by the AED display.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* Characters are output to the AED512 in the standard way required
|
||||
* for values indicated by "xy20" in the user manual.
|
||||
*
|
||||
* Errors: None.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
outxy20(x, y)
|
||||
int x, y; /* The coordinates to be output. Note:
|
||||
* these are world coordinates, not screen
|
||||
* ones. We scale in this routine.
|
||||
*/
|
||||
{
|
||||
char s1[4], s2[4], s3[4];
|
||||
x = ((x - xbot) * scale)>>12;
|
||||
y = ((y - ybot) * scale)>>12;
|
||||
chex(((y>>8)&03) | ((x>>6)&014), s1, 1);
|
||||
chex(x&0377, s2, 2);
|
||||
chex(y&0377, s3, 2);
|
||||
fprintf(stdout, "%s%s%s", s1, s2, s3);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* This routine sets the display's current color.
|
||||
*
|
||||
* Results: None.
|
||||
*
|
||||
* Side Effects:
|
||||
* The current color in the display is set to pcolor, if it
|
||||
* isn't that already.
|
||||
*---------------------------------------------------------
|
||||
*/
|
||||
setcolor(pcolor)
|
||||
char *pcolor; /* Pointer to a string giving the desired
|
||||
* color in hexadecimal.
|
||||
*/
|
||||
{
|
||||
static char curcolor[] = "xx";
|
||||
if ((pcolor[0] != curcolor[0]) || (pcolor[1] != curcolor[1]))
|
||||
{
|
||||
curcolor[0] = pcolor[0];
|
||||
curcolor[1] = pcolor[1];
|
||||
putc('L', stdout);
|
||||
fputs(curcolor, stdout);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user