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.
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.
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.
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:
Highest Number for Port Labels: You can assign the highest port number so that when it is reached, SansGUI will start from 1 again, if uniqueness is not a requirement (see next). If the port numbers have to be unique, the user will not be able to create any additional port when all the numbers are used. Enter 0 (default) in this field for no upper limit check.
Check Unique Port Label: Check this box if all port numbers associated with a part derived from this component class have to be unique. Leave it unchecked if you allow connections to multiple ports with the same port number.
Use Odd/Even Numbers for In/Out Ports: Check this box if you would like to have all input ports with odd numbers (1, 3, 5, ...) and output ports with even numbers (2, 4, 6, ...).
Allow Special Port Number 0: Check this box if you allow user to link to a part derived from this component class with a port number 0 and associate it with a special meaning. You will need to document the meaning of port number 0 for your users.
Instead of implicitly defined ports, you can predefine ports and give them numbers. Check the Explicitly Defined box to activate the port definition table:
Port @: Enter the port number you are defining.
In: If checked, it specifies that the port can be used for input connection.
Out: If checked, it specify that the port can be used for output connection.
Unique: If checked, the port can be attached to a link only once. The number cannot be reused.
Export: If checked, the port can be exported to the parent assembly for connection made in that level or beyond.
Top: If checked, the port can be located at the top side of the component icon.
Bottom: If checked, the port can be located at the bottom side of the component icon.
Left: If checked, the port can be located at the left side of the component icon.
Right: If checked, the port can be located at the right side of the component icon.
Memo: Enter a short description of the port.
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.
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:
Suppress the icon of this class in Link Value display mode: Check this option if you do not want the icons of the derived parts to be shown in the Link Value display mode (with thick links). Certain component classes may have a "connection" nature and may not have physical volumes. They are the candidates for suppressing the icons in the Link Value mode. This option only has a visual effect and has nothing to do with the model configuration.
Specify possible (green) input classes instead of disallowed (red) ones: Check this box if you would like to specify the component classes that can be linked to this class. All the input class displayed below will be marked green (can connect) and all the other component classes cannot be used as input classes. Leave it unchecked if you want to specify those cannot be used as input classes.
Specify possible (green) output classes instead of disallowed (red) ones: Different from the input classes specification, this check box is for output classes. One tip is that if there are fewer component classes that can be connected than the number of classes that cannot be connected, check the box to specify the minority.
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.
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.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.