jmri.implementation
Class SensorGroupConditional

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.DefaultConditional
          extended by jmri.implementation.SensorGroupConditional
All Implemented Interfaces:
Serializable, Conditional, NamedBean

public class SensorGroupConditional
extends DefaultConditional
implements Serializable

Conditional.java A Conditional type to provide runtime support for Densor Groups.

This file is part of JMRI.

JMRI is free 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:
Pete Cressman Copyright (C) 2009
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jmri.implementation.DefaultConditional
_actionList
 
Fields inherited from interface jmri.Conditional
ACTION_CANCEL_SENSOR_TIMERS, ACTION_CANCEL_TURNOUT_TIMERS, ACTION_CLEAR_SIGNAL_HELD, ACTION_CONTROL_AUDIO, ACTION_COPY_MEMORY, ACTION_DELAYED_SENSOR, ACTION_DELAYED_TURNOUT, ACTION_DISABLE_LOGIX, ACTION_ENABLE_LOGIX, ACTION_JYTHON_COMMAND, ACTION_LOCK_TURNOUT, ACTION_NONE, ACTION_OPTION_ON_CHANGE, ACTION_OPTION_ON_CHANGE_TO_FALSE, ACTION_OPTION_ON_CHANGE_TO_TRUE, ACTION_PLAY_SOUND, ACTION_RESET_DELAYED_SENSOR, ACTION_RESET_DELAYED_TURNOUT, ACTION_RUN_SCRIPT, ACTION_SET_FAST_CLOCK_TIME, ACTION_SET_LIGHT, ACTION_SET_LIGHT_INTENSITY, ACTION_SET_LIGHT_TRANSITION_TIME, ACTION_SET_MEMORY, ACTION_SET_SENSOR, ACTION_SET_SIGNAL_APPEARANCE, ACTION_SET_SIGNAL_DARK, ACTION_SET_SIGNAL_HELD, ACTION_SET_SIGNAL_LIT, ACTION_SET_TURNOUT, ACTION_START_FAST_CLOCK, ACTION_STOP_FAST_CLOCK, ACTION_TRIGGER_ROUTE, ALL_AND, ALL_OR, FALSE, MAX_STATE_VARIABLES, MIXED, NUM_ACTION_OPTIONS, NUM_ACTION_TYPES, NUM_STATE_VARIABLE_TYPES, OPERATOR_AND, OPERATOR_AND_NOT, OPERATOR_NONE, OPERATOR_NOT, OPERATOR_OR, OPERATOR_OR_NOT, TRUE, TYPE_CONDITIONAL_FALSE, TYPE_CONDITIONAL_TRUE, TYPE_FAST_CLOCK_RANGE, TYPE_LIGHT_OFF, TYPE_LIGHT_ON, TYPE_MEMORY_COMPARE, TYPE_MEMORY_EQUALS, TYPE_NONE, TYPE_SENSOR_ACTIVE, TYPE_SENSOR_INACTIVE, TYPE_SIGNAL_HEAD_DARK, TYPE_SIGNAL_HEAD_FLASHGREEN, TYPE_SIGNAL_HEAD_FLASHLUNAR, TYPE_SIGNAL_HEAD_FLASHRED, TYPE_SIGNAL_HEAD_FLASHYELLOW, TYPE_SIGNAL_HEAD_GREEN, TYPE_SIGNAL_HEAD_HELD, TYPE_SIGNAL_HEAD_LIT, TYPE_SIGNAL_HEAD_LUNAR, TYPE_SIGNAL_HEAD_RED, TYPE_SIGNAL_HEAD_YELLOW, TYPE_TURNOUT_CLOSED, TYPE_TURNOUT_THROWN, UNKNOWN
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT
 
Constructor Summary
SensorGroupConditional(String systemName, String userName)
           
 
Method Summary
 int calculate(boolean enabled, PropertyChangeEvent evt)
          Calculate this Conditional, triggering either or both actions if the user specified conditions are met, and the Logix is enabled.
 
Methods inherited from class jmri.implementation.DefaultConditional
cancelSensorTimer, cancelTurnoutTimer, getAntecedentExpression, getCopyOfActions, getCopyOfStateVariables, getLogicType, getState, setAction, setLogicType, setState, setStateVariables, validateAntecedent
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, dispose, firePropertyChange, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.Conditional
addPropertyChangeListener, dispose, removePropertyChangeListener
 
Methods inherited from interface jmri.NamedBean
getComment, getNumPropertyChangeListeners, getSystemName, getUserName, setComment, setUserName
 

Constructor Detail

SensorGroupConditional

public SensorGroupConditional(String systemName,
                              String userName)
Method Detail

calculate

public int calculate(boolean enabled,
                     PropertyChangeEvent evt)
Description copied from class: DefaultConditional
Calculate this Conditional, triggering either or both actions if the user specified conditions are met, and the Logix is enabled. Note: if any state variable evaluates false, the Conditional calculates to false. If all state variables evaluate true, the Conditional calculates to true. So, the first false state variable results in a false state for the conditional. Sets the state of the conditional. Returns the calculated state of this Conditional.

Specified by:
calculate in interface Conditional
Overrides:
calculate in class DefaultConditional


Copyright © 1997 - 2009 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