Top Up Prev Next Bottom Contents Index Search

11.3 Working within Ptolemy


In terms of implementation, a standalone FSM domain in Ptolemy is not very interesting. The reason for this is that most applications, in addition to control, contain many other features, e.g., signal processing. Moreover, there are other Ptolemy domains with which an FSM can interact. By mixing the FSM domain with other domains, we get a very powerful FSM model. Currently the FSM domain only works with the SDF and DE domains.

11.3.1 Make an Icon in Vem

Unlike other domains, an FSM galaxy is edited in a .std file using Tycho instead of Vem. However, to work with other domains, an icon in Vem is required to represent the corresponding FSM galaxy described in an STD file. To make an icon in Vem for the STD file, first start Tycho from within Ptolemy by pressing y. Open the file in Tycho and choose Make Icon....from the Special pull-down menu. This will load the FSM galaxy into the Ptolemy kernel and generate an icon with appropriate input/output ports in the specified palette in Vem.

The icon looks like a star (blue outline) but it is actually a galaxy. This may be confusing, but the idea is to avoid using an Octtools handle. There are two different ways to make an icon in Vem: ptkSetMkSchemIcon and ptkSetMkStar. The former needs an OctFacetHandle as one argument and is used for other "Vem" galaxies. However, since the FSM galaxy uses Tycho as the editor instead of Vem, there is no OctFacetHandle. Therefore the latter (ptksetMkStar), which uses the star (or galaxy) name instead, is more appropriate.

11.3.2 Look Inside an FSM Galaxy

Similar to the galaxy icon in the other domain, when the i key is pressed on the icon to look inside the galaxy, the corresponding STD file which describes the FSM galaxy will be automatically invoked in Tycho. (Note: if the environment variable PT_DISPLAY is set to another editor instead of Tycho, it must be unset for the look-inside to work.)

11.3.3 Compile an FSM Galaxy

The FSM domain uses EditSTD to edit a Galaxy, but other domains use Vem as the editor. Therefore, when an FSM Galaxy is compiled, the EditSTD (Tycho) is invoked to compile the state transition graph into the Ptolemy kernel.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.