Class SampleAutomaton2

All Implemented Interfaces:

public class SampleAutomaton2
extends AbstractAutomaton
This sample Automaton watches a Sensor, and adjusts the momentum of a locomotive using ops-mode programming when the sensor state changes.

The sensor and decoder are hardcoded, as this is an example of just the Automaton function. Adding a GUI to configure these would be straight-forward. The values could be passed via the constructor, or the constructor (which can run in any required thread) could invoke a dialog.

For test purposes, one of these objects can be created and invoked by a SampleAutomaton2Action.

For more information on JMRI support for automation classes, please see the JMRI Layout Automation in Java page.

See Also: