Routine Editor

From Planimate Knowledge Base
Jump to: navigation, search

This dialog lists and enables editing of a Planimate Routine.

A routine is a series of steps that are performed when it gets triggered. For example, for a routine in a change object, this occurs when an item flows through the change object.

Routines can also be associated with track loops to assist in logging train movement.

Key features of Planimate routines:
- a colour coded display of the routine

  • context sensitive editor and operation browser
  • lookahead - the option to perform all or part of a routine as part of the decision making proces on whether an item should move
  • support for common programming structures such as IF, ITERATE, SELECT-CASE and WHILE
  • support for local routine attributes. These are very fast to access and should be used where possible especially in speed critical loops
  • the ability to call local subroutines which can share the parent routine's attributes as well as have their own private attributes (enabling recursion)
  • the ability to send an item message to another part of the model and wait for it to return before continuing the routine
  • the ability to send a broadcast (not sent until after the routine has completed)
  • the ability to call a DLL which complies to the Planimate DLL SDK
  • support for conditional breakpoints and an animated step through of routine lines at runtime
  • the ability to share a given routine definition between many objects. This does not save memory but does mean a routine called in many locations can be edited in one place only.
  • ability to quickly prevent lines from executing without having to remove it or wrap it in an IF/ENDIF
  • inbuilt profiling showing how often each routine line has been taken, as well as summaries on routine line execution times (Tools->Show Run Profile, also check the debugging options)

To edit a routine, use the up and down arrow keys to select a line and press space to edit it or add a new line (if the last line is selected). A line can also be double clicked or right clicked for a context menu with other editing operations.

The selected routine line auto-advances after an edit

There is a single level of undo, using CTRL-Z

To close the routine window, press ESCAPE.

Cut and Copy/Paste are supported. For these, multiple lines can be selected using the shift key. Planimate always uses an entire selection, even if not all lines in it are selected.

Menu Bar
The menu bar has the following commands which apply to the whole routine



Routine Attributes

Sub Routines

These shortcut keys are supported in the routine list:
"[" Jump to start of code block
"]" Jump to end of code block
"-" Toggle disable/enable of line
"A" Edit routine attributes
"D" Duplicate the current line
"E" Edit details for the current line
SPACE Edit details for the current line
"M" Show the context menu for the current line
CTRL-C Copy selected range
CTRL-X Cut selected range
CTRL-V Paste copied rows at the current row
CTRL-Z Undo the last edit
INS Insert a new row at the current row
DEL Delete the current selected row range
ESC Close editor
UP Previous line
DOWN Next Line
/ Edit the comment for the currently selected line

idkbase note 10162