Model INI File: Difference between revisions

From Planimate Knowledge Base
Jump to navigation Jump to search
(Importing text file)
 
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<font face="Arial">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.<br /><br />'''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.


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. It can also be directed to use a specific INI file using the /INIFILE= command line option. This will override any model INI file specified in the model.


'''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.'''<br /> '''<br />'''Setting Portal Attributes
The INI file contains sections for different classes of data. These are explained in the sections below.


__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.


ATT "&lt;attribute name&gt;" &lt;"formatted-value"&gt;
[FILES]<br/>
"&lt;from-name&gt;" "&lt;to-name&gt;"</br>




Example INI file:
Note that all names must be quoted.


Example:


[Portal 1]<br /> ATT "test1" "123"<br /> ATT "test2" "1:23"<br /> ATT "test3" "blue"
[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.


[Portal 2]<br /> ATT "test1" "456"<br /> ATT "test2" "1:23"<br /> ATT "test3" "blue"<br /> ATT "test4" "no"
====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.


[Configurations]<br /> ATT "expert user" "0"<br /><br /><br /><br /><br /><br /><br /><br />
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\"


Currently the only object specific data which can be set are attributes of a portal.
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.


&lt;portal object label name&gt; is the name of an object as it appears in the object label list. This must be a portal.<br /> &lt;attribute name&gt; is the name of a portal attribute owned by the portal<br /> &lt;formatted value&gt; is the value to set it to, formatted to the attribute's format.<br /><br />
[&lt;Object List Name&gt;]<br/>
ATT "&lt;attribute name&gt;" "&lt;formatted-value&gt;"


It is assumed that the Object List Name identifies a portal in the object label list.


For example, the following sets some portal attri<br /> </font>
Examples:
----
 
[[Category:Data/Import]]
[Portal 1]
[[Category:File]]
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.
 
===Mapping Shares===
Planimate can run under different user credentials than the user who launches it. This is useful where Planimate needs access to data files that the user should not have access to. The command line options /USER and /SHARES are used. The /SHARES command line option enables an INI file to be specified with the mappings for these. Planimate will establish network shares using names in the [SHARES] section, as follows.
 
[Shares]
"S:" "//SERVER/DATA1"
"T:" "//SERVER2/MOREDATA"
 
Note that this section of the INI file is only read if the /SHARES command line option is used. It can co-exist with other initialisation sections that the model uses, if desired.
 
===Sockets===
Network Socket configurations can be customised by an INI file. This is useful where an application is being used in a number of locations with different network configurations
 
This is achieved using a sockets section:<br/>
[SOCKETS]
"&lt;socket-name&gt;" "&lt;address&gt;" "&lt;port&gt;"
 
address specifies an IP address or name. It should be empty if the socket is configured as a server (this cannot be overridden here). Example:
 
[SOCKETS]
"Server"  "192.168.100.50" "5500"
"MyListener"  ""  "5601"
 
[[Category:Data]]
[[Category:Attribute]]
[[Category:Batch]]
[[Category:INI File]]
[[Category:INI File]]
[[Category:Attribute]]
[[Category:Data/Exchange]]
[[Category:Fact]]
<font size="2">idkbase note 309</font>

Latest revision as of 19:26, 12 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. It can also be directed to use a specific INI file using the /INIFILE= command line option. This will override any model INI file specified in the model.

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.

[<Object List Name>]
ATT "<attribute name>" "<formatted-value>"

It is assumed that the Object List Name identifies a portal in the object label list.

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.

Mapping Shares

Planimate can run under different user credentials than the user who launches it. This is useful where Planimate needs access to data files that the user should not have access to. The command line options /USER and /SHARES are used. The /SHARES command line option enables an INI file to be specified with the mappings for these. Planimate will establish network shares using names in the [SHARES] section, as follows.

[Shares]
"S:" "//SERVER/DATA1"
"T:" "//SERVER2/MOREDATA"

Note that this section of the INI file is only read if the /SHARES command line option is used. It can co-exist with other initialisation sections that the model uses, if desired.

Sockets

Network Socket configurations can be customised by an INI file. This is useful where an application is being used in a number of locations with different network configurations

This is achieved using a sockets section:
[SOCKETS] "<socket-name>" "<address>" "<port>"

address specifies an IP address or name. It should be empty if the socket is configured as a server (this cannot be overridden here). Example:

[SOCKETS]
"Server"  "192.168.100.50" "5500"
"MyListener"  ""  "5601"