Class CbusReporter

All Implemented Interfaces:
Comparable<NamedBean>, EventListener, PropertyChangeProvider, IdTagListener, AbstractMRListener, CanListener, NamedBean, PhysicalLocationReporter, Reporter

public class CbusReporter
extends AbstractRailComReporter
implements CanListener
Extend jmri.AbstractRailComReporter for CBUS controls.
This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

CBUS Reporters can accept 5-byte unique Classic RFID on DDES or ACDAT OPCs, CANRC522 / CANRCOM DDES OPCs.

  • Constructor Details

  • Method Details

    • setState

      public void setState​(int s)
      Set the CbusReporter State.

      May also provide / update a CBUS Sensor State, depending on property. Provide generic access to internal state.

      This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.

      Specified by:
      setState in interface NamedBean
      Overrides:
      setState in class AbstractIdTagReporter
      Parameters:
      s - the state
    • notify

      public void notify​(IdTag id)
      Resets report briefly back to null so Sensor Listeners are updated.
      Specified by:
      notify in interface IdTagListener
      Overrides:
      notify in class AbstractIdTagReporter
    • message

      public void message​(CanMessage m)
      CBUS Reporters can respond to ACDAT or DDES OPC's.
      Specified by:
      message in interface CanListener
    • reply

      public void reply​(CanReply m)
      CBUS Reporters can respond to ACDAT or DDES OPC's
      Specified by:
      reply in interface CanListener
    • getCbusReporterType

      Get the Reporter Listener format type.

      Defaults to Classic RfID, 5 byte unique.

      Returns:
      reporter format type.
    • getMaintainSensor

      public boolean getMaintainSensor()
      Get if the Reporter should provide / update a CBUS Sensor, following Reporter Status.

      Defaults to false.

      Returns:
      true if the reporter should maintain the Sensor.
    • dispose

      public void dispose()
      Deactivate this object, so that it releases as many resources as possible and no longer effects others.

      For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.

      It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.

      Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.

      Specified by:
      dispose in interface NamedBean
      Overrides:
      dispose in class AbstractNamedBean