jmri
Class TransitSectionAction

java.lang.Object
  extended by jmri.TransitSectionAction

public class TransitSectionAction
extends Object

This class holds information and options for a Action to be applied when an automated train enters, exits, or is inside of a Section in a Transit.

A TransitSection holds specified TrainsitSectionActions. A TransitSection may have as many TransitSectionActions as appropriate. Each TransitSectionAction belongs to one and only one TransitSection.

TransitSectionActions are specified in two parts: 1. The "When" part specifies when after the automated train enters the Section the action is to be initiated. Optionally, each "when" may be delayed by a specified time (in milliseconds). 2. The "What" part specified what action is to occur.

TransitSectionActions are created and editted in the Transit Table, when Transits are defined.

This class provides support for SENSORACTIVE and SENSORINACTIVE "when"'s.

This file is part of JMRI.

JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Author:
Dave Duchamp Copyright (C) 2009, 2010

Field Summary
static int BLOCKENTRY
           
static int BLOCKEXIT
           
static int ENTRY
           
static int EXIT
           
static int LOCOFUNCTION
           
static int NUM_WHATS
          Constants designating the "what" (the action to be taken) of the Action
static int NUM_WHENS
          Constants representing the "when" (when the action is to be initiated) of the Action
static int PAUSE
           
static int RAMPTRAINSPEED
           
static int SENSORACTIVE
           
static int SENSORINACTIVE
           
static int SETCURRENTSPEED
           
static int SETLIGHT
           
static int SETMAXSPEED
           
static int SETSENSORACTIVE
           
static int SETSENSORINACTIVE
           
static int SOUNDHORN
           
static int SOUNDHORNPATTERN
           
static int STARTBELL
           
static int STOPBELL
           
static int TOMANUALMODE
           
static int TRAINSTART
           
static int TRAINSTOP
           
 
Constructor Summary
TransitSectionAction(int when, int what)
          Main constructor method
TransitSectionAction(int when, int what, int dataWhen, int dataWhat1, int dataWhat2, String sWhen, String sWhat)
          Convenience constructor
 
Method Summary
 void dispose()
           
 void disposeSensorListener()
           
 int getDataWhat1()
           
 int getDataWhat2()
           
 int getDataWhen()
           
 PropertyChangeListener getSensorListener()
           
 String getStringWhat()
           
 String getStringWhen()
           
 TransitSection getTargetTransitSection()
           
 Sensor getTriggerSensor()
           
 boolean getWaitingForBlock()
           
 boolean getWaitingForSectionExit()
           
 boolean getWaitingForSensor()
           
 Thread getWaitingThread()
          Operational access methods
 int getWhatCode()
           
 int getWhenCode()
          Access methods
 void initialize()
          initialize all operational instance variables (not saved between runs)
 void setDataWhat1(int n)
           
 void setDataWhat2(int n)
           
 void setDataWhen(int n)
           
 void setSensorListener(PropertyChangeListener l)
           
 void setStringWhat(String s)
           
 void setStringWhen(String s)
           
 void setTargetTransitSection(TransitSection ts)
           
 void setTriggerSensor(Sensor s)
           
 void setWaitingForBlock(boolean w)
           
 void setWaitingForSectionExit(boolean w)
           
 void setWaitingForSensor(boolean w)
           
 void setWaitingThread(Thread t)
           
 void setWhatCode(int n)
           
 void setWhenCode(int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_WHENS

public static final int NUM_WHENS
Constants representing the "when" (when the action is to be initiated) of the Action

See Also:
Constant Field Values

ENTRY

public static final int ENTRY
See Also:
Constant Field Values

EXIT

public static final int EXIT
See Also:
Constant Field Values

BLOCKENTRY

public static final int BLOCKENTRY
See Also:
Constant Field Values

BLOCKEXIT

public static final int BLOCKEXIT
See Also:
Constant Field Values

TRAINSTOP

public static final int TRAINSTOP
See Also:
Constant Field Values

TRAINSTART

public static final int TRAINSTART
See Also:
Constant Field Values

SENSORACTIVE

public static final int SENSORACTIVE
See Also:
Constant Field Values

SENSORINACTIVE

public static final int SENSORINACTIVE
See Also:
Constant Field Values

NUM_WHATS

public static final int NUM_WHATS
Constants designating the "what" (the action to be taken) of the Action

See Also:
Constant Field Values

PAUSE

public static final int PAUSE
See Also:
Constant Field Values

SETMAXSPEED

public static final int SETMAXSPEED
See Also:
Constant Field Values

SETCURRENTSPEED

public static final int SETCURRENTSPEED
See Also:
Constant Field Values

RAMPTRAINSPEED

public static final int RAMPTRAINSPEED
See Also:
Constant Field Values

TOMANUALMODE

public static final int TOMANUALMODE
See Also:
Constant Field Values

SETLIGHT

public static final int SETLIGHT
See Also:
Constant Field Values

STARTBELL

public static final int STARTBELL
See Also:
Constant Field Values

STOPBELL

public static final int STOPBELL
See Also:
Constant Field Values

SOUNDHORN

public static final int SOUNDHORN
See Also:
Constant Field Values

SOUNDHORNPATTERN

public static final int SOUNDHORNPATTERN
See Also:
Constant Field Values

LOCOFUNCTION

public static final int LOCOFUNCTION
See Also:
Constant Field Values

SETSENSORACTIVE

public static final int SETSENSORACTIVE
See Also:
Constant Field Values

SETSENSORINACTIVE

public static final int SETSENSORINACTIVE
See Also:
Constant Field Values
Constructor Detail

TransitSectionAction

public TransitSectionAction(int when,
                            int what)
Main constructor method


TransitSectionAction

public TransitSectionAction(int when,
                            int what,
                            int dataWhen,
                            int dataWhat1,
                            int dataWhat2,
                            String sWhen,
                            String sWhat)
Convenience constructor

Method Detail

getWhenCode

public int getWhenCode()
Access methods


setWhenCode

public void setWhenCode(int n)

getWhatCode

public int getWhatCode()

setWhatCode

public void setWhatCode(int n)

getDataWhen

public int getDataWhen()

setDataWhen

public void setDataWhen(int n)

getDataWhat1

public int getDataWhat1()

setDataWhat1

public void setDataWhat1(int n)

getDataWhat2

public int getDataWhat2()

setDataWhat2

public void setDataWhat2(int n)

getStringWhen

public String getStringWhen()

setStringWhen

public void setStringWhen(String s)

getStringWhat

public String getStringWhat()

setStringWhat

public void setStringWhat(String s)

initialize

public void initialize()
initialize all operational instance variables (not saved between runs)


getWaitingThread

public Thread getWaitingThread()
Operational access methods


setWaitingThread

public void setWaitingThread(Thread t)

getWaitingForSectionExit

public boolean getWaitingForSectionExit()

setWaitingForSectionExit

public void setWaitingForSectionExit(boolean w)

getTargetTransitSection

public TransitSection getTargetTransitSection()

setTargetTransitSection

public void setTargetTransitSection(TransitSection ts)

getWaitingForBlock

public boolean getWaitingForBlock()

setWaitingForBlock

public void setWaitingForBlock(boolean w)

getWaitingForSensor

public boolean getWaitingForSensor()

setWaitingForSensor

public void setWaitingForSensor(boolean w)

getTriggerSensor

public Sensor getTriggerSensor()

setTriggerSensor

public void setTriggerSensor(Sensor s)

getSensorListener

public PropertyChangeListener getSensorListener()

setSensorListener

public void setSensorListener(PropertyChangeListener l)

disposeSensorListener

public void disposeSensorListener()

dispose

public void dispose()


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