UNPKG

@p2olab/pimad-core

Version:

PiMAd (Process-industry-Modular-Automation-description) High level access to automation of modular plants.

135 lines (134 loc) 5.52 kB
import { Backbone } from '../Backbone'; import { ModuleAutomationObject } from './ModuleAutomationObject'; import { NodeIdTypeEnum } from '@p2olab/pimad-types'; import PiMAdResponse = Backbone.PiMAdResponse; /** * This interface describes an OPC-UA-NodeId for PiMAd-data-model. There is no OPC-UA connection, client or something * else. It models just the pure connection data. Use the data in your clients... For a detailed overview of * OPC-UA-NodeIds look at https://documentation.unified-automation.com/uasdkhp/1.0.0/html/_l2_ua_node_ids.html * * <uml> * interface ModuleAutomationObject * * interface NodeId { * +getNodeIdIdentifier(callback: (response: PiMAdResponse, identifier: string) => void): void * +getNamespaceIndex(callback: (response: PiMAdResponse, namespaceIndex: number) => void): void * +getNodeId(callback: (response: PiMAdResponse, nodeId: string) => void): void * +initialize(instructions: {namespaceIndex: number; identifier: string}): boolean * } * * abstract class AModuleAutomationObject * * abstract class ANodeId<IdentifierType> { * #namespaceIndex: number = -1 * #identifier: IdentifierType * {abstract} abstract getNodeId(callback: (response: PiMAdResponse, nodeId: string) => void): void * #setNamespaceIndex(namespaceIndex: number): boolean * +getNamespaceIndex(callback: (response: PiMAdResponse, namespaceIndex: number) => void): void * +getNodeIdIdentifier(callback: (response: PiMAdResponse, identifier: string) => void): void * +initialize(instructions: {namespaceIndex: number; identifier: string}): boolean * } * * class NumericNodeId<number> { * #identifier: number = -1 * +getNodeId(callback: (response: Backbone.PiMAdResponse, nodeId: string) => void): void * +initialize(instructions: {namespaceIndex: number; identifier: string}): boolean * } * * class StringNodeId<string> { * #identifier: string = 'identifier: not initialized' * +getNodeId(callback: (response: Backbone.PiMAdResponse, nodeId: string) => void): void * } * * class QpaqueNodeId { * +getNodeId(callback: (response: Backbone.PiMAdResponse, nodeId: string) => void): void * } * * class GUIDNodeId { * +getNodeId(callback: (response: Backbone.PiMAdResponse, nodeId: string) => void): void * } * * ModuleAutomationObject <|-- NodeId * AModuleAutomationObject <|-- ANodeId * ModuleAutomationObject <|.. AModuleAutomationObject * NodeId <|.. ANodeId * ANodeId <|-- NumericNodeId * ANodeId <|-- StringNodeId * StringNodeId <|-- GUIDNodeId * StringNodeId <|-- QpaqueNodeId * </uml> */ export interface NodeId extends ModuleAutomationObject { /** * Getter for the identifier part of an opcua-nodeId. * @param callback - A callback function. The response object shows the status (success while object was initialized * or error while not) of the request, while the identifier object the requested data. */ getNodeIdIdentifier(callback: (response: PiMAdResponse, identifier: string) => void): void; /** * Getter for the namespace part of an opcua-nodeId. * @param callback - A callback function. The response object shows the status (success while object was initialized * or error while not) of the request, while the namespaceIndex object the requested data. */ getNamespaceIndex(callback: (response: PiMAdResponse, namespaceIndex: number) => void): void; /** * Get the hole nodeId as string. Like toString() but via callback. * @param callback - A callback function. The response object shows the status (success while object was initialized * or error while not) of the request, while the nodeId object the standard conform combination of namespace-index * and identifier as a string. */ getNodeId(callback: (response: PiMAdResponse, nodeId: string) => void): void; /** * Initialize the NodeId object with namespace-index and identifier. * @param instructions - Pass the namespace-index and identifier of OPC-UA-NodeIds to the instance. Namespace-index * and identifier follows the rules of the opc foundation. The first one must be >= zero, the second one > zero. */ initialize(instructions: { namespaceIndex: number; identifier: string; }): boolean; } /** * The Factories create all kind of OPC-UA-NodeIds. */ export interface NodeIdFactory { /** * Create a new instance of OPC-UA-{@link NodeId}. */ create(): NodeId; } declare abstract class ANodeIdFactory implements NodeIdFactory { abstract create(): NodeId; } /** * This factory creates {@link NumericNodeId}s. */ export declare class NumericNodeIdFactory extends ANodeIdFactory { create(): NodeId; } /** * This factory creates {@link StringNodeId}s. */ export declare class StringNodeIdFactory extends ANodeIdFactory { create(): NodeId; } /** * This factory creates {@link QpaqueNodeId}'s. */ export declare class QpaqueNodeIdFactory { create(): NodeId; } /** * This factory creates {@link GUIDNodeId}'s. */ export declare class GUIDNodeIdFactory { create(): NodeId; } export declare class NodeIdVendor { private numericNodeIdFactory; private stringNodeIdFactory; private qpaqueNodeIdFactory; private gUIDNodeIdFactory; buy(type: NodeIdTypeEnum): NodeId; } export {};