|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.AbstractNamedBean
jmri.DefaultLogix
public class DefaultLogix
Class providing the basic logic of the Logix interface.
| Field Summary | |
|---|---|
protected int[] |
mConditionalOrder
|
protected String[] |
mConditionalSystemNames
Persistant instance variables (saved between runs) |
protected int |
mCurrentMinutes
|
protected Timebase |
mFastClock
|
protected PropertyChangeListener |
mFastClockListener
|
protected String[] |
mListenerData
|
protected String[] |
mListenerName
|
protected String[] |
mListenerProperty
|
protected PropertyChangeListener[] |
mListeners
|
protected int[] |
mListenerState
|
protected int[] |
mListenerType
|
protected int[] |
mListenerVarType
|
protected int[] |
mMinuteBeginTime
|
protected int[] |
mMinuteEndTime
|
protected int |
mNextConditionalNumber
Operational instance variables (not saved between runs) |
protected int |
mNumConditionals
|
protected int |
mNumMinuteListenerTimes
|
| Fields inherited from interface jmri.Logix |
|---|
LISTENER_TYPE_CONDITIONAL, LISTENER_TYPE_LIGHT, LISTENER_TYPE_MEMORY, LISTENER_TYPE_SENSOR, LISTENER_TYPE_SIGNAL, LISTENER_TYPE_TURNOUT, MAX_CONDITIONALS, MAX_LISTENERS |
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| Constructor Summary | |
|---|---|
DefaultLogix(String systemName)
|
|
DefaultLogix(String systemName,
String userName)
|
|
| Method Summary | |
|---|---|
void |
activateLogix()
Activate the Logix, starts Logix processing by connecting all inputs that are included the Conditionals in this Logix. |
boolean |
addConditional(String systemName,
int order)
Add a Conditional to this Logix Returns true if Conditional was successfully added, returns false if the maximum number of conditionals has been exceeded. |
void |
calculateConditionals()
Calculate all Conditionals, triggering action if the user specified conditions are met, and the Logix is enabled. |
boolean |
checkLoopCondition()
Assembles a list of state variables that both trigger the Logix, and are changed by it. |
void |
deActivateLogix()
Deactivate the Logix. |
boolean |
deleteConditional(String systemName)
Delete a Conditional and remove it from this Logix Note: Since each Logix must have at least one Conditional to do anything, the user is warned in Logix Table Action when the last Conditional is deleted. |
String |
getConditionalByNumberOrder(int order)
Returns the system name of the conditional that will calculate in the specified order. |
boolean |
getEnabled()
Get enabled status |
String |
getLoopGremlins()
Returns a string listing state variables that might result in a loop. |
int |
getNextConditionalNumber()
Get never used number for next Conditional system name |
int |
getNumConditionals()
Get number of Conditionals for this Logix |
int |
getState()
Not needed for Logixs - included to complete implementation of the NamedBean interface. |
int |
getStateVariableList(String[] varName,
int[] varListenerType,
String[] varListenerProperty,
int[] varAppearance,
int[] numTriggersCalc,
int[] numTriggerSuppressed,
int arrayMax)
Assembles and returns a list of state variables that are used by conditionals of this Logix including the number of occurances of each variable that trigger a calculation, and the number of occurances where the triggering has been suppressed. |
void |
initializeReorder()
Initialize for reordering Conditionals |
boolean |
nextConditionalInOrder(int oldOrder)
Make the conditional with given current order, the next in order Returns 'true' if reordering is done, returns 'false' if continue |
void |
setEnabled(boolean state)
Set enabled status. |
void |
setState(int state)
Not needed for Logixs - included to complete implementation of the NamedBean interface. |
| 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.NamedBean |
|---|
addPropertyChangeListener, dispose, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setUserName |
| Field Detail |
|---|
protected String[] mConditionalSystemNames
protected int[] mConditionalOrder
protected int mNextConditionalNumber
protected int mNumConditionals
protected PropertyChangeListener[] mListeners
protected String[] mListenerName
protected int[] mListenerVarType
protected int[] mListenerType
protected String[] mListenerProperty
protected int[] mListenerState
protected String[] mListenerData
protected int mNumMinuteListenerTimes
protected int[] mMinuteBeginTime
protected int[] mMinuteEndTime
protected PropertyChangeListener mFastClockListener
protected Timebase mFastClock
protected int mCurrentMinutes
| Constructor Detail |
|---|
public DefaultLogix(String systemName,
String userName)
public DefaultLogix(String systemName)
| Method Detail |
|---|
public int getNumConditionals()
getNumConditionals in interface Logixpublic void initializeReorder()
initializeReorder in interface Logixpublic int getNextConditionalNumber()
getNextConditionalNumber in interface Logixpublic boolean nextConditionalInOrder(int oldOrder)
nextConditionalInOrder in interface Logixpublic String getConditionalByNumberOrder(int order)
getConditionalByNumberOrder in interface Logixorder - - order in which the Conditional calculates.
public boolean addConditional(String systemName,
int order)
addConditional in interface LogixsystemName - The Conditional system nameorder - - the order this conditional should calculate in
if order is negative, the conditional is added
at the end of current group of conditionalspublic void setEnabled(boolean state)
setEnabled in interface Logixpublic boolean getEnabled()
getEnabled in interface Logixpublic boolean deleteConditional(String systemName)
Note: Since each Logix must have at least one Conditional to do anything, the user is warned in Logix Table Action when the last Conditional is deleted.
Returns true if Conditional was successfully deleted, otherwise returns false.
deleteConditional in interface LogixsystemName - The Conditional system namepublic void calculateConditionals()
calculateConditionals in interface Logixpublic void activateLogix()
A Logix must be activated before it will calculate any of its Conditionals.
activateLogix in interface Logix
public int getStateVariableList(String[] varName,
int[] varListenerType,
String[] varListenerProperty,
int[] varAppearance,
int[] numTriggersCalc,
int[] numTriggerSuppressed,
int arrayMax)
getStateVariableList in interface Logixpublic void deActivateLogix()
A Logix must be deactivated before it's Conditionals are changed.
deActivateLogix in interface Logixpublic boolean checkLoopCondition()
checkLoopCondition in interface Logixpublic String getLoopGremlins()
getLoopGremlins in interface Logixpublic int getState()
getState in interface NamedBeanpublic void setState(int state)
setState in interface NamedBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||