Package jmri
Interface DigitalIO
-
- All Superinterfaces:
java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Subinterfaces:
Light
,Sensor
,Turnout
,VariableLight
- All Known Implementing Classes:
AbstractLight
,AbstractSensor
,AbstractTurnout
,AbstractVariableLight
,AcelaLight
,AcelaSensor
,AcelaTurnout
,AnymaDMX_UsbLight
,BiDiBLight
,BiDiBSensor
,BiDiBTurnout
,CbusLight
,CbusSensor
,CbusTurnout
,Dcc4PcSensor
,DCCppLight
,DCCppSensor
,DCCppTurnout
,EasyDccTurnout
,EcosSensor
,EcosTurnout
,EliteXNetTurnout
,IpocsLight
,IpocsSensor
,IpocsTurnout
,JMRIClientLight
,JMRIClientSensor
,JMRIClientTurnout
,LnLight
,LnSensor
,LnTurnout
,MarklinSensor
,MarklinTurnout
,MqttLight
,MqttSensor
,MqttTurnout
,MrcTurnout
,Mx1Turnout
,NceLight
,NceSensor
,NceTurnout
,OlcbLight
,OlcbSensor
,OlcbTurnout
,RaspberryPiSensor
,RaspberryPiTurnout
,RfidSensor
,RpsSensor
,SerialLight
,SerialLight
,SerialLight
,SerialLight
,SerialLight
,SerialLight
,SerialSensor
,SerialSensor
,SerialSensor
,SerialSensor
,SerialSensor
,SerialSensor
,SerialTurnout
,SerialTurnout
,SerialTurnout
,SerialTurnout
,SerialTurnout
,SerialTurnout
,SerialTurnout
,SerialX10Light
,SpecificDmxLight
,SpecificInsteonLight
,SpecificInsteonLight
,SpecificLight
,SpecificLight
,SpecificLight
,SpecificX10Light
,SpecificX10Light
,SprogCSTurnout
,SprogTurnout
,SRCPSensor
,SRCPTurnout
,TamsSensor
,TamsTurnout
,TimeoutRfidSensor
,XBeeLight
,XBeeSensor
,XBeeTurnout
,XNetLight
,XNetSensor
,XNetTurnout
,XpaTurnout
,Z21CanSensor
,Z21RMBusSensor
,Z21XNetTurnout
,ZTC611XNetTurnout
public interface DigitalIO extends NamedBean
Represent a digital I/O on the layout.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description static int
OFF
State value indicating output is off.static int
ON
State value indicating output is on.-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getCommandedState()
Query the commanded state.int
getKnownState()
Query the known state.boolean
isConsistentState()
Show whether state is stable.void
requestUpdateFromLayout()
Request an update from the layout soft/hardware.void
setCommandedState(int s)
Change the commanded state, which results in the relevant command(s) being sent to the hardware.-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
ON
static final int ON
State value indicating output is on.- See Also:
- Constant Field Values
-
OFF
static final int OFF
State value indicating output is off.- See Also:
- Constant Field Values
-
-
Method Detail
-
isConsistentState
boolean isConsistentState()
Show whether state is stable. For turnouts, a consistent state is one you can safely run trains over. For lights, it's a state which is either on or off, not in between.- Returns:
- true if state is valid and the known state is the same as commanded
-
setCommandedState
@InvokeOnLayoutThread void setCommandedState(int s)
Change the commanded state, which results in the relevant command(s) being sent to the hardware. The exception is thrown if there are problems communicating with the layout hardware.- Parameters:
s
- the desired state
-
getCommandedState
int getCommandedState()
Query the commanded state. This is a bound parameter, so you can also register a listener to be informed of changes.- Returns:
- the commanded state
-
getKnownState
int getKnownState()
Query the known state. This is a bound parameter, so you can also register a listener to be informed of changes. A result is always returned; if no other feedback method is available, the commanded state will be used.- Returns:
- the known state
-
requestUpdateFromLayout
@InvokeOnLayoutThread void requestUpdateFromLayout()
Request an update from the layout soft/hardware. May not even happen, and if it does it will happen later; listen for the result.
-
-