OcaBlockFactory

A online version of the AES70 specification of this class can be found at http://docs.deuso.de.

The class is a subclass of OcaWorker().

This class defines the properties

Name

JavaScript Type

AES70 Type

ProtoPorts

OcaProtoPort[]

OcaList<OcaProtoPort>

ProtoMembers

OcaProtoObjectIdentification[]

OcaList<OcaProtoObjectIdentification>

ProtoSignalPaths

Map<number, OcaProtoSignalPath>

OcaMap<OcaUint16, OcaProtoSignalPath>

GlobalType

OcaGlobalTypeIdentifier

OcaGlobalTypeIdentifier

Furthermore, it inherits the properties ClassID, ClassVersion, ObjectNumber, Lockable, Role, Enabled, Ports, Label, Owner, Latency, ProtoPorts, ProtoMembers, ProtoSignalPaths and GlobalType.

class OcaBlockFactory(objectNumber, device)

Factory to create custom block instances. Used only in reconfigurable devices. The idea is that you instantiate a factory once, populate it with proto-objects and proto-signal paths, then use it subsequently to instantiate identical blocks. In this context, proto-object means a prototype of a block member. Unbound objects are identified by proto-object numbers (PONo’s) instead of actual object numbers. PONos are unique within the factory, and are converted to globally unique object numbers ONos) in all new block instances that the factory builds. Correspondingly, proto-signal path means a signal path expressed in terms of PONos rather than ONos . When the factory constructs a block, it converts all of its unbound signal paths to normal (bound) signal paths by mapping its PONos into ONos . The factory also holds a list of proto-blockports which are OcaPorts that are allocated to new blocks the factory builds. As well, the proto-objects in the factory may contain lists of their own proto-ports. Together, the factory’s proto-ports and its members’ proto-ports are used to define the factory’s set of proto-signal paths. Factories may be predefined at time of device manufacture, or constructed “on the fly” by controllers. To create a factory , the controller calls a block’s CreateMember(…) method with the ClassID of this class ( OcaBlockFactory ). Factories ignore which block creates them, so it makes no difference which block’s CreateMember(…) method is used. It will usually make the most sense to use the Root Block’s method. To add proto-objects, proto-ports, and proto-signal paths to a block factory, the controller calls the factory’s DefineProtoMember(…), DefineProtoPort(…), and DefineProtoSignalPath(… ) methods, respectively.

OcaBlockFactory.OnGlobalTypeChanged

type: PropertyEvent.<OcaGlobalTypeIdentifier>

This event is emitted when the property GlobalType changes in the remote object. The property GlobalType is described in the AES70 standard as follows. Global block type identifier for reusable blocks. <b>Added in version 2 of this class.</b>

OcaBlockFactory.OnProtoMembersChanged

type: PropertyEvent.<Array.<OcaProtoObjectIdentification>>

This event is emitted when the property ProtoMembers changes in the remote object. The property ProtoMembers is described in the AES70 standard as follows. List of prot-object identifiers of proto-members in the block.

OcaBlockFactory.OnProtoPortsChanged

type: PropertyEvent.<Array.<OcaProtoPort>>

This event is emitted when the property ProtoPorts changes in the remote object. The property ProtoPorts is described in the AES70 standard as follows. List of proto-ports for built objects. The factory itself has no ports.

OcaBlockFactory.OnProtoSignalPathsChanged

type: PropertyEvent.<Map.<number, OcaProtoSignalPath>>

This event is emitted when the property ProtoSignalPaths changes in the remote object. The property ProtoSignalPaths is described in the AES70 standard as follows. List of proto-signal paths in the block.

OcaBlockFactory.DefineProtoMember(ClassIdentification, ConstructionParameters)

Defines a proto-member of the given class in the factory. The most current version of the class is used. The return value indicates whether the proto-member was successfully defined.

Arguments
  • ClassIdentification (OcaClassID) –

  • ConstructionParameters (ConstructionParameterDataType) –

Returns

Promise.<number> – A promise which resolves to a single value of type number.

OcaBlockFactory.DefineProtoMemberUsingFactory(FactoryONo)

Defines a proto-member which will be instantiated by a specified factory when the block is built. The return value indicates whether the proto-member was successfully defined.

Arguments
  • FactoryONo (number) –

Returns

Promise.<number> – A promise which resolves to a single value of type number.

OcaBlockFactory.DefineProtoPort(name, portmode)

Defines a proto-port in the factory. If proto-port already exists, it is replaced with the one from this call. The return value indicates whether the proto-port was successfully added.

Arguments
Returns

Promise.<OcaProtoPortID> – A promise which resolves to a single value of type OcaProtoPortID().

OcaBlockFactory.DefineProtoSignalPath(Path)

Defines a proto-signal path in the factory. The return value indicates whether the proto-signal path was successfully defined.

Arguments
Returns

Promise.<number> – A promise which resolves to a single value of type number.

OcaBlockFactory.GetGlobalType()

Gets the global type identifier for blocks created by this factory. The return value indicates whether the identifier was successfully retrieved. Added in version 2 of this class.

Returns

Promise.<OcaGlobalTypeIdentifier> – A promise which resolves to a single value of type OcaGlobalTypeIdentifier().

OcaBlockFactory.GetProtoMembers()

Gets the factory’s list of proto-members. Does not recurse inner proto-blocks. The return value indicates whether the list was successfully retrieved.

Returns

Promise.<Array.<OcaProtoObjectIdentification>> – A promise which resolves to a single value of type OcaProtoObjectIdentification[].

OcaBlockFactory.GetProtoPorts()

Gets the factory’s list of proto-ports. The return value indicates whether the list was successfully retrieved.

Returns

Promise.<Array.<OcaProtoPort>> – A promise which resolves to a single value of type OcaProtoPort[].

OcaBlockFactory.GetProtoSignalPaths()

Gets the factory’s list of proto-signal paths. Map key is proto-signal path ID. Does not recurse inner proto-blocks. The return value indicates whether the list was successfully retrieved.

Returns

Promise.<Map.<number, OcaProtoSignalPath>> – A promise which resolves to a single value of type Map<number, OcaProtoSignalPath>.

OcaBlockFactory.SetGlobalType(GlobalType)

Sets the global type identifier for blocks created by this factory. The return value indicates whether the identifier was successfully set. Added in version 2 of this class.

Arguments
Returns

Promise.<void>

OcaBlockFactory.UndefineProtoMember(ProtoObjectNumber)

Deletes a proto-member from the factory. Deletes all proto-signal paths attached to its ports. The return value indicates whether the member was successfully deleted.

Arguments
  • ProtoObjectNumber (number) –

Returns

Promise.<void>

OcaBlockFactory.UndefineProtoPort(ProtoPortID)

Deletes a proto-port from the factory. The return value indicates whether the proto-port was successfully deleted.

Arguments
Returns

Promise.<void>

OcaBlockFactory.UndefineProtoSignalPath()

Deletes a proto-signal path from the factory. The return value indicates whether the signal path was successfully added.

Returns

Promise.<number> – A promise which resolves to a single value of type number.