The State Transition Diagram editor is automatically invoked
whenever you open any file with a
.std
extension.
The EditSTD class is derived from the
EditBubbleAndArc class, and
therefore inherits all of its features.
Currently, the STD Editor is not very useful without Ptolemy, we include the documentation within Tycho only for the sake of uniformity.
.std
, or drag down the Window
menu and
under Graphical Editors
choose State transition diagram
editor
. A message window will pop up to ask for machine type. So
far there is only one type of FSM supported, called mixed Mealy/Moore
machine.
Special
menu and choose
I/O Port Names...
, then enter the names for the
input/output. Each name should be separated by at least one space.
Edit
menu and
choose New Node
, or use the keyboard accelerator
N
. Then a crossbar cursor will appear in the
window. Press and hold (don't release) the left mouse button, and move
the mouse to get a different shape of node. Release the button to
finish the drawing.
To edit a state, first select the state by pressing the left
mouse button on it. Then either drag down the Edit
menu
and choose Edit Item
, or use the e
keyboard accelerator key.
Edit
menu and
choose New Arc
, or use the A
keyboard
accelerator key. Then a crossbar cursor will appear in the
window. Press the left mouse button on the periphery of the starting
state. Move the mouse and press the left mouse button to get more
delicate arc. To finish the drawing, move the mouse on the periphery
of the ending state and press the left mouse button.
To edit a transition, first select the transition by pressing the
left mouse button on it. Then either drag down the Edit
menu
and choose Edit Item
, or use the e
keyboard
accelerator key.
Edit
menu and choose Delete
.
To move/reshape a transition, first select it, then some small rectangles will appear along the arc. Press and move one of the rectangles to move/reshape the arc.
From the point of view of implementation, a stand-alone FSM domain in Ptolemy is not very interesting, because in most of applications, in addition to the control part, they contains many other parts, such as signal processing. Moreover, there are various Ptolemy domains. With the FSM domain mixed with them, we can get a much more powerful FSM model.
vem
vem
. However, to work with other
domains, an icon in vem
is required to represent the
corresponding FSM galaxy described in an STD file.
y
while
the mouse is over a facet.
vem
for the STD file,
first open the file from within the Tycho window started from within Ptolemy.
Special
menu and choose
Make Icon...
vem
.
The icon looks like a star (blue outline), but it is actually an galaxy. This may be confusing, but the reason is to avoid using a Octtools handle, which would require adding Octtools knowledge to Tycho.
There are two different ways to make an icon in vem
:
ptkSetMkSchemIcon
and ptkSetMkStar
. The
former one needs an OctFactHandle
as one argument and is
used for other vem
galaxy. The FSM galaxy uses Tycho as
the editor instead of vem
, so there is no OctFactHandle
for an FSM galaxy. Therefore the latter one, which uses the star (or
galaxy) name instead, is more appropriate for this case.
If the mouse is over a FSM galaxy icon inside vem and the
i
key is pressed, then Tycho will automatically display
the corresponding STD file inside a STD editor.
(Note: if the environment variable
PT_DISPLAY
is set to other editor instead of Tycho, it
must be unset for the look-inside to work).