0 Votes

Object properties

Last modified by WikiBot on 2025/05/26 15:08

Object properties

The following properties are recognized by IDA Modeler (they may be defined in script modules or in object templates):

:template

A list of one or more object templates or other records allowed in .app file.

Normally the object templates are listed in .app and .eo files. These templates are loaded with the application and the objects of that types are available for insertion.

When creating a data object of a certain type, IDA Modeler searches for a template for that type. If no template is available, the modeler searches for :template property in file "type.cms" in the application directory and loads all records listed in the value of that property.

:views

The list of available view types. Determines the contents of view menu and open with … submenu.

Every item in the list is either view name or a list (name options…).

Note that an object may have other views (not listed in the :views property). These views are not accessible via the View menu, but may be accessed by other means.

For every view of an object of given type, the object’s script module may contain a property with the same name as the view (preceded by column character). The value of this property is a list of view-specific properties.

:view-name

The list of properties and methods for the given view name (e.g., :form, :editor). May also contain conditional properties (inside :cond script) help

:default-view

The default view for objects of this type.

:custom-views

The list of custom views that should be saved with the data document. The format is: (:custom-views (view_type ".ext") ...), where ext is the file extension for form document.

:template-views

The list of available view types for templates of this type. See also :views property.

:tabs

The list of tabs for the main view. The list may also be (:none), then no tabbed views are used or (:eval expr), then the expression is evaluated (as script expression) every time when the list is requested.

:problems

For IDA systems: list of standard problems that are defined in the application for IDA systems of this type.

:invoking-map

This property is used in the function invoke-components for creating mathematical models. The value contains either the code describing the invoking procedure or the name of the file containing this code. See Invoking mathematical model for details.

For application with extensions the invoking code is loaded from multiple files, see extending applications.

:window

The size (list of width and height) of the window for tabbed view.

:form

This is a view-specific property (except for interfaces).

The value may be (1) a file name or a list (filename). The file contains the form document for the view (if the file extension is ".idc") or source form to be evaluated to the form document; (2) the source form for the form document.

:dialog

This is a view-specific property (except for interfaces).

Describes a dialog-based view of objects of the given type. The value should be a list of dialog items (controls) and IDA script commands. See script code for dialogs for details

:bar

This is a view-specific property (except for interfaces).

Describes the side bar for the given view. The value should be a list of dialog items (controls) and IDA script commands. See script code for dialogs for details.

:area

This is a view-specific property: IDA Modeler uses it only for editor view.

For editor view, IDA Modeler expects the value of :area property to be a list ((property value) …), where properties are:

(:extent (left bottom right top)) – the range of data coordinates in the view.

(:margin x) or (:margin (left top right bottom)) – the margins around the data area defined by :extent, in pixels. If a single number is specified, it is used for all margins. Default margin is 0.

(:unit "value") – the measurement unit of data coordinates (default "m").

(:step value) – the coordinates acquired from the view are rounded to this value. Default 0.001.

(:page (x y)) – the window size in pixels. Default is (640 420).

The value is evaluated as script expression (base – the view’s object, variables: _pane – the view’s pane, _view – the view type (name), _form – the form document) every time when it is requested.

:interfaces

List of interface properties. Every item describes properties of one interface: (intname (prop . value) …). The interface properties are described in this section. If a property for some interface is not defined in this module, the property defined for link type is used.

:pict

The icon for objects of that type. Possible values: (1) a symbol denoting a built-in icon, or an icon defined in the application; (2) filename, (3) list of a filename and an index of the transparent color.

:collections

A collection is a named list of related objects (normally the components of the given object). The collections are shown in the outline view and list fields.

The value of the property is a list of script methods for creation of non-standard collections:

(:collections (collection_name script…) …)

:in-collection

A list ((type collection_name) …) used to determine the collection containing components of the named types. The collection_name may be (1) a name of collection (a symbol), (2) :none and (3) a script expression returning the collection name. The script expression is evaluated with arguments _obj = the component and _type = the type of the component.

:group

For resource objects, defines the grouping of the resources in the list of resources of this type. The value of this property is the route from the object to some attribute (e.g., to a value of some parameter). The objects are grouped by the value of this attribute.

:symbols

This is a view property. Defines one or more graphical symbols that represent the components of the objects of this type on the given view. The format is (:symbols (type symbol [symbol ... ]) ...). Here type is a component type or class, or :all; symbol may be one of (1) a class name of a graphical element; (2) a list (class [attr value] …), (3) (:eval expr) that is evaluated to a symbol, (4) same as (2) with some items written as (:eval expr).

Two attributes have a special meaning:
:cond expr if the expression is evaluated to NIL or :False, the symbol is skipped;
:choice label the label to be shown in the menu.

When inserting a new object, the first non-skipped symbol is used. If there is no entries for given component type, the entry for component class is used instead. If no entry for the class, the entry named :all is used. If that also is missing, the built-in default symbol (dependent on component class) is used.

If more than one symbol is available, the choices are shown in the symbol’s shortcut menu.

:pages

This is a view property. Defines the property pages for components of the objects of this type shown with the given view. The format is (:pages (type . page) ...). The value of page may be one of (1) a filename or a list (filename options …), defining the form for the property page; (2) (:eval expr) that is evaluated (base – the view’s object, variables: _pane – the view’s pane, _field – the selected graphical element representing the subobject) to (1).

:fields

The list of additional fields to be shown in the insert field dialog. Every field is represented as a list

(text class [attr value ...]) where text is the text to appear in the dialog (or a symbol, for translation to different languages), class is the field class, and the rest is the list of field attributes.

The whole list or any part may be enclosed in (:eval ) for evaluation (with the object as the base).

:id

For a web-based user interface, a prefix for a unique session identifier.

:auto-plug

This property may be defined for interfaces or interface types. The value is a list of one or two elements. The first element describes the action to be done when the interface is disconnected. The second element describes the action to be done when the auto plug is removed.

The possible actions are:

:close bind all flow variables to zero

:fix bind all flow variables to their start values

:open remove the binding of flow variables

a number: bind all variables to this number

an interface: connect to this interface (if the interface would be connected to itself, bind instead all variables to their start values)

:none do nothing

a list: the list is evaluated as a script expression (with the interface as the base). The result is used as the property value. The script may by itself do all the job; in this case it should return :done.

:adjustable-size

This property may be defined for interfaces or interface types. Set to :False to disable the automatic size adjustment for 1-dimensional arrays of interfaces (see Vector interfaces).

:line

This property may be defined for interfaces or interface types. The value should be a list of graphical attributes for connection line. The parts of the expression wrapped with (:eval …) are evaluated in the environment of the macro object containing the connection with variables _from, _to, and _dir bound to the connected interfaces and the direction of the connection (in, out, or nil).

:name

This property may be defined for interfaces or interface types. For an array interface, the value of this property is evaluated in order to obtain custom names of array elements. The expression is evaluated in the environment of the interface array; the variable _ind is bound to the list of indices.

:source-file

This property may be defined for math models. The value is either the pathname or a format string or a script used to evaluate the pathname of the file containing the source code of the math model.

If the value is a format string, the model type substitutes the placeholder.

If the value is a script, it is executed in the environment of the math model; the variables _name and _type bound to the model name and type.

:columns

This is a view-specific property for the outline view. It defines the columns in the right pane of the outline view. Same columns are also used in list fields.

The format of :columns property is (:outline … (:columns (collection options col1 col2 …) …) …), where collection is the name of collection to which the columns are defined; options is a list (key value …) that describe the properties of the table and col1 … are descriptions of columns.

Here are some table properties. See List Fields for whole list.

:header-rows n, the number of text lines in the header row
:summary (name1 …), the list of names of summary rows
:dict entry, the dictionary entry used to translate the headers to the current language

The format of a column description is (name slot width options) where

name is the column name
slot is the reference (relative to row’s object) to the attribute to be shown in the column's cells. It may be given as (:eval script_expression); in this case the slot will be evaluated separately for every row. The script will be applies to the row’s data object and should return the required reference.
width is the default width of the column (in pixels). The user may resize the columns.

See List Fields for the list of options.

The list of columns may be also given as a script expression: (:view_name … (:columns (collection options :eval script_expression key value …) …) …). The expression is evaluated when the table is created. The script expression is applied to the table’s data object with named variables _view = view name, _header = list of options, _sect = collection name and the additional variables written after expression.

If no :columns property is provides for some collection in the object’s script module, the property will be searched in the script module of the object’s parent etc.

:animation

Application-specific description of animation of the results of simulation.

:logvar-info

A list ((varname . fn) …) that describes the additional information that may be stored as attributes of the columns of the output files that log the named variables. The function fn is called with 3 arguments: model, variable and indices. If fn is a script, it is called as fn(model, _var=variable, _ind=indices). It should return a list (key value …) where the supported keys are :ie (the value is stored as attribute initial-element) and :x (the value is stored as attribute role). This attribute may be used for customization of the presentation of the results.

:title-key

The dictionary entry used to generate the title of the window showing the object's view. May also be (:eval expr). The default key is :title.