5 Using the GenSAA Workbench

This section describes all features of the GenSAA Workbench. It is organized as a reference, covering each of the major Workbench tools in turn. The subsections for each tool explain how to perform primary operations, describe the relevant Workbench panels, and describe each command on the pull-down menus.

5.1 GenSAA Workbench Basics

This section defines terms and describes basic skills needed to use the GenSAA Workbench. If you have used applications in the Motif, Macintosh, or Microsoft Windows environments, you will already be familiar with most of these terms and skills.

When using the GenSAA Workbench, you interact with multiple windows called GenSAA Workbench panels. Panels contain several types of controls, including pull-down menus, pushbuttons, and list boxes. The various types of controls you will encounter are described in the sections that follow. The mouse, and occasionally the keyboard, are used to manipulate panels and interact with their controls.

5.1.1 Using the Mouse and Keyboard

Most operations with the GenSAA Workbench are performed with the mouse. The keyboard is used when needed to enter and edit text, and occasionally to perform control functions.

5.1.1.1 Operating the Mouse

Moving the mouse controls the location of the pointer on the screen. The pointer is usually shown as a small arrow or an "X". The mouse has three physical buttons on its back; you use only the leftmost button, called the mouse button, in the GenSAA Workbench.

The following mouse operations are performed when using the Workbench:

NOTE: On some keyboards, the Ctrl key is labeled Control.

5.1.1.2 Setting the Keyboard Focus

When you use the keyboard, the characters you type are sent to the window that has the keyboard focus. This includes text input, the arrow keys, the Return key, and function keys. The frame of the window having the keyboard focus is highlighted. Before you begin typing text or control keystrokes, you may need to set the keyboard focus to the proper window.

On some workstations, the keyboard focus is set by just moving the mouse pointer into the window. The frame of the window becomes highlighted as soon as the mouse pointer enters it. On other workstations, you must click the mouse button after moving the pointer into the window. The frame of the window becomes highlighted after you click. (The keyboard focus style is determined by a parameter in your workstation's Motif startup file.)

5.1.1.3 Entering and Editing Text

Some panels contain text input boxes that are used for entering and editing (modifying) text using the keyboard. Text input boxes appear to be depressed into the panel and are easily identified by their light gray color. Although text may already appear in these boxes, it can be modified. Dark gray boxes are text output boxes; text displayed in these cannot be modified.

You can also enter and edit text in some text drop-in boxes. A text drop-in box is magenta or green and has a small diagonal down-arrow attached to its upper left corner. However, it is usually easier to drag a text item into a drop-in box than to enter text from the keyboard. (For details, see Section 0, 5.1.9 Drag-and-Drop Operations).

=> To enter or edit text:

1. Move the mouse pointer into the desired text box, position the pointer in the text, and click.

The border of the text box becomes highlighted.

2. Enter the desired text.

Keyboard keystrokes are sent to the text box while the mouse pointer is in the highlighted box. The highlighting disappears when you move the mouse pointer out of the box. (This style of entering text may seem unfamiliar to users of Macintosh, Microsoft Windows, or other windowed environments. If your keystrokes don't appear in the text box, make sure the mouse pointer is still in the box.)

Text you enter appears at the position of the text cursor. The text cursor is an I-beam (I) or sometimes a caret (^). Existing text to the right of the text cursor moves right as new text is inserted. To move the text cursor, use the keyboard arrow keys or move the mouse pointer to a new position in the text box and click.

To delete a single character, position the text cursor immediately to the right of the character and strike the Delete key. To rapidly delete or replace a range of text, drag the mouse pointer over the text; the text is highlighted as you drag. Release the mouse button when the desired text is highlighted. Then strike the Delete key to delete the highlighted text, or type in new text to replace the old. On some workstations, you can double-click on the text box to quickly highlight its entire contents. To remove text highlighting, click the mouse button again anywhere in the text box.

5.1.2 GenSAA Workbench Panels

The user interface of the GenSAA Workbench consists of a collection of Motif windows called GenSAA Workbench panels. Panels contain pull-down menus, pushbuttons, text boxes, and other controls. An example panel is shown in Figure 5-1. At the top of each panel is a title bar that identifies the panel. The Workbench displays a panel when it is needed to perform a requested operation. A panel is closed when you click the panel's OK or Close button.

Minimize and maximize buttons appear at the right end of the title bar on some panels. The minimize button is a very small square; the maximize button is a larger square. Click the minimize button to iconify a panel, that is, reduce it to a small icon that appears at the bottom of the screen. Double-click on the icon to restore the panel to its original size. Click on the maximize button to enlarge a panel to its maximum size. Click the maximize button of an enlarged panel to restore it to its original size.

Figure 5-1 Example Workbench Panel

Usually, several panels are displayed simultaneously to perform a Workbench task. The Workbench displays a panel in a default screen position that minimizes interference with other panels displayed at the same time. However, there are occasions when panels will overlap, with one panel partially or fully obscuring others. To access obscured panels, you can move panels around the screen, and raise or lower one panel with respect to the others. To raise a panel to the top of the window stack, click its title bar. To move a panel, drag the panel by its title bar. The X and Y coordinates of the upper left corner of the panel are displayed in the center of the screen as you move it. To lower a panel to the bottom of the window stack, use the Lower command on the panel's Window menu as described below.

When you are using the UIB tool, another window called the WorkSpace appears on your screen. The WorkSpace is the containing window for all the graphic components you create for display to the expert system user. The WorkSpace also appears during runtime; it is the primary interface window for the expert system user. At runtime, it contains all the graphic components you created in the Workbench.

In the Workbench, the WorkSpace can be moved, raised, and lowered just like a panel. Its menubar shows the pull-down menus that will be active during runtime; the expert system user selects these commands to monitor and control the execution of the expert system. The menu commands are not active in the Workbench. The WorkSpace is hidden when you close the UIB.

5.1.2.1 The Window Menu

At the left end of each panel's title bar is a button labeled with a hyphen (-). Click on this button to display the window menu for the panel. (The Window Menu is sometimes called the control menu or the system menu.) The window menu for GenSAA Workbench panels contains the commands listed below. Click on the desired command to perform its action. To hide the window menu without performing any of the commands, click anywhere outside of the menu.

5.1.3 MenuBars and Pull-down Menus

Some panels have a MenuBar located directly beneath the title bar. A MenuBar is a horizontal list of menu names. You click on a menu name to show a pull-down menu that appears below the menu name. The pull-down menu is a vertical list of commands. Click on the desired command to perform its action. To hide the pull-down menu without performing any of the commands, click anywhere outside the menu.

When you click on a command in a pull-down menu that ends in an ellipsis (...), a panel is displayed that contains the controls needed to perform the action. For example, when you click the command "Open...", a panel appears that allows you to select the GenSAA expert system to open.

Sometimes a command in a pull-down menu is desensitized, or grayed (i.e., the command name is displayed at half intensity). If a command is grayed, the command cannot be used because its action is not appropriate at the current time. For example, the "Save" command is grayed before you have opened an existing or new GenSAA expert system.

The rightmost menu name on all MenuBars is Help. Select the Help menu to obtain assistance in using the GenSAA Workbench.

Some menu names on MenuBars and commands on pull-down menus have mnemonics. A mnemonic is a single keystroke, usually a letter, used to select a menu or command without using the mouse. A mnemonic is indicated by an underlined character in a menu or command name. For example, on the GenSAA Workbench main panel MenuBar, the File menu has the mnemonic "F". The mnemonic is usually the first character in the name but may be another if more than one menu or command begins with the same character. Mnemonics are case insensitive; do not use the Shift key when you enter a mnemonic.

=> To select a menu command using mnemonics:

1. Set the keyboard focus to the panel containing the menu.

2. Strike the mnemonic key for the desired pull-down menu.

The pull-down menu appears.

It may be necessary to hold down the Alt key while you strike the mnemonic key. On some keyboards, the Alt key function is performed with the key labeled with a diamond.

3. Strike the mnemonic key for the desired command on the pull-down menu.

The pull-down menu disappears and the command is performed.

Refer to Appendix B for more information on using keyboard mnemonics.

5.1.4 Pushbutton Controls

Most panels contain several pushbutton controls, usually located at the bottom of the panel. A pushbutton (Figure 5-2) is a small rectangular button that appears to be raised from the panel, and which contains a label and sometimes an icon.

Figure 5-2 Sample Pushbutton.

Pushbuttons are used to perform actions, and are very similar to commands on pull-down menus. Several panels allow you to perform the same action either by using a pushbutton or by selecting a command from a pull-down menu. The label on a pushbutton identifies the button's action.

To perform the action associated with a pushbutton, click on it. The pushbutton appears to momentarily depress when you click on it. If the pushbutton's label ends in an ellipsis (...), a panel is displayed containing additional controls needed to perform the action. If a pushbutton's label is grayed, the pushbutton cannot be used because its action is not appropriate at that time.

The pushbuttons described in the following subsections appear on many Workbench panels.

5.1.4.1 Apply

A panel usually contains several controls that allow you to change some aspect of the expert system you are building. The Apply pushbutton causes your specified changes to be applied to the expert system. After you click on Apply, the panel remains open to allow you to make additional changes.

5.1.4.2 Close

The Close pushbutton is used to close and hide the panel. Changes that were specified using the panel controls after the last Apply was made are not applied to the expert system.

5.1.4.3 OK

The OK pushbutton is used to perform the same actions as Apply followed by Close. That is, all changes specified using the panel controls are applied to the expert system, and the panel is then closed.

5.1.4.4 Help

The Help pushbutton is used to obtain assistance in using the controls on the panel.

5.1.5 Radio Button Controls

Several panels provide radio button controls for setting parameters. A group of radio buttons (Figure 5-3) represents a "one-of-many" choice for a parameter (e.g., color is either red, white, or blue.) The labels identify the alternative settings for the parameter. The button for the currently selected alternative appears depressed into the panel; all other buttons in the group appear raised.

Figure 5-3 Sample Radio Button Group

To change the selected alternative in a radio button group, click the button for the desired alternative. The button appears depressed; the button for the previously selected alternative appears raised.

If all labels in the radio button group are grayed, the parameter cannot be changed because it is not currently relevant.

5.1.6 Check Box Controls

Several panels allow you to set parameters using check box controls. A check box is a small square button with an adjacent label that identifies the parameter. The button represents an "on-off" or "yes-no" choice for a parameter. A check box appears depressed and darkened to represent the "on" or "selected" setting, and appears raised and lightened to represent the "off" or "not selected" setting.

Figure 5-4 Sample Check Boxes

To toggle a check box to its alternate setting, click the button. That is, click an "off" check box to select it, and click an "on" check box to deselect it.

Check boxes may be clustered into a group on a panel like radio buttons as shown in Figure 5-4. However, the setting of each check box is independent of the others.

Check boxes are sometimes called CheckButtons.

5.1.7 OptionButtons and Option Menus

Many panels provide option menus for setting parameters. An option menu is a vertical list of options for a given parameter that appears when you click on an OptionButton. An OptionButton is a small hyphen-shaped button with an adjacent label. The label is dynamic, indicating the last option selected from the option menu. The button and the label are enclosed in a rectangular box that appears raised from the panel.

		

Figure 5-5 Sample Option Menu

An OptionButton and option menu are used to represent a "one-of-many" choice for a parameter, just like a radio button group. It is used instead of a radio button group when the number of alternative settings for a parameter is too large to permit displaying each alternative as a radio button.

To change the selected option for an OptionButton, click the OptionButton and the option menu will appear as shown in Figure 5-5. Click the desired option in the option menu. The option menu disappears, and the selected option appears as the new label for the OptionButton.

To hide the option menu without selecting any of the options, click the OptionButton again.

5.1.8 List Boxes

Several panels allow you to select one or more items from a scrolling list of items using a list box. A list box is a dark gray rectangular box that appears depressed in the panel. It has a vertical scroll bar along its right margin, and, sometimes, a horizontal scroll bar along its bottom margin. An example is shown in Figure 5-6.

To select an item from a list box, scroll until you find the item, and then click on it. The item becomes highlighted. To scroll the list one item at a time, click on the arrowheads at either end of the scroll bar. To scroll the list more quickly, drag the scroll bar up or down (or, for a horizontal scroll bar, left or right). Or, click in the depression between the scroll bar and one of the arrows.

Figure 5-6 Sample List Box

5.1.9 Drag-and-Drop Operations

In some situations, you can drag a GenSAA variable name or a graphic window (GW) name from a text drag-out box on one panel and drop it into a text drop-in box on another panel (Figure 5-7). By using this drag-and-drop operation, you can avoid entering the name from the keyboard.

To copy the contents of a drag-out box to a drop-in box, move the mouse pointer to the drag-out box, drag the mouse from the drag-out box to the drop-in box, and release the mouse button. A copy of the variable name or GW name in the drag-out box is "dropped" into the drop-in box.

Figure 5-7 Sample Drag-in and Drag-out Boxes

Drag-out and drop-in boxes are color coded to identify the types of names they can contain.

The colors visually indicate what and where you can drag-and-drop. For example, when you drag a name out of a magenta drag-out box, you can drop it only into a magenta drop-in box. The small arrows remind you which boxes are drag-out and which are drop-in.

A few panels contain a cyan colored image drop-in box. You can drag an image from the image palette and drop it into an image drop-in box.

5.2 GenSAA Workbench Main Panel

When you start the GenSAA Workbench, the first panel to appear is the GenSAA Workbench main panel (Figure 5-8). This small panel provides access to all Workbench top-level controls and is closed only when you exit the Workbench. You can minimize (iconify) it by clicking its minimize button or selecting Minimize from its window menu.

Figure 5-8 GenSAA Workbench Main Panel

Below the title bar is the GenSAA Workbench MenuBar. The commands on the File, Tools, Utilities, and X-Applications menus are described in the following sections.

The Mission text output box contains the name of the spacecraft mission the expert system will support. Several expert systems may be developed to support the same mission. The Expert System text output box contains the name of the expert system that is currently open.

5.2.1 The File Menu

The File menu lists commands for creating, opening, closing, saving, and deleting expert systems, and for exiting the GenSAA Workbench. The following subsections identify these commands and describe their functions.

5.2.1.1 New...

Select this command to create a new GenSAA expert system.

=> To create a new expert system:

1. Select New... from the File menu.

The Expert System Resources panel appears as shown in Figure 5-9. Use this panel to specify the expert system name, the mission name, and six directory paths.

Figure 5-9 Expert System Resources Panel

The directory paths are used to locate files needed when the expert system is being constructed in the Workbench, and when the expert system is executing in the runtime environment. Default paths are provided based on environment variables defined in the rungwb command file used to start the Workbench. (For more information on these environment variables, see Section 7, System Administration.)

2. Enter the Mission Name.

The mission name is the name of the spacecraft mission that the expert system will support. The mission name will be shown in the Mission text box on the GenSAA Workbench main panel. The mission name determines the filenames used for the SVT and the Master EGG Data Base.

3. Enter the Expert System Name.

The expert system name is used to identify the expert system to be opened in the Workbench. The expert system name will be shown in the Expert System text box on the GenSAA Workbench main panel.

4. Change the Expert System Path, if necessary.

Several files are created to contain the definition of a GenSAA expert system. These files are placed in the directory you specify as the Expert System Path. (See Appendix B for more information about these files.) The default path shown is the current working directory.

5. Enter the directory paths for the System Variable Table and the Master EGG Data Base.

The SVT directory path specifies the location of the System Variable Table file for the mission. All expert systems for a given mission share the same SVT.

The Master EGG Data Base directory path specifies the location of the Master EGG Data Base file for the mission. All expert systems for a given mission share the same Master EGG Data Base. (NOTE: Master EGG Data Bases are not currently implemented.)

The value of the environment variable MISSION_HOME specified in the command file rungwb is used as the default for both of these directory paths. Edit the text boxes to change the directory paths if necessary.

6. Enter the directory paths for the Image Palette Objects, DDGO Palette Objects, and UIGO Palette Objects.

The Image Palette Objects directory path specifies the location of the files for the Image Palette. Each file in this directory defines an image that appears in the Image Palette.

The DDGO Palette Objects directory path specifies the location of the files for the DDGO Palette. Each file in this directory defines a DDGO that appears in the DDGO Palette.

The UIGO Palette Objects directory path specifies the location of the files for the UIGO Palette. Each file in this directory defines a UIGO that appears in the UIGO Palette.

The value of the environment variable PALETTE_HOME specified in the command file rungwb is used as the default for all three of these directory paths. To use other palettes, edit the text boxes to change the directory paths.

7. Click the OK button.

The Expert System Resources panel disappears, and a message box appears to indicate that the expert system is being created. When the message box disappears, the expert system is open and you can continue work. The mission and expert system names appear in the text boxes on the GenSAA Workbench main panel.

To dismiss the Expert System Resources panel without creating an expert system, click the Close button.

5.2.1.2 Open...

Select this command to open an existing GenSAA expert system. You may open a partially built expert system to continue its development or a completed expert system to enhance or modify it.

=> To open an expert system:

1. Select Open... from the File menu.

The Expert System Open panel appears (Figure 5-10). This panel is a file selection box used to select the directory name and the expert system filename. The Filter text box shows the current directory. The Directories list shows all subdirectories in the current directory, and the Expert Systems list shows all GenSAA expert system files the current directory.

The Directories and Expert Systems list boxes have scroll bars at their right and bottom margins. Use these scroll bars to show directory or expert system names that extend beyond the edges of the list box.

2. Change the current directory, if necessary.

Using the Directories list, navigate up and down the directory tree until you reach the desired directory. To descend in the directory tree, click on a subdirectory in the Directories list and then click the Filter button. The subdirectory becomes the new current directory. To ascend in the directory tree, click on the directory ending in "/.." in the Directories list and then click the Filter button. The parent becomes the new current directory. Continue until the desired current directory is found. The Expert Systems list is updated to show all expert systems in the current directory.

3. Scroll the Expert Systems list and select the desired expert system.

The expert system name is shown in the Selected Expert System text box. Alternately, you can type the expert system name directly into the Selected Expert System text box.

Figure 5-10 Expert System OPEN Panel

4. Click the Open button to open the expert system.

The selected expert system is opened and the Expert System OPEN panel disappears.

The Expert System text box on the GenSAA Workbench main panel shows the name of the expert system you opened. The Mission text box shows the mission name that is associated with the expert system.

To dismiss the Expert System OPEN panel without opening an expert system, click the Close button.

5.2.1.3 Close

Select this command to close an open expert system.

=> To close an open expert system:

If you have made changes to the expert system and have not saved them with a Save or Save As... command, a warning dialog box appears asking if you want to save before closing. Click the Save button to have the expert system saved and then closed. Click the DoNotSave button to close without saving. Click the Cancel button to cancel the Close command, and keep the expert system open.

5.2.1.4 Save

Select this command to save the changes made to an open expert system. Use this command occasionally during a Workbench session to save your work and limit the loss that might result from a power failure or other system problem.

=> To save changes made to an expert system:

The expert system as modified in the Workbench is copied to its disk file. The previous contents of the file are lost. The expert system remains open.

The Workbench prompts you to Save by displaying a dialog box if the expert system has been modified and SAVEINTERVAL seconds have passed. SAVEINTERVAL is initially set to 600 seconds (10 minutes). You can change the value of SAVEINTERVAL by modifying the command file rungwb. For details, see Section 7.1. When the dialog box appears, click its Save Now button to cause the expert system to be saved; click Do Not Save to dismiss the dialog box without saving.

Whenever the Workbench performs a Save, it first copies the current contents of the file ESname.uif to the file ESname.uif.bak. ESname is the name of the expert system, and ESname.uif is the file containing the user interface specification for the expert system. (See Appendix B for more information about filenames.) This automatic backup feature allows you to recover from a system problem that may occur during the Save operation. To recover from such a problem, rename ESname.uif.bak to ESname.uif, and restart the Workbench. (NOTE: This will only recover changes made using the User Interface Builder. It will not recover changes made using the Rule Builder or the Data Manager.)

5.2.1.5 Save As... (Future Capability)

Select this command to save an open expert system into another file.

=> To save an open expert system to another file:

1. Select Save As... from the File menu.

The Expert System Save As panel appears. This file selection box is very similar to the one described with the Open... command above.

2. Change the current directory, if necessary.

Use the same approach described under the Open... command. The Expert Systems list is updated to show all expert systems in the current directory.

3. To save to an existing file, select the expert system name from the Expert Systems list.

The expert system file name is shown in the Selected Expert System text box. Alternately, you can type the expert system file name directly into the Selected Expert System text box.

4. If you want to save to a new file, type the new expert system file name into the Selected Expert System text box.

5. Click the Save button to save the expert system to the specified file.

The open expert system, with any changes made in the Workbench, is copied to the file. The previous contents of the file are lost. The expert system remains open with the new name.

To dismiss the Expert System Save As panel without saving the expert system, click the Close button.

5.2.1.6 Revert to Saved

Select this command to reload the open expert system from its disk file. This allows you to revert to the state of the expert system at the time it was last saved. All changes made in the Workbench after the last Save command are lost.

=> To reload the open expert system from its disk file:

1. Select Revert to Saved from the File menu.

2. Select Revert from the dialog box to confirm that you want to lose any changes that have been made or Cancel if you decide not to reload the expert system from disk.

5.2.1.7 Delete...

Select this command to delete an expert system. (If the expert system is currently open, it must be closed before it can be deleted.)

=> To delete an expert system:

1. Select Delete... from the File menu.

The Expert System DELETE panel appears (Figure 5-11). This file selection box is very similar to the one described under the Open... command above.

2. Change the current directory, if necessary.

Use the same approach described under the Open... command. The Expert Systems list is updated to show all expert systems in the current directory.

3. Scroll the Expert Systems list and select the desired expert system.

The expert system file name is shown in the Selected Expert System text box. Alternately, you can type the expert system file name directly into the Selected Expert System text box.

4. Click the Delete button.

A warning dialog box is displayed indicating that the expert system will be deleted. Click the Delete button on the dialog box to confirm that the expert system should be deleted. Click the Cancel button to cancel the Delete command without deleting the expert system.

To dismiss the Expert System DELETE panel without deleting the expert system, click the Close button.

Figure 5-11 Expert System DELETE Panel

5.2.1.8 Import Ascii ES...

This command is used to import an expert system that has been saved in text format using the Export Ascii ES command. It can be useful for transferring expert systems from one hardware platform to another.

To import an expert system:

1. Select Import Ascii ES... from the File menu.

The Expert System Import panel appears. This file selection box operates the same as the one described under the Open... command above.

2. Change the current directory, if necessary.

Use the same approach described under the Open... command. The Expert Systems list is updated to show all expert systems in the current directory. (To see only those which have been exported as ASCII files, substitute "*.asc" for "*.ges" in the Filter string. You must then change this string back before attempting to open the expert system.)

3. Scroll the Expert Systems list and select the desired expert system.

The expert system file name is shown in the Selected Expert System text box. Alternately, you can type the expert system file name directly into the Selected Expert System text box.

4. Click the Import button.

The expert system is opened and the Expert System Import panel disappears.

To dismiss the Expert System Import panel without deleting the expert system, click the Close button.

5.2.1.9 Export Ascii ES

This command is used to write the expert system files in ASCII format. It can be useful for transporting expert systems to other computers.

=> To export an open expert system:

1. Select Export Ascii ES from the File menu.

This will create an additional ASCII format file with the same filename as the other expert system files. Since this file contains a readable version of the expert system display specifications, it can also be useful for problem diagnosis.

5.2.1.10 Exit

Select this command to exit from the GenSAA Workbench.

=> To exit from the GenSAA Workbench:

If you have made changes to an open expert system and have not saved them with a Save or Save As... command, a warning dialog box appears asking if you want to save before closing. Click the Save button to have the expert system saved before exiting. Click the Do Not Save button to exit without saving. Click the Cancel button to cancel the Exit command, and keep the expert system open.

5.2.2 The Tools Menu

The Tools menu lists the three major tools of the GenSAA Workbench. Use these commands to open the tools for use. Each tool has a main control panel that appears when you open the tool. Each of the main panels has a Close button that is used to close the tool.

You will often find it useful to open more than one tool at a time, for example to drag a variable name from the Data Manager to the Rule Builder or User Interface Builder. Workbench panels initially appear in locations that minimize the amount of panel overlap, but sometimes overlapping occurs. Move, raise, or lower panels as necessary to access panels that are temporarily obscured.

5.2.2.1 Data Manager...

Select this command to open the Data Manager tool.

=> To open the Data Manager:

The Data Manager control panel appears.

5.2.2.2 Rule Builder...

Select this command to open the Rule Builder tool.

=> To open the Rule Builder:

The Rule Editor control panel appears.

5.2.2.3 User Interface Builder...

Select this command to open the User Interface Builder tool.

=> To open the User Interface Builder:

The User Interface Builder control panel appears, and the WorkSpace for the expert system is displayed. The WorkSpace is a window that contains the graphic items that you create for display to the expert system user. The WorkSpace title bar contains the expert system name.

5.2.2.4 Expert System Resources...

Select this command to view the names of several resources associated with a GenSAA expert system. The resource names are set when an expert system is created. They can be viewed at any time.

=> To view expert system resources for an open expert system:

The Expert System Resources panel appears. The panel identifies the mission name, the expert system name, and directory paths for the expert system, the SVT, the Master EGG Data Base, and the three palettes. The Expert System Resources panel is described in more detail with the New... command.

(NOTE: Currently, the resource names for an existing expert system can only be changed by editing the file ESname.ges, where ESname is the name of the expert system.)

5.2.3 The Utilities Menu

The Utilities menu contains commands for starting several utilities that are needed to complete the development of a GenSAA expert system.

5.2.3.1 Reports...

Select this command to generate reports that fully describe the open expert system. Three reports can be generated: a Data Specification report, a Rulebase Specification report, and a User Interface Specification report. These reports describe the characteristics of the expert system that you defined using the Data Manager, the Rule Builder, and User Interface Builder, respectively.

Use the GenSAA Workbench Reports panel to select the reports you want and to specify the level of detail generated in each report. All reports generated are written to a single ASCII file that can be browsed using a UNIX text editor such as "vi". Appendix D describes the format and content of the reports.

(NOTE: The Reports function is not fully supported in this release. The Reports command generates an ASCII report file ESname .rep that contains a full User Interface Specification report. Subsets of the full report can be selected on the Reports panel, but the full User Interface Specification report is always generated. The rulebase and user interface cross reference functions are not implemented for the Data Specification and Rulebase Specification reports.)

=> To generate reports for an open expert system:

1. Select Reports... from the Utilities menu.

The GenSAA Workbench Reports panel appears (Figure 5-12).

2. If you want a data specification report, select the Data Specification check box, and select the report details parameters as described below.

3. If you want a rulebase specification report, select the Rulebase Specification check box, and select the report details parameters as described later in this section.

4. If you want a user interface specification report, select the User Interface Specification check box, and select the report details parameters as described later in this section.

5. Click the Generate Report button.

The reports are generated and written to the file ESname.rep, where Esname is the expert system name. The GenSAA Workbench Reports panel disappears.

To close the GenSAA Workbench Reports panel without generating any reports, click the Close button on the panel.

Figure 5-12 GenSAA Workbench Reports Panel

The Data Specification report lists variables defined in the expert system, and optionally provides several kinds of information about them.

=> To set report details parameters for a Data Specification report:

1. Select the data types of the variables to be included in the report.

Select any combination of Mission, Inferred, User-Defined, and EGG (Externally-Generated GenSAA) using their check boxes. The report will include only variables of the data types selected.

2. If desired, specify a restriction on variable names by entering a string in the text entry box labeled "Generic Search String".

The string "DECOM" will match any variable name that begins with the characters "DECOM", such as DECOM10. The default value for the string is "*", which matches all variable names.

3. If you want details for all variables listed, select the "Include data details" check box.

The details generated are the same as those displayed in the Data Details panel of the Data Manager tool.

4. If you want a cross-reference of variables to rules, select the "Generate rulebase cross-reference" check box. (Future capability)

For each variable, the cross-reference lists all rules that include the variable name.

5. If you want a cross-reference of variables to graphic objects, select the "Generate user interface cross-reference" check box. (Future capability)

For each variable, the cross-reference lists all graphic objects that are associated with the variable.

The Rulebase Specification report lists the rules defined in the expert system, and optionally provides several kinds of information about them.

=> To set report details parameters for a Rulebase Specification report:

1. If desired, specify a restriction on rule names by entering a string in the text entry box labeled "Generic Search String". (NOTE: This capability is currently not implemented.)

2. If you want the right-hand side (i.e., the "actions" portion) of the rules to be listed in the report, select the "Include rule `then' specifications" check box.

3. If you want a cross-reference of rules to graphic objects, select the "Generate user interface cross-reference" check box.

For each rule, the cross-reference lists all graphic objects that are associated with variable names included in the rule.

The User Interface Specification report lists the graphic windows (GWs) and graphic objects (GOs) defined in the expert system, and, optionally, provides several kinds of information about them.

=> To set report detail parameters for a User Interface Specification report:

1. Set the level of detail for GWs and GOs. (Future Capability)

Use the two OptionButtons under the label "Level of Detail" to select the level of reporting detail you desire. The options on each Option Menu are Full Detail, Synopsis, and Minimum.

2. Set the report range for GWs and GOs. (Future Capability)

Use the two OptionButtons under the label "Report Range" to select the number of GWs and GOs you want listed. The options on each Option Menu are All, None, and One. Select All to include all GWs or GOs in the report. Select One to include only one; type the name of the GW or GO in the text entry box under the label Object Name.

5.2.3.2 Verify Specifications

Select this command to verify the internal consistency of the open expert system.

=> To verify the internal consistency of the open expert system:

The expert system is verified, and a verification report is written to the file ESname.ver, where ESname is the expert system name. The report identifies any inconsistencies found. A summary of the verification is written at the end of the report. The file is displayed in an xterm window with the vi editor. You can browse through the file using vi editor commands.

The Verify Specifications utility reports any of the following warning and error conditions that it finds in the expert system. In each case, the name of the relevant graphic component or other item is listed.

	-- The WorkSpace is empty (contains no graphic windows).

-- A GW contains no child GOs.

-- The WorkSpace minimum or maximum dimensions are questionable (height or width < 100, or > display size).

-- A graphic object's dimensions are questionable (height or width < 10).

-- A graphic object's position is questionable (x or y < 0).

-- Graphic object foreground color = background color

-- Graphic object contains no information box text

-- UIGO does not reference any user-defined data point.

-- Data point is referenced by multiple UIGOs.

-- Graphic window contains no information box text.

-- A variable defined in the Data Manager is not referenced by any rule or GO. (NOTE: This capability is not completely supported in this release. Variables are not checked for use in the rule base, so this message will appear if a variable is only used in the rule base.)

	-- The Information Box foreground and background colors are the
	   same.

-- The WorkSpace icon bitmap file cannot be found.

-- The associated data variable for a GO is not defined in the Data Manager.

-- A GW name referenced in the Linked Windows list of a DDGO does not exist.

-- An Image DDGO references an image file name that cannot be found.

-- A DDGO behavior rule references an image file name that cannot be found.

-- Behavior rules are defined for a GO with no associated data value.

-- Data type of associated data is not valid for behavior rules.

-- Data point referenced MUST be of type `user-defined'.

-- Data point referenced is not a valid type for this GO.

When an expert system is successfully verified with no errors, the ESname.ges file is updated with a flag that indicates that the verification was performed. When you run a GenSAA expert system, the runtime environment first checks for this flag. If the verification flag is not found, a dialog box is presented indicating that the expert system has not been verified. When the dialog box is displayed, you can choose to either continue or terminate execution. In most cases, verification errors should be corrected to avoid unpredictable behavior at runtime.

5.2.3.3 Update Master EGG DB (Future Capability)

Select this command to update the master EGG data base for the current mission. Each mission has its own master EGG data base, which is shared by all GenSAA expert systems supporting that mission. The master EGG data base lists all inferred and user-defined variables whose values are shared between GenSAA expert systems at runtime.

5.2.4 The X-Applications Menu

This menu contains several commands that start other X Windows application programs that you may use during a GenSAA Workbench session. These applications appear in their own windows, and run completely independent of the GenSAA Workbench.

5.2.4.1 X-terminal

Select this command to start a copy of the X Windows application xterm. With this application you can use the UNIX shell to examine directories and files, access mail, and perform other standard UNIX user functions.

fi To start an xterm application:

The xterm application begins and appears in its own window.

To terminate the xterm application, type the UNIX shell command "exit" within the xterm window. Or, select Close from its window menu. The xterm application terminates and its window disappears.

5.2.4.2 Bitmap Editor

Select this command to start the Bitmap Editor. This editor is used to create or modify two-color (1 bit depth) pictures and icons that can be placed in the UIB Image Palette. NOTE: This application is not currently available on HP workstations. See Appendix E.2, Bitmap and Pixmap/Image Editors for more information about this application.

=> To start the Bitmap Editor:

The Bitmap Editor begins and appears in its own window.

To terminate the Bitmap Editor, select Close from its window menu. The Bitmap Editor terminates and its window disappears.

5.2.4.3 Pixmap/Image Editor

Select this command to start the Pixmap/Image Editor. This editor is used to create or modify multicolor (8 bit depth) pictures and icons that can be placed in the UIB Image Palette. See Appendix E, Utilities, for more information about this application.

=> To start the Pixmap/Image Editor:

The Pixmap/Image Editor begins and appears in its own window.

To terminate the Pixmap/Image Editor, click the square button at the upper left corner of its window. The editor terminates and its window disappears.

5.2.5 The Help Menu

The help menu contains information on using the GenSAA Workbench.

5.2.5.1 On Version ...

Select this command to display a dialog box that identifies the version number of the GenSAA Workbench.

=> To obtain information about this version of GenSAA:

Figure 5-13 About GenSAA Panel

To close the information box, click on its Close button.

5.3 Using the Data Manager

The Data Manager is used to construct and edit the four lists of variables that are used by a GenSAA expert system. These lists compose the Data Interface Specification for the expert system. All variables that will be received from TPOCC, exchanged with other GenSAA expert systems, or associated with Graphic Objects must be specified using the Data Manager.

The four lists are described as follows:

When you open the Data Manager (by selecting the Data Manager... command from the Tools menu), the Data Manager control panel appears as shown in Figure 5-14. This panel contains two large list boxes that used to construct the four variable lists. Details about how to use the list boxes are described in the following sections. In general, however, they are used as follows:

Figure 5-14 Data Manager Panel

To close the Data Manager, click the Close button on the Data Manager control panel. When you close the Data Manager, all panels related to the Data Manager are removed from the screen.

5.3.1 Getting Started

At the top of the Data Manager control panel, the Expert System text output box shows the name of the open expert system. The remainder of the panel consists of two large list boxes, several pushbuttons, a drag-out text box, and an option menu.

To start working with the Data Manager, select the data variable list you want to construct or edit.

=> To select the data list:

1. Click on the OptionButton next to the label GenSAA Type.

An option menu appears containing the four choices: Mission, Inferred, User-Defined, and EGG.

2. Select the desired data list.

The Expert System Data list box is updated to show the current contents of the selected data list. The list box is blank if the list is empty.

When you are working with the Mission data list, the Available External Data list box contains the names of all variables in the TPOCC SVT for the mission. When you are working with the EGG data list, the list box contains the names of all variables in the Master EGG Data Base for the mission. The Available External Data list box is empty when you are working with the Inferred and User-Defined data lists.

5.3.2 Constructing the Mission Data List

To create or modify the Mission data variable list, first select Mission from the GenSAA Type option menu. The names of all variables in the SVT appear in the Available External Data list box. The subset of these variables that have been selected for this expert system appear in the Expert System Data list box.

=> To add a mission variable:

1. Scroll the Available External Data list to find a desired variable, and click on it to select it.

Each item in the list contains two strings, separated by a "#". The first string is the name of the mission variable; the second is the name of its Owner Process in TPOCC.

2. Click the Load (right arrow) button to add the selected variable in the Available External Data list to the Expert System Data list.

The loaded variable name and owner process name appear in the Expert System Data list box. The list is always sorted alphabetically by variable name.

=> To remove a mission variable:

1. Scroll the Expert System Data list to find the variable, and click on it to select it.

2. Click the Remove button.

The variable is removed from the Expert System Data list.

The SVT contains a set of detailed information about each variable. These details are copied into your expert system when you load a variable into the Mission data variable list. You can view the details for any variable in the SVT or any variable you have loaded into the Expert System Data list.

=> To view the details for a variable in the SVT or in the mission data list:

1. Click on the desired SVT variable name in the Available External Data list box to select it.

Or, click on the desired mission variable name in the Expert System Data list box to select it.

You may need to click and toggle the selection off and on again if the desired variable name is already highlighted.

2. Click the Details... button.

The Data Details panel appears (Figure 5-15) showing details for the selected variable.

Figure 5-15 Data Details Panel

The Data Details panel displays the following information (you cannot change these fields):

The Variable Name text output box identifies the variable whose details are displayed.

The Owner Process text output box identifies the TPOCC process that is the data source for this variable.

The GenSAA Type text output box indicates whether the variable is Mission, Inferred, User-Defined, or EGG.

The Server Host text output box identifies the computer system that hosts the TPOCC Data Server that provides data updates for this variable.

The Data Type OptionButton identifies the TPOCC data type of the mission variable. (Although this item is displayed in an option menu, there is only one option. The data type of a mission variable is defined by TPOCC and cannot be changed.) Appendix C, Variable Data Types, contains a list of all the TPOCC data types that may appear here.

The # of Elements text output box indicates whether the variable is scalar or an array; for variables of type C_STRING, it indicates the maximum length of the string.

The Export to Server radio button is grayed because it is not relevant for mission variables. (Mission variable updates cannot be sent to the GenSAA Data Server.)

The Description text output box displays a short description of the variable.

Some mission variables are called discrete state variables, because their values can be interpreted as state name indexes. A set of state names is defined for a discrete state variable, and each state name corresponds to a range of values. This information is shown for a discrete state mission variable at the bottom of the Data Details panel. (NOTE: Discrete state mission variables have data type LONG.)

The # of States text output box indicates the number of states defined, and the State Names list box shows their names. When you select a state name in the list box, the Low Value and High Value text output boxes indicate the value range for the state. The State Name text output box mirrors the selected state name.

You can set parameters on the Data Details panel that affect how mission data variable updates are received.

=> To set details for a variable in the mission data list:

1. Click on the desired mission variable name in the Expert System Data list box to select it.

2. Click the Details... button to display the Data Details panel.

3. Set the Element #, Update Policy, Update Rate, Time Tag, and CVT Component specifications as described below.

4. Click the Apply button to make the changes permanent and keep the Data Details panel open.

Or, click the OK button to apply the changes and close the panel.

Or, click the Close button to close the panel without applying any changes made after you last clicked Apply.

The Use Element # text input box is used only for arrays. It specifies the element of the array that will appear in the Expert System data list. Multiple array elements can be specified for a single mission variable.

Use the Update Policy option menu to specify when data updates are received. Choose Asynchronous to receive updates regularly at the interval specified by the Update Rate. Choose Synchronous to receive a data update immediately whenever a new data value is provided by the TPOCC data source. Synchronous update policy works only if the source of the data is set up to send synchronous data and it is only available for mission variables with a data type beginning with CVT_. (The option menu indicates No Policy before you select asynchronous or synchronous.)

The Update Rate text output box indicates the interval, in tenths of seconds, at which data updates are received from the TPOCC Data Server, if the Update Policy is asynchronous. If the Update Policy is synchronous, Update Rate indicates the sampling rate. For example, an Update Rate of 1 means that every update will be received; 2 means that every second update will be received, etc.

Use the Time Tag option menu to specify whether a Time Tag fact should be sent to the inference engine with each data update. Time tags are also needed whenever time-based DDGOs are being used, such as Time and XTGraph. (Time Tag facts can be requested for mission variables that have a data type beginning with CVT_. They can also be obtained for inferred variables by setting the environment variable GENSAA_TIMETAG_INFERRED to ON). The options available are: None, Local GMT, Ground Receipt time, and Spacecraft time. If you select an option other than None, then during runtime a Time Tag fact will be asserted in addition to the value fact each time a value update for the variable is received from TPOCC.

For mission variables having a data type beginning with CVT_ , the TPOCC Data Server sends a data quality and limit status indication along with the value. The status indication is routed to the inference engine, where it is stored as a LimitStatus fact. The LimitStatus for a mission variable is always one of the following: InLimits, LimitsInhibited, HighWarning, LowWarning, HighAlarm, LowAlarm, or BadQuality.

NOTE: If LimitStatus for a mission variable is BadQuality, the value of the variable is still displayed in DDGOs, but it is not sent to the inference engine. In the inference engine, the previous value of the variable is retracted, and the new value is asserted as "BadQuality".

At each data update, the TPOCC Data Server sends two different values for mission variables having a data type beginning with CVT_: a raw value, and a converted value. The converted value is expressed in engineering units (EU).

The CVT Component option menu is used to specify the component of the CVT variable to be used. The CVT options are: Status, Raw, Converted, and Conv/Raw. Only one component of the data type can currently be selected for use in an expert system. The CVT component options are described below:

If "status" is selected, the status word will be used for behavior rules and expert system rules, but the raw value will be displayed when this variable is connected to a DDGO.

If "converted" is selected and the EU valid flag is not set, a warning will appear in the xterm window that the expert system was started from.

5.3.3 Constructing User-Defined and Inferred Data Lists

To create or modify the User-Defined or Inferred data list, first select User-Defined or Inferred from the GenSAA Type option menu. The names of the variables you have created appear in the Expert System Data list. (The Available External Data list is not used, and remains empty.)

=> To add a user-defined or inferred variable:

1. Click the New... button to create a new user-defined or inferred variable.

The Data Details panel appears.

2. Set the following items on the Data Details panel, as described below: Variable Name, Data Type, # of Elements, Description, and Export to Server.

3. If you want the variable to be a discrete-state variable, set Data Type to LONG, and set the items in the Discrete State Specification part of the Data Details panel as described below. The value of a discrete-state variable is one of a set of state names defined for that variable (such as "OFF" and "ON").

4. Click the OK button to add the new user-defined or inferred variable to the data list.

The Data Details panel is dismissed, and the new variable appears in the Expert System Data list box. Click the Apply button instead of OK to add the variable to the list, but keep the Data Details panel open. Click the Close button to dismiss the panel without adding the variable.

The Data Details panel contains several items that you must set to define a new variable; default values are suggested for some of them. These text boxes are shown in light gray. Other items on the panel are automatically set to predefined values that you cannot change. These text boxes are shown in dark gray. A few items are not relevant to user-defined and inferred variables; these items are grayed out.

Type the name of the new variable into the Variable Name text box. A unique default name is in the box when the Data Details panel appears.

The Owner Process is automatically set to the expert system name, and cannot be changed.

The contents of the GenSAA Type text box on the Data Details panel always matches the selection in the GenSAA Type option menu on the Data Manager panel.

Pull down the Data Type option menu, and select one of the following:

Set the # of Elements item to specify the maximum length of a variable of type C_STRING. This item is not relevant for other types of variables.

Use the Export to Server radio button to specify if you want this variable to be included in the Master EGG Data Base for this mission. Yes indicates that during runtime the value of this variable will be sent to the GenSAA Data Server whenever the value is updated. The Master EGG Data Base is not updated until you select Update Master EGG Data Base from the Utilities menu on the GenSAA Workbench main panel. (NOTE: Export to Server is not supported in this release.)

Type a short description of the new variable into the Description text box.

The Server Host, Time Tag, Update Policy, Update Rate, and CVT Component items are not relevant for user-defined and inferred variables.

Use the Discrete State Specification area to define the state names for a discrete-state variable. You must set Data Type to LONG for a discrete-state variable.

=> To add a state name for a discrete-state variable:

1. Click the New State button.

A unique default state name appears in the State Name text box, and default values appear in the Low Value and High Value boxes. The low and high values define the range of integers that correspond to the state name.

2. Type the desired state name in the State Name text box.

3. Edit the Low Value and High Value text boxes, as described below.

4. Click the Save (left arrow) button.

The new state name appears in alphabetical order in the State Names list box. The # of States text box is updated to show the number of states you have defined.

You can use discrete-state variables for two different purposes: to represent logical conditions, or to represent range names:

then set the Low and High Value for each state name to the corresponding range of values for that state description.

=> To view the low and high values for a state name:

The Low and High Value text boxes are updated with the values defined for the selected state name.

=> To remove a state name:

1. Click on the name in the State Names list box to select it.

2. Click the Remove button.

You remove a variable from the User-Defined or Inferred data list in essentially the same way as a mission variable:

=> To remove a user-defined or inferred variable:

1. Scroll the Expert System Data list to find the variable and select it.

2. Click the Remove button.

The variable is removed from the User-Defined or Inferred data list.

If Export to Server was set to Yes for this variable, then the variable is marked for removal from the Master EGG Data Base. The variable is actually removed when you perform the Update Master EGG Data Base command. (NOTE: Export to Server is not supported in this release.)

You can view and optionally modify the details for a variable you have previously defined as follows:

=> To view or modify the details of a user-defined or inferred variable:

1. Scroll the Expert System Data list to find the variable, and select it.

2. Click the Details... button.

The Data Details panel appears, showing details for the selected variable.

3. Edit any of the items that can be changed.

4. Click the Apply button to make the changes permanent and keep the Data Details panel open.

Or, click the OK button to apply the changes and close the panel.

Or, click the Close button to close the panel without applying any changes made after you last clicked Apply.

5.3.4 Constructing the EGG Data List (Future Capability)

To create or modify the EGG data variable list, first select EGG from the GenSAA Type option menu. The names of all variables in the Master EGG Data Base appear in the Available External Data list box. The subset of these variables that have been selected for this expert system appear in the Expert System Data list box.

You add an EGG data variable, remove an EGG data variable, and view the data details for an EGG data variable in essentially the same way as you perform these actions for a mission data variable. See Section 5.3.2, Constructing the Mission Data List, for more information. The few differences between constructing the EGG data and mission data lists are described below.

The Owner Process text output box identifies the GenSAA expert system that generates the EGG data variable.

The Server Host text output box identifies the computer system that hosts the GenSAA Data Server.

The Data Type option button indicates the data type of the variable as defined in the generating GenSAA expert system.

The Update Rate is not relevant to EGG data variables, and is left blank.

The Update Policy is always synchronous. When the EGG data variable is changed in the owner GenSAA expert system, the updated value is immediately distributed via the GenSAA Data Server to all receiving expert systems.

You cannot set Time Tags for EGG data variables.

5.3.5 Working With Data Lists

The following operations apply to all four types of data lists.

=> To quickly find a variable name in either list box:

1. Click the Find... button.

The Data Manager Find panel appears (Figure 5-16).

2. Set the Search In radio buttons to search either the Available External Data list or the Expert System Data list.

3. Type a search string in the Search For text input box. The search is case-sensitive.

4. Click the Find button to begin searching.

The first variable name to match the search pattern is highlighted in the list box, and the search is ended.

5. Click the Again button to search for the next variable name that matches the search pattern.

6. Click the Close button to dismiss the Data Manager Find panel.

Figure 5-16 Data Manager Find Panel

=> To get details about a variable in a data list:

1. Scroll the Available External Data list or the Expert System Data list to find the desired variable, and click on it to select it.

2. Click the Details... button.

=> To remove a variable from a data list:

1. Scroll the Expert System Data list to find the variable, and click on it to select it.

2. Click the Remove button.

You can drag a variable name from any of the four data lists to a panel in the Rule Builder or UIB. Using this drag-and-drop feature, you can easily use variable names in rules and associate variables with GOs without the possibility of misspellings.

=> To drag a variable name to another panel:

1. Click on the variable name in the Expert System Data list.

The variable name appears in the magenta text drag-out box on the Data Manager panel.

2. Drag the variable name to a magenta text drag-in box on a panel in the Rule Builder or the UIB.

5.3.6 Handling Bad Quality and No Data Conditions

This section describes an approach to handling bad quality and no data conditions. These are special cases for TPOCC telemetry variables of type CVT in which a non-numeric value is assigned by GenSAA. Because of the approach GenSAA uses for handling real-time data, special CLIPS rules are required to animate GOs on your user interface and send messages to the Message Window when these conditions are detected. These rules form what is called a Bad Quality-No Data Model which is described in this section. If your application has no requirements regarding these special cases then there is no need to incorporate this model into your rulebase since any GenSAA expert system built with release 4.2, or a subsequent release, will automatically ignore both conditions.

If you are using release 4.0 or 4.1 then the truth maintenance section of your rulebase will require some modifications before your GenSAA expert system will ignore bad quality and no data conditions. These modifications are also necessary if you want to incorporate a Bad Quality-No data Model into your expert system.

5.3.6.1 Preliminaries

This section describes how GenSAA handles CVT variables and associated status data when received from TPOCC.

5.3.6.2 Bad Quality and No Data Conditions in GenSAA

This section describes how GenSAA handles CVT variables and associated status data when bad quality and no data conditions are detected. This information is the basis for the rulebased approach used to implement a Bad Quality-No Data Model.

NOTE: Because in both cases GenSAA asserts a Mission fact with BadQuality in the value field, it is not possible to distinguish between bad quality and no data conditions based on the Mission fact alone. In addition a LimitStatus fact with a value field of BadQuality can only be obtained when the bad quality condition is detected but a LimitStatus fact with a value field of InLimits can also be obtained when the Mission fact has a valid numeric value in the value field. Thus, it is a combination of Mission and LimitStatus facts that indicates the bad quality or no data condition.

5.3.6.3 Bad Quality-No Data Model Requirements

This section describes the general requirements placed on a Bad Quality-No Data Model and the functionality the model should provide.

1. Ignore conditions when appropriate: If your application has no requirements to handle bad quality and no data conditions then the facts relating to these conditions should be automatically retracted from the fact list. In GenSAA this requirement is actually implemented in the Truth Maintenance Model.

2. Eliminate erroneous rule firings: If your application has rules expecting the value field of a Mission fact to be numeric then these rule must not fire on a non-numeric value. In GenSAA this requirement is actually implemented in the Truth Maintenance Model. This keeps you from having to specifically test for a numeric value with CLIPS syntax in rules where a numeric value is expected for a mission variable.

3. Detect any CVT variable status transition to and from Bad Quality: You may want to animate the user interface on every transition of this type and/or on any transition of this type. Either way the model must capture every occurrence.

4. Detect any CVT variable status transition to and from No Data: You may want to animate the user interface on every transition of this type and/or on any transition of this type. Either way the model must capture every occurrence. CVT variables are only assigned No Data before AOS so theoretically they can't transition to No Data, however, the model should not make this assumption.

5. Detect any CVT variable status transition between Bad Quality and No Data: You may want to animate the user interface on every transition of this type and/or on any transition of this type. Either way the model must capture every occurrence. There are theoretical constraints on these transitions similar to those mentioned above, however, the model should not make these assumptions.

5.3.6.4 A GenSAA Implementation of a Bad Quality-No Data Model

This section contains CLIPS rules that form a Bad Quality-No Data Model for a GenSAA expert system. For your application these rules should be tailored to meet your specific needs. This implementation of a Bad Quality-No Data Model is based on the following assumptions about the GenSAA expert system it is incorporated into:

1. The user interface has a GO which will flash when any CVT variable status indicates bad quality and will not appear when all CVT variable status does not indicate bad quality. The inferred variable badquality is associated with this GO. It is defined as type long and has states off and on. The GO also has 2 appropriately defined behaviors.

2. A message will appear on the Message Window indicating every transition to and from bad quality and show the variable name. A transition to bad quality is considered a warning and a transition from bad quality is considered status.

3. The user interface has a GO which will flash when any CVT variable status indicates no data and will not appear when all CVT variable status does not indicate no data. The inferred variable nodata is associated with this GO. It is defined as type long and has states off and on. The GO also has 2 appropriately defined behaviors.

4. A message will appear on the Message Window indicating every transition to and from no data and show the variable name. A transition to no data is considered a warning and a transition from no data is considered status.

5. An appropriate message will appear on the Message Window indicating every transition between bad quality and no data and show the variable name. These transitions will all be considered a warning.

The following rules form a Bad Quality-No Data Model given the above assumptions:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Bad Quality rule section

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defrule detect-each-transition-to-bad-quality "assert BadQuality-flag for variable"

(declare (salience 995))

(LimitStatus ?x BadQuality)

(not (BadQuality-flag ?x))

=>

(assert (BadQuality-flag ?x))

(SendMessage "MessageWindow" Warning

(str-cat ?x " status indicates BAD QUALITY!!")))

(defrule detect-each-transition-from-bad-quality "retract BadQuality-flag for variable"

(declare (salience 995))

(LimitStatus ?x ~BadQuality)

?o <- (BadQuality-flag ?x))

=>

(retract ?o)

(SendMessage "MessageWindow" Status

(str-cat ?x " status is no longer BAD QUALITY!!")))

(defrule turn-bad-quality-icon-on "any BadQuality-flag turns on icon"

(declare (salience 995)

(BadQuality-flag ?)

?o <- (Inferred badquality off)

=>

(retract ?o)

(AssertFact "Inferred badquality on"))

(defrule turn-bad-quality-icon-off "no BadQuality-flag turns off icon"

(declare (salience 995)

?o <- (Inferred badquality on)

(not (BadQuality-flag ?))

=>

(retract ?o)

(AssertFact "Inferred badquality off"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Bad Quality to No Data rule section

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defrule detect-each-transition-bad-quality-to-no-data "swap flags for variable"

(declare (salience 996))

(Mission ?x BadQuality)

(LimitStatus ?x InLimits)

(not (NoData-flag ?x))

?o <- (BadQuality-flag ?x)

=>

(retract ?o)

(assert (NoData-flag ?x))

(SendMessage "MessageWindow" Warning

(str-cat ?x " status changed from BAD QUALITY to NO DATA!!")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; No Data rule section

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defrule detect-each-transition-to-no-data "assert NoData-flag for variable"

(declare (salience 995))

(Mission ?x BadQuality)

(LimitStatus ?x InLimits)

(not (NoData-flag ?x))

=>

(assert (NoData-flag ?x))

(SendMessage "MessageWindow" Warning

(str-cat ?x " status indicates NO DATA being received!!")))

(defrule detect-each-transition-from-no-data "retract NoData-flag for variable"

(declare (salience 995))

(Mission ?x ~BadQuality)

?o <- (NoData-flag ?x))

=>

(retract ?o)

(SendMessage "MessageWindow" Status

(str-cat ?x " status indicates data now being received!!")))

(defrule turn-no-data-icon-on "any NoData-flag turns on icon"

(declare (salience 995)

(NoData-flag ?)

?o <- (Inferred nodata off)

=>

(retract ?o)

(AssertFact "Inferred nodata on"))

(defrule turn-no-data-icon-off "no NoData-flag turns off icon"

(declare (salience 995)

?o <- (Inferred nodata on)

(not (NoData-flag ?))

=>

(retract ?o)

(AssertFact "Inferred nodata off"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; No Data to Bad Quality rule section

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defrule detect-each-transition-no-data-to-bad-quality "swap flags for variable"

(declare (salience 996))

(LimitStatus ?x BadQuality)

(not (BadQuality-flag ?x))

?o <- (NoData-flag ?x)

=>

(retract ?o)

(assert (BadQuality-flag ?x))

(SendMessage "MessageWindow" Warning

(str-cat ?x " status changed from NO DATA to BAD QUALITY!!")))

NOTE: The salience for these rules is very important. It allows them to fire after the Mission and LimitStatus facts are kept current and before the conditions indicating bad quality and no data are retracted. These actions are performed by the Truth Maintenance Model.

NOTE: If messages appearing in the Message Window are not desired then remove the SendMessage actions and close each modified rule after the preceding action.

NOTE: In addition to the above rules, the inferred variables badquality and nodata must be initialized to function properly. This can be accomplished with the following rule or an appropriate addition to your existing initialization rule:

(defrule initialize "assign default values as necessary"

?o <- (initial-fact)

=>

(retract ?o)

(AssertFact "Inferred badquality off")

(AssertFact "Inferred nodata off"))

5.3.6.5 Truth Maintenance Model Rules

This section shows the Truth Maintenance Model rules that implement requirements 1 and 2 for the Bad Quality-No Data Model. These rules have been incorporated into the HouseKeeping.clp file in release 4.2. If you are using this or a subsequent release then expert systems you develop with GenSAA will automatically ignore bad quality and no data conditions if you choose not to incorporate a Bad Quality-No Data Model into your rulebase.

If you are using release 4.0 or 4.1 and you want your expert system to ignore bad quality and no data conditions or you want to include a Bad Quality-No Data Model in your rulebase then the truth maintenance section of your rulebase will require the modifications described below. To add this capability to all future GenSAA expert systems built at your site, these modification should also be made to your HouseKeeping.clp file.

5.3.7 Constructing Event Filter Specifications

GenSAA has the capability to input event messages from the TPOCC event server and assert those events as CLIPS facts to the Inference Engine. The user can therefore use these facts in CLIPS rules. To create or modify the event filter specifications, select Event Filter Specification from the Data Manager window. This panel (Figure 5-17) will display any previously entered event filters in the list box at the bottom of the panel. These event filters can be added to, modified, or deleted by clicking the appropriate button on the panel. In order for the event filters to take effect in the ES, you must select Apply or OK. Apply will attach the event filters to the ES and leave the panel active. OK will attach the event filters to the ES and close the panel.

Figure 5-17 Event Filter Specification Panel

=> To add a new event filter:

1. Select the Event Number Range and enter the desired range.

2. Select the Message Type - All or Critical Only events within the range.

3. Select the Event Class - Include or Exclude events of the selected class.

4. Select Append to add the new event filter to the bottom of the list or Insert to add it at the top of the list.

5. Select Apply or OK to save the new event filter list.

=> To Modify an existing event filter:

1. Select the event filter from the box at the bottom of the panel and click Edit.

2. Modify the Event Number Range, Message Type, and/or Event Class and click Replace.

3. Select Apply or OK to save the new event filter list.

=> To Delete an existing event filter:

1. Select the event filter from the box at the bottom of the panel and click Delete.

2. Select Apply or OK to save the new event filter list.

A typical Event Filter might be:

-c -# 1008-1020 -e (tstol)

This indicates to select all critical events between event number 1008 and 1020 inclusive that are not TSTOL events.

=> To Specify this Event Filter:

1. Select All between and (inclusive) from the Event Number Range portion of the panel.

2. Enter 1008 in the top box and 1020 in the bottom box.

3. Select Critical Only.

4. Select Event Class tstol and select Exclude.

5. Select Insert to add the event filter to the event list in the bottom window.

6. Select Apply or OK to save the new event filter specification.

Once the event filters are specified and the ES is saved, event facts will be asserted onto the CLIPS fact list in the IEP. The format of these event facts is as follows:

(event ddd-hh:mm:ss.s seconds type number "Message text")

Where:

event is the fact type keyword.
ddd-hh:mm:ss.s is the day of year, hour, minute, seconds time tag of the message.
seconds is the time tag in seconds since January 1, 1970.
type is the message type --
(N = normal, Y = yellow alarm, R = red alarm, C = critical)
number is the message number

An example event fact is shown below:

(event 271-20:42:29.3 812320949 N 1082 "Op Output<gensaa:gensaa>: Directive Completed")

Go To The Front Section

Continue Section 5