home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
329.lha
/
MultiPlot
/
plt
/
HPGL_commands
< prev
next >
Wrap
Text File
|
1990-01-05
|
12KB
|
337 lines
HP-GL COMMANDS
--------------
The following is a list of the HP-GL commands that are currently
supported by PLT:. For the most part they were implemented from the
descriptions provided in the "HP ColorPro Graphics Plotter Programming
Manual". It appears as though every HP plotter has a slightly different
set of HP-GL commands. Some have extra commands, some of the commands that
have parameters for one plotter may not have parameters for a different
plotter (PA and PR come to mind). We followed the manual pretty accurately,
but we borrowed a couple of commands from a different plotter to control
when a page is ejected from the plotter. For example, the AF command
causes a page to be printed, this allows people to send several pages of
plots to PLT: without having to break the input up into several files
or several executions. Some commands in the manual were not emulated
since they did not make sense for a raster emulation of a plotter.
o The <term> symbol signifies a command terminator, it may be a space, a
semi-colon or the first character of the next command.
o Command names are NOT case sensitive.
o Parameters that are incased in parenthesis in the command description
are optional parameters. Do not use the paranthesis when specifying the
command.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Advance Full Page
AF <term>
Causes a page to be plotted/printed
Designate Alternate Character Set
CA font_number <term>
CA <term>
Selects font_number to be the alternate character set.
The alternate character set is used as the current font
through the use of the SA command.
0 <= font_number <= 50
Character Plot
CP spaces, lines <term>
CP <term>
Moves the pen the specified number of character plot cells.
All movements are relative to the current label direction.
spaces lines
----------------------------------------------
positive move right move left
negative move up move down
A CP command with no parameters performs a carriage return and a
line feed.
Designate Standard Character Set
CS font_number <term>
Selects font_number to be the standard character set.
The standard character set is used by default or
through the use of the SS command.
0 <= font_number <= 50
Default
DF <term>
Set certain plotter functions to predefined defaults.
This command maintains the locations of P1 and P2.
Default Conditions
Function Equivalent Instructions Conditions
-----------------------------------------------------------
Plotting mode PA; Absolute
Line type LT; Solid line
Line pattern LT; 4% of (P1, P2)
length
Relative Character DR1,0; Horizontal
Direction
Relative Character SR; width=.75% of (P2x-P1x)
Size height=1.5% of(P2y-P1y)
Standard Character CS0; set 0
Set
Alternate Character CA0; set 0
Set
Character Set SS; standard
Selected
Character Slant SL0; 0 degrees
Label Terminator DTetx; etx(ascii code 3)
Symbol Mode SM; Off
Tick Length TL; tp=tn=.5% of |P2x-P1x|
for y tick
tp=tn=.5% of |P2y-P1y|
for x tick
Scale SC; User-unit scaling off
Absolute Direction
DI run, rise <term>
DI <term>
Specifies the direction in which labels are drawn, independent of
P2 and P1 settings. If no parameters are given, then the direction
is set for horizontal.
run = cos(angle)
rise = sin(angle)
angle = arctan(rise/run)
Relative Direction
DR run, rise <term>
DR <term>
Specifies the direction that labels are drawn relative to the
scaling points P1 and P2. When the scaling points move, the
label direction is adjusted to maintain the same relationship.
A DR command with no parameters sets the direction for horizontal.
run -- the percentage of P2x - P1x
rise -- the percentage of P2y - P1y
Define Label Terminator
DT label_terminator <term>
The character immediately following the DT command is used as
the new label terminator. The label terminator is the
character that signifies when the data for the label is complete
so the plotter can start interpreting the input stream as commands
again. Be careful not to place a space between the DT and the
character that you want for the terminator. Otherwise the space
will become the new terminator.
Initialize
IN <term>
Returns the plotter to its power on state. Performs a DF AND:
o raises the pen
o sets P1 and P2 to the default states
o cancels 90 degree rotation
Input P1 and P2
IP P1x, P1y (, P2x, P2y) <term>
IP <term>
P1 and P2 are used as scaling points for fonts as well as for
establishing the location for a user-defined coordinate system.
Can either specify the positions of both scaling points, just the
first, or reset them to their defaults by specifying no parameters.
If only P1 in specified, then P2 will move to keep the distance
between P1 and P2 constant (P2 tracks P1).
Defaults:
---------
P1x = 250
P1y = 279
P2x = 10250
P2y = 7479
Label
LB c...c <label_terminator>
Puts text on the page starting at the current pen position.
Every character between LB and <label_terminator> is plotted.
<label_terminator> is usually ascii code 3, but can be set by
the DT command. The LB command uses the current selected font
and current label direction.
Line Type
LT pattern_number (, pattern_length) <term>
LT <term>
Selects the type of line that is plotted when the pen is down
and moving. An LT command without a parameter specifies a solid line.
Pattern 0 puts a dot at the endpoints of a line.
Patterns 1-6 are dotted, dashed, dashed-dotted combinations.
The length of the pattern can be specified through the use of
pattern_length. It is expressed as the percentage of the
diagonal distance between P1 and P2.
Any portion of a pattern not used for the current line is
carried over to the next line (provide a PU is not issued).
Plot Absolute
PA X, Y (, ...) <term>
PA <term>
Place the plotter in absolute mode. Causes all coordinates to then
be interpretted as actual coordinates and not offsets from the
current pen position. Coordinates can be specified with the
command as well. It this case the pen is moved to the
appropriate locations. If the pen is down a line will be drawn
in the current pattern. If the pen is up then it is merely moved
through the coordinates without drawing lines.
Pen Down
PD X, Y (, ...) <term>
PD <term>
Places the pen down onto the paper. If coordinates are specified
then the pen is moved to those locations (absolutely or relatively
depending on the current status). A line is drawn using the
current pattern.
Page Forward
PG <term>
Performs the same function as AF. Added to PLT: to allow greater
compatibility with slightly different plotter command sets.
Pen Up
PU X, Y (, ...) <term>
PU <term>
Raises the pen. If coordinates are given then the pen is moved
(relatively or absolutely depending on the current status) to the
specified locations.
Rotate
RO n <term>
RO <term>
Rotate the page to 0 or 90 degrees. Used for making plots in
portrait mode. n can either be 0 or 90. If no parameters are
given then n is taken to be 0. P1 an P2 rotate with the coordinate
system, but they maintain the same (x,y) positions. This means that
P2 can be located outside the drawing area. Following a RO 90; by
an IP; will set P1 and P2 to the soft-clip limits.
Select Alternate Character Set
SA <term>
Future labels will be drawn using the alternate character set as
the font. This font can be set using the CA command.
Scale
SC Xmin, Xmax, Ymin, Ymax <term>
SC <term>
Establishes a user-coordinate system by mapping values onto the
scaling points P1, P2. All subsequent moves will be interpretted
as coordinates in this coordinated system. If no parameters are
given the scaling is turned off.
Absolute Character Size
SI width, height <term>
Si <term>
Specifies the size of character in centimeters. This establishes
character sizes regardless of the locations of the scaling points.
With no parameters, the default sizes are used.
Character Slant
SL tan_angle <term>
SL <term>
Specifies the slant given to characters as they are drawn.
Makes tht font look more like an italic font. tan_angle specifies
how far off the vertical the font is slanted. Positive values
slant the font clockwise off the vertical, negative values
slant the font counter-clockwise. With no parameter, the font
is not slanted at all.
Symbol Mode
SM character <term>
SM <term>
Places the plotter in symbol mode. On subsequent moves the
character specified will be plotted at the various endpoints.
Used for scatter plots and emphasizing line endpoints. With
no parameters, symbol mode is turned off.
Select Pen
SP pen_number <term>
SP <term>
Use pen_number as the current pen. With no parameters, the pen
is returned to the carousel. Pens can be different colors
or different thicknesses.
0 <= pen_number <= 8
Relative Character Size
SR width, height <term>
SR <term>
Specifies the relative character size as a percentage of the
distance between P1 and P2. When the positions of P1 and P2
change, the size of the characters will also change to maintain the
scale. Without parameters, the default sizes are used.
Select Standard Character Set
SS <term>
Use the standard character set as the current font. The font
used as the standard character set can be set using the CS command.
Tick Length
TL tp (, tn) <term>
TL <term>
Specifies the length of the tick marks for both the X and Y-axes.
tp is the length of the positive portion of the tick (up or right),
tn is the length of the negative portion of the tick (down or left).
tp an tn are specified as a percentage of |P2x - P1x| and
|P2y - P1y|. Y-ticks use |P2x - P1x|, X-ticks use |P2y - P1y|.
To supress the negative portion of the tick, don not specify
a tn. To supress the positive portion of the tick, specify 0 for the
tp.
X-axis Tick
XT <term>
Place a verticl tick mark at the current pen position. The length
of the tick can be specified through the use of the TL command.
Y-axis Tick
YT <term>
Place a horizontal tick mark at the current pen position. The
length of the tick can be specified through the use of the TL
command.