Package jmri.jmrix.loconet.locoio
Class LocoIOModeList
- java.lang.Object
-
- jmri.jmrix.loconet.locoio.LocoIOModeList
-
public class LocoIOModeList extends java.lang.Object
Manage the set of valid modes for a particular LocoIO port, as well as the conversions between addresses and SV values. Used in LocoIO tool. Marked Legacy/Deprecated since 2017 version 4.12.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Vector<LocoIOMode>
modeList
protected java.lang.String[]
validmodes
-
Constructor Summary
Constructors Constructor Description LocoIOModeList()
Create a new instance of LocoIOModeList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
addressToValue1(LocoIOMode lim, int address)
Convert Value1 (Low bits) from Port Address.protected int
addressToValue2(LocoIOMode lim, int address)
Convert Value2 (High bits) from Port Address.protected int
addressToValues(int opcode, int sv, int v2mask, int address)
Create 2 byte value from Port Address bits.protected LocoIOMode
getLocoIOModeFor(int cv, int v1, int v2)
protected LocoIOMode
getLocoIOModeFor(java.lang.String s)
protected java.lang.String[]
getValidModes()
protected boolean
isValidModeValue(java.lang.Object value)
protected int
valuesToAddress(int opcode, int sv, int v1, int v2)
Extract Port Address from the 3 SV values.protected int
valuesToAddress(LocoIOMode lim, int sv, int v1, int v2)
-
-
-
Field Detail
-
modeList
protected java.util.Vector<LocoIOMode> modeList
-
validmodes
protected java.lang.String[] validmodes
-
-
Constructor Detail
-
LocoIOModeList
public LocoIOModeList()
Create a new instance of LocoIOModeList
-
-
Method Detail
-
getValidModes
protected java.lang.String[] getValidModes()
-
isValidModeValue
protected boolean isValidModeValue(java.lang.Object value)
-
getLocoIOModeFor
protected LocoIOMode getLocoIOModeFor(java.lang.String s)
-
getLocoIOModeFor
protected LocoIOMode getLocoIOModeFor(int cv, int v1, int v2)
-
addressToValue1
protected int addressToValue1(LocoIOMode lim, int address)
Convert Value1 (Low bits) from Port Address.- Parameters:
lim
- one of a list of defined port operation modesaddress
- the address for this port- Returns:
- low-bits value
-
addressToValue2
protected int addressToValue2(LocoIOMode lim, int address)
Convert Value2 (High bits) from Port Address.- Parameters:
lim
- one of a list of defined port operation modesaddress
- the address for this port- Returns:
- high-bits value
-
addressToValues
protected int addressToValues(int opcode, int sv, int v2mask, int address)
Create 2 byte value from Port Address bits.- Parameters:
opcode
- coded value for message typesv
- index of SV value to create, ignoredv2mask
- mask to apply on Value2address
- the address for this port- Returns:
- 2-byte value
-
valuesToAddress
protected int valuesToAddress(int opcode, int sv, int v1, int v2)
Extract Port Address from the 3 SV values.- Parameters:
opcode
- coded value for message typesv
- first SV value, ignoredv1
- second value (upper bits)v2
- second value (lower bits)- Returns:
- address (int) of the port
-
valuesToAddress
protected int valuesToAddress(LocoIOMode lim, int sv, int v1, int v2)
-
-