EcuUserScalar

Type: EcuUserScalar

Extends EcuItemIndexed

Script class for UserScalar ECU Definition objects.

UserScalars define alternative units and scaling for EcuObjectScaled derived objects.

Scaling can potentially be variable, via EcuOptions, depending upon the UserScalar definition

Properties

PropertyDescription
axes Array of the object's axes, elements are of type EcuItem.
axisCount The number of axes this object has (0 for options/channels, 1 for tables, 2 for maps).
description Description text for the object, normally displayed in the Descriptions view.
isConvertibleToReal 'true' if the value of this object has a conversion from raw (internal) to real (physical).
name The name of the object - e.g. 'Fuel' for the Fuel Map.
outputValue Interpolated output value. For tables / maps this is the linearly interpolated value at the current axes position. For options / channels this is the current value.
siteCount The total number of sites in the object.
typeName The internal type name of the object - e.g. 'Table' or 'Map'.
units The physical units of 'real' values in the object.
dependencyCount Number of sub-object dependencies.
displayIdentifier Display Identifier of this item.
ginIndex Index of this item within the EcuItemCollection for the object type in ECU Definition.
identifier Identifier of this item.
isIgnoredInCompareAndConvert 'true' if this object is not used in Compare / Convert Calibration operations, typically because it is aliased with another value at the same address.
longIdentifier Long Identifier of this item.
c offset in object scaling y = mx + c.
isFloatingPoint 'true' if the object value is be displayed with a decimal point.
m multiplier in object scaling y = mx + c.

Methods

MethodDescription
getAttribute(name) Get value of attribute with the given name
getAxisChannel(index) Get the channel (if any) for the given axis of the object.
getAxisPosition(index) Get the floating point position for the current input channel value for the given axis of the object.
getRaw(axes) Get the raw (internal) value at the specified site. 'axes' is an array of the [x,y] site in the object. Can be omitted for objects without axes (e.g. Options). The array can be passed inline - e.g. getRaw({2, 4}).
getReal(axes) Get the real (scaled to physical units) value at the specified site.
getString(axes) Get a textual representation of the value at the specified site.
getText(axes) Get a textual representation of the value at the specified site. Alias of getString.
hasAttribute(name) Determine of object has an attribute with the given name
rawFromReal(value, axes) Convert a real value to a raw value, given the scaling function for the site specified by 'axes'.
realFromRaw(value, axes) Convert a raw value to a real value, given the scaling function for the site specified by 'axes'.
rescale(multiplier, offset) Rescale the real value of all sites in the object by the given multiplier and offset.
setRaw(value, axes) Set the raw (internal) value at the specified site.
setReal(value, axes) Set the real (scaled to physical units) value at the specified site.
setString(value, axes) Set the textual value at the specified site.
setText(value, axes) Set the textual value at the specified site. Alias of setString.
apply(value [, axes])

Apply the user scalar's scaling function to the given value at the [optional] site position.

Some scalars are not the same for different sites (for example the duty cycle scalar on the fuel map). Such scalars are rare and in most cases the axes argument can be omitted.

applyInverse(value [, axes])

The inverse function of 'apply'.