ReleaseNotes:Planimate 4.93 Release Notes

From Planimate Knowledge Base
Jump to: navigation, search


  • moving of modules to move TCP/IP and XML stuff into iFLow
  • rework of old stream code so we can compile with VC7 and other compilers


  • Planimate can now display, input, import & export calendar dates beyond 2035. The current limit for input is 3000 AD

This means long term runs which go beyond 2035 will now display calendar dates without issues.
The file format has not changed from


so if there are any issues noticed, you can step back to the previous release until I address them.

There are these following limitations:

  • The PC clock must be before 2035 AD, if the model uses it.
  • Timestamps in key files are limited to 2035
  • The Edit Calendar Date Reference and the Run Start Date reference must both be before 2035 AD (ie: the model can "run" past 2035 but it cannot have time "0" as a date beyond about Jan 2035)

These will be addressed in due course and require a change to the MDL format which is why I didn't do them yet.

  • Internal cleanup - millisecond handling during time processing
  • Internal cleanup - signed and unsigned values being mixed in internal code causing warnings in MSVC


  • Fixed a memory leak when a label list is loaded from a dataset file
  • Fixed a crash which occured if a portal copied during run contained paint objects which were controlled by portal attributes


  • no button effect doesn't disable default ENTER handling of buttons
  • report added for model objects, panels and paint label lists. This creates a text file which can be copied/pasted into tables etc.
  • table references now include routine code and comment
  • fixed bug in opening help files in standalone exes


CHANGE: Significant rework of the paint inherit code re: Copy of all paint objects. Done so paint objects know their inherit owner BEFORE their scope is initialised.
!!! All paint inherit operations (editing and runtime) are affected !!! and must be carefully tested
NEW: Run Engine system attribute "Active Broadcast Index" returns label index of the currently active broadcast or 0 if none active
NEW: Routine operation "Format Title Into Label" - formats the target's title into a label. Implemented for tables and columns.
NEW: The routine logical comparison operators "Equal" and "Not Equal" now will compare 2 entire tables.
If the tables have the same dimensions and the VALUES in the cells match (using the precision limited comparison rules for numbers in PL) then the routine operation returns "1" otherwise "0"
NEW: Settings button in breakpoint dialog enables animation speed and routine stepping (if routine editor visible) to be changed within a breakpoint


NEW: Holding CTRL as the model restarts only prevents the restart if the system is in edit mode. This prevents a user CTRL-T-ing a model and having it enter "engine stopped" state
NEW: Scrollbars have proportional thumbs and a more 3D border style
(Unfortunately I cannot make them respond to mouse scroll events without replacing them with windows scrollbars and rewriting table views to be more like viewports)
BUGFIX: File locks fixed when multi word tags are used
CHANGE: If a table view has "No Block Edit" option on then the "Auto" cell submenu which includes fill and index options is not shown
NEW: Display option "3d Proportional Scrollbars" enables table scroll bars which have a thumb which resizes proportionally to the amount of data in the view.
NEW: Paint buttons have a new option which when selected, will cause that button to be "clicked" if the user presses <ENTER> on that panel


NEW: Ability to map network resources when running under a different account
When /LOGIN is used to run a PL session in a different user account, it causes a new user context to be set up which will not have any of the shared drives of the original account mapped.
PL can now perform this mapping process using an additional command line option: /SHARES=<ini file name>
The file spec specified can be the model INI file (but does not need to be). The file should have a section called [shares] and within that, one or more local drive / network name pairs, both in double quotes.
[shares] "o:" "\\laptop\work1" "p:" "\\pippa\media"
If any of the shares fail to map, PL will give an error and not load.
NEW: Pressing close box on the tree explorer now stays at the destination panel instead of reverting to the original panel
<ESC> key will close and revert to the original panel


NEW: "Retain on paste/replace" table option
This will cause a table in a replaced portal to be "retained". This is achieved by copying the table data, options and column formatting from the original table to the table replacing it.

BUGFIX: The "Advance to time" dialog properly handles redrawing after a large time offset has already been advanced
BUGFIX: When copying data to the clipboard from tables, PL will now allocate and use a file in the user's temp directory rather than the working directory. It also deletes the file as soon as PL is done with it.
NEW: <TAB> is equivalent to <ENTER> for a standalone field such as in a table cell click

BEW Routine operation "Initiate Edit" (under special)
Begins editing of a view (Currently only table cell views)
This routine op requires a panel/portal reference which may be a popup. It will initiate editing of cell views, chosing the view with the lowest non zero "edit order" value.
This acts as if the user clicked upon the field and simulates a form setting initial focus on a field.
The edit occurs while the routine is executing - ie: the current item has not left the change object; the routine is suspended at the line of this routine operation.


NEW: Data sets are now a label list, so they can be referred as labels in a routine rather than just as a number
NEW: System attribute: Owner Of Panel Visible
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 indicies.


NEW: Now support 30 data set files
The "Save All" data set ID is now 31 - any models using "9" to save all must be updated
BUGFIX: Dial display bug in



BUGFIX: Management of palette icons cleaned up to prevent bogus load error messages after a standalone exe was created


BUGFIX: Better display of "private" cells
BUGFIX: Cleanup/rewrite of some of the stat/view code to try simplify it a bit
Dials now follow the control attribute for the attribute view. The view can still be separately hidden using its "Make Hidden" option (and recovered using the Edit->Views menubar option)
NEW: Dials can dynamically change colour of pointer/label text according to an attribute. This attribute has the same scope as the portal attribute or table cell the dial is associated with


BUGFIX: Dataset read and write (routine control) - now will remap filenames that include a '*'
NEW: I'm using locking for dataset file writes and reads (routine only)
During a write, no-one else can open the file for read During read, no-one else can open the file for write
If an "open" (either read or write) fails, it waits 3 seconds and retries, up to 5 times.
IF you need more timeout on your file (ie: takes 20 seconds to read) let me know


BUGFIX: Dragging a portal with run active should now retain its state icon during the drag
NEW: System string attribute to get the current computer's name. Useful for identifying file locks
NEW: File lock management added (change object->file)
2 new file modes are supported:
"Acquire File Lock" and "Release File Lock"
A file lock is a file that an instance of Planimate keeps open to enable a mutual exclusion (mutex) mechanism to be set up. This is often useful in database applications where you need to lock multiple users from accessing a resource simultaneously. In this case the lock would reside in a shared directory.
(note: The supporting network must support file locking)
Planimate opens/creates a lock file with shared read and exclusive write permissions. This means other instances can read the file but not control it.
The Acquire File Lock operation works as follows:

  • The target file (specified directly or via a label) is the lock file. It is suggested that a ".LCK" extention be used. THIS FILE WILL BE OVERWRITTEN so ensure it is not pointing at a data file.
  • If present, the first data target will be interpreted as a string and written to the file, as a "tag" to help identify who has the lock.

It may be useful to use the recently added ability to specify a table row here so an informative line containing user name, time and computer name can be written.

  • If the lock is successful, the error result target is set to 0, otherwise a non zero error code (see below) is set. If an error occurs, detail of this error is available as a string in the new system attribute "Last Lock File Error". If the error is that another user has the lock, then this attribute will contain the "tag" and should be displayed to the user.
  • If acquiring a lock fails, the system will sleep 3 seconds and try again. It will do this 3 times before returning a failure.
  • It is valid to acquire a lock on a file multiple times. In this case the lock file is "verified" (against the original tag) to ensure the lock is still valid. A lock can be lost (unknown to PL) if a network outage occurs or the server is rebooted.
      • Hence it is a good idea to verify locks which have been open for a long time at strategic times; eg before starting a data write after an edit session.
  • Locks persist when the simulation engine stops/restarts

The Release File Lock operation works as follows:

  • The target file specifies the lock file to close. If this file is currently in the known lock list, it is verified that it in fact still has the correct "tag" and the file is closed and deleted.

If verification fails or the file was not originally acquired (or previously went stale and was removed from the lock list), an error code is returned (Stale Lock).
Both lock operations set the "Last File Accessed" system attribute to the actual name of the lock file, mainly to assist in debugging and diagnostics.
The Edit menu contains a new "File Locks" option which will list any current open lock files and their tags. The locks are also verified.
Both lock operations will return status codes from the following table:
0: Indicates the lock was acquired/confirmed or released without problem 1: Failed to acquire a lock; either the lock file is in use by another instance or there is a network problem. More detail is in the "Last Lock File Error" system attribute 2: Attempt to release a lock on a file that this instance did not have a lock registered 3: Stale Lock. This can occur either when reacquiring (verifying) a lock or releasing a lock. It indicates that the lock file is no longer valid perhaps because of a network outage.
It is recommended that lock files do not get kept open "all day" but rather that user interfaces are designed such that a user acquires a lock only when they are ready to make a change. This will help reduce stale locks.


BUGFIX: If the routine editor was positioned off screen by someone with a bigger work area, it gets brought into view when opened.
BUGFIX: Copying a portal between models and CTRL-pasting over another portal in a different model caused a crash. I have resolved this (by not referencing the original portal after the ctrl-paste)
NEW: Columns have a "keep private" option. This will keep the display of the column empty in a view and cause "*"s to be displayed for editing the value/label in a field. It does not affect the popup label list so it should be used with the "Edit Labels In Place" option.
No protection is provided for copying the column into the clipboard
(the option is intended to make password entry possible where you would start with an empty cell)
NEW: Planimate can run in a different user account than the user that launches it. This means Planimate can have access to data which the user cannot access from explorer.
This works as follows:

  • The shortcut which launches Planimate needs to include the /LOGIN=filespec command line option, where filespec points to a password file. This file is generated using the ODBC Password Generator EXE (mentioned in release notes for 4.91J)
  • The generator EXE is used to create an encrypted file for Planimate containing the username and password of an account on the local machine to use
  • If a domain controller is used, the username entered in the password generator can be of the form "user@domain"
  • If /LOGIN is user and there is a problem opening the file or verifying the password, an error will be given and Planimate will close
  • Under Win2000, the user account which launches Planimate must have SE_TCB_NAME privilege and in some cases SE_CHANGE_NOTIFY_NAME as well

The target account must have SE_LOGON_INTERACTIVE privilege

A significant rework of the track rules was made. This was done to resolve situations where an item in a section following a junction following a loop following another loop was preventing movement from the first loop in the chain, due to over zealous lookahead.
By default existing models will have a new Modelling Option "Engine: Older Track Lookahead Method" turned ON. Turn this OFF to activate the new algorithm.
Other Track related changes:

  • big cleanup to the lookahead/junction testing mechanism. Junction testing is now separate, done at section testenter time rather than depending on loop CheckNext to invoke it. Should improve "Route Step Lookthrough" with portals.
  • Removed the "max track lookahead" control variable
  • new System attribute "Doing Track CheckNext Lookahead" and portal option "Handles Lookahead Tests"

More Detail -----

These are experimental and should enable advanced track modelling to be performed. The detail below assumes thorough knowledge of the tracks system's operation.
When a track object (eg loop) wants to try move a train to another object, it does 2 tests:

  • TestEnter: Checks for capacity at an adjacent object
  • CheckNext: Checks further down the track for impending congestion (I often call this Track Lookahead which is different to Planimate item-on-flow lookahead)

By turning on the new portal option "Handles Lookahead Tests" and testing the system attribute "Doing Track CheckNext Lookahead", the modeller can give a controlled response to the CheckNext tests that the track network propagates.
For portals with the option off, Planimate will take default action. If the portals have either of their junction options on, PL will step to the next object along the route (includes intervening loops) and try test that.
Using this flag a modeller can tell the track systme whether a portal is safe to consider moving towards, even if the train is some distance back and not directly "TestEntering".
By directing the incoming train item towards an exit, the portal indicates it is safe to proceed towards it. By directing the incoming train towards a blocked path eg: a guide with no other flow, it indicates not to proceed.
By directing the incoming item towards a portal exit, it indicates that the test should be repeated at the NEXT object along the train's route.
Its important to realise that this path is only "tested" by the lookahead mechanism - an item entering should never actually move along it! That is enabled by testing the system attribute "Doing Track CheckNext Lookahead" using a non blocking switch (so the test is done during lookahead).
This mechanism should only be used with the "older track lookahead' modelling option (provided for compatability of existing models) switched OFF

  • Enhanced Track Unblocking debugging. Portal, loop and section menus contain an "unblock" option. This will report why a train is blocked, starting at the first object to report the blockage and working back towards the start of the unblock.

NEW: Routine operation "Create Password Hash"
This (label) routine operation takes the formatted string of 3 attrefs and creates a 32 character hash using the RSA MD5 hashing algorithm.
A modeller can use this to scramble passwords which can then be stored as in label lists without need to obscure them in datasets. This is used as follows:

  • Let user enter username/password. The password is stored in a temporary label list as cleartext
  • Use this new routine operation to create a hash of the password. This is what gets retained in say a "passwords" label list.
  • Clear the temporary label list - so the cleartext password is lost
  • When a user "logs in" do the same thing (so you end up with a hash of whatever they typed) then compare the 2 hashed strings

The hash is secure; even if a user knows the hash, they have no easy way to determine which password to use to create the hash that is expected.
HOWEVER... further security is necessary to prevent users "copy pasting" known hashes (eg: their own hash for which they know the password) to a different user (with say different access level) which they want to impersonate.
Hence, to create a secure hash, the 3 fields of this routine operation should be used as follows:
Field 1 should be set to the username. The modeller should retain this separately (in cleartext) Field 2 should be set to the entered cleartext password, which the modeller then discards (as described above) field 3 should be set to a "secret" application/version/zone specific name or string. This string should not appear in datasets, panels or be guessable.
The reason for this is described below.
Using all 3 fields to generate the hash prevents a user copying their hash over a different user and logging in as them using their own password.
The third field is useful to prevent a diligent hacker from using their username/password/hash to hack another application which uses this mechanism but they have no rights to access.
NEW The Format Into Label routine operation has been enhanced.
If the source is a table ROW specification, then the contents of the cells in that row will be appended together to form a label.
This is very useful in constructing say file names and paths. No delimiters are added between the columns but a modeller can dedicate certain columns to being delimiters. This gives maximum flexibility in how the cells get "packed" together.
The 63 character label string limit does apply so be careful in your design.

NEW: File name remapping (as used in model INI files to map internal file names to external file names/paths) has been enhanced.
One or more vertical bar (pipe symbol "|") can be used to separate parts of a file name so they are remapped separately. So a file name like "theroot|thefolder|thename.dat" can be used with "theroot" and "thefolder" being separately remappable.
The text following the last '|' is not remapped, however it is OK to use "theroot|thefolder|thename.dat|" to make it all remappable.

NEW: Ctrl-A can be used while paused (developers only) to cause the engine to advance/process ONE FEC event only. This will be even more useful when I add a rolling FEC display window ....
After this event then engine returns to paused (even if other zero time events are pending. Pause/continue BCs are not sent for this key.
NEW: Items ignore clicks if the shift key is down. This enables a modeller to click on objects under the items.
BUGFIX:A warning is given if a portal is copied between models and the calendar time references for the portal and the new model's differ (potentially scrambling any dates inside hte portal)
BUGFIX:Fixed model merging issues with scoped item classes being looked up as "global" when they should not have been (causing bogus merging to occur)
BUGFIX:Fixed issues with references to scoped classes being saved by name not by ordinal (class attribute references) causing possible incorrect loading if scoped classes had same name as global classes
NOTE:Class label list name lookup and socket broadcast<->class mappings are only supported for global classes
BUGFIX: Rewrite and cleanup startup code; fix standalone key bug
BUGFIX: Alignment of field and combo LHS was out by 1 pixel This is inherent in Windows and I've put in an adjustment for fields to compensate
BUGFIX: Label lists, Sub Label Lists and Multi Labels were not being properly updated when copied to a different model. If an attempt to edit them was made without the model having been saved/reloaded, a crash would occur
BUGFIX: Panel selector and Dynamic panel selectors were swapped about

idkbase note 218