Class ControllerParameter

java.lang.Object
com.efiAnalytics.plugin.ecu.ControllerParameter

public class ControllerParameter extends Object
This contains information and values for a single controller Parameter, A Controller parameter is segment of controller memory identified in the ecu configuration or ini file and given a name. A controller parameter can be a set of options or bit param, a single value or an array of values.
Author:
Phil Tobin
  • Field Details

    • PARAM_CLASS_BITS

      public static final String PARAM_CLASS_BITS
      Parameter to be set from a discrete set of provided options
      See Also:
    • PARAM_CLASS_SCALAR

      public static final String PARAM_CLASS_SCALAR
      a numeric value that can be set to anything between min and max
      See Also:
    • PARAM_CLASS_ARRAY

      public static final String PARAM_CLASS_ARRAY
      An array of values, can be 1 dimension or 2
      See Also:
  • Constructor Details

    • ControllerParameter

      public ControllerParameter()
      Creates a new instance of ControllerParameter
  • Method Details

    • getParamClass

      public String getParamClass()
      returns the parameter class for this Parameter as defined in the ecu configuration or ini file. Valid values will be:
      PARAM_CLASS_BITS
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
      Returns:

    • setParamClass

      public void setParamClass(String paramClass)
      the parameter class for this Parameter as defined in the ecu configuration or ini file.
      Valid values will be:
      PARAM_CLASS_BITS
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
    • getDecimalPlaces

      public int getDecimalPlaces()
      The number of digits to the right of the decimal point for this Parameter.
      Example: 2 will return 14.70, or an int will be 0
      valid for Parameter Classes of:
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
      Returns:
      The number of digits to the right of the decimal point for this Parameter
    • setDecimalPlaces

      public void setDecimalPlaces(int decimalPlaces)
      The number of digits to the right of the decimal point for this Parameter. i.e. 2 will return 14.70, or an int will be 0
      valid for Parameter Classes of:
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
    • getShape

      public Dimension getShape()
      returns the shape of an array. A 12x16 will provide
      getShape().w = 12
      getShape().h = 16
      valid for Parameter Classes of:
      PARAM_CLASS_ARRAY
    • setShape

      public void setShape(Dimension shape)
      The shape of an array. A 12x16 will provide
      getShape().w = 12
      getShape().h = 16
      valid for Parameter Classes of:
      PARAM_CLASS_ARRAY
    • getUnits

      public String getUnits()
      Units this number is represented in. i.e:
      ms., %, kPa ...
      valid for Parameter Classes of:
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
      Returns:
    • setUnits

      public void setUnits(String units)
      Units this number is represented in. i.e:
      ms., %, kPa ...
      valid for Parameter Classes of:
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
    • getMin

      public double getMin()
      minimum allowed value for this parameter to element of this Parameter.
      if a value above this is set, in most cases it will create an
      ValueOutofBoundsException and will roll back to the previous value and
      you will be notified of an update to the parameter value
    • setMin

      public void setMin(double min)
      minimum allowed value for this parameter to element of this Parameter.
      if a value above this is set, in most cases it will create an
      ValueOutofBoundsException and will roll back to the previous value and
      you will be notified of an update to the parameter value
    • getMax

      public double getMax()
      Maximum allowed value for this parameter to element of this Parameter.
      if a value above this is set, in most cases it will create an
      ValueOutofBoundsException and will roll back to the previous value and
      you will be notified of an update to the parameter value
    • setMax

      public void setMax(double max)
      Maximum allowed value for this parameter to element of this Parameter.
      if a value above this is set, in most cases it will create an
      ValueOutofBoundsException and will roll back to the previous value and
      you will be notified of an update to the parameter value
    • getOptionDescriptions

      public ArrayList getOptionDescriptions()
      All valid String Options for a bit selection.
      These selections are defined in the ecu configuration or ini file.
      Valid for parameterClass:
      PARAM_CLASS_BITS
    • setOptionDescriptions

      public void setOptionDescriptions(ArrayList optionDescriptions)
      Sets valid String Options for a bit selection.
      These Strings will be retrieved with
      getOptionDescriptions()
      This should normally only be used by an Implmentation of
      ControllerParameterServer in the Application
      Valid for parameterClass:
      PARAM_CLASS_BITS
    • getArrayValues

      public double[][] getArrayValues()
      returns the values of this Parameter.
      This is primarily used for Arrays, but can be used for scalars
      as well, A scalar will have a size of 1x1 and the value will be in
      getArrayValues()[0][0]
      valid for Parameter Classes of:
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
    • setScalarValue

      public void setScalarValue(double scalar)
      the value for a scalar parameter. this can be set via setArrayValue() with a value at xxx[0][0], but provides a shorthand version. Note when setting, only set ArrayValue or Scalar values. otherwise one will replace the other.
    • getScalarValue

      public double getScalarValue()
      the value for a scalar parameter. this can be accaessed via getArrayValue()[0][0] as well, but provides a shorthand version. Note when setting, only set ArrayValue or Scalar values. otherwise one will replace the other.
    • setArrayValues

      public void setArrayValues(double[][] arrayValues)
      returns the values of this Parameter.
      This is primarily used for Arrays, but can be used for scalars
      as well. A scalar will have a size of 1x1
      The size of the Array must equal the size of
      getShape()
      valid for Parameter Classes of:
      PARAM_CLASS_SCALER
      PARAM_CLASS_ARRAY
    • getStringValue

      public String getStringValue()
      Gets the correct bit value to this String.
      The String must be one of those retrieved with
      getOptionDescriptions()
      Valid for parameterClass:
      PARAM_CLASS_BITS
    • setStringValue

      public void setStringValue(String stringValue)
      Sets the correct bit value to this String.
      The String must be one of those retrieved with
      getOptionDescriptions()
      Valid for parameterClass:
      PARAM_CLASS_BITS