jmri.jmrit.automat
Class JythonSiglet

java.lang.Object
  extended by jmri.jmrit.automat.AbstractAutomaton
      extended by jmri.jmrit.automat.Siglet
          extended by jmri.jmrit.automat.JythonSiglet
All Implemented Interfaces:
Runnable

public class JythonSiglet
extends Siglet

This sample Automaton invokes a Jython interpreter to handle a script that defines a Siglet implementation.

The python file should define two functions:

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

Nested Class Summary
 
Nested classes/interfaces inherited from class jmri.jmrit.automat.AbstractAutomaton
AbstractAutomaton.MsgFrame
 
Field Summary
 
Fields inherited from class jmri.jmrit.automat.Siglet
inputs, outputs
 
Fields inherited from class jmri.jmrit.automat.AbstractAutomaton
promptOnWait
 
Constructor Summary
JythonSiglet(String file)
           
 
Method Summary
 void defineIO()
          Initialize this object.
 void setOutput()
          Invoke the Jython setOutput function
 
Methods inherited from class jmri.jmrit.automat.Siglet
handle, init, setInputs
 
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
 

Constructor Detail

JythonSiglet

public JythonSiglet(String file)
Method Detail

defineIO

public void defineIO()
Initialize this object. Initialization of the Python in the actual script file is deferred until the Siglet.handle() method.

Overrides:
defineIO in class Siglet

setOutput

public void setOutput()
Invoke the Jython setOutput function

Overrides:
setOutput in class Siglet


Copyright © 1997 - 2011 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads