It runs a locomotive back and forth using time delays. It listens to two sensors, running a locomotive back and forth between themīy changing its direction when a Sensor detects the engine.ĪutomatonExample. ![]() This is an example script for a JMRI "Automat" in Python. You need to set the speed of the engine using a throttle. Running a locomotive back and forth between them by changing its direction when a sensorĭetects the engine. Occupancy detectors.) It is intended to be run from the Start-up Preferences. (Activity is detected by monitoring block On the layout for a specified amount of time. This script turns off power to the layout automatically after there has been no activity This script provides full layout automation, using connectivity info provided by Layout Waits for debounce time plus a bit to allow signals, etc. While auto train(s) are "moving", repeatedly activates "next" allocated block, and deactivate Simulator for Dispatcher AutoActiveTrains. Window with entry fields and radio buttons.įor more information about the use of RFID and the Id Tags Table, see Getting Started with RFID. Updating the OperationsPro Locomotive and Car Tables, and using Java swing to create a popup Script Output window, writing information to the System Console, updating the ID Tag Table, This script illustrates the use of the JMRI property change listener, writing to the Tag from one loco or car to another and eliminate dupicate assignment of RFID Tag to cars or locomotives. It will flag locomotive/car numbers that do not exist, as well as move an ID It will also update the OperationsPro Locomotive Table or Car Table if requested (check box on It does this by creating a property change listener on the ID Tag Table. This is an example script for invoking an AppleScript from JMRI on Mac OS X.Ī more advanced example of scripting, this script "listens" for new or changed ID Tag Table entries (RFID Tags)Īnd opens a window to allow the user to enter a user name (typically locomotive or car/wagon number) and comment. This is an example script to pulse an output based on a Fast Clock. Sample script to add a button to the main JMRI application window that loads a script You canĭirectly request that JMRI lock/unlock a Turnout via the Turnout Table, Routes and Logix. This script has been superseded by the "Lock" capability in JMRI 1.9.3 and later. Sample script to show put a button on the screen that will enable or disable local control To browse the most current set of scripts, please see the jython directory on the JMRI website. ![]() Script file in the "jython" folder of the JMRI program directory and click the Run InĭecoderPro, Run Script is in the Actions menu. Simulator" to run without connecting to a layout), then under the Scripting To run one of these scripts, start DecoderPro or PanelPro (set preferences to "LocoNet This page provides a short description of each, copied from the comment in the scripts The JMRI distributions come with a jython directory that contains a few example scripts.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |