Skip to content

Data Curve Functions

These functions are used for working with data curves.

FunctionVersionsDescription
addCurve2.2+Adds a new data curve to a project.
deleteCurve2.2+Deletes a data curve from a project.
getCurveIndex2.2+Retrieves the index of a curve given its ID name.
getCurveId2.2+Retrieves the ID name of a curve given its index.
setCurveId2.2+Changes the ID name of a data curve given its index.
getCurveLenth2.2+Retrieves the number of points in a curve.
getCurveType2.2+Retrieves a curve’s type.
setCurveType2.3+Changes a curve’s classification.
getCurveValue2.2+Retrieves the value of a single data point for a curve.
setCurveValue2.2+Sets the value of a single data point for a curve.
setCurve2.2+Assigns a set of data points to a curve.

Adds a new data curve to a project.

addCurve(id: string): void;

Parameters

ParameterTypeDescription
idstringThe ID name of the curve to be added.

The new curve contains a single data point (1.0, 1.0).


Deletes a data curve from a project.

deleteCurve(index: number): void;

Parameters

ParameterTypeDescription
indexnumberthe data curve’s index (starting from 1).

Retrieves the index of a curve given its ID name.

getCurveIndex(id: string): number;

Parameters

ParameterTypeDescription
idstringthe ID name of a curve.

Returns

Number The curve’s index (starting from 1).


Retrieves the ID name of a curve given its index.

getCurveId(index: number): string;

Parameters

ParameterTypeDescription
indexnumbera curve’s index (starting from 1).

Returns

Number the curve’s ID name.


Changes the ID name of a data curve given its index.

setCurveId(index: number, id: string): void;

Parameters

ParameterTypeDescription
indexnumbera data curve index (starting from 1).
idstringthe data curve’s new ID name.

Retrieves the number of points in a curve.

getCurveLenth(index: number): number;

Parameters

ParameterTypeDescription
indexnumbera curve’s index (starting from 1).

Returns

Number The number of data points assigned to the curve.


Retrieves a curve’s type.

getCurveType(index: number): CurveType;

Parameters

ParameterTypeDescription
indexnumbera curve’s index (starting from 1).

Returns

CurveType the curve’s type (see CurveType).


Reassigns the type of an existing curve (e.g. pump-head vs. efficiency vs. volume curve).

setCurveType(index: number, type: CurveType): void;

Parameters

ParameterTypeDescription
indexnumbera curve’s index (starting from 1).
typeCurveTypethe new curve type (see CurveType).

Retrieves the value of a single data point for a curve.

getCurveValue(curveIndex: number, pointIndex: number): {
x: number;
y: number;
};

Parameters

ParameterTypeDescription
curveIndexnumbera curve’s index (starting from 1).
pointIndexnumberthe index of a point on the curve (starting from 1).

Returns

Object
{
x: number;
y: number;
}
PropertyTypeDescription
xnumberthe point’s x-value.
ynumberthe point’s y-value.

Sets the value of a single data point for a curve.

setCurveValue(curveIndex: number, pointIndex: number, x: number, y: number): void;

Parameters

ParameterTypeDescription
curveIndexnumbera curve’s index (starting from 1).
pointIndexnumberthe index of a point on the curve (starting from 1).
xnumberthe point’s new x-value.
ynumberthe point’s new y-value.

Assigns a set of data points to a curve.

setCurve(index: number, xValues: number[], yValues: number[]): void;

Parameters

ParameterTypeDescription
indexnumbera curve’s index (starting from 1).
xValuesnumber[]an array of new x-values for the curve.
yValuesnumber[]an array of new y-values for the curve.

Use this function to redefine (and resize) a curve all at once; use setCurveValue to revise a curve’s data points one at a time.