Class CbusParameters

java.lang.Object
jmri.jmrix.can.cbus.swing.bootloader.CbusParameters

public class CbusParameters extends Object
CBUS Node parameters
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum number of parameters.
    protected int[]
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create blank parameters
    CbusParameters(byte[] d)
    Create parameters from byte []
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Are the parameters valid?
    int
    Return the load address which is stored in little endian order in four parameters
    int
    getParam(int i)
    Get a parameter
    boolean
    isValidIndex(int i)
    Check if a parameter index can be used with getParam or setParam
    void
    setParam(int i, int v)
    Set a parameter
    void
    setValid(boolean s)
    Set parameter valid status
    Return String representation of CBUS parameters
    boolean
    Valid parameter block in a hex file by comparing against one read from hardware (or some other source)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • MAX_PARAMS

      public static final int MAX_PARAMS
      Maximum number of parameters. paramData holds the parameter count at index 0, then the parameters at indexes 1 to MAX_PARAMS.
      See Also:
    • paramData

      protected int[] paramData
    • valid

      protected boolean valid
  • Constructor Details

    • CbusParameters

      public CbusParameters()
      Create blank parameters
    • CbusParameters

      public CbusParameters(byte[] d)
      Create parameters from byte []
      Parameters:
      d - byte [] array
  • Method Details

    • getParam

      public int getParam(int i)
      Get a parameter
      Parameters:
      i - index of parameter to get
      Returns:
      parameter value
    • setParam

      public void setParam(int i, int v)
      Set a parameter
      Parameters:
      i - index of the parameter to set
      v - value for the parameter
    • isValidIndex

      public boolean isValidIndex(int i)
      Check if a parameter index can be used with getParam or setParam
      Parameters:
      i - index of the parameter
      Returns:
      true if the index is within the parameter array
    • validate

      public boolean validate(CbusParameters fp, CbusParameters hp)
      Valid parameter block in a hex file by comparing against one read from hardware (or some other source)
      Parameters:
      fp - Parameters from hex file
      hp - parameters to validate against
      Returns:
      true if parameter blocks match
    • getLoadAddress

      public int getLoadAddress()
      Return the load address which is stored in little endian order in four parameters
      Returns:
      the load address
    • toString

      public String toString()
      Return String representation of CBUS parameters
      Overrides:
      toString in class Object
      Returns:
      String
    • areValid

      public boolean areValid()
      Are the parameters valid?
      Returns:
      true if valid
    • setValid

      public void setValid(boolean s)
      Set parameter valid status
      Parameters:
      s - true or false valid status