home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
100-199
/
ff166.lzh
/
AutoGraf
/
Readme
< prev
next >
Wrap
Text File
|
1988-11-22
|
5KB
|
125 lines
AutoLog Programs
by Joel Swank
September 1988
Here is a set of programs that extract and display data from a file of
auto log records. Each record represents a gasoline purchase. There are 3
programs: checkup, averages and autograf.
Checkup is a file validator that checks the integrity of the
data file. It is a cli only program. Its only command line parameter is
the name of the data file. Its output will be a listing of any errors and
the records containing them. If the file is OK there will be no output.
Averages is a CLI only program that prints out a list of totals and
averages for the data file. It prints total miles, cost, and gallons.
It also prints averages cost/mile, mile/gallon and price/gallon. If requested
it will also print the maximum price/gallon, cost and number of gallons and
the minimum price/gallon.
usage:averages [-snn] [-enn] [-ynn] [-m] [-?] [file ...]
Options:
ynn - for requested year only.
snn - year to start.
enn - year to end.
m - include max and min information.
? - display this list.
AutoGraf reads the autolog datafile to construct 3 types of graphs:
cost per mile in cents per mile, price per gallon in dollars per gallon,
and miles per gallon. AutoGraf can be started by clicking its icon or by CLI
command. Autograf has a 7 item menu: Read File, Draw Graph, Averages,
Set Options, Print Window, Help, and Quit. DrawGraph and Averages are
disabled until a file has been read. The settings in the options window
determine how the graphs are drawn. You can read in a data file and then
graph it different ways. The options window has gadgets that allow you to
select which types of graphs you would like to see. It also allows you to
restrict the data graphed to a particular range of years using the start
and end year gadgets. Select the desired options and click 'OK'. When you
select Read File, you will select a file using the Fileio requester by R.J.
Mical. A sample file named '77pont' is included. After the data is read, you
can use Draw Graph or Averages to see the data. When a graph is displayed,
two gadgets will be available. Click the 'NEXT' gadget if you have requested
more than 1 type of graph. Click the 'DONE' gadget to enable the menu. While
a graph is on the screen you can see the value of any point on the trace
by moving the mouse to it. The Print Window item is available to dump
graphics or text to the printer. The Help menu item displays this
information, Quit ends the program. Click the Close Gadget at any time
to end the program.
Notes on AutoGraf: All graphs are drawn with one X point for each record in
the file. The X labels are the years. The size of a year will vary with the
number of entries for that year. The price/gallon graph plots the exact
price of each entry. Both of the other graphs plot the average for the
most recent 10 entrys. This is to keep partial fillups from skewing the
graph as badly (they will have some effect, especially near the beginning
of the data).
FILE FORMAT
The data file is an ASCII character file with integer, character
and floating point data items. Individual fields separated by commas.
It was created by a SuperBase Export command. The fields are:
* date - character format (MMM DD YYYY)
* odometer reading - 999999.9
* price per gallon - $9.999 } leading dollar sign required
* Total cost of purchase - $9999.99 } for both of these fields.
* gallons - 999.9
* place and brand of gas - character
FILE Notes:
* odometer reading can be whole miles or tenths.
* only the year of the date field is used. It must be the last 4
characters of the date field.
* The gallons number is not used by these programs. Gallons is
computed by cost/price on the assumption that they are more accurate
and the fact that gallons is a computed field in Superbase.
Printing Graphs:
The Print Window menu item can be used to do a graphic dump of the
autograf window. You may have to adjust your printer preferences to get
a reasonable printout. I found 'Negative' image, 'Black & White' shade
and a threshold of 5 to work well on my setup.
Restrictions and Limits:
To be acceptable to these programs the data records must be in
ascending order by odometer reading and year. This is to help spot data
entry errors. The price and cost fields must contain a leading dollar sign.
Autograf can accomidate files of up to 1000 records. Autograf reports
file format errors and other errors in a requester.
Compiling:
Source for all code except the fileio requester is provided. A
makefile for manx is included. I have no idea what it would take to
compile with lattice. 32 bit integers are required because fileio
requires them. Fileio is linked in from a library compiled from
the fileio source provided by R.J Mical in Prosuite on Fish disk
107. The include files fileio.h, prosuite.h, pointers.h, and reqsupp.h
are also needed.
Superbase Files:
Included are the superbase files that provide a skeleton of the
file used to create '77pont'. They are autolog.2, autolog.sbf, and
autolog.sbd. These can be copied to a superbase directory and used
to enter data and create ASCII data files with the Superbase Export
command. Superbase Import command can be used to input the '77pont' file.
Copyright:
All code in these files is uncopyrighted, public domain, no rights
reserved.