jmri.jmrit.automat
Class JythonAutomaton
java.lang.Object
jmri.jmrit.automat.AbstractAutomaton
jmri.jmrit.automat.JythonAutomaton
- All Implemented Interfaces:
- Runnable
public class JythonAutomaton
- extends AbstractAutomaton
This sample Automaton invokes a Jython interpreter to handle a script.
Access is via Java reflection so that both users and developers can work
without the jython.jar file in the classpath. To make it easier to
read the code, the "non-reflection" statements are in the comments
- Author:
- Bob Jacobsen Copyright (C) 2003
|
Method Summary |
protected boolean |
handle()
Invoke the Jython automat function |
protected void |
init()
Initialize this object. |
| Methods inherited from class jmri.jmrit.automat.AbstractAutomaton |
getCount, getName, getThrottle, readServiceModeCV, run, setName, setTurnouts, start, stop, wait, waitChange, waitMsec, waitSensorActive, waitSensorActive, waitSensorChange, waitSensorChange, waitSensorInactive, waitSensorInactive, waitSensorState, waitSensorState, waitTurnoutConsistent, writeOpsModeCV, writeServiceModeCV |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JythonAutomaton
public JythonAutomaton(String file)
init
protected void init()
- Initialize this object.
- Create the Python interpreter.
- Load the generally-available objects
- Read the file
- Run the python init routine
Initialization of the Python in the actual
script file is deferred until the handle() method.
- Overrides:
init in class AbstractAutomaton
handle
protected boolean handle()
- Invoke the Jython automat function
- Overrides:
handle in class AbstractAutomaton
- Returns:
- True to continue operation if successful
Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.
Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: