opcua-webapi-ts 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client/utils/UaDataTypeDictionary.js +38 -91
- package/dist/cjs/client/utils/UaNodeReader.js +459 -530
- package/dist/cjs/client/utils/UaObjectTypeDictionary.js +37 -29
- package/dist/cjs/client/utils/UaReferenceTypeDictionary.js +37 -29
- package/dist/cjs/common/nodes/UaDataType.js +35 -34
- package/dist/cjs/common/nodes/UaMethod.js +2 -2
- package/dist/cjs/common/nodes/UaObject.js +1 -1
- package/dist/cjs/common/nodes/UaVariable.js +10 -6
- package/dist/cjs/common/types/UaReference.js +59 -0
- package/dist/cjs/common/types/index.js +1 -1
- package/dist/client/utils/UaDataTypeDictionary.d.ts +3 -6
- package/dist/client/utils/UaDataTypeDictionary.js +38 -91
- package/dist/client/utils/UaNodeReader.d.ts +45 -73
- package/dist/client/utils/UaNodeReader.js +459 -530
- package/dist/client/utils/UaObjectTypeDictionary.d.ts +3 -3
- package/dist/client/utils/UaObjectTypeDictionary.js +37 -29
- package/dist/client/utils/UaReferenceTypeDictionary.d.ts +3 -3
- package/dist/client/utils/UaReferenceTypeDictionary.js +37 -29
- package/dist/common/nodes/UaDataType.d.ts +2 -2
- package/dist/common/nodes/UaDataType.js +35 -34
- package/dist/common/nodes/UaMethod.js +2 -2
- package/dist/common/nodes/UaObject.js +1 -1
- package/dist/common/nodes/UaVariable.d.ts +5 -4
- package/dist/common/nodes/UaVariable.js +10 -6
- package/dist/common/types/UaReference.d.ts +23 -0
- package/dist/common/types/UaReference.js +59 -0
- package/dist/common/types/index.d.ts +1 -1
- package/dist/common/types/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { UaNodeId, UaObjectType } from "../../common";
|
|
|
2
2
|
import { UaWebClient } from "../UaWebClient";
|
|
3
3
|
export declare class UaObjectTypeDictionary {
|
|
4
4
|
private _objectTypes;
|
|
5
|
-
private
|
|
6
|
-
constructor();
|
|
5
|
+
private _returnAllAttributes;
|
|
6
|
+
constructor(simpleMode?: boolean);
|
|
7
7
|
read(client: UaWebClient): Promise<void>;
|
|
8
8
|
getObjectType(nodeId: UaNodeId): UaObjectType | null;
|
|
9
9
|
getObjectTypes(): Array<UaObjectType>;
|
|
10
|
-
private
|
|
10
|
+
private _read;
|
|
11
11
|
private __delay;
|
|
12
12
|
}
|
|
@@ -12,16 +12,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.UaObjectTypeDictionary = void 0;
|
|
13
13
|
const opcua_webapi_1 = require("opcua-webapi");
|
|
14
14
|
const common_1 = require("../../common");
|
|
15
|
+
const UaNodeReader_1 = require("./UaNodeReader");
|
|
15
16
|
class UaObjectTypeDictionary {
|
|
16
|
-
constructor() {
|
|
17
|
+
constructor(simpleMode) {
|
|
17
18
|
this._objectTypes = new Map;
|
|
18
|
-
|
|
19
|
+
this._returnAllAttributes = (null == simpleMode) ? false : !simpleMode;
|
|
20
|
+
let baseObjectTypeId = common_1.UaNodeId.from(common_1.ObjectTypeIds.BaseObjectType);
|
|
19
21
|
this._objectTypes.set(baseObjectTypeId.toString(), new common_1.UaObjectType(baseObjectTypeId, "BaseObjectType", new common_1.UaLocalizedText("BaseObjectType"), false));
|
|
20
|
-
this._remainingNodesToBrowse = [baseObjectTypeId];
|
|
21
22
|
}
|
|
22
23
|
read(client) {
|
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
|
|
25
|
+
let browser = new UaNodeReader_1.UaChildBrowser([common_1.UaNodeId.from(common_1.ObjectTypeIds.BaseObjectType)]);
|
|
26
|
+
yield this._read(browser, client);
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
getObjectType(nodeId) {
|
|
@@ -31,37 +33,43 @@ class UaObjectTypeDictionary {
|
|
|
31
33
|
getObjectTypes() {
|
|
32
34
|
return [...this._objectTypes.values()];
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
_read(browser, client) {
|
|
35
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
let
|
|
40
|
-
for (let item of
|
|
41
|
-
let
|
|
42
|
-
|
|
38
|
+
// Browse child type
|
|
39
|
+
yield browser.browse(client);
|
|
40
|
+
let results = browser.results();
|
|
41
|
+
let referencesToRead = [];
|
|
42
|
+
for (let item of results) {
|
|
43
|
+
for (let reference of item.references)
|
|
44
|
+
referencesToRead.push(reference);
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
if (0 == referencesToRead.length)
|
|
47
|
+
return;
|
|
48
|
+
// Read child type
|
|
49
|
+
let nodeIdsToBrowse = [];
|
|
50
|
+
let nodeReader = new UaNodeReader_1.UaNodeReader(this._returnAllAttributes, false, false, this._returnAllAttributes);
|
|
51
|
+
let nodes = yield nodeReader.readByReferences(referencesToRead, client);
|
|
52
|
+
for (let node of nodes) {
|
|
53
|
+
if (opcua_webapi_1.NodeClass.ObjectType != node.nodeClass)
|
|
47
54
|
continue;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this._objectTypes.
|
|
56
|
-
|
|
57
|
-
if (parentType)
|
|
55
|
+
nodeIdsToBrowse.push(node.nodeId);
|
|
56
|
+
this._objectTypes.set(node.nodeId.toString(), node);
|
|
57
|
+
}
|
|
58
|
+
// Build parent-child relationship
|
|
59
|
+
for (let item of results) {
|
|
60
|
+
let parentType = this._objectTypes.get(item.nodeId.toString());
|
|
61
|
+
for (let reference of item.references) {
|
|
62
|
+
let objectType = this._objectTypes.get(reference.nodeId.toString());
|
|
63
|
+
if (objectType && parentType)
|
|
58
64
|
objectType.setParentType(parentType);
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
if (0 == nodeIdsToBrowse.length)
|
|
68
|
+
return;
|
|
69
|
+
yield this.__delay(20);
|
|
70
|
+
// Continue to browse and read child type
|
|
71
|
+
let childBrowser = new UaNodeReader_1.UaChildBrowser(nodeIdsToBrowse);
|
|
72
|
+
yield this._read(childBrowser, client);
|
|
65
73
|
});
|
|
66
74
|
}
|
|
67
75
|
__delay(ms) {
|
|
@@ -2,11 +2,11 @@ import { UaReferenceType, UaNodeId } from "../../common";
|
|
|
2
2
|
import { UaWebClient } from "../UaWebClient";
|
|
3
3
|
export declare class UaReferenceTypeDictionary {
|
|
4
4
|
private _referenceTypes;
|
|
5
|
-
private
|
|
6
|
-
constructor();
|
|
5
|
+
private _returnAllAttributes;
|
|
6
|
+
constructor(simpleMode?: boolean);
|
|
7
7
|
read(client: UaWebClient): Promise<void>;
|
|
8
8
|
getReferenceType(nodeId: UaNodeId): UaReferenceType | null;
|
|
9
9
|
getReferenceTypes(): Array<UaReferenceType>;
|
|
10
|
-
private
|
|
10
|
+
private _read;
|
|
11
11
|
private __delay;
|
|
12
12
|
}
|
|
@@ -12,16 +12,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.UaReferenceTypeDictionary = void 0;
|
|
13
13
|
const opcua_webapi_1 = require("opcua-webapi");
|
|
14
14
|
const common_1 = require("../../common");
|
|
15
|
+
const UaNodeReader_1 = require("./UaNodeReader");
|
|
15
16
|
class UaReferenceTypeDictionary {
|
|
16
|
-
constructor() {
|
|
17
|
+
constructor(simpleMode) {
|
|
17
18
|
this._referenceTypes = new Map;
|
|
18
|
-
|
|
19
|
+
this._returnAllAttributes = (null == simpleMode) ? false : !simpleMode;
|
|
20
|
+
let referencesId = common_1.UaNodeId.from(common_1.ReferenceTypeIds.References);
|
|
19
21
|
this._referenceTypes.set(referencesId.toString(), new common_1.UaReferenceType(referencesId, "References", new common_1.UaLocalizedText("References"), true, common_1.UaLocalizedText.nullText, true));
|
|
20
|
-
this._remainingNodesToBrowse = [referencesId];
|
|
21
22
|
}
|
|
22
23
|
read(client) {
|
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
|
|
25
|
+
let browser = new UaNodeReader_1.UaChildBrowser([common_1.UaNodeId.from(common_1.ReferenceTypeIds.References)]);
|
|
26
|
+
yield this._read(browser, client);
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
getReferenceType(nodeId) {
|
|
@@ -31,37 +33,43 @@ class UaReferenceTypeDictionary {
|
|
|
31
33
|
getReferenceTypes() {
|
|
32
34
|
return [...this._referenceTypes.values()];
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
_read(browser, client) {
|
|
35
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
let
|
|
40
|
-
for (let item of
|
|
41
|
-
let
|
|
42
|
-
|
|
38
|
+
// Browse child type
|
|
39
|
+
yield browser.browse(client);
|
|
40
|
+
let results = browser.results();
|
|
41
|
+
let referencesToRead = [];
|
|
42
|
+
for (let item of results) {
|
|
43
|
+
for (let reference of item.references)
|
|
44
|
+
referencesToRead.push(reference);
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
if (0 == referencesToRead.length)
|
|
47
|
+
return;
|
|
48
|
+
// Read child type
|
|
49
|
+
let nodeIdsToBrowse = [];
|
|
50
|
+
let nodeReader = new UaNodeReader_1.UaNodeReader(this._returnAllAttributes, false, false, this._returnAllAttributes);
|
|
51
|
+
let nodes = yield nodeReader.readByReferences(referencesToRead, client);
|
|
52
|
+
for (let node of nodes) {
|
|
53
|
+
if (opcua_webapi_1.NodeClass.ReferenceType != node.nodeClass)
|
|
47
54
|
continue;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this._referenceTypes.
|
|
56
|
-
|
|
57
|
-
if (parentType)
|
|
55
|
+
nodeIdsToBrowse.push(node.nodeId);
|
|
56
|
+
this._referenceTypes.set(node.nodeId.toString(), node);
|
|
57
|
+
}
|
|
58
|
+
// Build parent-child relationship
|
|
59
|
+
for (let item of results) {
|
|
60
|
+
let parentType = this._referenceTypes.get(item.nodeId.toString());
|
|
61
|
+
for (let reference of item.references) {
|
|
62
|
+
let referenceType = this._referenceTypes.get(reference.nodeId.toString());
|
|
63
|
+
if (referenceType && parentType)
|
|
58
64
|
referenceType.setParentType(parentType);
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
if (0 == nodeIdsToBrowse.length)
|
|
68
|
+
return;
|
|
69
|
+
yield this.__delay(20);
|
|
70
|
+
// Continue to browse and read child type
|
|
71
|
+
let childBrowser = new UaNodeReader_1.UaChildBrowser(nodeIdsToBrowse);
|
|
72
|
+
yield this._read(childBrowser, client);
|
|
65
73
|
});
|
|
66
74
|
}
|
|
67
75
|
__delay(ms) {
|
|
@@ -8,8 +8,8 @@ export declare class UaDataType extends UaDefintionNode {
|
|
|
8
8
|
get nodeClass(): NodeClass;
|
|
9
9
|
get valueType(): number;
|
|
10
10
|
get enumValues(): Map<number, UaLocalizedText> | null;
|
|
11
|
-
setEnumVariable(node: UaVariable): void;
|
|
12
|
-
setEnumValues(value: UaVariant): void;
|
|
13
11
|
classify(): void;
|
|
14
12
|
toJson(): any;
|
|
13
|
+
setEnumVariable(node: UaVariable): void;
|
|
14
|
+
setEnumValues(value: UaVariant): void;
|
|
15
15
|
}
|
|
@@ -20,38 +20,6 @@ class UaDataType extends _1.UaDefintionNode {
|
|
|
20
20
|
get enumValues() {
|
|
21
21
|
return this._enumValues;
|
|
22
22
|
}
|
|
23
|
-
setEnumVariable(node) {
|
|
24
|
-
if ("EnumStrings" == node.browseName ||
|
|
25
|
-
"EnumValues" == node.browseName) {
|
|
26
|
-
this.setEnumValues(node.value);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
setEnumValues(value) {
|
|
30
|
-
if (types_1.UaVariantType.LocalizedText == value.type) {
|
|
31
|
-
let enumStrings = value.toLocalizedTexts();
|
|
32
|
-
if (null == enumStrings)
|
|
33
|
-
return;
|
|
34
|
-
this._enumValues = new Map;
|
|
35
|
-
let index = 0;
|
|
36
|
-
for (let item of enumStrings) {
|
|
37
|
-
this._enumValues.set(index, item);
|
|
38
|
-
index++;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else if (types_1.UaVariantType.ExtensionObject == value.type) {
|
|
42
|
-
let extensionObjects = value.toExtensionObjects();
|
|
43
|
-
if (null == extensionObjects)
|
|
44
|
-
return;
|
|
45
|
-
let enumValues = new Map;
|
|
46
|
-
for (let item of extensionObjects) {
|
|
47
|
-
let enumValue = structure_1.UaEnumValueType.fromExtensionObject(item);
|
|
48
|
-
if (!enumValue)
|
|
49
|
-
return;
|
|
50
|
-
enumValues.set(enumValue.value, enumValue.displayName);
|
|
51
|
-
}
|
|
52
|
-
this._enumValues = enumValues;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
23
|
classify() {
|
|
56
24
|
let isBasicDataType = false;
|
|
57
25
|
if (0 == this._nodeId.nsIndex) {
|
|
@@ -73,7 +41,7 @@ class UaDataType extends _1.UaDefintionNode {
|
|
|
73
41
|
if (this._enumValues) {
|
|
74
42
|
for (let item of this._enumValues) {
|
|
75
43
|
enumValues.push({
|
|
76
|
-
|
|
44
|
+
index: item[0],
|
|
77
45
|
text: item[1].text
|
|
78
46
|
});
|
|
79
47
|
}
|
|
@@ -85,9 +53,42 @@ class UaDataType extends _1.UaDefintionNode {
|
|
|
85
53
|
displayName: this._displayName.text,
|
|
86
54
|
description: (this._description) ? this._description.text : undefined,
|
|
87
55
|
isAbstract: this._isAbstract,
|
|
88
|
-
enumValues: (enumValues.length
|
|
56
|
+
enumValues: (enumValues.length != 0) ? enumValues : undefined
|
|
89
57
|
};
|
|
90
58
|
return ret;
|
|
91
59
|
}
|
|
60
|
+
setEnumVariable(node) {
|
|
61
|
+
if ("EnumStrings" == node.browseName ||
|
|
62
|
+
"EnumValues" == node.browseName) {
|
|
63
|
+
if (node.value)
|
|
64
|
+
this.setEnumValues(node.value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
setEnumValues(value) {
|
|
68
|
+
if (types_1.UaVariantType.LocalizedText == value.type) {
|
|
69
|
+
let enumStrings = value.toLocalizedTexts();
|
|
70
|
+
if (null == enumStrings)
|
|
71
|
+
return;
|
|
72
|
+
this._enumValues = new Map;
|
|
73
|
+
let index = 0;
|
|
74
|
+
for (let item of enumStrings) {
|
|
75
|
+
this._enumValues.set(index, item);
|
|
76
|
+
index++;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (types_1.UaVariantType.ExtensionObject == value.type) {
|
|
80
|
+
let extensionObjects = value.toExtensionObjects();
|
|
81
|
+
if (null == extensionObjects)
|
|
82
|
+
return;
|
|
83
|
+
let enumValues = new Map;
|
|
84
|
+
for (let item of extensionObjects) {
|
|
85
|
+
let enumValue = structure_1.UaEnumValueType.fromExtensionObject(item);
|
|
86
|
+
if (!enumValue)
|
|
87
|
+
return;
|
|
88
|
+
enumValues.set(enumValue.value, enumValue.displayName);
|
|
89
|
+
}
|
|
90
|
+
this._enumValues = enumValues;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
92
93
|
}
|
|
93
94
|
exports.UaDataType = UaDataType;
|
|
@@ -66,8 +66,8 @@ class UaMethod extends _1.UaInstanceNode {
|
|
|
66
66
|
name: this._browseName,
|
|
67
67
|
displayName: this._displayName.text,
|
|
68
68
|
description: (this._description) ? this._description.text : undefined,
|
|
69
|
-
inputArguments: inputArgs,
|
|
70
|
-
outputArguments: outputArgs
|
|
69
|
+
inputArguments: (inputArgs.length != 0) ? inputArgs : undefined,
|
|
70
|
+
outputArguments: (outputArgs.length != 0) ? outputArgs : undefined
|
|
71
71
|
};
|
|
72
72
|
return ret;
|
|
73
73
|
}
|
|
@@ -59,7 +59,7 @@ class UaObject extends _1.UaInstanceNode {
|
|
|
59
59
|
name: this._browseName,
|
|
60
60
|
displayName: this._displayName.text,
|
|
61
61
|
description: (this._description) ? this._description.text : undefined,
|
|
62
|
-
|
|
62
|
+
typeDefinitionId: this._typeDefinitionId.toString(),
|
|
63
63
|
eventNotifier: this._eventNotifier,
|
|
64
64
|
children: (children.length != 0) ? children : undefined
|
|
65
65
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodeClass } from "opcua-webapi";
|
|
2
|
-
import { UaLocalizedText, UaNodeId, UaVariant } from "../types";
|
|
2
|
+
import { UaDataValue, UaLocalizedText, UaNodeId, UaVariant } from "../types";
|
|
3
3
|
import { UaInstanceNode } from ".";
|
|
4
4
|
export declare class UaVariable extends UaInstanceNode {
|
|
5
5
|
private _typeDefinitionId;
|
|
@@ -8,7 +8,7 @@ export declare class UaVariable extends UaInstanceNode {
|
|
|
8
8
|
private _accessLevel;
|
|
9
9
|
private _userAccessLevel;
|
|
10
10
|
private _historizing;
|
|
11
|
-
private
|
|
11
|
+
private _dataValue;
|
|
12
12
|
constructor(nodeId: UaNodeId, browseName: string, displayName: UaLocalizedText, dataType: UaNodeId, valueRank: number, accessLevel: number, userAccessLevel: number, historizing: boolean, typeDefinitionId: UaNodeId);
|
|
13
13
|
get nodeClass(): NodeClass;
|
|
14
14
|
get dataType(): UaNodeId;
|
|
@@ -16,8 +16,9 @@ export declare class UaVariable extends UaInstanceNode {
|
|
|
16
16
|
get accessLevel(): number;
|
|
17
17
|
get userAccessLevel(): number;
|
|
18
18
|
get historizing(): boolean;
|
|
19
|
-
get value(): UaVariant;
|
|
20
|
-
|
|
19
|
+
get value(): UaVariant | null;
|
|
20
|
+
get dataValue(): UaDataValue | null;
|
|
21
|
+
set dataValue(value: UaDataValue);
|
|
21
22
|
get typeDefinitionId(): UaNodeId;
|
|
22
23
|
addMember(node: UaVariable): void;
|
|
23
24
|
get variableMembers(): Array<UaVariable>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UaVariable = void 0;
|
|
4
4
|
const opcua_webapi_1 = require("opcua-webapi");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
5
|
const _1 = require(".");
|
|
7
6
|
class UaVariable extends _1.UaInstanceNode {
|
|
8
7
|
constructor(nodeId, browseName, displayName, dataType, valueRank, accessLevel, userAccessLevel, historizing, typeDefinitionId) {
|
|
@@ -12,8 +11,8 @@ class UaVariable extends _1.UaInstanceNode {
|
|
|
12
11
|
this._accessLevel = accessLevel;
|
|
13
12
|
this._userAccessLevel = userAccessLevel;
|
|
14
13
|
this._historizing = historizing;
|
|
15
|
-
this._value = types_1.UaVariant.null();
|
|
16
14
|
this._typeDefinitionId = typeDefinitionId;
|
|
15
|
+
this._dataValue = null;
|
|
17
16
|
}
|
|
18
17
|
get nodeClass() {
|
|
19
18
|
return opcua_webapi_1.NodeClass.Variable;
|
|
@@ -34,10 +33,13 @@ class UaVariable extends _1.UaInstanceNode {
|
|
|
34
33
|
return this._historizing;
|
|
35
34
|
}
|
|
36
35
|
get value() {
|
|
37
|
-
return this.
|
|
36
|
+
return (this._dataValue && this._dataValue.statusCode.isGood()) ? this._dataValue.value : null;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
this.
|
|
38
|
+
get dataValue() {
|
|
39
|
+
return this._dataValue;
|
|
40
|
+
}
|
|
41
|
+
set dataValue(value) {
|
|
42
|
+
this._dataValue = value;
|
|
41
43
|
}
|
|
42
44
|
get typeDefinitionId() {
|
|
43
45
|
return this._typeDefinitionId;
|
|
@@ -64,10 +66,12 @@ class UaVariable extends _1.UaInstanceNode {
|
|
|
64
66
|
nodeClass: opcua_webapi_1.NodeClass.Variable,
|
|
65
67
|
name: this._browseName,
|
|
66
68
|
displayName: this._displayName.text,
|
|
67
|
-
|
|
69
|
+
typeDefinitionId: this._typeDefinitionId.toString(),
|
|
68
70
|
dataType: this._dataType.toString(),
|
|
69
71
|
valueRank: this._valueRank,
|
|
70
72
|
accessLevel: this._accessLevel,
|
|
73
|
+
historizing: this._historizing,
|
|
74
|
+
value: this._dataValue ? this._dataValue.value.value : undefined,
|
|
71
75
|
children: (children.length != 0) ? children : undefined
|
|
72
76
|
};
|
|
73
77
|
return ret;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UaLocalizedText, UaNodeId } from "../types";
|
|
2
|
+
export declare class UaReference {
|
|
3
|
+
private _nodeId;
|
|
4
|
+
private _nodeClass;
|
|
5
|
+
private _browseName;
|
|
6
|
+
private _displayName;
|
|
7
|
+
private _referenceTypeId;
|
|
8
|
+
private _typeDefinitionId;
|
|
9
|
+
private _description;
|
|
10
|
+
constructor(nodeId: UaNodeId, nodeClass: number, browseName?: string, displayName?: UaLocalizedText, referenceTypeId?: UaNodeId, typeDefinitionId?: UaNodeId);
|
|
11
|
+
get nodeId(): UaNodeId;
|
|
12
|
+
get nodeClass(): number;
|
|
13
|
+
get browseName(): string;
|
|
14
|
+
get displayName(): UaLocalizedText;
|
|
15
|
+
set displayName(value: UaLocalizedText);
|
|
16
|
+
get referenceTypeId(): UaNodeId;
|
|
17
|
+
set referenceTypeId(value: UaNodeId);
|
|
18
|
+
get typeDefinitionId(): UaNodeId;
|
|
19
|
+
set typeDefinitionId(value: UaNodeId);
|
|
20
|
+
get description(): UaLocalizedText;
|
|
21
|
+
set description(value: UaLocalizedText);
|
|
22
|
+
toJson(): any;
|
|
23
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UaReference = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
class UaReference {
|
|
6
|
+
constructor(nodeId, nodeClass, browseName, displayName, referenceTypeId, typeDefinitionId) {
|
|
7
|
+
this._nodeId = nodeId;
|
|
8
|
+
this._nodeClass = nodeClass;
|
|
9
|
+
this._browseName = (browseName) ? browseName : "";
|
|
10
|
+
this._displayName = (displayName) ? displayName : types_1.UaLocalizedText.nullText;
|
|
11
|
+
this._referenceTypeId = (referenceTypeId) ? referenceTypeId : types_1.UaNodeId.nullNodeId;
|
|
12
|
+
this._typeDefinitionId = (typeDefinitionId) ? typeDefinitionId : types_1.UaNodeId.nullNodeId;
|
|
13
|
+
}
|
|
14
|
+
get nodeId() {
|
|
15
|
+
return this._nodeId;
|
|
16
|
+
}
|
|
17
|
+
get nodeClass() {
|
|
18
|
+
return this._nodeClass;
|
|
19
|
+
}
|
|
20
|
+
get browseName() {
|
|
21
|
+
return this._browseName;
|
|
22
|
+
}
|
|
23
|
+
get displayName() {
|
|
24
|
+
return this._displayName;
|
|
25
|
+
}
|
|
26
|
+
set displayName(value) {
|
|
27
|
+
this._displayName = value;
|
|
28
|
+
}
|
|
29
|
+
get referenceTypeId() {
|
|
30
|
+
return this._referenceTypeId;
|
|
31
|
+
}
|
|
32
|
+
set referenceTypeId(value) {
|
|
33
|
+
this._referenceTypeId = value;
|
|
34
|
+
}
|
|
35
|
+
get typeDefinitionId() {
|
|
36
|
+
return this._typeDefinitionId;
|
|
37
|
+
}
|
|
38
|
+
set typeDefinitionId(value) {
|
|
39
|
+
this._typeDefinitionId = value;
|
|
40
|
+
}
|
|
41
|
+
get description() {
|
|
42
|
+
return this._description;
|
|
43
|
+
}
|
|
44
|
+
set description(value) {
|
|
45
|
+
this._description = value;
|
|
46
|
+
}
|
|
47
|
+
toJson() {
|
|
48
|
+
let ret = {
|
|
49
|
+
nodeId: this._nodeId.toString(),
|
|
50
|
+
nodeClass: this._nodeClass,
|
|
51
|
+
name: this._browseName,
|
|
52
|
+
displayName: this._displayName.text,
|
|
53
|
+
description: (this._description) ? this._description.text : undefined,
|
|
54
|
+
typeDefinitionId: (!this._typeDefinitionId.isEmpty()) ? this._typeDefinitionId.toString() : undefined,
|
|
55
|
+
};
|
|
56
|
+
return ret;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.UaReference = UaReference;
|
|
@@ -7,7 +7,6 @@ export * from "./UaHistoryDataResult";
|
|
|
7
7
|
export * from "./UaHistoryEventFieldList";
|
|
8
8
|
export * from "./UaHistoryEventResult";
|
|
9
9
|
export * from "./UaLocalizedText";
|
|
10
|
-
export * from "./UaLink";
|
|
11
10
|
export * from "./UaNodeId";
|
|
12
11
|
export * from "./UaQuery";
|
|
13
12
|
export * from "./UaQueryFilter";
|
|
@@ -18,3 +17,4 @@ export * from "./UaAccessLevel";
|
|
|
18
17
|
export * from "./UaBrowseMask";
|
|
19
18
|
export * from "./UaValueRank";
|
|
20
19
|
export * from "./UaWriteMask";
|
|
20
|
+
export * from "./UaReference";
|
|
@@ -23,7 +23,6 @@ __exportStar(require("./UaHistoryDataResult"), exports);
|
|
|
23
23
|
__exportStar(require("./UaHistoryEventFieldList"), exports);
|
|
24
24
|
__exportStar(require("./UaHistoryEventResult"), exports);
|
|
25
25
|
__exportStar(require("./UaLocalizedText"), exports);
|
|
26
|
-
__exportStar(require("./UaLink"), exports);
|
|
27
26
|
__exportStar(require("./UaNodeId"), exports);
|
|
28
27
|
__exportStar(require("./UaQuery"), exports);
|
|
29
28
|
__exportStar(require("./UaQueryFilter"), exports);
|
|
@@ -34,3 +33,4 @@ __exportStar(require("./UaAccessLevel"), exports);
|
|
|
34
33
|
__exportStar(require("./UaBrowseMask"), exports);
|
|
35
34
|
__exportStar(require("./UaValueRank"), exports);
|
|
36
35
|
__exportStar(require("./UaWriteMask"), exports);
|
|
36
|
+
__exportStar(require("./UaReference"), exports);
|