OcaSwitch¶
A online version of the AES70 specification of this class can be found at http://docs.deuso.de.
The class is a subclass of OcaActuator()
.
This class defines the properties
Name |
JavaScript Type |
AES70 Type |
---|---|---|
Position |
number |
OcaUint16 |
PositionNames |
string[] |
OcaList<OcaString> |
PositionEnableds |
boolean[] |
OcaList<OcaBoolean> |
Furthermore, it inherits the properties ClassID, ClassVersion, ObjectNumber, Lockable, Role, Enabled, Ports, Label, Owner, Latency, Position, PositionNames and PositionEnableds.
-
class
OcaSwitch
(objectNumber, device)¶ (n)-position single-pole switch.
-
OcaSwitch.
OnPositionChanged
¶ type: PropertyEvent.<number>
This event is emitted when the property Position changes in the remote object. The property
Position
is described in the AES70 standard as follows. The current position of the switch. Positions shall be numbered from minPosition to (including) maxPosition. If the object does not return the optional parameters minPosition and maxPosition in its GetPosition method the positions shall be numbered from 1 to n.
-
OcaSwitch.
OnPositionEnabledsChanged
¶ type: PropertyEvent.<Array.<boolean>>
This event is emitted when the property PositionEnableds changes in the remote object. The property
PositionEnableds
is described in the AES70 standard as follows. Vector of booleans which enable or disable corresponding switch positions. Default values are a construction parameter. The usual default value is True.
-
OcaSwitch.
OnPositionNamesChanged
¶ type: PropertyEvent.<Array.<string>>
This event is emitted when the property PositionNames changes in the remote object. The property
PositionNames
is described in the AES70 standard as follows. Vector of switch position names. Supplied by controller.
-
OcaSwitch.
GetPosition
()¶ Gets the value of the Position property and, optionally, its implementation min and max. The return value indicates whether the data was successfully retrieved. The return values of this method are
position of type
number
minPosition of type
number
maxPosition of type
number
- Returns
Promise.<Arguments.<number, number, number>> –
-
OcaSwitch.
GetPositionEnabled
(Index)¶ Gets the Enabled flag assigned to a given switch position. The return value indicates whether the flag was successfully retrieved.
- Arguments
Index (number) –
- Returns
Promise.<boolean> – A promise which resolves to a single value of type
boolean
.
-
OcaSwitch.
GetPositionEnableds
()¶ Gets list of Enabled flags assigned to the switch’s positions. The return value indicates whether the flags were successfully retrieved.
- Returns
Promise.<Array.<boolean>> – A promise which resolves to a single value of type
boolean[]
.
-
OcaSwitch.
GetPositionName
(Index)¶ Gets the name assigned to a given switch position. The return value indicates whether the name was successfully retrieved.
- Arguments
Index (number) –
- Returns
Promise.<string> – A promise which resolves to a single value of type
string
.
-
OcaSwitch.
GetPositionNames
()¶ Gets list of names assigned to the switch’s positions. The return value indicates whether the names were successfully retrieved.
- Returns
Promise.<Array.<string>> – A promise which resolves to a single value of type
string[]
.
-
OcaSwitch.
SetPosition
(position)¶ Sets the value of the Position property. The return value indicates whether the property was successfully set.
- Arguments
position (number) –
- Returns
Promise.<void> –
-
OcaSwitch.
SetPositionEnabled
(Index, enabled)¶ Sets the Enabled flag assigned to a given switch position. The return value indicates whether the flag was successfully set.
- Arguments
Index (number) –
enabled (boolean) –
- Returns
Promise.<void> –
-
OcaSwitch.
SetPositionEnableds
(enableds)¶ Sets list of Enabled flags for the switch’s positions. The return value indicates whether the flags were successfully set.
- Arguments
enableds (Array.<boolean>) –
- Returns
Promise.<void> –
-
OcaSwitch.
SetPositionName
(Index, Name)¶ Assigns a name to a given switch position. The return value indicates whether the name was successfully assigned.
- Arguments
Index (number) –
Name (string) –
- Returns
Promise.<void> –
-
OcaSwitch.
SetPositionNames
(Names)¶ Assigns names to the switch’s positions. The return value indicates whether the names were successfully assigned.
- Arguments
Names (Array.<string>) –
- Returns
Promise.<void> –
-