|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.AbstractNamedBean
jmri.DefaultConditional
public class DefaultConditional
Class providing the basic logic of the Conditional interface.
| Field Summary | |
|---|---|
protected int[] |
actionData
|
protected int[] |
actionDelay
|
protected String[] |
actionName
|
protected int[] |
actionOption
|
protected String[] |
actionString
|
protected int[] |
actionType
|
protected int |
currentState
|
protected ActionListener[] |
mDelayListener
|
protected Timer[] |
mDelayTimer
|
protected boolean[] |
mDelayTimerActive
|
protected int |
numStateVariables
Operational instance variables (not saved between runs) |
protected Sound[] |
snd
|
protected String[] |
varDataString
|
protected String[] |
varName
|
protected int[] |
varNum1
|
protected int[] |
varNum2
|
protected int[] |
varOperator
Persistant instance variables (saved between runs) |
protected boolean[] |
varTriggersCalculation
|
protected int[] |
varType
|
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT |
| Constructor Summary | |
|---|---|
DefaultConditional(String systemName)
|
|
DefaultConditional(String systemName,
String userName)
|
|
| Method Summary | |
|---|---|
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 |
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 |
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 class jmri.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 |
| Field Detail |
|---|
protected int[] varOperator
protected int[] varType
protected String[] varName
protected String[] varDataString
protected int[] varNum1
protected int[] varNum2
protected boolean[] varTriggersCalculation
protected int[] actionOption
protected int[] actionDelay
protected int[] actionType
protected String[] actionName
protected int[] actionData
protected String[] actionString
protected int numStateVariables
protected int currentState
protected Timer[] mDelayTimer
protected ActionListener[] mDelayListener
protected boolean[] mDelayTimerActive
protected Sound[] snd
| Constructor Detail |
|---|
public DefaultConditional(String systemName,
String userName)
public DefaultConditional(String systemName)
| Method Detail |
|---|
public int getNumStateVariables()
getNumStateVariables in interface Conditional
public 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 should only be called by LogixTableAction. It assumes that all information has been validated.
setStateVariables in interface Conditionalopern - 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 referencednumVariables - the number of variables being set, also the length
of the parameter arrays
public 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.
getStateVariables in interface Conditionalpublic int getStateVariableOperator(int index)
getStateVariableOperator in interface Conditionalpublic int getStateVariableType(int index)
getStateVariableType in interface Conditionalpublic String getStateVariableName(int index)
getStateVariableName in interface Conditionalpublic String getStateVariableDataString(int index)
getStateVariableDataString in interface Conditionalpublic int getStateVariableNum1(int index)
getStateVariableNum1 in interface Conditionalpublic int getStateVariableNum2(int index)
getStateVariableNum2 in interface Conditionalpublic boolean getStateVariableTriggersCalculation(int index)
getStateVariableTriggersCalculation in interface Conditionalpublic void deleteAllStateVariables()
deleteAllStateVariables in interface Conditional
public void setAction(int[] opt,
int[] delay,
int[] type,
String[] name,
int[] data,
String[] s)
setAction in interface Conditional
public void getAction(int[] opt,
int[] delay,
int[] type,
String[] name,
int[] data,
String[] s)
getAction in interface Conditionalpublic int calculate(boolean logixEnabled)
calculate in interface Conditionalpublic void cancelSensorTimer(String sname)
cancelSensorTimer in interface Conditionalpublic void cancelTurnoutTimer(String sname)
cancelTurnoutTimer in interface Conditionalpublic int getState()
getState in interface ConditionalgetState in interface NamedBeanpublic void setState(int state)
setState in interface ConditionalsetState in interface NamedBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||