Define version information of package
package Modelica annotation(version="2.1", conversion(noneFromVersion="2.1 Beta 1", from(version="1.5", script="convertFromModelica1_5.mos"))); ... end Modelica; model A annotation(version="1.0", uses(Modelica(version="1.5"))); ... end A; model B annotation(uses(Modelica(version="2.1 Beta 1"))); ... end B;
In this example the model A uses an older version of the Modelica library and can be upgraded using the given script, and model B uses an older version of the Modelica library but no changes are required when upgrading.
Version numbers are of the forms:
""" UNSIGNED_INTEGER { "." UNSIGNED_INTEGER } """Example:
"2.1"
""" UNSIGNED_INTEGER { "." UNSIGNED_INTEGER } " " {S-CHAR} """Example:
"2.1 Beta 1"
""" NON-DIGIT {S-CHAR} """Example:
"Test 1"
The main release versions are ordered using the hierarchical numerical names, and follow the corresponding pre-release versions. The pre-release versions of the same main release version are internally ordered alphabetically.
In a top-level class, the version number and the dependency to earlier versions of this class are defined using one or more of the following annotations:
version = CURRENT-VERSION-NUMBER
conversion ( noneFromVersion =
VERSION-NUMBER)
conversion ( from (version = VERSION-NUMBER, script =
"?") )
uses(IDENT (version = VERSION-NUMBER) )
A top-level class, IDENT, with version VERSION-NUMBER can be stored in one of the following ways in a directory given in the MODELICAPATH:
This allows a tool to access multiple versions of the same package.