Package jmri.jmrix.jmriclient
Class JMRIClientSensor
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractSensor
-
- jmri.jmrix.jmriclient.JMRIClientSensor
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,java.util.EventListener
,PropertyChangeProvider
,DigitalIO
,AbstractMRListener
,JMRIClientListener
,NamedBean
,Sensor
public class JMRIClientSensor extends AbstractSensor implements JMRIClientListener
JMRIClient implementation of the Sensor interface.
-
-
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 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 JMRIClientSensor(int number, JMRIClientSystemConnectionMemo memo)
JMRIClient sensors use the sensor number on the remote host.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumber()
void
message(JMRIClientMessage m)
void
reply(JMRIClientReply m)
void
requestUpdateFromLayout()
Request an update from the layout soft/hardware.protected void
sendMessage(boolean active)
void
setKnownState(int newState)
Handle a request to change state by sending a formatted packet to the server.-
Methods inherited from class jmri.implementation.AbstractSensor
canInvert, describeState, dispose, getBeanType, getInverted, getKnownState, getPullResistance, getRawState, getReporter, getSensorDebounceGoingActiveTimer, getSensorDebounceGoingInActiveTimer, getState, getUseDefaultTimerSettings, sensorDebounce, setInverted, setOwnState, 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, 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
-
-
-
-
Constructor Detail
-
JMRIClientSensor
public JMRIClientSensor(int number, JMRIClientSystemConnectionMemo memo)
JMRIClient sensors use the sensor number on the remote host.- Parameters:
number
- sensor numbermemo
- system connection
-
-
Method Detail
-
getNumber
public int getNumber()
-
setKnownState
public void setKnownState(int newState) throws JmriException
Handle a request to change state by sending a formatted packet to the server.- Specified by:
setKnownState
in interfaceSensor
- Overrides:
setKnownState
in classAbstractSensor
- Parameters:
newState
- the state to set- Throws:
JmriException
- if unable to set the state
-
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
-
sendMessage
protected void sendMessage(boolean active)
-
reply
public void reply(JMRIClientReply m)
- Specified by:
reply
in interfaceJMRIClientListener
-
message
public void message(JMRIClientMessage m)
- Specified by:
message
in interfaceJMRIClientListener
-
-