home *** CD-ROM | disk | FTP | other *** search
-
- Documentation for MUFUSION.
-
- This is _FREE_ software.
-
- If you are happy with this software, please give a copy to anyone you
- think might find it useful. If you find any problems, please contact me
- (details below).
-
-
- Description:
-
- Mufusion is a terminal program which emulates a Microfusion MF30
- terminal, as used with McDonnell Douglas hospital information systems
- software. It provides 29 screens of backpaging, and extensive
- facilities for data capture. It is written in Turbo Pascal v5.0, and
- was adapted from a videotext terminal program by Jim Nutt, which is in
- the public domain. It will also compile in Microsoft QuickPascal.
-
- Most of the code in MUFUSION.PAS is copyright (C) Cardiology
- Department, Royal Melbourne Hospital. It may be freely distributed
- in an unmodified form, or modified for use within a particular
- institution. The executable file may be distributed without the
- source code, but must not be distributed without this documentation
- file. If you make any changes, please indicate this in an opening
- screen on the program, and in the documentation. If the changes are
- likely to be of use to others, please forward your code to me at the
- address below so it can be incorporated, with suitable credit, in the
- official release.
-
- We also have an int14 interface version of this package which will
- work with an asychronous comms server across a network. This version
- is available from us for $50 per mainframe connection, or $1000 for a
- site licence.
-
-
- Startup:
-
- Mufusion by default uses COM1: at 9600 baud. The complete syntax for
- mufusion is
-
- MUFUSION [<port>[<speed>[<foreground>[<background>[<protected>[printer]]]]]]
-
- All parameters are optional.
-
- The port can be a number from 1 to 4 (defaults to COM1:). If the port
- can not be found, the program will give an error message and set the
- DOS errorlevel to 1.
-
- The speed can be one of 110, 150, 300, 600, 1200, 2400, 4800, 9600,
- 19200, 38400 or 57600 (defaults to 9600).
-
- The foreground color is a number from 0 to 7 (where 0=black, 1=blue,
- 2=green, 3=aqua, 4=red, 5=purple, 6=yellow, 7=white). The default is
- green.
-
- The background color is likewise a number between 0 and 7, the default
- is black.
-
- A different color can be specified for protected mode text. This
- defaults to cyan.
-
- With a monochrome graphics adaptor, the color settings have no effect.
-
- The printer can be any DOS device (LPT1, LPT2, LPT3, COM1, COM2, NUL)
- or file name. If not specified, it defaults to LPT1. If the
- device/file name is invalid, a warning will be given. Do not send
- printer output to the port you are using for communications.
-
- A .PIF file is provided for running mufusion under windows.
-
-
- Commands:
-
- The current command list is as follows:
-
- <ALT>-<C> Open/close a capture file. With a capture file
- on, all incoming characters are saved in the
- file. The bottom right corner of the display
- flashes to indicate capture in on.
-
- <ALT>-<D> Dial with a Hayes compatible modem. Precede the
- number with "P" or "T" to force pulse or tone
- dialing.
-
- <ALT>-<E> Toggle in and out of a debug mode.
-
- <ALT>-<F> Send a formfeed to the printer and flush the
- printer buffer.
-
- <ALT>-<H> Hang up the modem.
-
- <ALT>-<I> Dump the screen to an image file (if debugging
- is off), useful for preparing documentation.
-
- <ALT>-<L> Toggle the number of lines on the screen
- (requires EGA/VGA).
-
- <ALT>-<O> Shell to DOS, allowing DOS operations while
- preserving the terminal screen.
-
- <ALT>-<P> Toggle the printer on/off. The bottom right
- corner of the screen is brightened to indicate
- when the printer is on.
-
- <ALT>-<R> Run a DOS command (for running file transfer
- programs, other emulators, editors, etc.)
-
- <ALT>-<S> Set printer. Allows selection of a different
- printer or for printing to be directed to a
- file. This is useful for downloading reports to
- the DOS disk, for later editing with a word
- processor, or further manipulation with a
- spreadsheet.
-
- <ALT>-<X> Exit the terminal emulator.
-
- PgUp or <ALT>-<F7> Page back (when debugging is off).
- PgDn or <ALT>-<F8> Page forward (when paged back).
- Home Line back (when debugging is off).
- End Line forward (when paged back).
-
- <CTRL-BREAK> Send a break signal.
-
- Print Screen Print the screen to the specified output device.
-
-
- Other keys (apart from the obvious ones):
-
- <ALT>-<F1> Send ^[.
- <ALT>-<F2> Send ^\.
- <ALT>-<F3> Send ^^.
- <ALT>-<F4> Send ^].
- <ALT>-<F5> Send ^@.
- <ALT>-<F6> Send ^@.
- <ALT>-<F9> Clear the screen.
-
- <Left arrow> or Send chr(20)
- <CTRL>-<left arrow>
-
- <Right arrow> or Send chr(22)
- <CTRL>-<right arrow>
-
- <Up arrow> Send chr(24)
- <Down arrow> Send chr(18)
-
- <CTRL>-<Home> Send chr(23)
- <CTRL>-<PgUp> Send chr(25)
- <CTRL>-<PgDn> Send chr(19)
- <CTRL>-<End> Send chr(17)
- <Ins> Send chr(16)
- <Del> Send chr(14)
-
- <CTRL>-<backspace> Send chr(127)
-
-
- Implementation:
-
- Mufusion sends characters with parity set to none. Received
- characters have the parity bit stripped before display, but no parity
- is the prefered line setting. If the host does not support XON/XOFF
- flow control, mufusion may drop characters, particulary when printing
- to a slow printer or capturing data onto a floppy disk. Not all of
- the microfusion terminal control codes are implemented, those that are
- are listed below. All these functions should behave as for an MF30
- terminal. If they don't, please let me know.
-
- Control Codes
-
- EOT ( 3) Printing off
- BELL ( 7) Bell
- BS ( 8) Back space destructive
- LF (10) Line feed
- VT (11) Vertical Address lead-in
- FF (12) Master clear
- CR (13) Carriage return
- DLE (16) Horizontal Address lead-in
- SUB (26) Clear screen
-
- Escape Sequences
-
- SP Destructive backspace
- ! Continuous bell
- & Protect off
- ' Protect on
- ( Full intensity
- ) Half intensity
- * New line
- + Master clear
- , Clear to end of page
- - Clear to end of line
- 1 Non-reverse video
- 2 Reverse video
- 5 Bell
- < Cursor left
- = Y X Position cursor row Y col X
- > Cursor right
- @ Send a carriage return
- E Insert line
- F Expanded facilities - some implemented, see below
- J Clear to end of page
- K Clear to end of line
- L Cursor down
- M Cursor up
- N Flashing on
- O Flashing off
- P Print the screen
- R Delete line (or printer on in prism mode)
- T Clear to end of line (or printer off in prism mode)
- Y Clear to end of page
- Z Cursor home
- [ Enter prism mode (bottom right corner goes red).
- b goto start of next line
- e x c Repeat character x for count c
- k Clear to end of page
- o Clear block
- p Clear field
-
- Expanded Facilities
-
- : Flush printer buffer.
- ; Print n copies.
- A ASCII printer ON
- B Printer OFF
- C Binary printer ON
- E Half-duplex
- F Full-duplex
- M Reposition cursor
- W Define function keys.
-
-
- Acknowledgments:
-
- Thanks is due to the following people;
-
- Jim Nutt, who wrote the original teletext terminal emulator on which this
- is loosely based.
-
- Philip R. Burns, Alan Bishop, C. J. Dunford, Michael Quinlan, Gene
- Harris and Michael Quinlan who wrote various parts of the asynchronous
- communication port handling library used by this program.
-
- Robert Murton, Peter Coventry, Andrew McKenzie, Ron Nash, Louis
- Eilermann, Neil McQuinn, Danny O'Callaghan, Paul Oppey, Joe Bainbridge
- and Tim Naylor who have helped with testing the code and tracking down
- problems.
-
- The Intensive Care Unit at RMH, who supplied us with a copy of Turbo
- Pascal.
-
- Health Computing Sevices, who have provided a copy of Fresh Technology's
- Modem Assist for the development of the INT14 version of MUFUSION, and
- Irene Pearey, Rhonda Whitfield and Barry Rogers, who helped arrange
- this.
-
-
- Comments, distribution:
-
- Please send any comments to me, Peter Summers, c/- Cardiology Department,
- Royal Melbourne Hospital, 3050, phone (+613/03) 342 8727, fax (+613/03)
- 347 2808 or email u5533129@ucsvc.ucs.unimelb.edu.au. If you make any
- improvements, please send them to me so I can incorporate them in the
- official release and everyone can benefit from them. Updates of this
- code are regularly posted to the SIMTEL archives, and can be obtained
- from there (wsmr-simtel20.army.mil), or a local mirror site (archie.au
- in Australia) by FTP. Updates are also posted to the PC Connection BBS
- ((+613/03) 388 0909). If you have a modem, I can send updates by phone.
- If all else fails, send me a disk and return postage to the above
- address.
-
-
- Blatant Advertising:
-
- Cardiology at RMH also has cardiology patient record keeping systems for
- echocardiographs, ambulatory monitor, exercise test, catheterisation and
- ECG reports, a stock control program, an equipment database program and
- an electronic mail program, all written in Clipper, which we would like
- to make available to others (for a price). We are willing to sell
- source code licenses for these packages. Please call me if you are
- interested.
-
-
- Version History (from when I started keeping one):
-
- v2.0 Terminal emulator ported from Turbo Pascal v3.0 to v5.0, using a
- completely new asynch comms library. The program now takes
- command line parameters for port number, speed and screen
- colors. The function keys are displayed when defined. The move
- to the new compiler improved the speed markedly and cleared up
- problems with the typeahead.
- v2.0a Fixed a problem with COM4:. Neatened up the function key
- display.
- v2.0b Disabled the exit from the program on Control-Break.
- v2.0c Fixed the handling of the bell character, which had caused problems
- on one machine.
- v2.0d Fixed a number of problems with the dial command. Improved the
- modem hangup, which now works more reliably, and doesn't
- automatically hang up when the program exits. Also, the program
- now strips the eighth bit from incoming data.
- v2.0e Cleaned up the behaviour of the program when it runs with very
- little free memory. If there is insufficient memory for the capture
- buffer the program now gives a message only if these functions are
- accessed.
- v2.0f I finally got sick of the capture to file stuff, which didn't work
- properly under TP v5.0, and was probably not very useful anyway, so
- I deleted it all.
- v2.0g Cleaned up the code a lot to make it more maintainable. Also,
- made the default protected mode colour cyan, because people liked
- it so much.
- v2.0h Detects mono graphics adaptors and doesn't attempt to use colors
- if one is found, so inverse text now works properly on a mono
- display.
- v2.0i Fixed a problem with the protected mode coloring being turned
- off when inverse text was turned off. Also, the display is now
- forced into 25x80 text mode if it was in another mode when the
- program started, and is restored afterwards.
- v2.0j Increased the maximum function key definition length from 10 to
- 80 characters.
- v2.0k Fixed a bug which caused definitions of function keys F11 and
- above to overwrite the definition of F10, and changed the
- function key display slightly.
- v2.0l Fixed a bug which caused the program to sometimes generate a
- carriage return character when it shouldn't while trying to
- overwrite protected text with unprotected.
-
- v2.1 Now supports slave printing, plus manual printer toggle with the
- ALT-P key combination. If the printer in off-line, the printing
- will be turned back off automatically.
- v2.1a Fixed a bug with the ESC-F-C sequence.
-
- v2.2 Now supports 20 function keys, keys 11-20 being the standard
- function keys combined with the shift key. Shift-F1 and
- shift-F10 therefore no longer exit the emulator. Also cleaned
- up the modem control (dial and hangup) code.
- v2.2a More cosmetic changes to the modem control stuff.
-
- v2.3 Now supports a debugging mode selected with <ALT>-<E>.
-
- v2.4 Now displays the shift-F key definitions when the Shift key is
- depressed and available commands when the Alt key is pressed.
- Removed the ALT-F command which displayed the function keys, as
- it should no longer be necessary. Cleaned up some other bits
- of code, and implemented the Insert Line and Delete Line codes.
-
- v2.5 Added an optional extra command line parameter allowing the
- specification of alternative print destinations. Any valid DOS
- device or file name can be specified.
-
- v2.6 Went over the emulation stuff really carefully, and made a few
- corrections. The program should now work with almost any program
- that can handle a Microfusion MF30.
- v2.6a Now generates an error message if it can't write to the printer,
- to tell the user that it has turned printing off.
- v2.6b Added buffering of data to the printer and XON/XOFF flow control
- to cope better with slow printers.
- v2.6c Cleaned up the flow control stuff a bit.
-
- v2.7 Added the ability to capture incoming text to a file (other than
- by specifying a file as the printer).
-
- v2.8 Moved to a new asynch comms library, which gives speeds up to
- 57600 bps, better flow control and break signalling, among other
- things.
- v2.8a Improved the modem hangup code, changed the dial code so that it
- hangs up the modem before attempting to dial, shortened the
- break to one second, added my name to the status line (on the
- insistence of our director).
- v2.8b Moved the send break function from the <ALT>-<B> key to the
- <CTRL>-<BREAK> key.
- v2.8c Fixed a minor problem associated with baud rates above 19200 bps.
-
- v3.0 Added 16 pages of backpaging (by popular request), and the
- ability to shell out to DOS.
- v3.0a Fixed a bug with screen addresses containing ^Q or ^S characters
- being intercepted by the async routines for flow control.
-
- v3.1 Implemented the esc-P (print screen). The screen printing code
- now writes to the specified print device, not necessarily to LPT1,
- when debugging is off. The print-screen key also sends output
- via this code, which allows for the capture of screen dumps to a
- file. The Del key now sends a chr(127). Chr(127)s sent to
- mufusion are now ignored. Fixed a bug with the control-break
- key not working as expected when shelled out to DOS.
- v3.1a Tracked down a couple of places where the screen copy used for
- backpaging wasn't being updated.
- v3.1b Changed the ALT-functions help line, because I woke up to the
- fact that O comes before P in the alphabet.
- v3.1c Fixed a few places where the program attempted to use the
- backpage buffer when it was not being kept up to date.
- v3.1d Fixed the file capture code so that it warns you before
- overwriting an existing file, and offers you the options of
- appending to it, overwriting it or leaving it alone.
- v3.1e Fixed a problem with not sending characters on some machines if
- it was run immediately after another terminal program.
- v3.1f Reduced the length of the break signal from 1000 to 400ms.
- v3.1g Fixed a problem with characters being dropped while printing the
- screen, and while sending a break signal.
- v3.1h Fixed the problem with control-break being ignored when shelled
- out to DOS.
- v3.1i Fixed the backpage display function so it no longer wraps around.
- v3.1j Fixed up the shell to DOS function because some vectors still
- held the values put into them by turbo pascal, which didn't
- actually cause any problems but seemed undesirable.
- v3.1k Removed some bits of redundant code.
- v3.1l Turned stack checking and array bounds checking on for all the
- code, after a report of a machine crashing while running
- mufusion.
- v3.1m Fixed a bug with cursor positioning commands and unprotected
- text.
- v3.1n Fixed a bug with scrolling text when the character after the
- line feed was a ^G.
- v3.1o Altered the hangup function so that it tells you whether the
- carrier was dropped (for those with internal modems).
- v3.1p Recoded the back page buffer handling, because people with XTs
- were complaining about the speed.
- v3.1q Fixed a problem with the display of function key definitions.
-
- v3.2 Implemented the <ALT>-function keys, as per the MF30.
- v3.2a Turned range checking off, which speeds everything up
- considerably, and added more documentation to the source.
- v3.2b Went over the character display code and made it faster.
- v3.2c Discovered that I had allocated a much larger stack than
- required, so I reduced it to something more sensible.
- v3.2d Cleaned up the clear to end of screen / end of line code, making
- it neater and slightly faster.
- v3.2e Cleaned up the get a character code and made it slightly faster.
- v3.2f All strings are now sent with 10ms/char delays to avoid problems
- on slow systems.
- v3.2g Turned stack checking off, which should improve speed.
- v3.2h Changed scrolling to avoid a line feed occuring if an escape
- sequence follows.
- v3.2i Fixed a couple of places where the screen would scroll and the
- backpage buffer didn't.
- v3.2j Fixed a bug in the handling of the "esc e" sequence.
- v3.2k Cleaned up the auto-echo code.
- v3.2l Wrote in a work-around for lines set up for Prism terminals to
- bypass the download an emulation stuff.
- v3.2m Fixed the "can't find the port" code so it exits with the
- errorlevel set to 1.
- v3.2n Fixed a bug which caused the display screw up with an EGA screen
- after shelling to DOS when debug mode was on.
- v3.2o Minor improvements to the debugging functions.
- v3.2p Rewrote the backpage buffer handling, so it no longer needs to
- be cleared on startup, avoiding the two second delay on slow XTs.
- Increased the backpage buffer size to from 15 to 30 screens.
- v3.2q Fixed the screen dump routines so they work properly when
- viewing backpages.
- v3.2r Rewrote the screen dump routine to be slightly less convoluted.
- v3.2s Altered the backpaging code slightly so it stops backpaging at
- the top of the buffer.
-
- v3.3 The Home and End keys now move the screen back or forward one
- line.
- v3.3a Recoded the backpage display routine to scroll more smoothly.
- v3.3b Slightly altered the handling of chr(12) in debugging mode
- to give a neater display.
- v3.3c Changed the display mode handling to allow users of EGA/VGA
- screens to use 43/50 line mode in mono.
- v3.3d Fixed a bug with invoking MUFUSION when in 43/50 line mode.
- Provided a .PIF file for windows users.
- v3.3e Incorporated DOS 5 style built-in help.
- v3.3f Fixed a bug with setting the baud rate introduced in 3.3e.
- v3.3g Recoded the message display associated with overwriting an
- existing file with a capture file, to make it less annoying.
- v3.3h Fixed a problem with running REALLINK within the DOS shell.
-
- v3.4 Implemented a dump-screen-to-image-file function, invoked by
- typing <ALT>-<I>.
- v3.4a Enabled dumping of screen images while backpaged.
- v3.4b Enables shelling to DOS and program exit while backpaged.
- v3.4c Fixes the screen dump and print screen routine so they don't
- print extra spaces at the end of each line.
- v3.4d Fixed a problem with the reverse text on monochrome machines
- introduced in 3.3e.
- v3.4e Removed a line of unwanted code, and packaged in the transmit
- utility.
- v3.4f Improved the program behaviour when dealing with an illegal
- printer, and rewrote parts of the .DOC file.
- v3.4g Flushes the keyboard buffer before exiting with an illegal
- port/printer message.
- v3.4h Implemented several undocumented escape sequences (esc J, esc K,
- esc k, esc b) and fixed bugs in several others (esc <, esc >).
- v3.4i Further refinements to esc < and esc >, plus corrections to the
- handling of the backspace character.
- v3.4j Further refinements to the handling of the backspace character.
- v3.4k Corrected the esc K sequence, which should clear to the end of
- the line, not to the end of the screen.
-
- v3.5 Implements Alt-F to send a form feed to the printer.
-
- v3.6 Separated the number of lines option from the debugging mode,
- putting number of lines on Alt-L, and simplified and improved
- the debugging mode.
- v3.6a Fixed a bug with backpaging wrapping around when in 43/50 line
- mode.
- v3.6b Implemented the Control-Arrow keys, and the arrow keys, which
- perform the same functions.
- v3.6c Delete no longer sends a chr(127), though Ctrl-backspace does.
- v3.6d Improvements to the toggle-lines code.
- v3.6e Minor improvement to the toggle-debugging code.
- v3.6f Implemented Ins, Del, ctrl-(Home,PgUp,PgDn,End).
- v3.6g Fixed a problem with incorrect text color after switching screen
- modes.
- v3.6h Fixed a problem with inappropriate cursor positioning after
- switching screen modes with emulation off.
- v3.6i Doesn't attempt to dump an image file if emulation is off (which
- won't work).
- v3.6j Stopped the screen from scrolling when protection is off (which
- it shouldn't do).
- v3.6k Fixed another minor problem with screen scrolling.
- v3.6l Renamed the Emulation function to Debug, since that's what it
- now does. This function is still performed using alt-E.
-
- v3.7 Implemented the RUN command, as an easy way of running file
- transfer programs without the fuss of shelling to DOS.
- v3.7a Fixed the clear field (esc p) sequence so it clears fields which
- run beyond the end of a line.
- v3.7b Rewrote the printer handling and increased the print buffer size
- to 2048 characters.
- v3.7c Implemented the clear print buffer (esc F :) and print n copies
- of data (esc F ; <n>) codes.
- v3.7d Sets the printer buffer to empty it printing fails.
- v3.7e Fixed a number of bugs with the printer handling as controlled
- by chr(18) and chr(20).
- v3.7f Fixed the handling of chr(3) for getting out of printing mode.
- v3.7g Fixed screen scrolling in response to horizontal address codes.
-
- v3.8 Added the SET PRINTER function.
- v3.8a Increased the printer buffer size to 3k (the same size as the
- MF30's), and removed one screen of backpaging to provide the
- required memory.
- v3.8b Removed chr(18) and chr(20) as printer control characters (they
- don't work on a Microfusion), and stopped the printing of chr(0)
- and chr(3).
- v3.8c Provides for neater handling of an illegal printer.
- v3.8d Further improvements to the handling of illegal printers
- v3.8e Neater illegal printer messages.
- v3.8f Fixed a bug with trying to print the screen to an illegal printer.
- v3.8g Improved handshaking for the INT14 version.
- v3.8h Fixed a bug with restoration of background screen color when
- returning from DOS shell.
- v3.8i Stops chr(131) being passed to the printer (this character gets
- stripped of its high bit and turns printing off).
-
- v3.9 Supports prism printer control sequences.
- v3.9a Fixed a bug with the flow control in the INT14 version after
- failing to write to the printer.
- v3.9b Put in the status information in the bottom right hand corner.
- v3.9c A really major rewrite of all the printer handling, which had
- become a real mess. This makes for much better interfacing with
- network print queues (no longer requires timeouts), and gives me
- a much more consistent printer interface to work with.
- v3.9d Put error checking on all file close operations (which rarely
- failed, but left the program unusable if they did).
- v3.9e Added the option of retrying of failed writes to the printer.
- v3.9f Fixed a bug with specifying non-existant print file destinations
- on the command line, and cleaned up the output to the printer.
- The printer now only sends printable characters (LF,FF,CR and
- characters 32 to 126 after stripping top bit) if using esc F A,
- or everything except 0, 3 or esc F (unless quoted with a
- preceding escape) if using esc F C.
- v3.9g Removed some unneeded code from the print screen and feed
- printer routines.
- v3.9h Slightly tighter setup code.
- v3.9i Cleaned up the image file code.
- v3.9j Fixed a bug with printing timed-out characters after esc-F-C.
- v3.9k Wrote a general purpose file open routine and removed a lot of
- repeated code for doing file opens.
- v3.9l Simplified and fixed bugs in the handshaking for the INT14 version.
- v3.9m Removed unneccessary pausing in the INT14 version.
- v3.9n Changed the handling of esc-T in prism mode so it does a clear
- end of line if the printer isn't on.