MLDesigner provides you with a number of primitive components that can be used to create complex animations. All these primitives are based on execution of Tcl/Tk scripts that realize Tk widgets. Tk widgets are realized by the Tk toolkit associated with the Tcl language.
Any number of animated displays can be created using Tcl/tk primitives. Some of them are opened in separate windows, others can be embedded in the simulation control window. The animation can be textual or graphical. The Tk animation primitives can be found within the Tcl/Tk library of the according domain, for example, MLD Libraries→SDF Domain→Tcl/Tk. The most important primitives are:
|
TkPlot |
Plot Y input(s) vs. time with dynamic updating. Two styles are currently supported: dot causes individual points to be plotted, whereas connect causes connected lines to be plotted. Drawing a box in the plot will reset the plot area to that outlined by the box. There are also buttons for zooming in and out and for resizing the box to fit the data in view. |
|
|
TkXYPlot |
Plot Y input(s) vs. X input(s) with dynamic updating. Two styles are currently supported: dot causes points to be plotted, whereas connect causes connected lines to be plotted. Drawing a box in the plot will reset the plot area to that outlined by the box. There are also buttons for zooming in and out and for resizing the box to fit the data in view. |
|
|
TkShowValues |
Display the values of the inputs in textual form. The print method of the input particles is used, so any data type can be handled, although the space allocated on the screen may need to be adjusted. |
|
|
TkBarGraph |
Dynamically display the value of any number of input signals in bar chart form. The first 12 input signals will be assigned distinct colors. After that, the colors are repeated. The colors can be controlled using X resources. |
|
|
TkMeter |
Dynamically display the value of any number of input signals on a set of bar meters. |
|
|
TkShowBooleans |
Display input Booleans using color to highlight their value. |
|
|
TkText |
Display the values of the inputs in a separate window, keeping a specified number of past values in view. The print method of the input particles is used, so any data type can be handled. |
|
The simplest animation is to print the output of ports to text widgets using a TkText primitive connected to the output port. For detailed information of the functionality of the animation primitives, please refer the online documentation of the primitives.
To demonstrate the using of Tk primitive modules we will modify the Sine Modulator model. Follow the steps below to modify the Sine Modulator module as shown in the figure.
Switch to Simulation Mode and click Go to run the simulation. A bar chart and a Ptolemy Xgraph is displayed when the simulation is complete.