Extending Application
Extending application
An advanced user may extend an existing IDA application with his/her own NMF modules:
- Using IDA NMF Translator, prepare one or more libraries of NMF models. The libraries should have unique names.
- In IDA Modeler, select "Extend IDA application" item from Tools menu. Fill the Extend Application dialog. In the Component library list, add the NMF libraries to be included in the extension.
- Select the folder where the extension should be installed. This may be either the user’s private folder, or a common folder, or the folder where IDA Modeler is installed. (Depending on the administration policy, the user may have no write access to some of these folders).
- Press "Install".
The program will copy the library files (libname.eo and libname.dll) to the installation directory, create extension file ext_name.app and palette page lib_ext_name.
The user may enhance the extension in the same way as the application, see Advanced customization.
Note that the systems created in extended application will be not compatible with non-extended applications.
Extension file
ext_name.app
The first record of the extension file ext_name.app:
(:EXTENSION ext_name :ver version :cr "copyright"
:doc (doctype ...) :up upgrade_fn)
The name, version and copyright will be shown in About IDA dialog.
The list (doctype ...) should contain the types of documents added by extension.
The function upgrade_fn is optional. It is used to upgrade the documents created with older versions of the extension. It is called with two arguments: document instance and the (old) version of the document.
See IDA application file for more options.
The rest of the extension file have the same format as the application file.
Declaring extensions
If an extension is used as optional part of the application, it may be desirable to declare the extension in the application file. This declaration gives some information about the extension to the users that have not yet installed it.
The declaration record is
(:EXTENSION ext_name :def (modname1 ...))
Here (modname1 ...) is a list of model names (either NMF/Modelica models or objects of custom types) that are defined in the extension. If the user tries to open a system that contains some of these models, IDA will inform the user that the system requires the named extension.