Package jmri.jmrix.can.cbus.node
Class CbusBasicNode
java.lang.Object
jmri.jmrix.can.cbus.node.CbusBasicNode
- Direct Known Subclasses:
CbusBasicNodeWithManagers
Class to represent a node.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CopyOnWriteArraySet<PropertyChangeListener>protected CanSystemConnectionMemo -
Constructor Summary
ConstructorsConstructorDescriptionCbusBasicNode(CanSystemConnectionMemo connmemo, int nodenumber) Create a new CbusBasicNodeWithChangeListener. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister for notification if any of the properties change.getMemo()intGet the Node CAN ID.booleanGet if the Node is in FLiM Mode.booleanGet if the Node is in Learn Mode.booleanGet if this Node is in Setup Mode.intReturns Node Number.protected voidnotifyPropertyChangeListener(String property, Object oldValue, Object newValue) Trigger the notification of Node PropertyChangeListeners.voidRemove notification listener.final voidsetCanId(int newcanid) Set Node CAN ID.final voidSet CAN ID by System Connection.voidsetNodeInFLiMMode(boolean inFlimMode) Set if the Node is in FLiM Mode.voidsetNodeInLearnMode(boolean inlearnmode) Set if the Node is in Learn Mode.voidsetNodeInSetupMode(boolean setup) Set flag for this Node in Setup Mode.voidsetNodeNumber(int newnumber) Set Node Number.
-
Field Details
-
_memo
-
send
-
_listeners
-
-
Constructor Details
-
CbusBasicNode
Create a new CbusBasicNodeWithChangeListener.- Parameters:
connmemo- The CAN Connection to usenodenumber- The Node Number
-
-
Method Details
-
addPropertyChangeListener
Register for notification if any of the properties change.- Parameters:
l- The Listener to attach to Node
-
removePropertyChangeListener
Remove notification listener.- Parameters:
l- Listener to remove
-
notifyPropertyChangeListener
Trigger the notification of Node PropertyChangeListeners. Properties include PARAMETER, BACKUPS, SINGLENVUPDATE ( newValue NV index (0 is NV1, 5 is NV6) ) ALLNVUPDATE SINGLEEVUPDATE ( newValue event row ) ALLEVUPDATE DELETEEVCOMPLETE ( newValue Error String else empty String ) ADDEVCOMPLETE ( newValue Error String else null ) ADDALLEVCOMPLETE ( Event Teach Loop Completed, newValue error count ) TEACHNVCOMPLETE ( newValue error count ) NAMECHANGE- Parameters:
property- Node propertyoldValue- Old ValuenewValue- New Value
-
getNodeNumber
Returns Node Number.- Returns:
- Node Number,1-65535
-
setNodeNumber
Set Node Number.- Parameters:
newnumber- Node Number, should be 1-65535
-
setCanId
Set Node CAN ID.- Parameters:
newcanid- CAN ID of the node
-
setCanId
Set CAN ID by System Connection.Leaves unchanged if no System Connection or Traffic Controller.
- Parameters:
memo- System Connection of the Node.
-
getNodeCanId
Get the Node CAN ID. min 1 , ( max 128? )- Returns:
- CAN ID of the node, default 1.
-
setNodeInSetupMode
Set flag for this Node in Setup Mode.Does NOT send instruction to actual node
- Parameters:
setup- use true if in Setup, else false
-
getNodeInSetupMode
Get if this Node is in Setup Mode.- Returns:
- true if in Setup, else false
-
setNodeInLearnMode
Set if the Node is in Learn Mode. Used to track node status, does NOT update Physical Node- Parameters:
inlearnmode- set true if in Learn else false
-
getNodeInLearnMode
Get if the Node is in Learn Mode.Defaults to false if unset
- Returns:
- true if in Learn else false
-
setNodeInFLiMMode
Set if the Node is in FLiM Mode.Defaults to true if unset
- Parameters:
inFlimMode- set true if in FlIM else false
-
getNodeInFLiMMode
Get if the Node is in FLiM Mode.Defaults to true if unset
- Returns:
- true if in FlIM else false
-
getMemo
-