Skip to content

Simple Control Functions

These functions are used for working with simple conditional controls.

Function Description
addControl Adds a new simple control to a project.
deleteControl Deletes an existing simple control.
getControl Retrieves the properties of a simple control.
setControl Sets the properties of an existing simple control.

addControl

Adds a new simple control to a project.

addControl(type: ControlType, linkIndex: number, setting: number, nodeIndex: number, level: number): number;

Parameters

Parameter Type Description
type ControlType the type of control to add (see ControlType).
linkIndex number the index of a link to control (starting from 1).
setting number control setting applied to the link.
nodeIndex number index of the node used to control the link (0 for ControlType.Timer and ControlType.TimeOfDay controls).
level number action level (tank level, junction pressure, or time in seconds) that triggers the control.

Returns

Number index of the new control.


deleteControl

Deletes an existing simple control.

deleteControl(index: number): void;

Parameters

Parameter Type Description
index number the index of the control to delete (starting from 1).

getControl

Retrieves the properties of a simple control.

getControl(index: number): {
type: ControlType;
linkIndex: number;
setting: number;
nodeIndex: number;
level: number;
};

Parameters

Parameter Type Description
index number the control's index (starting from 1).

Returns

Object

{
  type: ControlType;
  linkIndex: number;
  setting: number;
  nodeIndex: number;
  level: number;
}
Property Type Description
type ControlType the type of control to add (see ControlType).
linkIndex number the index of a link to control (starting from 1).
setting number control setting applied to the link.
nodeIndex number index of the node used to control the link (0 for ControlType.Timer and ControlType.TimeOfDay controls).
level number action level (tank level, junction pressure, or time in seconds) that triggers the control.

setControl

Sets the properties of an existing simple control.

setControl(index: number, type: ControlType, linkIndex: number, setting: number, nodeIndex: number, level: number): void;

Parameters

Parameter Type Description
index number the control's index (starting from 1).
type ControlType the type of control to add (see ControlType).
linkIndex number the index of a link to control (starting from 1).
setting number control setting applied to the link.
nodeIndex number index of the node used to control the link (0 for ControlType.Timer and ControlType.TimeOfDay controls).
level number action level (tank level, junction pressure, or time in seconds) that triggers the control.