User manual

Dymola 2013 FD01 Release notes 9
package MyFunctions "My Functions"
package MyMatrixFunctions "My Matrix Functions"
function solve=Modelica.Math.Matrices.solve(A=[1,2;3,4],b={1,1}) annotation (Icon(graphics={}));
function eigenValues=Modelica.Math.Matrices.eigenValues
"eigen values" annotation (Icon(graphics={}));
annotation(Icon(graphics={}));
end MyMatrixFunctions;
function sin=Modelica.Math.sin;
function cos=Modelica.Math.cos;
annotation(__Dymola_toolbar=true, __Dymola_menu=true, Protection(hideFromBrowser=true));
end MyFunctions;
Note that icon annotations have been given for solve, eigenValues and MyMatrixFunctions
and that these are used in the menus. If a description string is given, for example, “My
Functions”, “My Matrix Functions” and “eigen values”, those strings are used for the menu
otherwise the defined name. It is possible to give values to inputs which then become
prefilled in the dialog.
The package structure is made into a menu by providing the annotation
annotation(__Dymola_menu=true);
It is also possible to define a toolbar:
Toolbars are created by giving the annotation:
annotation(__Dymola_toolbar=true);
It is possible to hide such a package from the package browser by using the annotation:
annotation(Protection(hideFromBrowser=true));
Such a package can be automatically loaded by using a libraryinfo.mos file with
category=”persistent”:
LibraryInfoMenuCommand(
category="persistent",
reference="<Class To Preload>",
text="dummy")
It then not removed when the File > Clear All command is given.
The annotation
__Dymola_hideGraphics=true can be used to hide the graphics coming
from the base class. This also means that the base class is only loaded when needed to build
the parameter dialog and call the function.
Defining packages with users own collection of favorite models
It is possible to define packages with your own collections of favorite models by introducing
shortcuts to models.