plugin unload
Allows you to remove any plugin menus or commands.
Format:
plugin unload |
|---|
plugin_name = | existing plugin |
Example:
plugin unload & |
|---|
plugin_name = | vibration |
Description:
Parameter | Value Type | Description |
|---|
plugin_name | Existing plugin | Specifies the name of the plugin to be unloaded |
Extended Definition:
1. Any action that the user does while interacting with the plugin essentially falls in one of the three categories listed below,
a. Plugin discovery: Since, plugins are written by the Adams users themselves, there has to be a defined way for the Adams View software to discover the existence of the plugin. This is done with the help of xml files. There is one xml file per plugin, which has the file name as plugin_plg.xml (where plugin is the name of the plugin) and lies in one of the following three locations,
■A plugin specific directory included in the colon-separated list of directories contained in the user environment variable MDI_USER_PLUGIN_DIR.
■The $topdir/adams installation directory (that is, /usr/mdi/win32).
■A plugin specific directory under the mdi installation directory (that is, /usr/mdi/vibration) with a symbolic link from the $topdir/ directory.
The xml file contains the top level information about the plugin such as the plugin name, version number, Adams version for which it was designed and a brief description of the plugin itself. Note that the xml file is the only way for the plugin to establish its existence to Adams.
b. Plugin Load/unload : Whenever a plugin is loaded through the plugin manager, the plugin view dll is first searched. If present, the loader searches for the entry point function named plugin_initialize, inside the dll. The function is executed and contains the code to register the custom functions which the plugin provides. A function named “vc_function_add” is used for the purpose. The function, through its parameters takes the Function name of the function being registered, Function address, Number of parameters, Types of the parameters, that is, information which in itself is sufficient for the custom function to be used from inside the Adams View environment. All functions registered with Adams view through this function, are available in the function builder for use, like other standard functions which Adams View provides. The actual function implementations are defined as part of the view dll itself.
The dll also must export a function named plugin_terminate and is responsible for un-registering all plugin functions, which it does with the help of a complementary function called “vc_function_remove”.
As mentioned earlier, a full/partial binary file named plugin.bin must be present in one of the 3 defined locations. This file must contain,
■A view library object (this library object must have the same name as that of the plugin). It typically contains the dialog boxes, UDE definitions and the macros specific to the plugin.
■A load macro. This macro is called as part of the plugin load procedure and generally contains the Adams commands to create/load a custom menu in Adams View. The menu provides the central point of access for the plugin. The individual members of the menu are typically linked to the plugin specific dialog boxes (defined inside the BIN file itself) which provide a user-interface to access the plugin functionality.
■An unload macro. This macro typically does the opposite of what the load macro does. It restores the Adams View environment back to its original state, by removing any plugin specific menus/dialogs and so on.. This macro is automatically called as part of the plugin-unload procedure, that is, when the user unloads the plugin from the plugin manager.
When the plugin is loaded, the function registration as described earlier takes place after which the load macro inside the BIN file gets executed which in turn makes all the changes to the Adams UI as required by the plug-in.
c. Plugin use: Using plug-ins the user can enhance the functionality of the parent program, while making use of the environment that the parent offers.