OcaTaskManager¶
A online version of the AES70 specification of this class can be found at http://docs.deuso.de.
The class is a subclass of OcaManager()
.
This class defines the properties
Name |
JavaScript Type |
AES70 Type |
---|---|---|
State |
OcaTaskManagerState |
OcaTaskManagerState |
Tasks |
Map<number, OcaTask> |
OcaMap<OcaTaskID, OcaTask> |
Furthermore, it inherits the properties ClassID, ClassVersion, ObjectNumber, Lockable, Role, State and Tasks.
-
class
OcaTaskManager
(objectNumber, device)¶ Optional manager that collects OcaTask and OcaProgram objects.
May be instantiated once in any device.
If instantiated, object number must be 11.
Tasks shall be device execution threads that start, execute, and (normally) stop. The action of an OcaTask is defined by an OcaProgram . The idea is that OcaTasks shall execute OcaPrograms . OcaTaskManager offers global control over tasks in the device.
Device task processing state is Enabled by default. In Enabled state, tasks may be running.
Device task processing state may be Disabled by the OcaTaskManager Disable command.
The Disable command will succeed only if no tasks are running.
Tasks may be stopped by: passing the OcaTaskManager a Stop or Abort command, which will stop designated tasks in the device;.
-
OcaTaskManager.
OnStateChanged
¶ type: PropertyEvent.<OcaTaskManagerState>
This event is emitted when the property State changes in the remote object. The property
State
is described in the AES70 standard as follows. Current state of task processing. State is Disabled after a Disable command has been received, Enabled otherwise.
-
OcaTaskManager.
OnTaskStateChanged
¶ type: Event
This was not documented in the OCA standard.
-
OcaTaskManager.
OnTasksChanged
¶ type: PropertyEvent.<Map.<number, OcaTask>>
This event is emitted when the property Tasks changes in the remote object. The property
Tasks
is described in the AES70 standard as follows. Task collection
-
OcaTaskManager.
AddTask
(Task)¶ Creates a Task. Parameters of the new Task are given in the Task parameter; device returns the same parameter with the new Task ID filled in. Initial task state is set to Disabled. Return value indicates whether Task was successfully created.
-
OcaTaskManager.
ControlAllTasks
(Command, ApplicationTaskParameter)¶ Controls all tasks in device. Return value indicates whether tasks were successfully controlled.
- Arguments
Command (OcaTaskCommand) –
ApplicationTaskParameter (Uint8Array) –
- Returns
Promise.<void> –
-
OcaTaskManager.
ControlTask
(TaskID, Command, ApplicationTaskParameter)¶ Controls a specified task. Return value indicates whether tasks were successfully controlled.
- Arguments
TaskID (number) –
Command (OcaTaskCommand) –
ApplicationTaskParameter (Uint8Array) –
- Returns
Promise.<void> –
-
OcaTaskManager.
ControlTaskGroup
(GroupID, Command, ApplicationTaskParameter)¶ Controls all tasks in the given group. Return value indicates whether tasks were successfully controlled.
- Arguments
GroupID (number) –
Command (OcaTaskCommand) –
ApplicationTaskParameter (Uint8Array) –
- Returns
Promise.<void> –
-
OcaTaskManager.
DeleteTask
(ID)¶ Deletes a task. Return value indicates whether task was successfully deleted. Method fails with status=ProcessingFailed if task is running.
- Arguments
ID (number) –
- Returns
Promise.<void> –
-
OcaTaskManager.
Enable
(Enable)¶ Enables (parameter =TRUE) or disables (parameter = FALSE) the running of tasks. Changes value of property State from Disabled to Enabled and vice versa. All tasks running when Enable is called with parameter = FALSE are immediately aborted.
- Arguments
Enable (boolean) –
- Returns
Promise.<void> –
-
OcaTaskManager.
GetState
()¶ Gets value of property State . Return value indicates whether value was successfully retrieved.
- Returns
Promise.<OcaTaskManagerState> – A promise which resolves to a single value of type
OcaTaskManagerState()
.
-
OcaTaskManager.
GetTask
(ID)¶ Retrieves a Task. Return value indicates whether Task was successfully retrieved.
- Arguments
ID (number) –
- Returns
Promise.<OcaTask> – A promise which resolves to a single value of type
OcaTask()
.
-
OcaTaskManager.
GetTaskStatus
(TaskID)¶ This was not documented in the OCA standard.
- Arguments
TaskID (number) –
- Returns
Promise.<OcaTaskStatus> – A promise which resolves to a single value of type
OcaTaskStatus()
.
-
OcaTaskManager.
GetTaskStatuses
()¶ This was not documented in the OCA standard.
- Returns
Promise.<OcaTaskStatus> – A promise which resolves to a single value of type
OcaTaskStatus()
.
-
OcaTaskManager.
GetTasks
()¶ Gets map of Tasks in the device. Return value indicates whether map was successfully retrieved.
- Returns
Promise.<Map.<number, OcaTask>> – A promise which resolves to a single value of type
Map<number, OcaTask>
.