Class LocoIOModeList

java.lang.Object
jmri.jmrix.loconet.locoio.LocoIOModeList

public class LocoIOModeList extends 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 Details

  • Constructor Details

    • LocoIOModeList

      public LocoIOModeList()
      Create a new instance of LocoIOModeList
  • Method Details

    • getValidModes

      protected String[] getValidModes()
    • isValidModeValue

      protected boolean isValidModeValue(Object value)
    • getLocoIOModeFor

    • 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 modes
      address - 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 modes
      address - 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 type
      sv - index of SV value to create, ignored
      v2mask - mask to apply on Value2
      address - 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 type
      sv - first SV value, ignored
      v1 - 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)