Package jmri.jmrix.can.cbus.eventtable
Class CbusTableEvent
- java.lang.Object
-
- jmri.jmrix.can.cbus.CbusEventDataElements
-
- jmri.jmrix.can.cbus.CbusEvent
-
- jmri.jmrix.can.cbus.eventtable.CbusTableEvent
-
public class CbusTableEvent extends CbusEvent
Class to represent an event in the MERG CBUS event table
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.can.cbus.CbusEventDataElements
CbusEventDataElements.EvState
-
-
Constructor Summary
Constructors Constructor Description CbusTableEvent(CanSystemConnectionMemo memo, int nn, int en)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendOnOffBean(NamedBean nb, boolean beanState, CbusEventDataElements.EvState evState)
protected void
bumpDirection(int direction)
Increase Direction session and total counts.boolean
equals(java.lang.Object o)
protected CbusEventBeanData
getBeans(CbusEventDataElements.EvState state)
Get the Sensor Turnout and Light user names associated with event on or off.protected java.lang.String
getComment()
Get the event commentprotected java.util.Date
getDate()
Get the last-seen date time.protected int
getEventCanId()
Get the CAN ID to last send the eventprotected int
getSessionInOut(boolean in)
Number of times event heard coming in to JMRI this session.protected int
getSessionOnOff(boolean on)
Number of times event on or off for current session.protected int
getTotalInOut(boolean in)
Number of times event heard, all sessions.protected int
getTotalOnOff(boolean on)
Number of times event on or off all sessions.int
hashCode()
protected void
resetBeans()
protected void
resetSessionTotals()
Reset on, off, in and out session counts to 0protected void
setCanId(int newval)
Set the CAN ID to last send the eventvoid
setComment(java.lang.String newval)
Set the event commentprotected void
setCounts(int on, int off, int in, int out)
Set Event Counts.protected void
setDate(java.util.Date newval)
Set the last-seen date timevoid
setState(CbusEventDataElements.EvState newval)
Updates Event State and session / total on and off's.-
Methods inherited from class jmri.jmrix.can.cbus.CbusEvent
getEn, getName, getNn, getNodeName, getState, matches, sendEvent, sendOff, sendOn, sendRequest, setEn, setName, setNameIfNoName, setNn, toString
-
Methods inherited from class jmri.jmrix.can.cbus.CbusEventDataElements
getCanMessage, getData, getEvState, getJmriString, getNumElements, getNumEventDataElements, setData, setDataFromFrame, setNumElements
-
-
-
-
Constructor Detail
-
CbusTableEvent
public CbusTableEvent(CanSystemConnectionMemo memo, int nn, int en)
-
-
Method Detail
-
setState
public void setState(CbusEventDataElements.EvState newval)
Updates Event State and session / total on and off's. Set current state of the event.Does NOT send update to layout.
-
getDate
protected java.util.Date getDate()
Get the last-seen date time.- Returns:
- The last time the event was heard on the network
-
setDate
protected void setDate(java.util.Date newval)
Set the last-seen date time- Parameters:
newval
- the last-seen date time
-
getBeans
protected CbusEventBeanData getBeans(CbusEventDataElements.EvState state)
Get the Sensor Turnout and Light user names associated with event on or off.- Parameters:
state
- CbusEvent State of ON or OFF- Returns:
- Sensor Turnout and Light set.
-
resetBeans
protected final void resetBeans()
-
appendOnOffBean
public void appendOnOffBean(NamedBean nb, boolean beanState, CbusEventDataElements.EvState evState)
-
getEventCanId
protected int getEventCanId()
Get the CAN ID to last send the event- Returns:
- CAN ID
-
setComment
public void setComment(java.lang.String newval)
Set the event comment- Parameters:
newval
- Comment String
-
getComment
protected java.lang.String getComment()
Get the event comment- Returns:
- Comment String
-
setCanId
protected void setCanId(int newval)
Set the CAN ID to last send the event- Parameters:
newval
- CAN ID
-
setCounts
protected void setCounts(int on, int off, int in, int out)
Set Event Counts.- Parameters:
on
- Total Onoff
- Total Offin
- Total Inout
- Total Out
-
getSessionOnOff
protected int getSessionOnOff(boolean on)
Number of times event on or off for current session.- Parameters:
on
- true for on, false for off- Returns:
- Number of times event on for current session
-
getTotalOnOff
protected int getTotalOnOff(boolean on)
Number of times event on or off all sessions.- Parameters:
on
- true for on, false for off.- Returns:
- Number of times event on or off all sessions.
-
getSessionInOut
protected int getSessionInOut(boolean in)
Number of times event heard coming in to JMRI this session.- Parameters:
in
- true for in, false for out.- Returns:
- Number of times event heard coming in to JMRI this session
-
getTotalInOut
protected int getTotalInOut(boolean in)
Number of times event heard, all sessions.- Parameters:
in
- true for in, false for out.- Returns:
- Number of times event heard coming in or out to JMRI all sessions
-
bumpDirection
protected void bumpDirection(int direction)
Increase Direction session and total counts.- Parameters:
direction
- CbusConstant of EVENT_DIR_IN or EVENT_DIR_OUT
-
resetSessionTotals
protected void resetSessionTotals()
Reset on, off, in and out session counts to 0
-
equals
public boolean equals(java.lang.Object o)
Custom method to compare Node Number and Event Number.
-
-