Defining Component Classes

The procedures described in the Adding Classes, Sharing Classes, and Adding Attributes to Classes sections are used to define classes in a Schema Definition in general. For component classes, there are additional definitions a simulation developer needs to examine and complete. In this section, we explain these component class specifics in detail.

Component Class Properties

In the Class Properties dialog for a component class, there are three additional sheets with DLL, Port, and Connectivity tabs. Click on the tab or press Ctrl+PageUp and Ctrl+PageDown key combinations to switch tabs.

DLL Function Entry Points

From the DLL sheet, you can define the class function entry points for an in-process simulator to be implemented in a DLL. The definitions of the class functions and their semantics are explained in the SansGUI Application Programming Interface and the SansGUI Simulation Control chapters of the SansGUI Reference Manual.

There are two columns of check boxes under the column headers Call and Override. A checked box under the Call column means that you will provide the class function for SansGUI to call at the specified time. The name of the function is listed in the last column which contains the function name started with SG_x and appended with the class path in which all the non-alphanumeric characters are turned into underscores. When the function has the Call box checked, SansGUI will generate the skeleton of the function and put it in the source file with the class name during the process of Object Library generation. If you leave the box unchecked, the function will not be included in the source file. When none of the box is checked, there will be no source file generated for the class.

The check boxes in the Override column is for you to allow your users to supply overriding routines. A precondition is that a function has to be called in order to be overridden. Therefore, when you check the Override box, the Call box will automatically be checked.

Port Definitions

You can use the Port sheet to define the ports of the component class. By default, the ports are implicitly defined, meaning that SansGUI will automatically assign a port number that starts from 1 and increase the number every time a port is created for linking. There is a set of options that you can specify for port number assignment:

Instead of implicitly defined ports, you can predefine ports and give them numbers. Check the Explicitly Defined box to activate the port definition table:

When there is any port attribute in the component class, the ports have to be explicitly defined. The Implicitly Defined box are disabled until all the port attributes are removed.

If you need to delete a port definition, move the mouse pointer to the port number in the Port @ column and right click to get the context menu. Select the Delete Port menu item to delete it.

Connectivity Specifications

In the Connectivity sheet, you can limit a part derived from the component class to be connected to parts derived from a certain set of component classes. SansGUI allows you to specify the component classes that "can" or "cannot" be used to create parts for linking directly to the parts derived from the current component class. In other words, the connectivity specifications limit "what can be linked to what" and "what cannot be linked to what." By default, a part can be linked to any part, including itself, derived from any component class. The options in this sheet are:

When you click on the Edit... button next to either the Input From Classes or the Output To Classes list, a Multiple Items [Select] dialog will pop up. Depending on the input class and output class specification check box stated above, you will select the classes that can (if checked, green) or cannot (if unchecked, red) be linked to this class. When a class is specified, the descendent classes in the subtree will all be specified automatically, even though they are not shown in the Multiple Items [Select] dialog immediately. Close the Multiple Items [Select] dialog by clicking on the OK button. The selected classes with their subclasses will be displayed in the associated columns, with green dots for "can connect" and red dots for "cannot connect" relations.

Port Attributes

You may want to have attributes associated with the ports. For instance, a T-Junction in a hydraulic system has three ports and their inner diameters may be different. You can explicitly define the three ports and add the port attribute to the class. When a port attribute is added to a class, SansGUI will automatically set port definitions to Explicitly Defined.


C:\FH_Suite\htmlgifs\home.gif Operating on Attribute Grid View Defining Link Classes

SansGUI Modeling and Simulation Environment Version 1.2

Copyright 2000-2003 ProtoDesign, Inc. All rights reserved.