Class CbusReporter
- All Implemented Interfaces:
Comparable<NamedBean>,EventListener,PropertyChangeProvider,IdTagListener,AbstractMRListener,CanListener,NamedBean,PhysicalLocationReporter,Reporter
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameExceptionNested classes/interfaces inherited from interface jmri.PhysicalLocationReporter
PhysicalLocationReporter.Direction -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanShould all CbusReporters clear themselves after a timeout?booleanShould this CbusReporter clear itself after a timeout?Fields inherited from class jmri.implementation.AbstractReporter
_currentReport, _lastReportFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.Reporter
PROPERTY_CURRENT_REPORT, PROPERTY_LAST_REPORT -
Constructor Summary
ConstructorsConstructorDescriptionCbusReporter(String address, CanSystemConnectionMemo memo) Create a new CbusReporter. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Deactivate this object, so that it releases as many resources as possible and no longer effects others.Get the Reporter Listener format type.booleanGet if the Reporter should provide / update a CBUS Sensor, following Reporter Status.voidCalled when an outgoing message is sent to the CAN Network.voidResets report briefly back to null so Sensor Listeners are updated.voidCalled when an incoming CanFrame is received from the CAN Network.voidsetState(int s) Set the CbusReporter State.Methods inherited from class jmri.implementation.AbstractRailComReporter
getLocoAddressMethods inherited from class jmri.implementation.AbstractIdTagReporter
describeState, getDirection, getPhysicalLocation, getPhysicalLocation, getStateMethods inherited from class jmri.implementation.AbstractReporter
getBeanType, getCurrentReport, getLastReport, setReportMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.can.CanListener
addTc, addTc, removeTc, removeTcMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
eraseOnTimeoutAll
Should all CbusReporters clear themselves after a timeout?Default behavior is to not timeout; this is public access so it can be updated from a script
-
eraseOnTimeoutThisReporter
Should this CbusReporter clear itself after a timeout?Default behavior is to not timeout; this is public access so it can be updated from a script
-
-
Constructor Details
-
CbusReporter
Create a new CbusReporter.- Parameters:
address- Reporter address, currently in String number format. No system prefix or type letter.memo- System connection.
-
-
Method Details
-
setState
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:
setStatein interfaceNamedBean- Overrides:
setStatein classAbstractIdTagReporter- Parameters:
s- the state
-
notify
Resets report briefly back to null so Sensor Listeners are updated.- Specified by:
notifyin interfaceIdTagListener- Overrides:
notifyin classAbstractIdTagReporter
-
message
Called when an outgoing message is sent to the CAN Network. CBUS Reporters can respond to ACDAT or DDES OPC's.- Specified by:
messagein interfaceCanListener- Parameters:
m- the CanMessage being sent.
-
reply
Called when an incoming CanFrame is received from the CAN Network. CBUS Reporters can respond to ACDAT or DDES OPC's- Specified by:
replyin interfaceCanListener- Parameters:
m- the CanReply being received.
-
getCbusReporterType
Get the Reporter Listener format type.Defaults to Classic RfID, 5 byte unique.
- Returns:
- reporter format type.
-
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
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:
disposein interfaceNamedBean- Overrides:
disposein classAbstractNamedBean
-