Class RpsReporter
- All Implemented Interfaces:
Comparable<NamedBean>,PropertyChangeProvider,MeasurementListener,NamedBean,Reporter
- Since:
- 2.3.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionRpsReporter(String systemName, String prefix) RpsReporter(String systemName, String userName, String prefix) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Deactivate this object, so that it releases as many resources as possible and no longer effects others.getDirection(String rep) Get the direction (ENTER/EXIT) of the report.getLocoAddress(String rep) Parses out a (possibly old) RpsReporter-generated report string to extract the address from the front.Get the PhysicalLocation of the Reporter.Get the PhysicalLocation of the Transmitter for a given ID.intgetState()Numerical state is the number of transmitters in the region.void(package private) voidNotify parameter listeners that a device has entered the region covered by this reporter.(package private) void(package private) voidnotifyLeaving(Integer id) Notify parameter listeners that a device has left the region covered by this reporter.(package private) voidvoidsetState(int i) Provide generic access to internal state.Methods inherited from class jmri.implementation.AbstractReporter
getBeanType, getCurrentReport, getLastReport, setReportMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, 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.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, 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
-
region
-
contents
-
-
Constructor Details
-
RpsReporter
-
RpsReporter
-
-
Method Details
-
notify
- Specified by:
notifyin interfaceMeasurementListener
-
notifyInRegion
-
notifyOutOfRegion
-
notifyLeaving
Notify parameter listeners that a device has left the region covered by this reporter.- Parameters:
id- Number of region being left
-
notifyArriving
Notify parameter listeners that a device has entered the region covered by this reporter.- Parameters:
id- Number of region being entered
-
getState
Numerical state is the number of transmitters in the region. -
setState
Description copied from interface:NamedBeanProvide 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.
-
dispose
Description copied from class:AbstractNamedBeanDeactivate 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
-
getLocoAddress
Parses out a (possibly old) RpsReporter-generated report string to extract the address from the front. Assumes the RpsReporter format is "NNNN".- Parameters:
rep- loco string.- Returns:
- loco address, may be null.
-
getDirection
Get the direction (ENTER/EXIT) of the report.Because of the way Ecos Reporters work (or appear to), all reports are ENTER type.
- Parameters:
rep- reporter ID in string form.- Returns:
- direction is always a location entrance
-
getPhysicalLocation
Get the PhysicalLocation of the Reporter.Reports its own location, for now. Not sure if that's the right thing or not. Would be nice if it reported the exact measured location of the transmitter, but right now that doesn't appear to be being stored anywhere retrievable. NOT DONE YET
- Returns:
- PhysicalLocation.getBeanPhysicalLocation
-
getPhysicalLocation
Get the PhysicalLocation of the Transmitter for a given ID.Given an ID (in String form), looks up the Transmitter and gets its current PhysicalLocation (translated from the RPS Measurement).
- Parameters:
s- transmitter ID.- Returns:
- physical location.
-