Package jmri.jmrix.can.cbus.node
Class CbusNode
- java.lang.Object
-
- Direct Known Subclasses:
CbusDummyNode
,CbusNodeFromBackup
public class CbusNode extends CbusBasicNodeWithMgrsCommandStation
Class to represent a node.
-
-
Field Summary
Fields Modifier and Type Field Description static int
BOOT_LONG_TIMEOUT_TIME
static int
BOOT_PROG_TIMEOUT_FAST
static int
BOOT_PROG_TIMEOUT_SLOW
static int
SINGLE_MESSAGE_TIMEOUT_TIME
-
Fields inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeWithManagers
_fwBuild, _fwMaj, _fwMin
-
Fields inherited from class jmri.jmrix.can.cbus.node.CbusBasicNode
_listeners, _memo, send
-
-
Constructor Summary
Constructors Constructor Description CbusNode(CanSystemConnectionMemo connmemo, int nodenumber)
Create a new CbusNode
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getliveUpdate()
Get live update modejava.lang.String
getName()
Reports just the name, not the user name.int
getNodeFlags()
Get Node Flagsjava.lang.String
getNodeNameFromName()
Get Module Type Name from a previous NAME OPC response Used when a module type is not identified within JMRI.boolean
getnvWriteInLearnOnly()
CANSERVO8C and related modules only accept NV writes in learn mode.java.lang.String
getResyncName()
Get name of node being resync'edboolean
getsendsWRACKonNVSET()
DO NOT RELY ON, TO BE REMOVED IN FUTURE RELEASE when the NV will automatically be queried if no NVSET is receivedjava.lang.String
getUserComment()
Get a Node User Commentprotected void
nodeOnNetwork(boolean isFound)
Set node on networkprotected void
resetNodeAll()
Resets NV's, Events and Parametersprotected void
saveForResync()
Save module name when Resync is in progress Resync resets all node parameters, etc.void
setliveUpdate(boolean liveUpdate)
Set flag to say node is in live update mode.void
setNameIfNoName(java.lang.String newName)
Set Node UserName only if UserName not currently set used in RestoreFromFCUvoid
setNodeFlags(int flags)
Set the Node Flagsvoid
setNodeNameFromName(java.lang.String newName)
Set Module Type Name Used when a module is not identified within JMRI so the NAME is requested.void
setnvWriteInLearnOnly(java.lang.Boolean nvWriteInLearn)
CANSERVO8C and related modules only accept NV writes in learn mode.void
setsendsWRACKonNVSET(java.lang.Boolean sendsWRACK)
DO NOT RELY ON, TO BE REMOVED IN FUTURE RELEASE when the NV will automatically be queried if no NVSET is receivedvoid
setUserComment(java.lang.String comment)
Set a Node User Commentjava.lang.String
toString()
Custom toString reports the Node Number Name-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeWithMgrsCommandStation
getCsNum, getStatResponseFlagsAccurate, setCsFlags, setCsNum, setStatResponseFlagsAccurate
-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeWithManagers
dispose, getCanListener, getNewCanListener, getNodeBackupManager, getNodeEventManager, getNodeNvManager, getNodeParamManager, getNodeStats, getNodeTimerManager, getPnnManufacturer, getPnnModule, getTableModel, getUserName, setFW, setManuModule, setTableModel, setUserName
-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNode
addPropertyChangeListener, getMemo, getNodeCanId, getNodeInFLiMMode, getNodeInLearnMode, getNodeInSetupMode, getNodeNumber, notifyPropertyChangeListener, removePropertyChangeListener, setCanId, setCanId, setNodeInFLiMMode, setNodeInLearnMode, setNodeInSetupMode, setNodeNumber
-
-
-
-
Field Detail
-
SINGLE_MESSAGE_TIMEOUT_TIME
public static int SINGLE_MESSAGE_TIMEOUT_TIME
-
BOOT_PROG_TIMEOUT_FAST
public static int BOOT_PROG_TIMEOUT_FAST
-
BOOT_PROG_TIMEOUT_SLOW
public static int BOOT_PROG_TIMEOUT_SLOW
-
BOOT_LONG_TIMEOUT_TIME
public static int BOOT_LONG_TIMEOUT_TIME
-
-
Constructor Detail
-
CbusNode
public CbusNode(@CheckForNull CanSystemConnectionMemo connmemo, int nodenumber)
Create a new CbusNode- Parameters:
connmemo
- The CAN Connection to usenodenumber
- The Node Number
-
-
Method Detail
-
setNameIfNoName
public void setNameIfNoName(java.lang.String newName)
Set Node UserName only if UserName not currently set used in RestoreFromFCU- Parameters:
newName
- UserName of the node
-
getNodeNameFromName
public java.lang.String getNodeNameFromName()
Get Module Type Name from a previous NAME OPC response Used when a module type is not identified within JMRI.- Returns:
- Module type name, NOT prefixed with CAN or ETH, may be empty.
-
setNodeNameFromName
public void setNodeNameFromName(java.lang.String newName)
Set Module Type Name Used when a module is not identified within JMRI so the NAME is requested.- Parameters:
newName
- The module type name, should NOT be prefixed with CAN or ETH
-
setNodeFlags
public void setNodeFlags(int flags)
Set the Node FlagsBit 0: Consumer Bit 1: Producer Bit 2: FLiM Mode Bit 3: The module supports bootloading Bit 4: The module can consume its own produced events Bit 5: Module is in learn mode - CBUS Spec 6c
- Parameters:
flags
- the int value of the flags.
-
getNodeFlags
public int getNodeFlags()
Get Node FlagsCaptured from a PNN node response
- Returns:
- flags in int form, will need decoding to bit, -1 if unset
-
getResyncName
public java.lang.String getResyncName()
Get name of node being resync'ed- Returns:
- String node name
-
saveForResync
protected void saveForResync()
Save module name when Resync is in progress Resync resets all node parameters, etc. To re0display the NV edit GUI before the resync completes we save a copy of the name of the node.
-
resetNodeAll
protected void resetNodeAll()
Resets NV's, Events and Parameters
-
getUserComment
public java.lang.String getUserComment()
Get a Node User Comment- Returns:
- user generated comment string
-
setUserComment
public void setUserComment(java.lang.String comment)
Set a Node User CommentTypically output from JTextArea
If a backup has completed for this session, updates the xml file
- Parameters:
comment
- user comment
-
toString
public java.lang.String toString()
Custom toString reports the Node Number Name- Overrides:
toString
in classjava.lang.Object
- Returns:
- string eg "1234 UserName" or "256 CANPAN" if no UserName. No trailing space.
-
getName
public java.lang.String getName()
Reports just the name, not the user name.- Returns:
- string eg "CANPAN"
-
nodeOnNetwork
protected void nodeOnNetwork(boolean isFound)
Set node on network- Parameters:
isFound
- false if not on network
-
setsendsWRACKonNVSET
public void setsendsWRACKonNVSET(java.lang.Boolean sendsWRACK)
DO NOT RELY ON, TO BE REMOVED IN FUTURE RELEASE when the NV will automatically be queried if no NVSET is received- Parameters:
sendsWRACK
- true if sends
-
getsendsWRACKonNVSET
public boolean getsendsWRACKonNVSET()
DO NOT RELY ON, TO BE REMOVED IN FUTURE RELEASE when the NV will automatically be queried if no NVSET is received- Returns:
- true if sends WRACK, else false
-
setnvWriteInLearnOnly
public void setnvWriteInLearnOnly(java.lang.Boolean nvWriteInLearn)
CANSERVO8C and related modules only accept NV writes in learn mode. This was used by the MERG FCU to update servo positions in "real time" in response to interaction with the GUI. Call this method to indicate that a node must be in learn mode to support NV writes.- Parameters:
nvWriteInLearn
- true if node requires to be in learn mode for NV writes
-
getnvWriteInLearnOnly
public boolean getnvWriteInLearnOnly()
CANSERVO8C and related modules only accept NV writes in learn mode. This was used by the MERG FCU to update servo positions in "real time" in response to interaction with the GUI. Call this method to query if a node must be in learn mode to support NV writes.- Returns:
- true if sends WRACK, else false
-
setliveUpdate
public void setliveUpdate(boolean liveUpdate)
Set flag to say node is in live update mode.- Parameters:
liveUpdate
- true if in live update mode
-
getliveUpdate
public boolean getliveUpdate()
Get live update mode- Returns:
- true in live update
-
-