User Tools

Site Tools


actionctrl-en

Differences

This shows you the differences between two versions of the page.


actionctrl-en [2023/10/20 08:14] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Action Control ======
 +[[:english#objects|{{  :objects.png}}]][[:english|{{  :rocrail-logo-35.png}}]]
  
 +[[:english|Content]] -> [[:english#objects|Objects]] ->   [[timed-actions-en|Actions]]
 +  * [[:actions-en|Action Setup]] | **Action Control** | [[:actionctrl-en#system-actions|System Actions]] | [[:actioncond-en|Action Condition]] | [[:xmlscripting-en|XML Scripting]] | [[action-example-en|Example]]
 +\\  
 +
 +===== Description =====
 +Action controls trigger actions when the states of Rocrail objects change.
 +An action control is therefore **not part** of an action but can control one. 
 +An action control is part of the object that is used to trigger the action (eg sensor, switch, route)
 +
 +The button for setting up an action control (trigger) is mostly found on the General tab of the Rocrail object to be used to control the action.
 +
 +It is possible to have several actions controlled by the state change of one action control object
 +It is possible to have one action triggered by the state change of several different action control objects\\
 +
 +__
 +Before an action control can be set up__ , the action that is to be controlled **must first** be defined in [[:actions-en|Action Setup]]
 +
 +
 +===== Setup =====
 +{{:actions:action-ctrl-en.png?600}}\\
 +The list contains the actions that are to be triggered.
 +\\
 +====UP/Down====
 +Move the selected action control up or down in the list.\\
 +====Copy====
 +Copy the selected action control(s) to the clipboard as XML text.\\
 +This can also be pasted in a text editor for expert viewing. It can be manually modified and re-copied to the clipboard.\\
 +{{:actions:actionctrl-paste.png}}\\
 +The listbox is multi selectable to enable copying of more then one action control.\\
 +
 +====Paste====
 +Add the action control(s) from the clipboard to the list.\\
 +
 +==== ID ====
 +An action ID can be selected from a dropdown list of all previously defined actions in [[:actions-en|Action Setup]].\\
 +==== State ====
 +The state value entered here is the state that the action control object (trigger) has to change to for the action to be triggered.
 +
 +Depending on the action control object being used, only the states available for that object will be presented in the dropdown field as listed below:\\
 +The field can be edited with additional parameters (count, track number etc.) if necessary.
 +
 + \\
 +^ Object ^ State ^ Remark ^
 +| Sensor | on, off, true, false,<count><sup>3</sup>,shorton,longon<sup>4</sup>,regval | |
 +| Output | on, active, off,shorton,longon<sup>4</sup>, longclick | Output objects do not contain loco information. |
 +| Switch | turnout, straight, left, right, none, lock, unlock | Use "none" if the action should __not__ activated by left-clicking on the __**[[:symbols-themes-accessories-en#action_controls|accessory (switch) object]]**__, but __only__ from it's command menu. |
 +| Signal | red, yellow, green, white, blank, blockstate, aspect number | |
 +| Loco | home, forwards, reverse, diesel, steam, electric, battery, min, mid, cruise, max, fon, foff, +, -, #, x, light, lightgoods, local, goods, post, ice, mixed, regional, shunting, cleaning, none, service, commuter, class, schedule:, idle, wait, auto, run, manual, automatic, stop, stall, f1-f28, __**[[:rocrailini-automode-en#event_timeout|eventtimeout]]**__, eventtimeoutreset | Substate for energy: high, middle and low. |
 +| Block | ghost, enter, occupied, reserved, free, closed, open, depart¹, acceptident<sup>2</sup>, exit(unexpected), codemismatch | occupied is triggered at in |
 +| Staging block | ghost, enter, occupied, reserved, free, closed, depart<sup>1</sup>, exit, section, timeout, timeoutreset | "exit" is performed, if the **exit** event will follow on the **in** event.  Requirement: __**[[sensors_and_blocks-en#sensor_events|Exit sensor]]**__\\ In case of "section" the sub state must be set to the wanted section ID or to *. |
 +| Route | go, lock, unlock | "lock" is performed when the route is set (the Route is reserved but the switches are not yet set).\\ "unlock" is performed when the Route is released. |
 +| Schedule | //leave blank// | |
 +| Turntable | goto <tracknumber>, next, prev, turn180, lighton, lightoff, calibrate, atposition <tracknumber> | When goto is used without tracknumber, the action is triggered for every goto command, when goto <tracknumber> is used, the action is triggered only with a command to go to that particular track. \\ "atposition" is triggered by the Position Sensor in the Interface Tab or in the Turntable Add Track Dialog, without a track number for every message, with a track number only if the platform is on the corresponding track. |
 +| System | go-cmd, go-event, stop-cmd, stop-event, stoplocs, save, shutdown, analyse, reset, ebreak, init, initready, short-circuit, on-auto, off-auto, stagetimeout, stagetimeoutreset, exception-xxxx, __**[[:rocrailini-automode-en#event_timeout|eventtimeout]]**__, eventtimeoutreset, error | System actions are located in the __**[[:rocgui-menu-en#tables|Rocview Table Menu]]**__ \\ The **init** event is fired after all Command Station libraries has been loaded. \\ For processing **[[http://rocrail.net/software/rocrail-snapshot/rocrail/messages.xml|exception-xxxx]]** the __**[[:rocrailini-automode-en#check_trace_actions|Check trace actions]]**__ must be activated on the Rocrail Automatic Tab.  |
 +| Text | //leave blank// | the action is raised when [[:text-en#dynamic_text|dynamic text]] is updated | 
 +| Booster | load, short circuit | |
 +| MVTrack | in | |
 +| Variable | See __**[[:variable-en#action_status_and_conditions|Action status]]**__. | |
 +| Weather | sunrise, noon, sunset | |
 +| Location | scheduleupdate, occupdate | occupdate: callertext=LocoList, calleruserdata=actocc:minocc |
 +
 +
 +<sup>1</sup>) Depart for a departing train (not for a train running through!) is triggered at the same moment the route to the next destination is set.\\
 +<sup>2</sup>) Accept a new ident in auto mode.\\
 +<sup>3</sup>) The sensor counts the 'on' states. The action will be triggered if the count set in the state field match the counter of the sensor.\\
 +<sup>4</sup>) The short-/longon states are used for two different actions with the same sensor/output. The action is executed at off. Advised is not to combine short-/longon with other states.\\
 +:!: All state values are __case sensitive__.\\
 +
 + \\
 +
 +==== Sub state ====
 +The sub state is used in combination with:
 +  * Staging block and "section" state. 
 +  * Loco function "on" / "off".
 +  * Car function "on" / "off".
 +  * Loco energy "high, middle, low".
 + \\
 +
 +====Duration====
 +//In 100ms units//\\
 +If set greater then zero this value will overwrite the __**[[:actions-en#duration|duration in the action setup]]**__.\\
 +
 +====Timer====
 +//In milliseconds//\\
 +If set greater then zero this value will overwrite the __**[[:actions-en#timer|timer in the action setup]]**__.\\
 +
 +====Locomotive====
 +Can be use to set the loco ID for specific objects which do not have any loco information like outputs.\\
 +Usually left blank for most action control definitions.\\
 +  * Block objects overwrite this value with the loco ID which has reserved it.
 +  * Sensor objects overwrite this value with the identifier if detected. (RFID, Railcom...)
 +**Note:**// This field may show the last value used for this action after a restart of Rocrail.//\\
 + \\
 +====Description====
 +Optional description for use in the __**[[:symbols-themes-accessories-en#action_controls|Accessory Switch]]**__ type popup menu.\\
 + \\
 +
 +====Parameter====
 +//2.1.982+//\\
 +Optional parameter(s), CSV, for XMLScript actions.\\
 +Variable naming for the parameter(s) are "%param1%...%paramN%".\\
 +{{:xmlscript:actionctrl-param-en.jpg?300}}\\
 + \\
 +====Reset====
 +Reset the counter in case of a sensor object.\\
 +If this option is not set, the counter will continue and actions defined for a higher counter value can be triggered.
 +For the action to be triggered with the highest counter value this option must be set otherwise actions requiring a lower counter value will not be triggered.
 +
 + \\
 +====All conditions must be true====
 +At default all defined conditions of this action control must be all true.\\
 +By disabling this option only one of the conditions must be true.\\
 +
 + \\
 +====At Command/Event====
 +For switch, outputs and signal objects to define if actions will be checked at a command and/or at an event.\\
 +Events are usually generated by the command station.\\
 +If both options are enabled, and the command station also generates events after commands, the actions will be checked twice.\\
 +
 + \\
 +
 +==== Mode ====
 +===Automatic===
 +The action will only be triggered in automatic mode
 +
 +=== Manually ===
 +The action will only be triggered in manual mode
 +
 +=== Both ===
 +The action will be triggered in both automatic and manual modes\\
 +\\
 +==== Buttons ====
 +
 +=== Add ===
 +The selected type and ID will be added to the list
 +
 +=== Delete ===
 +The object selected in the list will be deleted
 +
 +=== Modify ===
 +Changes to an object must be confirmed with this button.\\
 +
 +
 +
 + \\
 +=====System-Actions=====
 +
 +In **Roview Table Menu-> System-Actions** Actions can be set, which are triggered by **Rocrail system events**\\
 +The same actions and conditions can be used as in objects.\\
 +System events = system states: see table above __**[[actionctrl-en#state|System -> State]]**__
 +\\
 +The typical use-case for system actions is to set actions to a defined state when starting a Rocrail session.
 +\\
 +\\
 +Some Examples:
 +   * set all buttons in the plan on "red" when "init" (initializing Rocrail)
 +   * start a XML-script with the event "on-auto" bzw. "off-auto" (auto-mode on, auto-mode off)
 +   * set a output if "short-circuit" to trigger a external alarm
 +   * ....
 +=====Common Buttons=====
 +__**[[rocview-common-buttons-en|Common Buttons]]**__