|
||||||||||
| 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). It services these Conditionals by installing and deinstalling the proper listeners for their variables.
A Logix can be enabled or not. It passes this attribute to its Conditionals. By default it is enabled. When not enabled, a Conditional will still respond to callbacks from its listeners and calculate its state, however it will not execute its actions. Enabled is a bound property of a Logix.
A Logix can be deactivated or not. When deactivated, the listeners of the Conditional variables are deinstalled.
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_FASTCLOCK
|
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 |
LISTENER_TYPE_WARRANT
|
| 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. |
void |
deActivateLogix()
Deactivate the Logix. |
String[] |
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 |
int |
getNumConditionals()
Get number of Conditionals for this Logix |
void |
setEnabled(boolean state)
Set enabled status. |
void |
swapConditional(int nextInOrder,
int row)
Move 'row' to 'nextInOrder' and shift all between 'nextInOrder' and 'row' up one position |
| Methods inherited from interface jmri.NamedBean |
|---|
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getState, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setState, setUserName |
| Field Detail |
|---|
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
static final int LISTENER_TYPE_FASTCLOCK
static final int LISTENER_TYPE_WARRANT
| Method Detail |
|---|
void setEnabled(boolean state)
boolean getEnabled()
int getNumConditionals()
void swapConditional(int nextInOrder,
int row)
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 conditionalsString[] deleteConditional(String systemName)
Note: Since each Logix must have at least one Conditional, the last Conditional will not be deleted.
Returns An array of names used in an error message explaining why Conditional should not be deleted.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||