|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Logix
A Logix is a group of Conditionals that monitor one or more conditions (internal or on the layout) and take action when these conditionals change in a user specified way.
A Logix can be enabled or not. By default it is enabled and will act when one or more of its Conditionals changes in a user specified way. When not enabled, the Logix will not trigger actions when its Conditionals change. Enabled is a bound property of a Logix.
A Logix does not have a "state", however, each of its Conditionals does.
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.
| Field Summary | |
|---|---|
static int |
LISTENER_TYPE_CONDITIONAL
|
static int |
LISTENER_TYPE_LIGHT
|
static int |
LISTENER_TYPE_MEMORY
|
static int |
LISTENER_TYPE_SENSOR
|
static int |
LISTENER_TYPE_SIGNAL
|
static int |
LISTENER_TYPE_TURNOUT
|
static int |
MAX_CONDITIONALS
|
static int |
MAX_LISTENERS
|
| Fields inherited from interface jmri.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| 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 from this Logix Note: Since each Logix must have at least one Conditional, the last Conditional will not be 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()
Assembles 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 |
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. |
| Methods inherited from interface jmri.NamedBean |
|---|
addPropertyChangeListener, dispose, getComment, getNumPropertyChangeListeners, getState, getSystemName, getUserName, removePropertyChangeListener, setComment, setState, setUserName |
| Field Detail |
|---|
static final int MAX_CONDITIONALS
static final int MAX_LISTENERS
static final int LISTENER_TYPE_SENSOR
static final int LISTENER_TYPE_TURNOUT
static final int LISTENER_TYPE_LIGHT
static final int LISTENER_TYPE_CONDITIONAL
static final int LISTENER_TYPE_SIGNAL
static final int LISTENER_TYPE_MEMORY
| Method Detail |
|---|
void setEnabled(boolean state)
boolean getEnabled()
int getNumConditionals()
void initializeReorder()
boolean nextConditionalInOrder(int oldOrder)
int getNextConditionalNumber()
String getConditionalByNumberOrder(int order)
order - - order in which the Conditional calculates.
boolean addConditional(String systemName,
int order)
systemName - 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 conditionalsboolean deleteConditional(String systemName)
Note: Since each Logix must have at least one Conditional, the last Conditional will not be deleted.
Returns true if Conditional was successfully deleted, otherwise returns false.
systemName - The Conditional system namevoid calculateConditionals()
void activateLogix()
A Logix must be activated before it will calculate any of its Conditionals.
void deActivateLogix()
A Logix must be deactivated before it's Conditionals are changed.
boolean checkLoopCondition()
String getLoopGremlins()
int getStateVariableList(String[] varName,
int[] varListenerType,
String[] varListenerProperty,
int[] varAppearance,
int[] numTriggersCalc,
int[] numTriggerSuppressed,
int arrayMax)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||