Package jmri.jmrix.can.cbus.node
Class CbusNodeTimerManager
- java.lang.Object
-
- jmri.jmrix.can.cbus.node.CbusNodeTimerManager
-
public class CbusNodeTimerManager extends java.lang.Object
Class to handle Timers for a CbusNode.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
_sendNVErrorCount
protected int
allEvTimeoutCount
protected java.util.TimerTask
allEvTimerTask
protected int
fetchEvVarTimeoutCount
protected int
fetchNvTimeoutCount
protected int
numEvTimeoutCount
protected int
paramRequestTimeoutCount
protected java.util.TimerTask
sendEnumTask
protected int
sendEvErrorCount
static int
SINGLE_MESSAGE_TIMEOUT_TIME
-
Constructor Summary
Constructors Constructor Description CbusNodeTimerManager(CbusBasicNodeWithManagers node)
Create a new CbusNodeTimers
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelTimers()
protected void
clearAllEvTimeout()
Stop timer for an ALL event by index fetch request.protected void
clearAllParamTimeout()
Stop timer for a single parameter fetchprotected void
clearNextEvVarTimeout()
Stop timer for a single event variable request.protected void
clearNextNvVarTimeout()
Stop timer for a single NV fetch request.protected void
clearNumEvTimeout()
Stop timer for event total RQEVN request.protected void
clearsendEditEvTimeout()
Stops timer for Teaching Eventsprotected void
clearsendEditNvTimeout()
Stop timer for Teaching NV Node Variablesprotected void
clearSendEnumTimeout()
Stops timer for CAN ID Self Enumeration Timeoutprotected boolean
hasActiveTimers()
See if any timers are running, ie waiting for a response from a physical Node.protected void
resetTimeOutCounts()
protected void
setAllEvTimeout()
Starts timer for an ALL event by index fetch request.protected void
setAllParamTimeout(int index)
Start timer for a Parameter request If 10 timeouts are counted, aborts loop, sets 8 parameters to 0 and node events array to 0protected void
setNextEvVarTimeout(int eventVarIndex, java.lang.String eventString)
Start timer for a single event variable request.protected void
setNextNvVarTimeout()
Start timer for a single Node Variable request.protected void
setNumEvTimeout()
Start timer for event total RQEVN request.protected void
setsendEditEvTimeout()
Start timer for Teaching Events On timeout, ie Node does not Respond with a success message, stops Learn Loop and takes node out of Learn Mode.protected void
setsendEditNvTimeout()
Start timer for Teaching NV Node Variables If no response received, increases error count and resumes loop to teach next NV which handles the errorprotected void
setsendEnumTimeout()
Starts timer for CAN ID Self Enumeration Timeout If no response adds warning to console log
-
-
-
Field Detail
-
fetchNvTimeoutCount
protected int fetchNvTimeoutCount
-
fetchEvVarTimeoutCount
protected int fetchEvVarTimeoutCount
-
numEvTimeoutCount
protected int numEvTimeoutCount
-
allEvTimeoutCount
protected int allEvTimeoutCount
-
allEvTimerTask
protected java.util.TimerTask allEvTimerTask
-
paramRequestTimeoutCount
protected int paramRequestTimeoutCount
-
sendEnumTask
protected java.util.TimerTask sendEnumTask
-
sendEvErrorCount
protected int sendEvErrorCount
-
_sendNVErrorCount
protected int _sendNVErrorCount
-
SINGLE_MESSAGE_TIMEOUT_TIME
public static int SINGLE_MESSAGE_TIMEOUT_TIME
-
-
Constructor Detail
-
CbusNodeTimerManager
public CbusNodeTimerManager(CbusBasicNodeWithManagers node)
Create a new CbusNodeTimers- Parameters:
node
- The Node
-
-
Method Detail
-
hasActiveTimers
protected boolean hasActiveTimers()
See if any timers are running, ie waiting for a response from a physical Node.- Returns:
- true if timers are running else false
-
cancelTimers
protected void cancelTimers()
-
resetTimeOutCounts
protected final void resetTimeOutCounts()
-
clearNextNvVarTimeout
protected void clearNextNvVarTimeout()
Stop timer for a single NV fetch request.
-
setNextNvVarTimeout
protected void setNextNvVarTimeout()
Start timer for a single Node Variable request. If 10 failed requests aborts loop and sets number of NV's to unknown
-
clearNextEvVarTimeout
protected void clearNextEvVarTimeout()
Stop timer for a single event variable request.
-
setNextEvVarTimeout
protected void setNextEvVarTimeout(int eventVarIndex, java.lang.String eventString)
Start timer for a single event variable request. If 10 failed requests aborts loop and sets events to 0- Parameters:
eventVarIndex
- Event Variable IndexeventString
- User Friendly Event Text
-
clearNumEvTimeout
protected void clearNumEvTimeout()
Stop timer for event total RQEVN request.
-
setNumEvTimeout
protected void setNumEvTimeout()
Start timer for event total RQEVN request. If 10 failed requests aborts loop and sets event number to 0
-
clearAllEvTimeout
protected void clearAllEvTimeout()
Stop timer for an ALL event by index fetch request.
-
setAllEvTimeout
protected void setAllEvTimeout()
Starts timer for an ALL event by index fetch request.This has a higher chance of failing as we could be expecting up to 255 CAN Frames in response. If fails, re-sends the NERD to the physical node Aborts on 10 failed requests
-
clearAllParamTimeout
protected void clearAllParamTimeout()
Stop timer for a single parameter fetch
-
setAllParamTimeout
protected void setAllParamTimeout(int index)
Start timer for a Parameter request If 10 timeouts are counted, aborts loop, sets 8 parameters to 0 and node events array to 0- Parameters:
index
- Parameter Index
-
clearsendEditNvTimeout
protected void clearsendEditNvTimeout()
Stop timer for Teaching NV Node Variables
-
setsendEditNvTimeout
protected void setsendEditNvTimeout()
Start timer for Teaching NV Node Variables If no response received, increases error count and resumes loop to teach next NV which handles the error
-
clearsendEditEvTimeout
protected void clearsendEditEvTimeout()
Stops timer for Teaching Events
-
setsendEditEvTimeout
protected void setsendEditEvTimeout()
Start timer for Teaching Events On timeout, ie Node does not Respond with a success message, stops Learn Loop and takes node out of Learn Mode.
-
clearSendEnumTimeout
protected void clearSendEnumTimeout()
Stops timer for CAN ID Self Enumeration Timeout
-
setsendEnumTimeout
protected void setsendEnumTimeout()
Starts timer for CAN ID Self Enumeration Timeout If no response adds warning to console log
-
-