params Functions

The following table lists the functions of the params object. Detailed descriptions appear after the table. If you are reading this document on-screen, click a function name in the table to view its description.

Function

Parameters

Returns

Description

createCopy

Source OID Destination OID

ParamScriptable

Creates a copy of the parameter. The duplicate parameter is independent of the base parameter. Changing the value of one does not affect the other.

createIntChoiceConstraint

[choices]

N/A

Creates a choice constraint (which is a set of key/value pairs) for use in toggle buttons, combo box, radio buttons, etc. The choice constraint you create here can be used to replace a constraint for a parameter.

createLinkedCopy

Source OID Destination OID

ParamScriptable

Creates a copy of the parameter that is linked to the base parameter:

Changing the value of the base parameter also changes the value of the duplicate parameter.

Changing the value of the duplicate parameter does not affect the value of the base parameter.

createMultiSet

String [OID] Integer [Index] Object [Value]

multiset object

Replaces multiple parameter values all at once.

createParam

JSON parameter definition

N/A

Creates a parameter based on a JSON parameter definition.

deleteParam

OID of parameter to delete

N/A

Deletes the specified parameter.

getAllValues

String [OID]

The entire array of values within the parameter.

Retrieves the entire array of values within the parameter.

getConstraint

String [OID]

Constraint

Get the constraint from the parameter with the specified OID.

getDeviceStatus

String [OID]

Device status information

Checks the status of a device and returns an Integer value indicating that status:

0 - good

- warning

- error

- unknown

getElementCount

Integer [Context ID] String [OID]

Integer [Index]

ParamScriptable

Get the information about an element in a parameter with the specified OID.

getIdentifiedConstraint

String [ID]

String

Get the constraint with the specified ID. If the ID is an external object URL, get the constraint defined in the specified external object.

getParam

String [Context ID]

String [OID]

Integer [Index]

ParamScriptable

Gets information about an element in the parameter with the specified Object ID.

getParam (OID, Index).remove

String or Integer [OID] Integer [Index]

N/A

Removes a parameter element. If the parameter is an array with more than one element, the element at the index location is removed.

 

String [OID]

Boolean

Check whether streaming of parameter values to XPression is enabled.

getValue

String [OID] Integer [Index]

String

Get the value of a parameter with the specified OID.

If the parameter is not an array parameter, use an Index of 0. In most cases, enter 0 as the Index.

getValueAsString

String [OID] Integer [Index]

String

Get a string representation of an element in a parameter with the specified OID.

isDeviceOnline

String [OID]

Online status of the device as Boolean

Queries a device to determine whether it is online.

isPrivateParamContext

N/A

Boolean

Returns true if local OGLML-based parameters are operating disconnected from the real device.

replaceConstraint

String [OID]

String [Constraint ID]

N/A

Replace the constraint for the parameter with the specified OID with the constraint with the specified constraint ID.

replaceViewConstraint

String [view OID]  String [constraint object]

N/A

Replaces the constraint object of a parameter view.

resetAllValues

String [parameter OID]

N/A

If the specified parameter is a copy of a base parameter, this function resets the parameter’s values to those of the base parameter.

setAccess

String [OID], Integer [Access]

N/A

Set the access level of the parameter with the provided OID.

setAllValues

OID Object[] Values

N/A

For an array parameter, replaces the current array with the new array.

setMenuState

Integer [Static Menu ID], Integer [Menu State]

N/A

Set the menu state of the menu with the specified static menu ID.

setPrivateParamContext

Boolean [Value]

N/A

true — disconnect parameters defined in the OGLML document from the device.

false — re-connect parameters defined in the OGLML document from the device.

setStream

String [OID] Boolean [true/false]

N/A

Controls whether the parameter streams its values to XPression when XPression streaming is on.

When true, streaming is ON. When false, streaming is OFF.

setValue

String [OID], Integer [Index], Object [Value]

N/A

Set the value of an element in a parameter with the provided OID to the provided value.

setValueRelative

String [OID], Integer [index],

Integer [change in value]

N/A

Changes the value of a parameter.

If the value is a string, it is replaced. If it is a float or int, the specified value is added to the current value.

toOid

String (OID)

N/A

Creates an OID object.