Class CbusTableEvent


public class CbusTableEvent extends CbusEvent
Class to represent an event in the MERG CBUS event table
  • Constructor Details

  • Method Details

    • setState

      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 Date getDate()
      Get the last-seen date time.
      Returns:
      The last time the event was heard on the network
    • setDate

      protected void setDate(Date newval)
      Set the last-seen date time
      Parameters:
      newval - the last-seen date time
    • getBeans

      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(String newval)
      Set the event comment
      Parameters:
      newval - Comment String
    • getComment

      protected 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(Object o)

      Custom method to compare Node Number and Event Number.

      Overrides:
      equals in class CbusEvent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CbusEvent