Skip to content

OcaProgram#

This document describes the controller implementation of OcaProgram. This class is documented in the AES70 standard as:

A Program. Child of OcaDataset.

Execution:

A program executes in a task. Tasks may be explicitly created by OcaTaskManager2, or they may be implicitly created at execution time. The execution task may be explicitly specified, by giving its task ID, or automatically created by the device.

In either case, the given task ID parameter will be updated by the Run() or Schedule() method call to reflect the task actually assigned to the run.

Once a task is set up, subscribing controllers will receive notifications about changes in its status from OcaTaskManager2.

As well, running tasks can be controlled using OcaTaskManager2 methods.

Running and scheduling methods are as follows: Run(...) starts execution, then returns immediately., Schedule(...) schedules execution, then returns immediately., RunWait(...) starts execution, but does not return until execution terminates., ScheduleWait(...) schedules execution, but does not return until execution termiantes.

If execution is invoked via Run(...) or Schedule(...), OcaTaskManager2 will raise a CommandSetTerminated event when execution terminates. If execution is invoked via RunWait(...) or ScheduleWait(...), termination information is returned by the method, and no such event is raised.


Overview#

Class Declaration#

namespace aes70::controller
{
  class OcaProgram : public OcaDataset
  {
  public:
    OcaProgram(std::shared_ptr<connection> connection,
            uin32_t object_number);
    OcaProgram(const OcaProgram &o);

    // Control Methods
    // Calls GetSupportedRunModes and calls on_result or on_failure
    void GetSupportedRunModes(auto on_result, failure_callback on_failure);
    // Calls SetSupportedRunModes and calls on_result or on_failure
    void SetSupportedRunModes(OcaList<OcaProgramRunMode> RunModes, auto on_result, failure_callback on_failure);
    // Calls SetSupportedRunModes and does not wait for the response
    void SetSupportedRunModes(OcaList<OcaProgramRunMode> RunModes);

    // Observing Properties
    subscription observeSupportedRunModes(auto callback, failure_callback on_failure);

    // Property Changed Subscriptions
    subscription OnSupportedRunModesChanged(auto callback, failure_callback on_failure);
  };
}

Methods#

GetSupportedRunModes#

void GetSupportedRunModes(auto on_result, failure_callback on_failure)

Calls the method GetSupportedRunModes in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaList<OcaProgramRunMode> RunModes
  • failure_callback on_failure: A callback which is called on error.

SetSupportedRunModes#

void SetSupportedRunModes(OcaList<OcaProgramRunMode> RunModes, auto on_result, failure_callback on_failure)

Calls the method SetSupportedRunModes in the remote device. If no result and error callback is specified, the method will be called without requesting a response.

Parameters:#

  • OcaList<OcaProgramRunMode> RunModes
  • auto on_result: A callable (e.g. a lambda) with 0 arguments.
  • failure_callback on_failure: A callback which is called on error.

observeSupportedRunModes#

subscription observeSupportedRunModes(auto callback, failure_callback on_failure)

Fetches the remote property SupportedRunModes and subscribes for modifications. The callback is called with the initial values of SupportedRunModes and whenever it changes.

Parameters:#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaList<OcaProgramRunMode> SupportedRunModes
  • failure_callback on_failure: A callback which is called on error.

OnSupportedRunModesChanged#

subscription OnSupportedRunModesChanged(auto callback, failure_callback on_failure)

Parameters#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaList<OcaProgramRunMode> SupportedRunModes
  • failure_callback on_failure: A callback which is called on error.