home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
266_01
/
ploxhist.doc
< prev
next >
Wrap
Text File
|
1990-07-21
|
5KB
|
95 lines
The History and Rationale of microPLOX
Bob Patton
1713 Parkcrest Terrace
Arlington, TX 76012
microPLOX was written as a personal tool to draw graphs on an Epson
FX-80 printer from a Kaypro IV CP/M computer with 2 floppy drives. It
was also used as a project to try and become proficient in the C
language and to attempt object oriented design in C.
The main idea was to manage the limited memory available while having
a tool to make nice looking charts with the maximum detail that the
FX-80 could deliver. The emphasis on saving memory was the impetus
behind every design decision. There was no strong idea of supporting
other devices except in a general way.
The user's view is that of a plotting specification language that
describes the chart wanted with somewhat English-like statements. The
numeric data to be plotted may be extensive and is stored separately.
This way the data can be amended or the chart layout changed and
redrawn at any time.
The way the chart is actually drawn is to build its bit image in
memory and then dump it directly to the printer. I borrowed a little
from Don Brittain's public domain code here to get started, but I saw
no need to keep the bit image in a file. If a chart were to be
redrawn it would probably be changed in some way. To keep the maximum
memory available for the bit image the chart is built as a binary file
by a front end program and the device driving program has minimal
intelligence and uses only standard integer arithmetic.
The front end is where the fun is. PLOX is a keyword-value user
language that is executed interpretively. The implementation is
pretty much brute force, but in a structured way that allows a lot of
code to copied for each major object on a plot. The drawn objects are:
AREA, AXIS, BARS, ISO (isogram, line of constant value), LABEL, LINE,
PIC (picture), and TITLE. The objects receive messages via a single
string interface and react accordingly. Other objects, each in a
separate file, are Data and the PlotFile. The other library files
just contain groups of related but independent functions.
There is minimal user documentation including several examples and a
language summary. The executable modules and the source code for the
device driver were released to public domain in 1987 by giving them to
friends. I kept the front end source code because of 2 major design
flaws that I thought I would fix, but I seem not to have the time to
work with it since microPLOX does draw the charts I want as it is.
Therefore, the entire package is placed in public domain now (May
1988) in hopes that someone may get some beneficial use from it and
perhaps enhance the package.
The 2 major flaws (in my opinion) are: (1) in the binary file,
coordinates are given directly in physical pixels (at 72 per inch) for
the Epson. A logical pixel at 1024 per inch would adapt more easily
to other devices especially those with higher precision. This is not
a difficult change. (2) the location of text is computed in the front
end based on knowledge of the font sizes on the output device. I
really should have known better, but it was so easy and it kept the
back end program smaller and simpler. Actually this approach works
quite well if the letters are purely vectors and the exact height is
specified, but that is not the case here.
The name, PLOX, is not an acronym. It is simply a word coined to be
short and suggestive of plotting. The name and the general look of
the user language is based on a main frame product I designed which
is, of course, much more powerful and which is completely
nonprocedural.
The original CP/M version was compiled with MIX C. A later MS-DOS
version was compiled under Microsoft C 4.0 and later 5.0. This does
produce small and fast code. When I originallly got my own MS-DOS
machine I used MIX Power C (which is amazing for the price). The
current release 5.0 uses Watcom 7.0.
As PLOX grew several more device drivers were kludged. Many Epson
compatible printers couldn't handle 72 dots per inch horizontal so
PLOTEPS2 with 60 dots (ESC,K) was developed. Same code; just adjust
the horizontal aspect ratio.
Once I had a graphics monitor on desk the desire to see charts on the
screen was overwhelming. Well, it turns out that PLOX's pixel map at
504 by 360 for 7 by 5 inches is close enough to most common graphics
screens that you can get a decent image by just ratioing the x and y
coordinates to fit the screen. Thus were born the QD graphics monitor
drivers for Hercules, CGA, EGA, and VGA. (QD? Certainly not Quick and
Dirty, merely Quality Deferred.) The major flaw in these is that the
text is sometimes shifted horizontally a little, but mostly it's not
very noticeable.
For all its faults microPLOX is a useful tool if your only plotting
device is an Epson compatible printer or if you just want to view
charts on-screen. I hope some people may make use of it and I would be
glad to hear from them if they did.