actions-en
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | actions-en [2024/01/20 17:34] (current) – [Notes:] rjversluis | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Action Setup ====== | ||
+ | [[: | ||
+ | |||
+ | [[: | ||
+ | * **Action Setup** | [[: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Index===== | ||
+ | {{: | ||
+ | ====Table column headers==== | ||
+ | **ID:** The unique action ID\\ | ||
+ | **Description: | ||
+ | **Type:** The type abbreviation (see table below). The type is set in the tab Definition.\\ | ||
+ | |||
+ | ====Double click==== | ||
+ | A double click will open the __**[[: | ||
+ | |||
+ | |||
+ | ====New==== | ||
+ | Add a new action to the list.\\ | ||
+ | Changing the ID\\ | ||
+ | The ID and description of an action can be changed by selecting the line in the list then writing the required text in the input fields. It is advisable to use self-explanatory IDs.\\ | ||
+ | ====Copy==== | ||
+ | Copy the selected action. This is of help if defining similar actions of the same kind.\\ | ||
+ | ====Delete==== | ||
+ | Delete the selected action.\\ | ||
+ | ====Documentation==== | ||
+ | Opens the default WEB browser with all actions in a printable format.\\ | ||
+ | ====Test==== | ||
+ | Unconditional test of the selected action.\\ | ||
+ | //Not all variables are set as which is the case in automatic mode.//\\ | ||
+ | |||
+ | \\ | ||
+ | =====Definition===== | ||
+ | {{: | ||
+ | |||
+ | ==== Type & ID ==== | ||
+ | With these two fields the object that should perform the action is defined. | ||
+ | The Type can be selected from the drop-down list (see the table below). | ||
+ | The ID of an existing object in the Type category can be selected from the dropdown list, otherwise it is left empty.\\ | ||
+ | \\ | ||
+ | For the type Locomotive and type Function the IDs of existing locomotives will be available for selection.\\ | ||
+ | \\ | ||
+ | The ID field for type Locomotive and type Function can be left empty if the following objects are used to trigger the action: | ||
+ | * Sensor **< | ||
+ | * Route | ||
+ | * Switch | ||
+ | * Schedule | ||
+ | In this case the Action Control of these objects will automatically handover the ID of the locomotive that triggers the action to the action itself.\\ | ||
+ | This makes it possible to define actions for locomotives and locomotive functions that apply to any particular locomotive that at that moment is on that route/ | ||
+ | For example: The light can be switched on (function F0) when starting a particular route or a whistle can be sounded before entering a tunnel.\\ | ||
+ | It is also possible to trigger such an action conditionally by using the action conditions. | ||
+ | |||
+ | **< | ||
+ | \\ | ||
+ | |||
+ | ==== Sub-ID ==== | ||
+ | Only for use with __**[[: | ||
+ | |||
+ | ====Command==== | ||
+ | The command to be performed by the object in the Type field is selected here. Only the commands that can be performed by the selected Type are available for selection (see table below)\\ | ||
+ | |||
+ | ===Triple dot button (...) === | ||
+ | Can be used to select the path to an external program or script for the type External. (See note on External below.) | ||
+ | |||
+ | ===Double quote=== | ||
+ | Optional if the Rocrail server runs under Windows to add a surrounding quotation: | ||
+ | < | ||
+ | "" | ||
+ | </ | ||
+ | Without this option the command would be like this: | ||
+ | < | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | ===Asynchroon=== | ||
+ | The external program, external script or XmlScript will be executed asynchrone to prevent blocking of the calling object.\\ | ||
+ | In some cases it is desired to wait until the external process has been ended. (For example: [[: | ||
+ | |||
+ | ====Parameter==== | ||
+ | Some commands require an additional parameter (see table below).\\ | ||
+ | \\ | ||
+ | ==== Types, Commands & Parameters ==== | ||
+ | ^ Type ^ Type \\ abbr. ^ ID ^ Commands | ||
+ | | Output | ||
+ | | AccGroup | ||
+ | | Sensor | ||
+ | | External | ||
+ | | Switch | ||
+ | | Route | st | Route | set, lockset, lock, unlock, open, closed, class | lockid (// | ||
+ | | System | ||
+ | | Signal | ||
+ | | Block | bk | Block | schedule, schedule_manual, | ||
+ | | Staging block | sb | Staging block | unlock, white, yellow, green, red, open, closed, exitopen, exitclosed, compress | //unlock ID// | The color commands will set the exit signal defined for this block. \\ open/closed are for enter side. | | ||
+ | | Locomotive | lc | Locomotive | go, govirtual, stop, velocity, velocity2, percent dispatch, swap, blockside, carcount, min, mid, cruise, max, consist, assigntrain, | ||
+ | | Function | ||
+ | | Turntable | ||
+ | | Fiddle Yard | seltab | Fiddle Yard | goto | //track number// | | | ||
+ | | Text | tx | Text | update, __**[[variable-en# | ||
+ | | Sound | sound | - | play, straigh, turnout | Sound file name. | Set the sound player device in the interface tab. \\ (RocNet only!) | | ||
+ | | [[: | ||
+ | | Car | car | Car | empty, loaded, maintenance | The new car status. | - | | ||
+ | | Operator | operator | Operator | addcar, removecar, loadcar, emptycar, class | Adding, removing, loading or emptying cars. | A comma separated list of car IDs. | | ||
+ | | Locality | location | Locality | minocc, fifo, go, schedule, scheduletable | Sets the minimal occupation in this locality. \\ go and schedule will start random a loco. | parameter: minocc number or 0/1 for fifo de/ | ||
+ | | Weather | weather | Weather | setweather, weathertheme | Activates the selected weather(theme) ID. | At " | ||
+ | | Light | light | - | flip, enable, disable | Enable a light from LightControl | | | ||
+ | | Clock | clock | - | set | divider, | ||
+ | |||
+ | ¹ When velocity or percent is negative the execution of the action will not only set the locomotive speed, but also change direction. Please note that only a negative value changes direction, it is **not** the case that negative means backwards and positive forwards.\\ | ||
+ | ² Hint: To debug not working external program calls; In the trace lines containing the executed command look like this // | ||
+ | ³ Function commands are send to all wagons in the operator train.\\ | ||
+ | |||
+ | ====Notes: | ||
+ | ==Type External:== | ||
+ | If this type is used to execute an external program or script the path of the program (including parameters) or script is written in the command field. The path should exist on the server computer, so if you use the TrippleDot (...) button on another computer than the one the Rocrail server is running on it will probably not match.\\ | ||
+ | Alternatively a program can be started in its own process running a Unix system. (myprog.sh &)\\ | ||
+ | XMLScript files must be set without path, see __**[[: | ||
+ | |||
+ | ==Playback== | ||
+ | A record file, *.txt, can also be selected as external command to play back.\\ | ||
+ | See: **[[rocview: | ||
+ | Extra parameters are ignored.\\ | ||
+ | |||
+ | ==XMLScript== | ||
+ | A XMLScript file, *.xml, can also be selected as external command to run.\\ | ||
+ | See: **[[xmlscripting-en|XMLScripting]]**\\ | ||
+ | Extra parameters are ignored.\\ | ||
+ | |||
+ | ==VLC== | ||
+ | **Example: Sound playback with VLC** | ||
+ | |||
+ | Install **[[https:// | ||
+ | Define an action:\\ | ||
+ | Type: “run ext. program”\\ | ||
+ | Leave default “Double quote” and “Asynchrone” unchanged.\\ | ||
+ | Command: “C: | ||
+ | Parameter: “C: | ||
+ | |||
+ | Explanation of the parameters: | ||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | |||
+ | Further parameters: | ||
+ | '' | ||
+ | |||
+ | The action can be triggered by a block or a feedback.\\ | ||
+ | |||
+ | ==== Duration ==== | ||
+ | The duration of the action in 100ms units; 10 = 1s. Time unlimited in case of zero.\\ | ||
+ | Only used for function commands.\\ | ||
+ | |||
+ | ==== Timer ==== | ||
+ | Number of ms to wait before executing this action after the action has been triggered.\\ | ||
+ | |||
+ | This can be used, for example, to sound a whistle before a tunnel without having to install a separate sensor. The action can be triggered with the last (distant) sensor and be performed after the timed delay just before the tunnel.\\ | ||
+ | |||
+ | An action control can be used to trigger several actions at the same time but are then performed with different time delays one after another.\\ | ||
+ | |||
+ | ==== Activation time ==== | ||
+ | ===Use=== | ||
+ | If the action is to be triggered at a particular time **Use** should be checked and the required time should be entered.\\ | ||
+ | The time refers to the Rocrail clock and not to the real time. There maybe situations in which it is useful to have the Rocrail clock run faster than the real clock, for example to implement a 24h day/night control.\\ | ||
+ | If the **[[: | ||
+ | |||
+ | ===Every=== | ||
+ | This action will be executed every hour + minutes after it has been enabled by an action control with state " | ||
+ | It can be disabled by an action control with state " | ||
+ | The **Use** must be checked to activate the every timer.\\ | ||
+ | The **Random** option must be disabled.\\ | ||
+ | The shortest execution interval is one minute.\\ | ||
+ | |||
+ | ===Random=== | ||
+ | This action will be executed at a random interval.\\ | ||
+ | The random activation time is relative between 1 minute and the activation time specified. The resolution is in scale minutes.\\ | ||
+ | The **Use** must be checked to activate the random timer.\\ | ||
+ | The **Every** option does not have any usage if **Random** is set.\\ | ||
+ | |||
+ | ===Activated=== | ||
+ | Pre activation option; No event needed to be evaluated in case of activation time.\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | |||
+ | =====Usage===== | ||
+ | This tab lists all other objects, //"ID (type)"//, | ||
+ | {{: | ||
+ | A double click on an object in the list will open the **[[: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Interface===== | ||
+ | The address of the sound player device/ | ||
+ | {{: | ||
+ | If the sound command is straight or turnout a switch command is generated.((The given sound file name is ignored.))\\ | ||
+ | If the sound command is play an action command is generated which is supported by: | ||
+ | * RocNet | ||
+ | * RocNetNode | ||
+ | * Virtual | ||
+ | |||
+ | \\ | ||
+ | =====Report===== | ||
+ | {{: | ||
+ | A double click will open the selected object.\\ | ||
+ | ====Generate==== | ||
+ | Generates a report of all used actions in all objects.\\ | ||