home *** CD-ROM | disk | FTP | other *** search
- CALIBRATE - Program to Create and Configure a BasePrinter Stream
- ----------------------------------------------------------------
- Richard Sadowsky
- TurboPower Software
- 1/90
- Version 1.0
- Released to the public domain
-
-
- Overview
- ------------------------------------------------------------------------------
-
- The main purpose of CALIBRATE is to illustrate how to best choose a printer
- test number for BiosPrinter instances. It is also useful for creating a stream
- file that contains the calibrated BasePrinter (BiosPrinter or DosPrinter).
-
- When configuring a BiosPrinter, CALIBRATE has the ability to determine the
- appropriate printer test number to use with the given printer. This is a nice
- feature, since printer tests are a touchy issue!
-
- This program is intended as an example of how auto printer test selection can
- be implemented. Since it is public domain, you may do with it what you wish,
- but be warned - it is a sample program by design and may not be up to
- production quality!
-
-
- Running CALIBRATE
- ------------------------------------------------------------------------------
-
- When CALIBRATE is run, you are first prompted for the stream file name. If you
- specify a filename that already exists, you will be asked if it should be
- overwritten.
-
- After specifying a filename, you enter a data entry screen. The first question
- is "Use Bios Services?" This is a True/False field. If True is specified (the
- default), then CALIBRATE will create a BiosPrinter object. If False is
- specified, then a DosPrinter will be created. Your answer to this question
- will dictate which remaining fields on the entry screen are required.
-
-
- Configuring DosPrinter's
- ------------------------------------------------------------------------------
-
- If you specify False to the Use Bios Services field, then you will be asked
- for a printer name. This name may be any valid DOS filename (optionally
- including drive and path), or any DOS character device (PRN, LPT1, LPT2, LPT3,
- NUL). This is all CALIBRATE needs to know about a DosPrinter.
-
-
- Configuring BiosPrinter's
- ------------------------------------------------------------------------------
-
- If True is specified for Use Bios Services, then you will be asked for the LPT
- number of the printer. Enter 1 for LPT1, 2 for LPT2, or 3 for LPT3. No other
- numbers are valid choices. The proper selection of the port is especially
- important if the "Auto Test Selection" feature is used (see below).
-
- The final field prompts for a printer test number. The printer test number is
- used by a BiosPrinter instance to determine if a printer is ready, and whether
- a printer operation succeeded or failed. Valid printer test for Object
- Professional 1.00 are in the range of 0..4 (see OPPRNLOW section of OPRO
- manual for more information on the meaning of the printer test number). While
- the cursor is on this printer test field, you may press F10 to have CALIBRATE
- perform its "Auto Test Selection."
-
-
- Auto Test Selection for BiosPrinter's
- ------------------------------------------------------------------------------
-
- Determining a printer test that will work for a given hardware setup can be a
- difficult chore. CALIBRATE can attempt to select an appropriate printer test
- for you. In order to do so, it needs your help. You will be asked to create
- certain conditions related to the printer, and press a key when those
- conditions have been created. It is important that you do create the exact
- condition asked for, or the automatic test selection may not work.
-
- The first printer condition you are asked to create is "online and ready with
- paper loaded." The next condition is "offline" (sometimes referred to as
- "selected"). The offline state means that printer is powered on, but not
- selected. The next condition prompted for is "out of paper." This means you
- should place the printer online again (selected), and remove the paper. The
- final condition is "powered off." This means the printer is turned off
- completely.
-
- The auto test selection works by applying each printer test while the printer
- is in each of the conditions. It stores the results, and when the test is
- complete they are analyzed. This is done by assigning a weight to each of the
- conditions. For each printer test, the list of results is scanned, adding the
- weight for each test that properly determined the state of the printer. The
- printer test with the highest score is deemed to be the best test. There is a
- minimum score that must be surpassed, or no test will be considered
- acceptable. In this case, you will be informed of this condition (through a
- "dialog window") and zero will be placed in the printer test field (zero
- indicates not to use a printer test).
-
- The reason why the printer conditions are given weights is to properly
- evaluate the importance of each test. It is mandatory that the test be able to
- determine when a printer is online and ready. In order to be acceptable, the
- printer must also be able to detect whether the printer is offline or out of
- paper. The powered off condition is given a very low weight since the results
- of the Bios Printer Status function call are undefined for a powered off or
- non-existent printer.