com.efiAnalytics.plugin.ecu
Class ControllerParameter

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

public class ControllerParameter
extends java.lang.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 Summary
static java.lang.String PARAM_CLASS_ARRAY
          An array of values, can be 1 dimension or 2
static java.lang.String PARAM_CLASS_BITS
          Parameter to be set from a discrete set of provided options
static java.lang.String PARAM_CLASS_SCALAR
          a numeric value that can be set to anything between min and max
 
Constructor Summary
ControllerParameter()
          Creates a new instance of ControllerParameter
 
Method Summary
 double[][] getArrayValues()
          returns the values of this Parameter.
 int getDecimalPlaces()
          The number of digits to the right of the decimal point for this Parameter.
 double getMax()
          Maximum allowed value for this parameter to element of this Parameter.
 double getMin()
          minimum allowed value for this parameter to element of this Parameter.
 java.util.ArrayList getOptionDescriptions()
          All valid String Options for a bit selection.
 java.lang.String getParamClass()
          returns the parameter class for this Parameter as defined in the ecu configuration or ini file.
 double getScalarValue()
          the value for a scalar parameter.
 java.awt.Dimension getShape()
          returns the shape of an array.
 java.lang.String getStringValue()
          Gets the correct bit value to this String.
 java.lang.String getUnits()
          Units this number is represented in.
 void setArrayValues(double[][] arrayValues)
          returns the values of this Parameter.
 void setDecimalPlaces(int decimalPlaces)
          The number of digits to the right of the decimal point for this Parameter.
 void setMax(double max)
          Maximum allowed value for this parameter to element of this Parameter.
 void setMin(double min)
          minimum allowed value for this parameter to element of this Parameter.
 void setOptionDescriptions(java.util.ArrayList optionDescriptions)
          Sets valid String Options for a bit selection.
 void setParamClass(java.lang.String paramClass)
          the parameter class for this Parameter as defined in the ecu configuration or ini file.
 void setScalarValue(double scalar)
          the value for a scalar parameter.
 void setShape(java.awt.Dimension shape)
          The shape of an array.
 void setStringValue(java.lang.String stringValue)
          Sets the correct bit value to this String.
 void setUnits(java.lang.String units)
          Units this number is represented in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CLASS_BITS

public static final java.lang.String PARAM_CLASS_BITS
Parameter to be set from a discrete set of provided options

See Also:
Constant Field Values

PARAM_CLASS_SCALAR

public static final java.lang.String PARAM_CLASS_SCALAR
a numeric value that can be set to anything between min and max

See Also:
Constant Field Values

PARAM_CLASS_ARRAY

public static final java.lang.String PARAM_CLASS_ARRAY
An array of values, can be 1 dimension or 2

See Also:
Constant Field Values
Constructor Detail

ControllerParameter

public ControllerParameter()
Creates a new instance of ControllerParameter

Method Detail

getParamClass

public java.lang.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(java.lang.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 java.awt.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(java.awt.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 java.lang.String getUnits()
Units this number is represented in. i.e:
ms., %, kPa ...
valid for Parameter Classes of:
PARAM_CLASS_SCALER
PARAM_CLASS_ARRAY


setUnits

public void setUnits(java.lang.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 java.util.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(java.util.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 java.lang.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(java.lang.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