Model INI File: Difference between revisions

From Planimate Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
Planimate supports a model specific INI file which is different to the Planimate.INI file (which is used to store modeller settings). The model INI file stores definitions specific to the model including file name mappings, shares and object specific data. This note covers object specific data.
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.


'''Object Specific Data'''
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 can contain settings targetted to a model object. The object to which the settings apply must be named in square brackets and must be in the object label list.
The INI file contains sections for different classes of data. These are explained in the sections below.


'''Setting Portal Attributes'''
__TOC__


Currently setting portal attributes for portals is supported. This is done using the ATT command which expects 2 quoted strings, as follows:
===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">
ATT "<attribute name>" <"formatted-value">


Example INI file:
It is assumed that the portal named is a topmost portal in the model.
 
Examples:


  [Portal 1]
  [Portal 1]
Line 18: Line 59:
  ATT "test3" "blue"
  ATT "test3" "blue"


  [Portal 2]
  [Test Setup]
  ATT "test1" "456"
  ATT "test1" "456"
  ATT "test2" "1:23"
  ATT "test2" "1:23"
Line 27: Line 68:
  ATT "expert user" "0"
  ATT "expert user" "0"


 
These set the named attributes to the values given, in portals "Portal 1","Test Setup" and "Configurations" respectively.
----
 
 
 
 
 
<font size="2">idkbase note 309</font>


[[Category:Data]]
[[Category:Data]]
Line 40: Line 74:
[[Category:Batch]]
[[Category:Batch]]
[[Category:INI File]]
[[Category:INI File]]
[[Category:Data/Exchange]]

Revision as of 20:49, 11 February 2008

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.