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 >
Text File  |  1990-07-21  |  5KB  |  95 lines

  1.                 The History and Rationale of microPLOX
  2.                               Bob Patton
  3.                         1713 Parkcrest Terrace
  4.                          Arlington, TX 76012
  5.  
  6. microPLOX was written as a personal tool to draw graphs on an Epson 
  7. FX-80 printer from a Kaypro IV CP/M computer with 2 floppy drives.  It 
  8. was also used as a project to try and become proficient in the C 
  9. language and to attempt object oriented design in C.
  10.  
  11. The main idea was to manage the limited memory available while having 
  12. a tool to make nice looking charts with the maximum detail that the 
  13. FX-80 could deliver.  The emphasis on saving memory was the impetus
  14. behind every design decision.  There was no strong idea of supporting
  15. other devices except in a general way.
  16.  
  17. The user's view is that of a plotting specification language that 
  18. describes the chart wanted with somewhat English-like statements.  The 
  19. numeric data to be plotted may be extensive and is stored separately.
  20. This way the data can be amended or the chart layout changed and 
  21. redrawn at any time.
  22.  
  23. The way the chart is actually drawn is to build its bit image in 
  24. memory and then dump it directly to the printer.  I borrowed a little 
  25. from Don Brittain's public domain code here to get started, but I saw 
  26. no need to keep the bit image in a file.  If a chart were to be 
  27. redrawn it would probably be changed in some way.  To keep the maximum 
  28. memory available for the bit image the chart is built as a binary file 
  29. by a front end program and the device driving program has minimal 
  30. intelligence and uses only standard integer arithmetic.
  31.  
  32. The front end is where the fun is.  PLOX is a keyword-value user 
  33. language that is executed interpretively.  The implementation is 
  34. pretty much brute force, but in a structured way that allows a lot of 
  35. code to copied for each major object on a plot. The drawn objects are: 
  36. AREA, AXIS, BARS, ISO (isogram, line of constant value), LABEL, LINE, 
  37. PIC (picture), and TITLE.  The objects receive messages via a single 
  38. string interface and react accordingly.  Other objects, each in a 
  39. separate file, are Data and the PlotFile.  The other library files 
  40. just contain groups of related but independent functions.
  41.  
  42. There is minimal user documentation including several examples and a
  43. language summary.  The executable modules and the source code for the
  44. device driver were released to public domain in 1987 by giving them to
  45. friends.  I kept the front end source code because of 2 major design
  46. flaws that I thought I would fix, but I seem not to have the time to
  47. work with it since microPLOX does draw the charts I want as it is.  
  48. Therefore, the entire package is placed in public domain now (May 
  49. 1988) in hopes that someone may get some beneficial use from it and 
  50. perhaps enhance the package.
  51.  
  52. The 2 major flaws (in my opinion) are: (1) in the binary file, 
  53. coordinates are given directly in physical pixels (at 72 per inch) for 
  54. the Epson.  A logical pixel at 1024 per inch would adapt more easily 
  55. to other devices especially those with higher precision.  This is not 
  56. a difficult change. (2) the location of text is computed in the front 
  57. end based on knowledge of the font sizes on the output device.  I 
  58. really should have known better, but it was so easy and it kept the 
  59. back end program smaller and simpler. Actually this approach works 
  60. quite well if the letters are purely vectors and the exact height is 
  61. specified, but that is not the case here.
  62.  
  63.  
  64. The name, PLOX, is not an acronym.  It is simply a word coined to be 
  65. short and suggestive of plotting.  The name and the general look of 
  66. the user language is based on a main frame product I designed which 
  67. is, of course, much more powerful and which is completely 
  68. nonprocedural.
  69.  
  70. The original CP/M version was compiled with MIX C.  A later MS-DOS 
  71. version was compiled under Microsoft C 4.0 and later 5.0.  This does 
  72. produce small and fast code.  When I originallly got my own MS-DOS
  73. machine I used MIX Power C (which is amazing for the price).  The
  74. current release 5.0 uses Watcom 7.0.
  75.  
  76. As PLOX grew several more device drivers were kludged.  Many Epson
  77. compatible printers couldn't handle 72 dots per inch horizontal so
  78. PLOTEPS2 with 60 dots (ESC,K) was developed.  Same code; just adjust
  79. the horizontal aspect ratio.
  80.  
  81. Once I had a graphics monitor on desk the desire to see charts on the
  82. screen was overwhelming.  Well, it turns out that PLOX's pixel map at
  83. 504 by 360 for 7 by 5 inches is close enough to most common graphics
  84. screens that you can get a decent image by just ratioing the x and y
  85. coordinates to fit the screen.  Thus were born the QD graphics monitor
  86. drivers for Hercules, CGA, EGA, and VGA.  (QD? Certainly not Quick and
  87. Dirty, merely Quality Deferred.)  The major flaw in these is that the
  88. text is sometimes shifted horizontally a little, but mostly it's not
  89. very noticeable.
  90.  
  91. For all its faults microPLOX is a useful tool if your only plotting 
  92. device is an Epson compatible printer or if you just want to view
  93. charts on-screen.  I hope some people may make use of it and I would be
  94. glad to hear from them if they did.
  95.