home *** CD-ROM | disk | FTP | other *** search
- PLT:
- Version 1.2
- July 5, 1989
-
- Jim Miller
- Rich Champeaux
-
-
-
- This archive includes a file-handler (plt-handler), a
- portion of mountlist, a program for setting an environment variable for
- the handler (SetPltInfo), and a example plot file (amiga.clr).
-
- PLT: is a file-handler that accepts HP-GL commands, produces a
- raster image, then dumps it to your printer. The handler
- inquires from Preferences your printer's current resolution in order
- to maximize your plot quality. There is also an ability to preview
- a plot in order to see what it will look like on paper before
- you waste the time printing it. When previewing a plot, a separate
- screen appears that illustrates your plot's layout relative to the
- size of the paper.
-
-
- The basic HP-GL commands are implemented, but none of the
- advanced commands that are usually held in an external ROM cartridge.
-
-
- Feel free to copy, use and distribute this handler as you wish,
- as long as this handler remains in the public domain.
- No financial profit should be obtained by distributing this handler
- without the consent of Richard Champeaux or James Miller. Please respond
- with any problems, comments, or instructions.
-
-
-
- The handler is uuencoded. It must be uudecoded and placed
- in your L: directory. A portion of a mountlist in included
- and must be inserted into your mountlist. (Alterations to the
- startup-string will be necessary if you want different colors
- or pen thicknesses.)
-
-
- ____________________________________________________________________
-
- MOUNTLIST PORTION
-
- plt: Handler = l:plt-handler
- Startup = SW/000-1/f00-2/0f0-2/00f/ff0-1
- Stacksize = 5000
- Priority = 5
- GlobVec = 1
- #
-
-
- ____________________________________________________________________
-
- OPERATION
-
- PLT: can be used in a variety of manners.
-
- 1. You can copy files containing HP-GL commands to the handler.
- ex. copy <filename> PLT:
-
- 2. You can direct a CAD package to plot to a file and give the
- filaname as "PLT:"
-
- 3. You can redirect output from a CAD package heading towards
- the serial port to the handler.
- ex. cmd serial.device PLT:
-
- 4. You can write your own applications that write directly to the
- handler (PLT:).
- ____________________________________________________________________
-
- MEMORY
-
- PLT: does take up quite a bit of memory. Not as much as a full raster image,
- but still quite alot.
-
- PLT: code needs 35K
- printer.device needs 35K
- raster varies from 5K - 14K
- each lines takes 28 bytes (or 16 in the Memory Conserve mode)
-
-
- Before data is read, PLT: removes 90K from your system.
-
- An average plot will usually require an additional 30-50k.
- A complex plot will usually require about 180K or more.
-
- ______________________________________________________________________
-
- COLORS and LINE THICKNESSES
-
- Pen plotters usually have a variety of pens that can be different colors
- or thicknesses. PLT: emulates this by allowing you to set the number
- of pens you wish to emulate, their respective colors, and their respective
- thicknesses. By default, PLT: assumes you want one black pen of thickness
- one. If you wish to redefine this default, you can use a "Startup String"
- similar to one displayed in the above mountlist.
-
- The startup string allows you to customize PLT: by instructing it whether
- it should plot to the screen or to the printer, whether to display a
- status window when dumping to the printer, and by setting the colors
- and thicknesses of the pens you wish to emulate. The format is:
-
- SWITCHES/RGB-t/RGB-t/RGB-t/...
-
- where:
- SWITCHES could be: S Plot to screen
- W Display status window (default)
- M Memory Conserve mode
- (A '-' can be prefixed to the switches to negate them)
-
- PENS are decribed as: RGB-t
- where:
- RGB is the pen color (in hex)
- t is the pen thickness (optional,
- defaults to 1)
-
- Ex.
-
- Startup = S/000-1/f00-3/0c3-2
- Startup = SW/0f0/000/0f0-2
- Startup = ff0-2/05f
-
- The StartUp field of the mountlist appears to be limited to only 39
- characters. This is enough for a couple of switches and about 5 pens.
- If more pens are needed, use the method discussed below.
-
- (NOTE: Due to an programming error, v1.0 negated all switches that occured
- after a '-'. I guess it was a valid way to do it, but it wasn't
- what I intended, and it's not the way this version works. As an
- example, to negate both the S and W switches, you must use '-S-W'.
- The only switch that might need to be negated in the default string
- is 'W'. The other switches default off. The '-' is there mainly for
- switches passed when PLT: is called so that the switches defined in
- the default strings can be turned off. )
-
-
- Another way to redefine the defaults of PLT: is to specify a string similar
- to the startup string by using environment variables. This may be performed
- by setting the AmigaDOS enviroment variable "PltInfo" with the SetEnv command.
- The format for this string is identical to the startup string in the mountlist.
- If the enviroment variable is found, the string in the mountlist is ignored.
-
-
- Ex.
-
- setenv pltinfo S/000-1/f00-3/0c3-2
-
-
- This is useful if you want to alter the way the next several plots look,
- without having to alter your mountlist and rebooting your computer.
-
-
- If you want to override the defaults for the current plot, you can add
- a startup string to the invocation of the handler. For instance, if
- you have a file of HP-GL commands that you want plotted; you could
- normally type:
-
- copy <filename> PLT:
-
- If for this particular plot, you wanted all the parameters identical
- to your previously defined defaults (from environment variables, mountlist
- string, or handler defaults) except you wanted it to plot to the screen;
- then you could type:
-
- copy <filename> PLT:S
-
-
- If you wanted it to plot to the screen using only one pen, you could
- type:
-
- copy <filename> PLT:S/000
-
- With these three methods of altering how your plot will look, you have the
- greatest flexibility for customizing your plots on the fly.
-
- The string passed through the invocation of the handler only affects
- the parameters defined. If you add the switch to plot to the screen,
- it will no affect the pen colors. To negate one of the switches set
- as a default, prefix a '-' to it. Ex. -W.
-
-
- PLT: decides how many bitplanes to use by the number of different colors
- you request, not the number of pens. This allows you to have many pens
- of the same color but of different thicknesses with out requiring extra
- bit planes.
-
- The usable colors are dependent upon the number of colors that your printer
- can display in a single pixel. For example, the Okidata ML-292 can display
- only 14 colors in a single pixel. If a color is used that the printer can't
- support, the driver will try to dither. This causes oddities such as lines
- with alternating yellow and green dots. (Who knows? This may actually be
- desired.) Also, the RGB colors may not always match up to printer colors
- like you might expect. For instance, 00f prints as violet on the Okidata
- ML-292, and 0ff prints as cyan, which is the blue I expected 00f to print
- as. It might take a bit of playing with the RGB values to get the colors
- you desire.
-
- MEMORY CONSERVE MODE
-
- This mode reduces the amount of memory required for each plot, allowing
- more complex plots to be printed.
-
- PLT: builds a sorted list of the lines to be plotted, and then prints the
- page in strips. In it's normal mode, PLT: requires 28 bytes per line,
- however, in the Memory Conserve mode, only 16 bytes are required per
- line. This allows you to plot almost twice as many lines, but causes
- a serious performance degradation. The normal mode implements a linked
- list with a binary tree on top of it for insertion. The Memory Conserve
- mode does not use the binary tree, and must do a linear search of the list
- to insert a new line. The performance degradation becomes most noticable
- when the plot has more than 2000 lines. As an example, a 9800 line plot
- that I have takes 2 minutes and 10 seconds to process the input using the
- normal mode, but takes 8 minutes and 7 seconds using the Memory Conserve
- mode.
-
-
- STATUS WINDOW
-
- When the 'W' switch is set, PLT: displays a status window. As well as
- displaying the status of the plot, this window has a close box that can
- be used to abort the plot. It also displays the number of lines processed
- and the amount of free memory.
-
-
- ESTIMATING MEMORY USAGE
-
- When the output is sent to the screen, the number of lines processed is
- displayed in the title bar. Since sending the plot to the screen is
- considerably faster than sending it to the printer, you can estimate the
- amount of memory needed by multiplying the number of lines by either
- 16 or 28 and adding 80-100k. When the output is sent to the screen, the
- line list is not built, and thus takes much less memory.
-
-
- AF AND PG COMMANDS
-
- The AF and PG commands are now implemented. These commands cause the page
- to be dumped, and a new one started. If the output is sent to the screen,
- the close box must be clicked to display the next page.
-
- __________________________________________________________________________
-
- FUTURE PLANS
-
- 1. There are some more HP-GL commands that I wish to implement but
- are not currently implemented, because they are seldom used by
- CAD packages.
-
- 2. Making the previewer more powerful, by letting you alter the shape
- of the plot, laying two plot files on the same page, or adding
- borders and additional text.
-
- 3. Implementing another font and symbol set.
-
- 4. Optimizing the code to make the handler process information faster.
-
- 5. Preparing a document describing the purpose, operation and features
- of PLT:
-
- __________________________________________________________________________
-
- My e-mail address is:
-
- jvmiller@rdrc.rpi.edu
-
- if you have any questions, comments, or requests.