Package jmri
Interface AnalogIO
- All Superinterfaces:
Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Subinterfaces:
CurrentMeter
,Meter
,VariableLight
,VoltageMeter
- All Known Implementing Classes:
AbstractAnalogIO
,AbstractVariableLight
,AnymaDMX_UsbLight
,DefaultMeter
,DefaultMeter.DefaultCurrentMeter
,DefaultMeter.DefaultVoltageMeter
,SerialLight
,SerialX10Light
,SpecificInsteonLight
,SpecificInsteonLight
,SpecificLight
,SpecificLight
,SpecificX10Light
,SpecificX10Light
public interface AnalogIO extends NamedBean
Represent an analog I/O on the layout.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AnalogIO.AbsoluteOrRelative
Is the value an absolute value or a relative value?Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
Field Summary
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
Method Summary
Modifier and Type Method Description AnalogIO.AbsoluteOrRelative
getAbsoluteOrRelative()
Is this AnalogIO absolute or relative?double
getCommandedAnalogValue()
Query the commanded value.default double
getKnownAnalogValue()
Query the known analog value.double
getMax()
Get the maximum value of this AnalogIO.double
getMin()
Get the minimum value of this AnalogIO.double
getResolution()
Get the resolution of this AnalogIO.double
getState(double v)
Provide generic access to internal state.default boolean
isConsistentValue()
Show whether the analog value is stable.default void
requestUpdateFromLayout()
Request an update from the layout soft/hardware.void
setCommandedAnalogValue(double value)
Change the commanded value, which results in the relevant command(s) being sent to the hardware.void
setState(double value)
Provide generic access to internal state.Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getFullyFormattedDisplayName, getFullyFormattedDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, 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
-
Method Details
-
isConsistentValue
Show whether the analog value is stable.- Returns:
- true if the analog value is stable
-
setCommandedAnalogValue
Change the commanded value, 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.The value must be a valid number, not a NaN or infinity number.
- Parameters:
value
- the desired analog value- Throws:
JmriException
- general error when setting the value failsIllegalArgumentException
- if the value is Double.NaN, Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY
-
getCommandedAnalogValue
Query the commanded value. This is a bound parameter, so you can also register a listener to be informed of changes.The result must be a valid number, not a NaN or infinity number.
- Returns:
- the analog value
-
getKnownAnalogValue
Query the known analog value. 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 value will be used.The result must be a valid number, not a NaN or infinity number.
- Returns:
- the known analog value
-
setState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (setCommandedAnalogValue). This is provided to make scripts access easier to read.
- Parameters:
value
- the analog value- Throws:
JmriException
- general error when setting the state fails
-
getState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (getCommandedAnalogValue). This is provided to make scripts easier to read.
- Parameters:
v
- only used to select this method which returns an analog value. It's recommended to use 0.0 as the parameter.- Returns:
- the state
-
getMin
Get the minimum value of this AnalogIO.- Returns:
- minimum value.
-
getMax
Get the maximum value of this AnalogIO.- Returns:
- maximum value.
-
getResolution
Get the resolution of this AnalogIO.- Returns:
- analog resolution.
-
getAbsoluteOrRelative
Is this AnalogIO absolute or relative?- Returns:
- if absolute or relative.
-
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.
-