Package jmri.jmrix.rfid
Class RfidSensor
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractSensor
-
- jmri.jmrix.rfid.RfidSensor
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,PropertyChangeProvider
,DigitalIO
,IdTagListener
,RfidTagListener
,NamedBean
,Sensor
- Direct Known Subclasses:
TimeoutRfidSensor
public class RfidSensor extends AbstractSensor implements RfidTagListener
Extend jmri.AbstractSensor for RFID systemsSystem names are "FSpppp", where ppp is a representation of the RFID reader.
- Since:
- 2.11.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
Nested classes/interfaces inherited from interface jmri.Sensor
Sensor.PullResistance
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ArrayList<java.lang.Integer>
contents
-
Fields inherited from class jmri.implementation.AbstractSensor
_inverted, _knownState, _rawState, r, sensorDebounceGoingActive, sensorDebounceGoingInActive, thr, useDefaultTimerSettings
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
Fields inherited from interface jmri.Sensor
ACTIVE, INACTIVE, MAX_DEBOUNCE
-
-
Constructor Summary
Constructors Constructor Description RfidSensor(java.lang.String systemName)
RfidSensor(java.lang.String systemName, java.lang.String userName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.util.List<java.lang.Integer>
getContents()
void
notify(IdTag r)
(package private) void
notifyArriving(java.lang.Integer id)
Notify parameter listeners that a device has entered the region covered by this sensor(package private) void
notifyInRegion(java.lang.Integer id)
(package private) void
notifyLeaving(java.lang.Integer id)
Notify parameter listeners that a device has left the region covered by this sensor(package private) void
notifyOutOfRegion(java.lang.Integer id)
void
requestUpdateFromLayout()
Request an update from the layout soft/hardware.void
setOwnState(int state)
Set our internal state information, and notify bean listeners.-
Methods inherited from class jmri.implementation.AbstractSensor
canInvert, describeState, dispose, getBeanType, getInverted, getKnownState, getPullResistance, getRawState, getReporter, getSensorDebounceGoingActiveTimer, getSensorDebounceGoingInActiveTimer, getState, getUseDefaultTimerSettings, sensorDebounce, setInverted, setKnownState, setPullResistance, setReporter, setSensorDebounceGoingActiveTimer, setSensorDebounceGoingInActiveTimer, setState, setUseDefaultTimerSettings, stateChangeCheck
-
Methods 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, vetoableChange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods 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, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.Sensor
getCommandedState, isConsistentState, setCommandedState
-
-
-
-
Field Detail
-
contents
java.util.ArrayList<java.lang.Integer> contents
-
-
Constructor Detail
-
RfidSensor
public RfidSensor(java.lang.String systemName)
-
RfidSensor
public RfidSensor(java.lang.String systemName, java.lang.String userName)
-
-
Method Detail
-
notify
public void notify(IdTag r)
- Specified by:
notify
in interfaceIdTagListener
-
setOwnState
public void setOwnState(int state)
Description copied from class:AbstractSensor
Set our internal state information, and notify bean listeners.- Overrides:
setOwnState
in classAbstractSensor
- Parameters:
state
- the new state
-
getContents
java.util.List<java.lang.Integer> getContents()
-
notifyInRegion
void notifyInRegion(java.lang.Integer id)
-
notifyOutOfRegion
void notifyOutOfRegion(java.lang.Integer id)
-
notifyLeaving
void notifyLeaving(java.lang.Integer id)
Notify parameter listeners that a device has left the region covered by this sensor- Parameters:
id
- number of region being left
-
notifyArriving
void notifyArriving(java.lang.Integer id)
Notify parameter listeners that a device has entered the region covered by this sensor- Parameters:
id
- number of arrived-in region
-
requestUpdateFromLayout
public void requestUpdateFromLayout()
Description copied from interface:DigitalIO
Request an update from the layout soft/hardware. May not even happen, and if it does it will happen later; listen for the result.- Specified by:
requestUpdateFromLayout
in interfaceDigitalIO
-
-