System Attribute

From Planimate Knowledge Base
Revision as of 15:28, 14 December 2008 by Tony.Griffith (talk | contribs)
Jump to navigation Jump to search

System Attributes

System Attributes are where Planimate® manages various attributes to run the model.

These attributes (e.g. the clock time), may be referenced. In some cases they may be set by the modeller in a Routine.


Uses for System Attributes

System Attributes are always available.

You can derive information about time spent in various states or regions of the model.

They give access to time variables useful in developing or monitoring schedules of activity.

Time-Related System Attributes

These attributes cover pretty much all there is to know about both simulation time (i.e. within the Model during a run), and real time (i.e. the time at which you are running your model).

For full details refer to this page: Time-Related System Attributes

Item Related System Attributes

Each individual Item created in your model records and stores information about itself. This information can be useful to support identification and perhaps logging of each item's experience while it is the model.

For full details refer to this page: Item Related System Attributes

Item Animation Related System Attributes

These attributes are intended for run time assignment so their settings are not currently saved with the model and in fact cannot be edited directly, only via a routine calculation.

For full details refer to this page: Item Animation Related System Attributes

Track-related System-Item Attributes

Planimate automatically maintains a number of system-item attributes as trains move along a track network. These attributes simplify management of routines executed as trains move through the network and are useful to modellers generating logs and graphs of the train movement which occurs.

These system attributes are available via routines to support more sophisticated decision making, manage and control train movements, derive useful records and for creating train graph outputs.

They can be accessed when items pass through routines. Some can be changed, altering the nature of a train’s movement, others are read-only, and can be used also in switches, to control processing of and delays to train items.

For full details refer to this page: Track-related System-Item Attributes

Owning Portal Object Related System Attributes

These system attributes enable a subsystem to access its owning portals graphics without having to use a label list.

For full details refer to this page: Owning Portal Object Related System Attributes

System String Related System Attributes

These system attributes provide information to assist with File input and output and management.

For full details refer to this page: System String Related System Attributes

Model Run Engine Related System Attributes

These system attributes provide information to assist you in how to respond to activities and events in the Model during a Run.

For full details refer to this page: Model Run Engine Related System Attributes

Display Related System Attributes

These attribute relate to what is going on concerning the currently visible panels, and status bar displays etc.

Name Read / Write Description

Current Screen Visible R/W This can be either Read or Set. To Read: Ask the model if the screen is visible: returns 1 if visible, 2 if it is not. This way you can detect what the user is looking at, and perhaps alter the animation to suit them. To Set: Assigning a value of one to the screen visible attribute makes the screen visible! You might think of using this to jump to screens if errors or interesting behaviour occurs.

Owner of Panel Visible R This returns true (1) if the panel containing the current panel from where the attref is scoped is visible, otherwise it returns "2" for false. This is useful for event handlers which reside in a subsystem "under" a panel which an end user sees/interacts with. It enables routine code to determine if the subsystem immediately above is visible without requiring object or panel indices.

Visible Portal Index R If the main visible panel is a subsystem of a portal with an object label, that label index is returned. If the top level window is visible, 0 is returned. Otherwise the value is -1

Lock Drawing W Set to 1 to stop updates to the screen. Set to Zero to resume updates. May need to force a repaint after that to be sure.

Activity State (0..100) W Shows an activity bar in the status bar. Value of 0..100 controls length of bar, 0 to reset (no bar). Automatically reset at start and end of run. Up to modeller how it gets used. Since this updates even when running without animating, use carefully to avoid model slowdown

Activity State (0..1.0) W Shows an activity bar in the status bar. Value of 0..1 controls length of bar, 0 to reset (no bar). Automatically reset at start and end of run. Up to modeller how it gets used. Since this updates even when running without animating, use carefully to avoid model slowdown.

Activity Bar Colour W Use a Value from the _Colours Label list to set the colour of the Activity bar.

Mouse X, Mouse Y R Returns the current Mouse Position Coordinates.

Visible Panel ID R Returns the panel index of the currently visible/front most panel. (This is the _Model Panels Label List, not _Model Objects).

Lock Portals from Drags W Enables the modeller to lock portals from being dragged at runtime even though their options setting enables this. This gives the modeller more control over when users can reposition portals in their display.

Trace Animation W Set to 1 to turn on the Trace Animation debugging option. Set to Zero to turn it off again.

Timer Broadcast Interval (ms) W Lets the modeller change the timing interval of the "_Real Time Tick" broadcast. A range of 10ms (100 times a second) to 1000ms (once a second) is now supported. 100 times a second will be too fast for slower systems so be careful on using the faster rates.

Enable Table Cell Edit R/W This enables the modeller to decide whether a cell edit should occur when a table cell is clicked, using the cell click broadcast. If the model sets this attribute nonzero while processing a table cell click broadcast (before edit) then the edit will actually occur. If this attribute is not set, the edit will not occur (as is current). This attribute is reset to 0 before each cell click broadcast gets sent. It is only valid to set/read this attribute in the initial thread of a cell click broadcast. For this feature to work, the table view option "Don’t Defer BC on FEC" must be enabled. This forces PL to send the BC immediately rather than waiting until a "safer" time. With this option "on" the modeller MUST NOT close the panel containing the table view as a result of the cell click broadcast, otherwise the platform will crash.

Animation Update Interval R/W Enables a model to control how often animation updates occur (0 sets none, model advances to model events only). See note below. The way the Animation Update Interval is handled. Planimate® always delays a minimum of 15ms every animation update interval regardless of whether there is item animation or not. This makes model time flow more smoothly especially if time based portal animation is being used. If a model spends a long time without animation which you want to skip, you can now set the animation update interval system attribute to make the model advance without showing the "Advance" dialog.

Time Scaling R/W Sets the Real Time Scaling value that is found under Run in the Menu Bar.

Item Animation Speed R/W Sets the Item Animation Speed value that is found under Run in the Menu Bar.


Table Related System Attributes

Relating to the currently-referenced table in a routine operation.

Name Read / Write Description

Table Rows R This gives access to the rows/column count for the table being referenced by the overall attribute reference. The advantage is that they can be used directly in a row or column index without having to use a separate temporary attribute and a separate routine line to set it. These attributes can determine a table from: direct references within an attref; dynamic table references; item table references (if item is available); implied (eg: a sort column attref in a sort knows the target table even though that table hasn't been directly specified in that attref

Table Columns R As above.


Other (General) System Attributes

Name Read / Write Description

Null W Enables dialog results etc. to be thrown away without having to create a dummy attribute.

Runtime Break Point Control W Provides convenient control of any breakpoint(s) in the model. This works in addition to modeller defined breakpoint control attributes, enabling breakpoints at complex conditions or at certain stages in a long loop to be activated.

Current Object Location R Lets you get an owning portal location for an object without involving an item. In other words, it obtains the location from the object's point of view rather than going via the item. This can be useful when you need to find the subsystem that a specific object is in, perhaps so you can direct a message to this location.

Total Object Label Count R With this attribute, the model can query the number of objects which are in the _Model Objects label list

ODBC Error Status R ODBC operations have an option to not stop the run on error. This system attribute returns whether an error in the ODBC operation occurred, non zero value indicates an error. ODBC Error Status must be read in the same thread that performs the ODBC operation.

Spatial link Scan Depth W Limits how deep PL will scan a spatial net looking for the closest route to the target. The attribute needs to be set each time the model is loaded, it is not saved. The default is 9999999 (ie: don’t limit search depth). Setting this value means Planimate® may not chose the shortest distance path in a spatial net if it contains more intermediate nodes than an alternative which is further in distance, and the node limit happens to be exceeded in scanning the shorter path. This will be obvious in incorrect animation but should not affect the item arrival time. In other words, reducing the search depth may cause PL to chose a route which is not the "shortest". It may also cause Planimate® not to find the correct route at all (if it has too many intermediate nodes) in which case PL will report a flow error. This attribute has to be set before firing the first item into the spatial net. It doesn't get saved with the model, it resets to a large number when the model is loaded. You can change its setting during the run but probably not something useful to do, if its too low and PL fails to find a target it will stop the model with a "no outgoing flow" type message.

User Edited Model Data R Gets set when a user edits an attribute view or table view/editor. The model can set and reset this attribute. It gets reset when the model is saved. Tables and attribute views have an option to not set this bit when they are edited

Button Paint ID R Set while a paint object checks its visibility/state attribute reference. If the object is in the paint label list, it can be used to assist in looking up visibility for that paint object.