|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Conditional
A Conditional is layout control logic, consisting of a logical expression and an action.
A Conditional does not exist on its own, but is part of a Logix. The system name of each Conditional is set automatically when the conditional is created. It begins with the system name of its parent Logix. There is no Conditional Table. Conditionals are created, editted, and deleted via the Logix Table.
A has a "state", which changes depending on whether its logical expression calculates to TRUE or FALSE. The "state" may not be changed by the user. It only changes in response to changes in the "state variables" used in its logical expression.
Listeners may be set to monitor a change in the state of a conditional.
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.
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Request a call-back when the bound KnownState property changes. |
int |
calculate(boolean logixEnabled)
Calculate this Conditional, triggering either or both actions if the user specified conditions are met, and the Logix is enabled. |
void |
cancelSensorTimer(String sname)
Stop a sensor timer if one is actively delaying setting of the specified sensor |
void |
cancelTurnoutTimer(String sname)
Stop a turnout timer if one is actively delaying setting of the specified turnout |
void |
deleteAllStateVariables()
Delete all State Variables from this Conditional |
void |
dispose()
Remove references to and from this object, so that it can eventually be garbage-collected. |
void |
getAction(int[] opt,
int[] delay,
int[] type,
String[] name,
int[] data,
String[] s)
Get action parameters for action 1 and action 2 |
int |
getNumStateVariables()
Get number of State Variables for this Conditional |
int |
getState()
State of the Conditional is returned. |
String |
getStateVariableDataString(int index)
Provide access to data string of state variable by index Note: index ranges from 0 to numStateVariables-1 |
String |
getStateVariableName(int index)
Provide access to Name (user or system, whichever was specified) of state variable by index Note: index ranges from 0 to numStateVariables-1 |
int |
getStateVariableNum1(int index)
Provide access to number 1 data of state variable by index Note: index ranges from 0 to numStateVariables-1 |
int |
getStateVariableNum2(int index)
Provide access to number 2 data of state variable by index Note: index ranges from 0 to numStateVariables-1 |
int |
getStateVariableOperator(int index)
Provide access to operator of state variable by index Note: index ranges from 0 to numStateVariables-1 |
void |
getStateVariables(int[] opern,
int[] type,
String[] name,
String[] data,
int[] num1,
int[] num2,
boolean[] triggersCalc)
Get State Variables for this Conditional. |
boolean |
getStateVariableTriggersCalculation(int index)
Provide access to triggers option of state variable by index Note: returns true if Logix should listen for changes in this state variable to trigger calculation (default) and returns false if the listener should be suppressed. |
int |
getStateVariableType(int index)
Provide access to type of state variable by index Note: index ranges from 0 to numStateVariables-1 |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a request for a call-back when a bound property changes. |
void |
setAction(int[] opt,
int[] delay,
int[] type,
String[] name,
int[] data,
String[] s)
Set action parameters for action 1 and action 2 |
void |
setState(int state)
State of Conditional is set. |
boolean |
setStateVariables(int[] opern,
int[] type,
String[] name,
String[] data,
int[] num1,
int[] num2,
boolean[] triggersCalc,
int numVariables)
Set State Variables for this Conditional. |
| Methods inherited from interface jmri.NamedBean |
|---|
getComment, getNumPropertyChangeListeners, getSystemName, getUserName, setComment, setUserName |
| Field Detail |
|---|
static final int TRUE
static final int FALSE
static final int UNKNOWN
static final int MAX_STATE_VARIABLES
static final int OPERATOR_AND
static final int OPERATOR_NOT
static final int OPERATOR_AND_NOT
static final int OPERATOR_NONE
static final int NUM_STATE_VARIABLE_TYPES
static final int TYPE_SENSOR_ACTIVE
static final int TYPE_SENSOR_INACTIVE
static final int TYPE_TURNOUT_THROWN
static final int TYPE_TURNOUT_CLOSED
static final int TYPE_CONDITIONAL_TRUE
static final int TYPE_CONDITIONAL_FALSE
static final int TYPE_LIGHT_ON
static final int TYPE_LIGHT_OFF
static final int TYPE_MEMORY_EQUALS
static final int TYPE_FAST_CLOCK_RANGE
static final int TYPE_SIGNAL_HEAD_RED
static final int TYPE_SIGNAL_HEAD_YELLOW
static final int TYPE_SIGNAL_HEAD_GREEN
static final int TYPE_SIGNAL_HEAD_DARK
static final int TYPE_SIGNAL_HEAD_FLASHRED
static final int TYPE_SIGNAL_HEAD_FLASHYELLOW
static final int TYPE_SIGNAL_HEAD_FLASHGREEN
static final int TYPE_SIGNAL_HEAD_LIT
static final int TYPE_SIGNAL_HEAD_HELD
static final int ACTION_OPTION_ON_CHANGE_TO_TRUE
static final int ACTION_OPTION_ON_CHANGE_TO_FALSE
static final int ACTION_OPTION_ON_CHANGE
static final int NUM_ACTION_TYPES
static final int ACTION_NONE
static final int ACTION_SET_TURNOUT
static final int ACTION_SET_SIGNAL_APPEARANCE
static final int ACTION_SET_SIGNAL_HELD
static final int ACTION_CLEAR_SIGNAL_HELD
static final int ACTION_SET_SIGNAL_DARK
static final int ACTION_SET_SIGNAL_LIT
static final int ACTION_TRIGGER_ROUTE
static final int ACTION_SET_SENSOR
static final int ACTION_DELAYED_SENSOR
static final int ACTION_SET_LIGHT
static final int ACTION_SET_MEMORY
static final int ACTION_ENABLE_LOGIX
static final int ACTION_DISABLE_LOGIX
static final int ACTION_PLAY_SOUND
static final int ACTION_RUN_SCRIPT
static final int ACTION_DELAYED_TURNOUT
static final int ACTION_LOCK_TURNOUT
static final int ACTION_RESET_DELAYED_SENSOR
static final int ACTION_CANCEL_SENSOR_TIMERS
static final int ACTION_RESET_DELAYED_TURNOUT
static final int ACTION_CANCEL_TURNOUT_TIMERS
static final int ACTION_SET_FAST_CLOCK_TIME
static final int ACTION_START_FAST_CLOCK
static final int ACTION_STOP_FAST_CLOCK
static final int ACTION_COPY_MEMORY
| Method Detail |
|---|
int getNumStateVariables()
boolean setStateVariables(int[] opern,
int[] type,
String[] name,
String[] data,
int[] num1,
int[] num2,
boolean[] triggersCalc,
int numVariables)
Returns true if state variables were successfully set, otherwise false.
This method assumes that all information has been validated.
All the argument arrays must be of the same length, numVariables.
numVariables - the number of variables being set, also the length
of the parameter arraysopern - array of operator values, e.g. OPERATOR_NOT, OPERATOR_AND, etctype - array of type variables, e.g. TYPE_SENSOR_ACTIVE, etcname - array of system or user names for NamedBeans being referenceddata - num1 - num2 -
void getStateVariables(int[] opern,
int[] type,
String[] name,
String[] data,
int[] num1,
int[] num2,
boolean[] triggersCalc)
Returns state variables for this Conditional in supplied arrays.
This method should only be called by LogixTableAction and methods to save this conditional to disk in a panel file.
int getStateVariableOperator(int index)
int getStateVariableType(int index)
String getStateVariableName(int index)
String getStateVariableDataString(int index)
int getStateVariableNum1(int index)
int getStateVariableNum2(int index)
boolean getStateVariableTriggersCalculation(int index)
void deleteAllStateVariables()
void setAction(int[] opt,
int[] delay,
int[] type,
String[] name,
int[] data,
String[] s)
void getAction(int[] opt,
int[] delay,
int[] type,
String[] name,
int[] data,
String[] s)
int calculate(boolean logixEnabled)
void cancelSensorTimer(String sname)
void cancelTurnoutTimer(String sname)
int getState()
getState in interface NamedBeanvoid setState(int state)
setState in interface NamedBeanvoid addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in interface NamedBeanvoid removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in interface NamedBeanvoid dispose()
dispose in interface NamedBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||