Package jmri
Interface AnalogIO
-
- All Superinterfaces:
java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Subinterfaces:
CurrentMeter
,Meter
,VariableLight
,VoltageMeter
- All Known Implementing Classes:
AbstractAnalogIO
,AbstractVariableLight
,AnymaDMX_UsbLight
,BiDiBLight
,DefaultMeter
,DefaultMeter.DefaultCurrentMeter
,DefaultMeter.DefaultVoltageMeter
,MqttLight
,SerialLight
,SerialX10Light
,SpecificDmxLight
,SpecificInsteonLight
,SpecificInsteonLight
,SpecificLight
,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
All Methods Instance Methods Abstract Methods Default Methods 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, 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
-
-
-
-
Method Detail
-
isConsistentValue
@CheckReturnValue default boolean isConsistentValue()
Show whether the analog value is stable.- Returns:
- true if the analog value is stable
-
setCommandedAnalogValue
void setCommandedAnalogValue(double value) throws JmriException
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 failsjava.lang.IllegalArgumentException
- if the value is Double.NaN, Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY
-
getCommandedAnalogValue
@CheckReturnValue double 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
@CheckReturnValue default double 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
@InvokeOnLayoutThread void setState(double value) throws JmriException
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
@CheckReturnValue double getState(double v)
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
@CheckReturnValue double getMin()
Get the minimum value of this AnalogIO.- Returns:
- minimum value.
-
getMax
@CheckReturnValue double getMax()
Get the maximum value of this AnalogIO.- Returns:
- maximum value.
-
getResolution
@CheckReturnValue double getResolution()
Get the resolution of this AnalogIO.- Returns:
- analog resolution.
-
getAbsoluteOrRelative
@CheckReturnValue AnalogIO.AbsoluteOrRelative getAbsoluteOrRelative()
Is this AnalogIO absolute or relative?- Returns:
- if absolute or relative.
-
requestUpdateFromLayout
default 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.
-
-