Package jmri.jmrix.dcc4pc
Class Dcc4PcSensor
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractSensor
-
- jmri.jmrix.dcc4pc.Dcc4PcSensor
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,PropertyChangeProvider
,DigitalIO
,NamedBean
,Sensor
public class Dcc4PcSensor extends AbstractSensor
Implement a Sensor via Dcc4Pc communications.This object doesn't listen to the Dcc4Pc communications. This is because it should be the only object that is sending messages for this sensor; more than one Sensor object pointing to a single device is not allowed.
-
-
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) boolean
enabled
static int
ORIENTA
static int
ORIENTB
(package private) int
realState
-
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 Dcc4PcSensor(java.lang.String systemName)
Dcc4PcSensor(java.lang.String systemName, java.lang.String userName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getEnabled()
int
getInput()
int
getRailCommState()
void
notifyMessage(Dcc4PcMessage m)
void
notifyReply(Dcc4PcReply r)
void
requestUpdateFromLayout()
Request an update from the layout soft/hardware.void
setEnabled(boolean enable)
void
setInput(int i)
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
-
ORIENTA
public static final int ORIENTA
- See Also:
- Constant Field Values
-
ORIENTB
public static final int ORIENTB
- See Also:
- Constant Field Values
-
realState
int realState
-
enabled
boolean enabled
-
-
Constructor Detail
-
Dcc4PcSensor
public Dcc4PcSensor(java.lang.String systemName, java.lang.String userName)
-
Dcc4PcSensor
public Dcc4PcSensor(java.lang.String systemName)
-
-
Method Detail
-
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.
-
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
-
getRailCommState
public int getRailCommState()
-
notifyReply
public void notifyReply(Dcc4PcReply r)
-
notifyMessage
public void notifyMessage(Dcc4PcMessage m)
-
setEnabled
public void setEnabled(boolean enable)
-
getEnabled
public boolean getEnabled()
-
setInput
public void setInput(int i)
-
getInput
public int getInput()
-
-