Method for and apparatus for controlling the execution of host computer application programs through a second computer5734871Abstract A method of simultaneously executing one or more computer application programs in one or more host computer system under the control of a second computer system, where the second computer system performs operations on data and instructions and the host computer systems generates presentation information based on the application programs, involves establishing selected parameters in the host computer presentation information, interpreting selected portions of the host computer system's presentation information, providing the interpreted selected portions of the host computer system's presentation information as input to a computer program resident in the second computer system, examining the host computer system presentation information at the second computer system to detect the presence therein of one or more the selected parameters, continuing operation of the second computer system during the examining for the selected parameters, and generating an indication to the second computer system of the detection of one or more of the selected parameters in the host computer system presentation information. Claims We claim: Description BACKGROUND
______________________________________
Protocol: Async
i. Set up communications facility
X25
TCP/IP Async 1200 7e
X-OFF
etc
Terminal: TTY
VT100
3278
etc ii. Select TTY emulation in
Normalization P2 via
control C1
______________________________________
2) Get the HAYES compatible modem under control Get the modem into a known state i. Select pattern to look for "OK" response via control C4 ›O! ›K! Cursor Relative.fwdarw.› ! Settle Time=5 (0.5 sec after last character received) ii. Set to check whenever input buffer empties via control C3 iii. Set up pattern match time-out via C4 iv. Enter "ATZ/r" through emulation keyboard via D8 For a TTY emulation with a Hayes modem, the user types ATZ, hits the return key and the modem will respond. The Z in ATZ is a command interpreted by the Hayes modem to tell it to reset back to another state. If everything is satisfactory, "OK", the user gets back an indication. The user may not get anything back because the modem may be dead or not plugged in. The cursor temporarily ends up on top of the 0 because the system provides a carriage return, then a line feed. At this point the system is awaiting a response from the external system (in this case a Hayes compatible modem). The Hayes modem processes the ATZ command upon receipt of the carriage return, resets itself and responds with OK followed by CARRIAGE RETURN and LINEFEED. The characters echoed by the external system (Hayes compatible modem) are processed through normalization P2 into accumulation P3 and triggering P4. In this example, triggering is set on empty buffer only and thus the analysis P5 (pattern matching process) will be activated almost every character due to the speed at which input is processed. The analysis process checks the set of selected patterns in a LIFO manner against the accumulated screen image and cursor conditions looking for the correct combination of the two to occur. In the present example, the analysis P5 is triggered with the complete pattern (blank under cursor at X,Y and the string OK starting at origin X,Y-1). Analysis P5 defers announcing the match until the pattern match settle timer P7 expires. Any additional communication from the host restarts the timer and potentially results in an alternative pattern match. When the settle timer expires, the signal S4 causes analysis P5 to signal the identifier of the matching pattern on S5 to message handling P9. If the pattern match timer P7 expires, then analysis P5 signals a TIME-OUT by way of signal S5. The message handling P9 queues the message until the next application time slice at which accumulated message(s) are presented to the AIM. 3) Get Connected Dial the number i Select pattern to look for "CONNECT" response by way of control C4 Cursor ›C!›O!›N!›N!›E!›C!›T! Relative.fwdarw.› ! Settle Time=5 (0.5 sec after last character received) ii Select pattern to look for "BUSY" ›B!›U!›S!›Y! Cursor Relative.fwdarw.› ! Settle Time=5 (0.5 sec after last character received) ii Set to check whenever input buffer empties via control C3 iii Set up pattern match time-out via C4 iv Enter "ATDT 123-4567/r" through emulation keyboard via D8 At this point the system is again awaiting a response from the Hayes compatible modem. The Hayes modem processes the ATDT 123-4567 command upon receipt of the carriage return and dials the number. The characters echoed by the external system (Hayes compatible modem) are processed through normalization P2 into accumulation P3 and triggering P4. The case under study is set for triggering on empty buffer only and thus the pattern matching process will again be activated almost every character due to the speed at which input is processed. The analysis process checks the set of selected patterns in a LIFO manner against the accumulated screen image and cursor conditions looking for the correct combination of the two to occur. Eventually the analysis P5 is triggered with the complete pattern (blank under cursor at X,Y and the string CONNECT at origin X,Y-1). Analysis P5 defers signalling the match until the pattern match settle timer P7 expires. Any additional communication from the host restarts the timer and potentially results in an alternative pattern match. When the settle timer expires, the signal S4 causes analysis P5 to signal the identifier of the matching pattern as S5 to the message handling process P9. If the pattern match timer (P7) expires, analysis P5 signals a TIME-OUT via signal S5. Message handling P9 again queues the message until the next application time slice at which accumulated message(s) are presented to the AIM. 4) If it is desired for example to verify the speed of the link, the AIM may then examine the informational part of the CONNECT message: ATDT 123-4567 CONNECT 1200 › ! This is achieved by selecting a cursor relative mask by way of control C5 to extraction P8 to extract the desired information from the accumulation buffer. The mask for this example would be:
______________________________________
.sub.-- -- -- -- -- -- -- ****
Cursor Relative mask from
› ! cX+7,cY-1 to cX10,cY-1 where
cX,cY is the cursor
coordinates.
______________________________________
This will extract the string 1200, or any other information at that location, and return it by way of D6 to message handling P9 and D7 to AIM P1. Example of the Operation of the Present Invention When Used With a Macintosh.TM. Computer and Hypercard.TM. The following is a description of the operation of the present invention employed with a Macintosh Computer from Apple Computer Inc. Hypercard and Macintosh are trademarks of Apple Computer, Inc. However, the invention is equally applicable to operation with computers from other companies such as International Business Machines Corporation, or Digital Equipment Corporation, for example. Additional details of the structure and operation of Hypercard are contained in the publication "The Complete Hypercard Book", expanded 2nd Edition, Goodman, 1988, Bantam Books. That publication is incorporated herein by reference. When an AIM is run on a Macintosh Computer utilizing Hypercard, both HyperCard and the present invention are run at the same time. When HyperCard encounters a present invention command in an AIM, it looks in the Home card for the information necessary to run the command. Once an AIM is running, it calls the run-time module to execute commands. The AIM script invokes the present invention as necessary by using one of a set of XCMDs (external commands) or XFCNs (external functions) installed in the stack. These commands are labeled with the letters XCMD and XFCN in HyperCard's resource fork. The XCMDs pass parameters to and from the host system through the present invention. They convert serial messages from the host system into events to be handled by HyperCard using event handlers in scripts. An AIM's first activity is to establish a connection between the user computer and the host system and allow the user to log on. Next, the stack provides a custom interface of choices related to the application called. The usual Macintosh conventions are followed to display selections based on the host application's offerings (for example, display incoming mail and make requests for a data search). The AIM generates and passes the necessary commands to the host application. These commands and the low-level responses from the host system are unseen by the user. At the host system end, the host application sees a standard call from one of its regularly supported terminals. The fact that the call is from a HyperCard interface or a Macintosh is transparent to the host system. That is why, from the host's point of view, an AIM is a non-invasive interface. The present invention communicates with the AIM in the same way it would communicate with any other HyperCard facility. Just as events at the keyboard can signal HyperCard events, so events in the communications link can signal the present invention events. A WHOOP is defined to watch for these events as patterns coming from the host system. When a pattern coming from the host system matches a pattern defined in the WHOOP, the present invention sends a message to the AIM. The message is intercepted by a handler in the AIM, which describes what HyperCard should do when the event occurs. A handler for the present invention event is written in exactly the same way as any other HyperCard message. Much of an AIM consists of the definitions of handlers that respond to events signaled by the present invention, as well as from the events the user signals with the mouse or keyboard. Following is the sequence of events in an interaction between an AIM and the host system. 1. The AIM invokes the present invention. The AIM's script opens the present invention automatically when the AIM is opened, keeps it on idle (ready to communicate when necessary), and closes it automatically when the AIM is closed. The script includes three handlers: on open Stack openFitos (Friendly Interface To On-line Systems) end openStack on idle Fitos end openStack on closeStack closeFitos end closeStack 2. The AIM creates a device. The present invention sets up a device for each session with the host system, the device being a virtual terminal. 3. The handlers are defined in the AIM. The handlers control displays that appear on the screen. They respond to messages the WHOOP sends out when it sees a designated pattern arriving on the session window. The handler is defined the same way as a standard HyperCard event handler. 4. The AIM tells the WHOOP what to look for. The present invention commands in the AIM pass predicted patterns to the WHOOP so the WHOOP can watch for these patterns. 5. The WHOOP signals patterns in host system activity. The WHOOP for each device continually monitors the session window as data arrives from the host system, searching for specific patterns. When it finds a sought pattern, it signals an event by sending a message to the handler. 6. The handlers transfer data between the AIM and the host system. The handlers transfer data detected by the WHOOP on the session window to a field of a card in the AIM. They also respond to signals generated by clicking the mouse, or to instructions entered from the keyboard, passing data or commands back to the host system. The device created by the AIM is a logical device (as opposed to a physical device) and includes terminal emulation and a session window. A session window is an image of the conventional host terminal screen that is maintained to monitor host system patterns and activity. Unless the user asks to see the session window, it is invisible to the user. There are specific protocols to interpret the data stream arriving from the host system and the data stream originating from the keyboard or the AIM, based on terminal type (VT100, TTY, T6530, etc.). The emulation process converts the data to characters in the session window image, using the correct protocol for the terminal. For each device, the script specifies: The style of terminal presentation (for example, 6530 or TTY) The communications protocol (for example, ASYNC on port A) Details such as baud rate, bits per character, and stop bits, as necessary There is a separate device for each concurrent session with the host system. When an AIM connects to one computer and logs on as one user for one session, the present invention needs only one device. However, if more than one port is used at a time, or the communications link is able to accept multiple sessions through the same port, the present invention creates a separate device for each session. As discussed above, the present invention controls the devices through six managers: the Application Program Interface (API), the WHOOP, the Central Event Manager, the Window Manager, the Presentation Manager, and the Communications Manager. The interrelationship between these six managers is shown in FIG. 15. The present invention managers perform the following tasks: Application Program Interface (API). Forms the link between the AIM, HyperCard, the custom XCMDs and XFCNs, and the present invention development tools and editors. WHOOP. Performs real-time scanning of patterns on the session window as translated by the Presentation Manager. Detects predefined events to which the AIM must respond, and signals the Central Event Manager. Central Event Manager. Routes and dispatches the present invention internal messages and events to the various managers. Window Manager. Hides, displays, scrolls, and relocates the session window. Presentation Manager. Transmits data received from the host system or from the keyboard to the session window according to the conventions of the requested terminal emulation. Communications Manager. Accepts data arriving from the host system through one of the user system communication ports and passes it on to the Presentation Manager. In addition, the Communications Manager takes outgoing data and presents it to one of the user system communication ports for transmission to the host system. These six managers act together to move data between host applications and the AIM. For example, referring to FIG. 15, assume that the AIM sends a command to the WHOOP to "watch for" the appearance of the letter "A" and a command to the Window Manager to display the session window. The WHOOP starts to watch for the appearance of the letter "A." The session window appears in a Macintosh window but the session window does not need to be visible for all of these actions to take place. Now assume that the host system sends a letter "A" to the user's terminal. The present invention Communications Manager receives the letter and sends it on to the Presentation Manager. The Presentation Manager uses the current terminal emulation parameters (either 6530 or TTY) to interpret the incoming letter and causes an "A" to appear in the appropriate format on the session window. When the letter appears on the session window, the WHOOP detects its presence and sends a message to the AIM that an "A" has arrived. The AIM then initiates a task based on the fact that the host system has sent a letter "A." There is another key component in the present invention. This is the recorder and player. The recorder and player records a session with the host systems and then plays it back. This is particularly useful when building an AIM by way of a modem. A sender can capture the conversation between the host system and the Macintosh while they are connected, and then analyze and manipulate it after disconnecting, thereby reducing line charges. The recorder and player can be used in two ways: In the early stages of development, to capture host transactions in slow motion. In later stages, to verify that the AIM and the host system interact as anticipated. FIG. 16 shows how the recorder and player are positioned between the device's Communications Manager and the Presentation Manager of the session window. It is designed to record both sides of the conversation between the session window and the host system. The recorder and player does not distinguish between messages that come from the host system directly and messages transmitted from the Communications Manager through a local echo. As with other HyperCard commands, if a command is typed in the Message window and there is a handler for the command in the script, the command executes at once--a useful feature for debugging or development. In the discussions that follow, the present invention commands are organized into groups that relate to specific issues. Any of the commands can be used on its own, irrespective of the grouping below. Group 1 The Present Invention Availability
______________________________________
openFitos Makes the present invention available.
closeFitos Removes the present invention and
cleans up when the AIM is closed.
fitos Allows the present invention to pass
messages to the AIM.
fitosVers Returns the current present invention
version number.
stackVers Returns the version number of the
current stack.
maxMemory Returns amount of free memory.
______________________________________
Group 2 Device Control
______________________________________
makeDevice Creates a device, including its
session window and its WHOOP. Before
the device can communicate, the AIM
must make a device for each active
session.
commandTo Sends a command to one of the managers
associated with a device (for example,
to initialize the WHOOP).
stateTo Revise the state parameters of one of
the managers associated with a device
(for example, makes a device's window
visible or invisible or alters the
communications parameters).
pfKey Sends a sequence of characters
associated with a particular virtual
device's Function Keys.
______________________________________
Group 3 Pattern Matching
______________________________________
addPattern Adds a previously defined
pattern to the list for a WHOOP.
addPattern also specifies the
name of the handler to which the
WHOOP must signal when the
pattern is found.
rmvPattern Removes a pattern from a
particular WHOOP's list.
modifyPattern Modifies the attributes of a
pattern already in the WHOOP. In
this way, the AIM may alter its
response to patterns as
circumstances change.
addErrPattern Adds an error pattern to a
device's WHOOP.
modifyErrPattern
Change the state of an error
pattern that has already been
added to the WHOOP.
rmvErrPattern Removes the most recently added
error pattern from the WHOOP.
timeOut Tells the WHOOP how long to wait
for a response from the host
system before signaling an error
to the AIM.
whenWHOOP Instructs the WHOOP to modify its
rules about when to check
patterns.
______________________________________
Group 4 Reading To And Writing From The Session Window
______________________________________
typeString Writes a string of characters to a
device's session window and transmits
them to the host system.
slitAttribute
Returns a string of attributes bytes
for a slit.
slitString Returns a text string taken from the
device's session window by looking
through a specific slit in a mask.
allSlits Returns the number of slits that a
mask contains, or indicates which
slits contain specified text.
collectOn Opens a buffer to receive a filtered
stream of characters arriving from the
host system. (The collected
characters are retrieved by the
function dataFrom.)
collectOff Terminates collectOn.
dataFrom Returns the characters collected in
the device's buffer. This is a step
in processing a block of data
transmitted from the host system.
dataTo Transfer data from a HyperCard
contained to the session window and to
the host system.
dataOff Terminates dataTo.
fromMask Transfers data from specific locations
on a device's session window
(specified by a mask) to one or more
HyperCard containers.
toMask Transfers data from one or more
HyperCard contains to locations on a
device's session window.
______________________________________
Group 5 File Transfer
______________________________________
fileFrom Starts a file transfer from the host system
to the Macintosh. Once started, sends
progress reports as the transfer proceeds
so the AIM can inform the user.
fileTo Starts a file transfer to the host system
from the Macintosh. Once started, sends
progress reports as the transfer proceeds
so the AIM can inform the user.
fileOff Aborts a file transfer that has not yet
completed.
getFile Opens a dialog that returns both the name
of a file and the path to it.
______________________________________
Group 6 Recorder And Playback Commands
______________________________________
recorderOn Captures the data stream arriving from
the host system and records it in a
file.
recorderOff Terminates a recording and closes the
file in which the data stream was
being recorded.
playerOn Takes the data recorded in a file and
presents it to the Communications
Manager as if it were being received
in a session with the host system.
playerOff Turns off the player.
______________________________________
Block Mode Full-screen applications usually operate the terminal in what is called block mode. That is, the host application sends the terminal a transmission that paints the entire screen. Subsequent transmissions may update portions of the screen, but the screen remains present as a whole until the host clears it and transmits an entirely new screen. This mode of operation is quite different from the continuous scrolling mode, which imitates the irreversible forward movement of an endless piece of paper. As the user writes on the screen, the terminal records the changes but delays sending them to the host system until the user presses a particular key (for example, the one designated Send). Then the terminal transmits as a block information about all the changes the user has made since the previous Send. Frequently, in setting up the screen, the host system also defines the field in which the user can write. The field definitions act as a mask: the user can write only within them. The application may also define automatic tabs, so that upon filling one field, the cursor moves directly to the next in the sequence that the host application mandates. Depending on how "smart" the terminal is, the terminal may also validate what the user writes in the fields. For example, when the host system sets aside eight positions for a field and calls them numeric, the terminal will not accept a non-numbered character, nor an input of more than eight digits in this field. Indeed, the terminal will not send anything at all to the host system until the entries are within the constraints the host system has specified. AIM DEVELOPMENT Developing an AIM: The task is to construct a HyperCard Stack that gives the user a friendly Macintosh interface and a set of controls of the host Application. The AIM must detect patterns in what the host transmits to the present invention virtual screen, and the AIM must contain HyperTalk handlers for events that are detected by the present invention WHOOP and that may be caused by the user (mouse and keyboard actions). Preparatory work in developing an AIM: Design the user interface and analyze the host's transmissions, states, and characteristic patterns. Specific work in developing an AIM: Design the AIM's HyperCard stacks, use the present invention editors to create data patterns, masks, and maps for moving data to and from the host Application. Write the HyperTalk handlers to be used within the AIM. To minimally activate an AIM , the user must send the present invention the following commands: openFitos: Starts up the present invention and establishes the link between the AIM and the services provided by the present invention. makeDevice: Creates a virtual device and a WHOOP for that device. Also names the window that displays the virtual screen. Specifies the communication settings and protocols being used. In addition to these two commands, the user must also create handlers for two other present invention commands and handlers for two present invention messages that get sent back to the AIM. The two present invention commands that require handlers are: fitos: Directs the present invention to deliver any events or data that it is holding to the AIM. This command is most often placed in an idle handler at the stack level. closeFitos: Terminates the present invention services. Virtual devices and open files are closed and memory is deallocated. The two present invention messages that require handlers are: windowMessage: A message that the present invention sends to the AIM when changes occur to the window containing the virtual screen, The parameters that accompany the message provide detailed status information about the window. commError: A message that the present invention sends to the AIM when communication errors occur. The parameters that accompany the message indicate the kind of error that was encountered. In the AIM to be developed, the scripts and handlers will be distributed between two cards. As an example of the use of the invention in a communication environment, the first card, the top card of the stack, can be considered the user's navigation card. During AIM development this card can also be used as the place from which to activate the present invention, examine the window of host transmissions to the virtual screen, locate and identify host patterns, and use and examine the WHOOP, among other things. The second card, called the Set Up card, emulates one form of a communication's setup option that might be provided in an actual AIM. In complex applications, this card might be better implemented as an entire and separate stack. To start, another card is created in the AIM stack (either activate the NEW CARD menu command or do a COPY CARD followed by a PASTE CARD). With two cards in the stack, return to the first card, add a legend and four potential button locations. Layout the Set Up card by adding legends and potential field and button locations. The Set Up card provides users access to needed communication settings. These are settings that might require adjustment based on the type of terminal being used, the phone hookup, the modem speed, and other communication parameters associated with the particular AIM and host situations. In building an AIM, it is good practice to provide users with an easy way to change variable communication settings by using a card or stack like Set Up. Now, add two buttons and a card field to the navigation card, as follows: Card Button 1: LogOn (Shadow, Auto Hilite) ›name(style, hilite setting)! Card Button 2: Set Up (Shadow, Auto Hilite) Card Field 1: Status (Shadow) ›name(style)! LogOn will be used to activate and deactivate handlers that cause the present invention to run and terminate, respectively. Set Up will be used to send the user to the Set Up card in order to change some of the communication settings. The Status field will display the current set of communication settings being transmitted to the present invention for emulation purposes and other status messages during AIM operations. Add the following buttons and card fields to the Set Up card: Card Button 1: OK (Shadow, Auto Hilite) Card Button 2: Cancel (Shadow, Auto Hilite) Card Field 1: User Number (Rectangle, visible) Card Field 2: Phone (Rectangle, visible) Card Field 3: Speed (Rectangle, visible) Card Field 4: Dial (Rectangle, visible) Card Field 5: Old User Number (Rectangle, hidden) Card Field 6: Old Phone (Rectangle, hidden) Card Field 7: Old Speed (Rectangle, hidden) Card Field 8: Old Dial (Rectangle, hidden) OK will be used to check and record the current communication settings and return the user to the navigation card. Cancel will restore the communication settings to the values saved in the Old card fields, and return the user to the navigation card. The 300, 1200, and 2400 Baud buttons cause the speed setting to be changed. The speed value will be put into the Speed card field. The Pulse and Tone Dial buttons will set the type of dialing option the user wishes to use. The setting will be stored in the Dial card field. The user may enter a user identification number into card field User Number, and a phone number into the Phonefield. The baud rate is set by entering either 300, 1200, or 2400 into the card field Speed. Dialing options can be set by typing "T" (for Tone dialing) or "P" (for Pulse dialing) into card field Dial. Current settings will be transferred to the navigation card by the script that activates the present invention. All of the hidden fields will be used to store either current or past communication settings. The user does not need to see those fields when the AIM is operating. To begin, type the number 1200 into card field Speed and the letter "T" into card field Dial. Entering these values will set the start up communication settings to 1200 baud and tone dialing, If the modem operates at only 300 or 2400 baud, put either 300 or 2400 into the field Speed. If the phone system uses pulse dialing, put the letter "P" into the field Dial. If speed and dialing settings are not entered, or are entered incorrectly, a warning message will be displayed when the OK button is clicked to record the settings. Listed below is an example HyperTalk, stack level handler for activating an AIM called startSession. The handler gets the communication settings, invokes the openFitos command, sends a makeDevice command, and then transmits a stateTo command to the Window Manager telling it to display the virtual screen in a window. Mask and Patterns When a user marked the modem OK pattern, they also marked a mask to be associated with the pattern. A pattern specifies the set of characters the WHOOP will be told to look for. A pattern cannot exist on its own: it requires a mask to give it shape. A mask specifies where to look and the shape of the pattern. The set of positions in a mask are similar to a set of holes in an opaque card that isolate places of interest. Each row of a mask is called a slit, and, unlike a pattern, a mask can exist on its own. Masks, especially the ones used with cMaps, that are completely pattern independent, can be created and saved. A slit is the consecutive positions in a mask's row, and the simplest mask consists of just one slit. During pattern matching, the WHOOP uses an entire mask to look for data. The present invention data transfer commands, however, may refer to individual slits within a mask. With the selected modem OK pattern highlighted Edit Patterns is selected from the MPedit menu. The MPedit window appears. The present invention Mask and Pattern Editor performs the following functions: Saves resources (patterns, masks, transactions, and cMaps) created by using MPedit and the session window. When resources are saved, the resources can be defined and attributes assigned. Edits previously stored resources. Permits changing resource attributes and deleting the present invention resources from the stack's resource fork. Copy resources. The present invention resources can be copied from one AIM to another. Create and Edit cMaps that can be used to transfer data between HyperCard containers and the slits in a mask. cMaps are particularly useful for specifying the transfers of full-screen data blocks to and from the host. The Mask and Pattern Editor stores each pattern, mask, transaction mask, and map as a resource in the AIM. To refer to one of these resources in an AIM script, its name can be used in one of the relevant present invention commands. 1. Select the Patterns radio button. If it is not selected, click on the Patterns radio button to indicate the intent to work with a pattern. 2. Name the pattern. Type "ModemOK" into the field labeled Pattern Name. When an existing resource is edited, its name can be selected from the scroll window at the top left and the Load button clicked. "Editing" means changing the attributes of a resource and doesn't include changing the shape of a mask. To change the mask, the old resource must be deleted and replaced with a new one. 3. Indicate attribute choices. For the ModemOk pattern, click Cursor Relative, Fixed Column, Enable Pattern, and One Shot Pattern. The choice of pattern attributes will be discussed below. 4. Save the pattern. Click the New Pattern button. The pattern name will appear in the scroll window. For the ModemOK pattern, the pattern was indicated as Cursor Relative. Choosing this attribute tells the WHOOP that the pattern's mask has no fixed position on the screen. Instead, its position is defined with respect to the position of the cursor. When the WHOOP tries to match a cursor-relative pattern, it slides the entire mask so that the elements of the mask have the same offset from the current cursor as they had at the time the pattern was marked. The cursor may be inside the mask (as with ModemOK), but does not need to be. The WHOOP always knows the position of the cursor whether or not the cursor is visible through the mask. If Cursor Independent was chosen, this would be telling the WHOOP that the pattern's mask is located at a fixed screen position, regardless of where the cursor may be. The WHOOP would look through the mask for the pattern at the place where the original pattern was marked. Cursor-independent patterns are usually appropriate only for block mode host transmissions (whole screen transmissions) or for a pattern that the host sends to a specific screen address. Fixed Columns and Fixed Row These options restrict the interpretation of a cursor relative resource. The Options are not available for a cursor-independent resource. Fixed Column Fixed Column tells the WHOOP to consider the pattern only when it occurs in the same columns it occupied when the pattern was captured. In other words, the pattern's mask is free to slide up and down, but not sideways. As an example of its use, a modem is unlikely to put the "OK" response anywhere but at the beginning of a line. Fixed column patterns are common in host transmissions that use asynchronous communications, like TTY emulation. Fixed Row Fixed Row tells the WHOOP to consider a pattern only when it occurs in the same rows it occupied when the pattern was captured. The mask would be free to slide sideways to follow the cursor, but could not slide up and down. For example, there is no guarantee that the modem will always put the "OK" message on the second screen row. The first initialization attempt might fail and the modem would respond with "ERROR" on the second row. A subsequent retry at initialization might succeed and the "OK" message would appear on another row. A pattern is likely to occur at a fixed row only when the host specifically addresses it to a row or when the pattern is part of a full-screen (block mode) transmission. During TTY emulations such transmissions are not possible. Fixed Column and Fixed Row With both Fixed Row and Fixed Column, the WHOOP looks for the pattern only when it occurs in the same position (row and column) as it had when the pattern was captured. Neither Fixed Column nor Fixed Row With this option, the WHOOP attempts to find a match for the pattern anywhere on the screen. The WHOOP has no problem making this kind of exhaustive search. However, a user may want to restrict the search to a fixed row or column to make sure that the patterns are reliable. Enable Pattern Checking the Enable Pattern box means that the pattern will be immediately enabled when it is added to the WHOOP. If this box is not checked, when the pattern is added to the WHOOP (with the addPattern command), it will remain inactive until expressly enabled with the present invention modifyPattern command. Synchronous Pattern When the Synch.Pattern box is checked, the pattern (when added to the WHOOP and enabled) causes the WHOOP to act in a synchronous fashion. That is, when the WHOOP matches the pattern, it signals the pattern's handler in the usual way and instructs the Presentation Manager to suspend posting characters to the session window. Since the event is signaled to the AIM immediately and no additional characters reach the screen, the screen and the event are synchronized. An AIM command that looks at the screen is assured of seeing the screen as if the pattern had just arrived. During the suspension, the present invention buffers arriving characters and they are not lost. When HyperCard finishes executing the handler signaled by the pattern match, the suspension terminates. If the handler cannot complete for any reason, the suspension still terminates. One Shot Pattern When a pattern has the attribute One-Shot, it has only one change to "fire." As soon as the WHOOP matches the pattern, the WHOOP changes the pattern's status from enable to disable. Even though the pattern might still be in the WHOOP, it will not be matched again until its status is set back to enable. For the example given above, for the Hayes modem, the ModemOk pattern should have its one-shot attribute set. Once the AIM knows the modem is working, the user does not want the WHOOP to keep finding the modem's "OK" message on the screen and sending a signal back to the AIM's ModemOk handler. The ModemOK pattern should be removed at that point and whatever patterns are needed are added for the next stage of AIM processing. Gamma Pattern A Gamma Pattern is one that cannot be matched at the same place twice in a row. A gamma pattern is usually (but not necessarily) cursor-relative. Once a gamma pattern has been matched with the cursor at a particular location, the WHOOP will not again report a match with the cursor at that location until the pattern is matched with the cursor at a different location. A gamma pattern is useful in identifying successive lines of multi-line text. For such lines, almost the only distinguishing clue is that the cursor has returned to column 0. Making the pattern a gamma pattern prevents the WHOOP from signaling more than one match for the same pattern on the same line. Settle Time Settle time adds duration to the description of a pattern. A pattern's settle time is the length of time the host must remain quiet (no transmissions) before the WHOOP reports a match. Including settle time as part of a pattern's definition has two useful effects: 1. Avoids having the AIM send a response to the host before the host is ready. 2. Avoids false positives that might arise from transitory matches. After sending a prompts some hosts may not be immediately ready to accept a reply. Using a settle time prevents the WHOOP from matching the pattern and the AIM sending a reply before a host is ready to receive information. A second feature of using settle time is that it avoids "false positives"--legitimate host transmissions, which taken out of context, look like patterns the WHOOP has been asked to detect. Once the ModemOK pattern has been marked and saved, that pattern may be used in the AIM. To do so, the startSession handler's script is updated two new handlers are added at the stack level as well. One key debugging and development tool of the present invention is the WHOOP Inspect feature. With the AIM running, click on WHOOP Inspect in the MPedit menu. The WHOOP Inspect window will appear. This window tells what patterns are currently in the WHOOP and whether the WHOOP is enabled. This window is extremely useful during development and while debugging an AIM. The window can stay on the screen, along with the session window, and all the HyperCard tools and windows. The six state codes to the right of the handler name give information about each pattern in the WHOOP. The six state codes have the following interpretations: 1. P--for Pattern. 2. D or E--for Disabled or Enabled. 3. A or S--for Asynchronous or Synchronous. 4. M or 1--for Multi-shot or One-shot. 5. G or (space)--for Gamma or not gamma. 6. T: and Value--for settle time value. Patterns can be added to the WHOOP manually by entering an addPattern command through the HyperCard message window: addPattern "device", "whoop", "ModemOK". Another way to do the same thing is to put two "generic" buttons on the AIM navigation card, Add Pattern and Rmu Pattern. The following are scripts for buttons for various cards of the AIM. on mouseUp Install a pattern in the WHOOP Get the pattern name ask "Name of pattern . . . " Put name into container put it into patName Add the pattern to the WHOOP addPattern "device", patName," ",patName end mouseUp on mouseUp Remove a pattern from the WHOOP Get the pattern name ask "Name of pattern . . . " Put name into container ;ut it into patName Remove the pattern rmvPattern "Device", patName end mouseUp When the buttons have been created and the button scripts inserted, the Add Pattern button is clicked on (with the WHOOP Inspect window showing). A dialog box will appear, at which time the name of the pattern is entered, ModemOk, and Return pressed. In addition to the regular WHOOP, the present invention also maintains another pattern matching facility called the ErrorWHOOP. The present invention activates the Error WHOOP whenever a timeout command is in effect for a virtual device and the WHOOP receives no data from the host during the timeout period. The Error WHOOP has its own separate set of commands for adding, modifying, and removing error patterns. The Error WHOOP commands are: addErrPattern--add an error pattern modifyErrPattern--modify an error pattern rmvErrPattern--remove an error pattern Unlike regular patterns, error patterns do not show up in WHOOP Inspect. To delete a pattern, mask, transaction, or cMap, open the MPedit window by choosing Edit Patterns . . . on the MPedit menu. 1. Click, the radio button for the type of resource to be deleted (Patterns, Transactions, Mask Only, or cMaps). 2. In the scroll window, select the name of the time or items to be deleted. To select several consecutive items, press Shift while clicking. To select items that are not contiguous, press Command-Option on all clicks after the first. 3. Click Delete to remove the selected resources. Each resource in an AIM (pattern, transaction, mask or cMap) can be copied between the current open stack and another stack by clicking the Copy button on the MPedit window. Clicking the Copy button brings up a standard dialog box with a scrollable window containing the names of folders and HyperCard stacks. When the second stack is selected, the present invention Resource Copier window will appear. The Resource Copier window has two side-by-side scrollable lists, one for each stack. When one of the radio buttons is clicked (Patterns, Transactions, Mask Only, cMaps), listing of the selected resources for both stacks appear in the scrollable list areas. The developer can then proceed to select items and move or copy the resources between the two stacks. Two commands of the present invention transfer data between HyperCard containers and the slits of a mask on the session window. The command fromMask moves data from the screen to one or more containers. Characters are taken from particular slits and moved to containers. The destination (or destinations) may be any HyperCard containers, including card fields, background fields, or global HyperCard variables. The command toMask does the reverse. During execution of toMask, for terminal emulations which support data types such as protected fields, the present invention verifies that the data type supplied to the mask is consistent with the host's description of that field and signals an error if there is a type mismatch. Navigation between containers and the slits of a mask is governed by an object called a cMap (for container map). A cMap is stored in the AIM's resource area. When either fromMask or toMask is used, the command must include the name of an existing cMap. Thus, before using either of these commands, the developer must have set up one or more cMaps. Each cMaps consists of a list of containers and for each container a set of frames that relate containers to the various slits in the mask. Taken together, the set of frames for a particular container constitute a recipe for the container contents. The sequence of a set of frames specifies the order in which data from the various slits are moved into a container (for fromMask operations) or out of a container to the slits (for toMask operations). A cMap can also specify constant text to be inserted along with the data received from the mask. Constants are ignored in sending data from containers to the mask. The mask used must have slits that cover all the data to be transferred. Data from different slits can be put into different containers, or data can be concatenated from several slits into one container. It is permissible to use the same slit more than once, or to make no use of some slits. The whole slit must be taken; the developer cannot address individual characters within a slit. 1. Open the Editor. With the session window visible, pull down the MPedit menu and select Edit Patterns . . . 2. Specify a mask for the new cMap. The developer has a choice of either of two ways to specify the mask on the session window: 2a. Draw the mask on the session window. This procedure is similar to the way the ModemOk pattern and mask were created earlier. or 2b. Load an existing mask. To load an existing mask: Click the Mask Only radio button on the MPedit window. The names of masks defined appear in the scrollable list. Click the Load Mask button. The selected mask will be brought to the session window.
|
Same subclass Same class Consider this |
||||||||||
