Modules

From Planimate Knowledge Base
Jump to navigation Jump to search

Portals as Modules

Planimate® 5 enables you to set an option on a Portal for it to Act as a Module.

This will make your Portal behave more like an specially tailored object, and have its own configuration panels and parameters.

You are free to design and construct the internal behaviours of your Module Portal in a fully encapsulated manner, using Scoped Attributes, Tables, Label Lists, Item Classes and Subsystem Panels.

This Module can also be saved as a self contained object that can be loaded and used in other models.

Saving Modules for Re-use

Modules can also be saved using the File Menu option “Save Model and Create Module (PMB file)”.

As a self contained object that can be loaded and used in other models, the intention is that subsystem based "modules" will provide the functionality of recently-retired standard Planimate® 4 objects, with the advantage that the specific logic of these objects can be customised way beyond the older objects’ hard coded capabilities.

Saving a Module requires that the model which is the module is saved as a Planimate® Module Bundle (PMB) file and only has one top level portal.

No other objects are carried through the merge process.

The File menu option "Add Module To Current Model" enables simple merging of models. Selecting this option saves the current model, enables a "PMB" saved model to be selected, loads that model and merge with original model, leaves user with the "module" ready to be pasted, (the original model is not resaved after the merge).

Loading a module will now merge in any resources in its DB file into the current model's DB file.

Any existing resources with the same name and type are replaced.


Modules can have Configuration Panels

Turning on the Portal option "Act As Module" will cause the Portal to search for subsystems containing the "Subsystem is Module Configuration Screen" flag.

These substems are presented in the Portal's context menu and will popup when selected.

It is recommended to have the popup options "Stay in Front of Main Window" and "Ensure Visible on Display" are turned on for the Configuration Screen subsystems.


Incorporating Modules in new Models

When a module (i.e. a portal with "module" option set On) which has internal classes is included in a flow, Planimate® will check if there is a mapping for the current item class being edited.

If there isn't it will offer to allow an internal class to be selected.

If the module only has one class, then Planimate® will create a mapping automatically without prompting the user. This simplifies the use of modules with a single scoped class within them.


Other Module Notes

Modules looking for module configuration screens will not search within other modules nested within the module.

The INI file option "ModuleFolder" defines the folder Planimate will first look in when loading a module.

ModuleFolder="Modules" (will look in {exe path}\Modules)