Model INI File

From Planimate Knowledge Base
Revision as of 20:49, 11 February 2008 by Rick (talk | contribs)
Jump to navigation Jump to search

Planimate supports having configuration files external to a model which can be used to set run specific details. These settings are stored in an INI file. This is distinct to the INI file which configures Planimate itself.

Planimate will look for the INI file specified using Edit->Select Model INI File when the model (or PBA) is loaded. It looks in the same directory as the PBA.

The INI file contains sections for different classes of data. These are explained in the sections below.

File Name Remapping

References to file names in a model used in the Change Object File Access operations are run through a remapper. This enables the names referenced in the model to be customised and repointed to actual files/paths. This lets an user specify exactly where files are without them being hard coded in the model.

The mappings are placed in a section called [FILES] in the INI file.

[FILES] "<from-name>" "<to-name>"

: :

Note that all names must be quoted.

Example:

[FILES]
"TEST1.DAT" "c:\rick\sv\data\test1.dat"
"TEST2.DAT" "d:\moredata\test2.dat"
"c:\rick\data\test3.dat" "d:\moredata\test3.dat"

Note that even names that included paths can be remapped.

Sub File Names

For advanced configurations, an internal name in PL can include the bar symbol "|" to break it up into separate sections. At runtime, the bars are stripped out and the sections of file names are then separately remapped.

This can greatly simplify the INI file where only the prefix path of a file needs to be changed.

eg: In Planimate, the following file reference is used:

"dataroot|path|data_3.dat"

then the details provided in an INI file:

[FILES]
"dataroot" "q:\"
"path"     "files\mydata\"

Note that text following a "|" is never remapped unless there is a bar after it, eg: data_3.dat above would not be checked by the remapper unless another "|" was added after it.

Attribute Values

Portal attributes can be set from the INI file. This is done in a portal section using the ATT command which expects 2 quoted strings, as follows.

[<Portal's Name>] ATT "<attribute name>" <"formatted-value">

It is assumed that the portal named is a topmost portal in the model.

Examples:

[Portal 1]
ATT "test1" "123"
ATT "test2" "1:23"
ATT "test3" "blue"
[Test Setup]
ATT "test1" "456"
ATT "test2" "1:23"
ATT "test3" "blue"
ATT "test4" "no"
[Configurations]
ATT "expert user" "0"

These set the named attributes to the values given, in portals "Portal 1","Test Setup" and "Configurations" respectively.