-
Notifications
You must be signed in to change notification settings - Fork 0
Automatic animation
This section is showing how to do automatic animation.
-
Create a new project and add a new block in BDD (Block definition diagram)

-
Add a new state diagram to the block (right click the block and select Add New -> Statechart)

-
Add a new reception in the block (right click the block in browser and select Add New -> Blocks -> Reception)

-
Fill in the reception event name and select Yes to create new one

-
Create two more using the same method (right click the Operation package and select Add New -> Reception)

-
Add four state in the state diagram and one initial point and end point

-
Connect the state and set the trigger (add transition line then right click and select Feature… then select a reception in Trigger)

-
Add trigger in same method to another two transition lines

-
Initialize the block (in BDD right click the block and select Make an Object)

-
Open the component configuration window (expand the Component package and right click the DefaultConfig then select Feature…)

-
Choose correct settings (click the Settings label and select Animation for Instrumentation mode and select Web Enabling then click OK)

-
Execute the model (click the Generate/Make/Run button and click Yes to create the directory)


-
Run the model (click the run button)

-
Open the animated diagram (select Tools -> Animated Statechart and select initialized block in the new window then click OK)

-
Verify the action (click the Event Generator and select the first reception to trigger the transition of state then click Generate)

-
Verify the other two actions (select second and third reception then click Generate)

-
End the animation (click Stop button)

-
Add an configuration file for automatic animation (create a file - omanimator.cfg in Rhapsody project folder)

-
Add code for automatic animation in the file (use text editor to open the file and add code then save it and close the file)

Code:
//================================================
// Run with animation off to create all objects
go idle
// Switch animation back on
display
System->GEN(sysevent1())
go idle
System->GEN(sysevent2())
go idle
System->GEN(sysevent3())
//go event
go idle
go idle
// Run continuously
go
- Run Rhapsody model again (click the Run button then model will be executed and all events will be automatically triggered)