Class CbusTableEvent

    • 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.

        Overrides:
        setState in class CbusEvent
        Parameters:
        newval - the enum event state ie ON, OFF, UNKNOWN
      • 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
      • 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 On
        off - Total Off
        in - Total In
        out - 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.

        Overrides:
        equals in class CbusEvent