node-opcua-data-model 2.54.0 → 2.60.0
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/.mocharc.yml +10 -10
- package/LICENSE +20 -20
- package/dist/_make_flag.d.ts +1 -1
- package/dist/_make_flag.js.map +1 -1
- package/dist/access_level.js.map +1 -1
- package/dist/access_level_ex.d.ts +2 -0
- package/dist/access_level_ex.js +5 -2
- package/dist/access_level_ex.js.map +1 -1
- package/dist/access_restrictions.js.map +1 -1
- package/dist/attributeIds.js.map +1 -1
- package/dist/data_encoding.d.ts +1 -1
- package/dist/data_encoding.js +2 -2
- package/dist/data_encoding.js.map +1 -1
- package/dist/diagnostic_info.d.ts +2 -2
- package/dist/diagnostic_info.js.map +1 -1
- package/dist/localized_text.d.ts +3 -3
- package/dist/localized_text.js.map +1 -1
- package/dist/node_class_mask.js.map +1 -1
- package/dist/nodeclass.js.map +1 -1
- package/dist/permission_flag.js.map +1 -1
- package/dist/qualified_name.js +2 -2
- package/dist/qualified_name.js.map +1 -1
- package/dist/result_mask.js.map +1 -1
- package/dist/write_mask.js +1 -1
- package/dist/write_mask.js.map +1 -1
- package/package.json +14 -12
- package/source/BrowseDirection.ts +41 -41
- package/source/_make_flag.ts +2 -3
- package/source/access_level.ts +18 -13
- package/source/access_level_ex.ts +26 -25
- package/source/access_restrictions.ts +1 -3
- package/source/attributeIds.ts +1 -5
- package/source/data_encoding.ts +23 -23
- package/source/diagnostic_info.ts +362 -361
- package/source/localized_text.ts +189 -188
- package/source/node_class_mask.ts +47 -47
- package/source/nodeclass.ts +23 -23
- package/source/permission_flag.ts +8 -8
- package/source/qualified_name.ts +3 -3
- package/source/result_mask.ts +35 -35
- package/source/time_zone.ts +18 -18
- package/source/write_mask.ts +37 -37
- package/.nyc_output/13d15b6c-23cf-479c-919f-4cd69586f383.json +0 -1
- package/.nyc_output/processinfo/13d15b6c-23cf-479c-919f-4cd69586f383.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
|
@@ -1,49 +1,51 @@
|
|
|
1
1
|
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
2
|
-
import { _accessLevelFlagToString } from "./access_level";
|
|
3
2
|
import { registerBasicType } from "node-opcua-factory";
|
|
4
|
-
import {
|
|
3
|
+
import { _accessLevelFlagToString } from "./access_level";
|
|
4
|
+
import { _make_flag } from "./_make_flag";
|
|
5
5
|
/**
|
|
6
6
|
* from https://reference.opcfoundation.org/v104/Core/docs/Part3/8.58/:
|
|
7
|
-
*
|
|
8
|
-
* This is a subtype of the UInt32 DataType with the OptionSetValues Property defined.
|
|
9
|
-
* It is used to indicate how the Value of a Variable can be accessed (read/write),
|
|
7
|
+
*
|
|
8
|
+
* This is a subtype of the UInt32 DataType with the OptionSetValues Property defined.
|
|
9
|
+
* It is used to indicate how the Value of a Variable can be accessed (read/write),
|
|
10
10
|
* if it contains current and/or historic data and its atomicity.
|
|
11
|
-
* The AccessLevelExType DataType is an extended version of the AccessLevelType DataType and
|
|
11
|
+
* The AccessLevelExType DataType is an extended version of the AccessLevelType DataType and
|
|
12
12
|
* as such contains the 8 bits of the AccessLevelType as the first 8 bits.
|
|
13
13
|
* The NonatomicRead, and NonatomicWrite Fields represent the atomicity of a Variable.
|
|
14
|
-
* In general Atomicity is expected of OPC UA read and write operations.
|
|
14
|
+
* In general Atomicity is expected of OPC UA read and write operations.
|
|
15
15
|
* These Fields are used by systems, in particular hard-realtime controllers, which can not ensure atomicity.
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
CurrentRead = 0x01,
|
|
19
|
-
CurrentWrite = 0x02,
|
|
20
|
-
HistoryRead = 0x04,
|
|
21
|
-
HistoryWrite = 0x08,
|
|
17
|
+
export enum AccessLevelExFlag {
|
|
18
|
+
CurrentRead = 0x01, // bit 0 : Indicate if the current value is readable (0 means not readable, 1 means readable).
|
|
19
|
+
CurrentWrite = 0x02, // bit 1 : Indicate if the current value is writable (0 means not writable, 1 means writable).
|
|
20
|
+
HistoryRead = 0x04, // bit 2 : Indicates if the history of the value is readable (0 means not readable, 1 means readable).
|
|
21
|
+
HistoryWrite = 0x08, // bit 3 : Indicates if the history of the value is writable (0 means not writable, 1 means writable).
|
|
22
22
|
SemanticChange = 0x10, // bit 4 : Indicates if the Variable used as Property generates SemanticChangeEvents
|
|
23
|
-
StatusWrite = 0x20,
|
|
23
|
+
StatusWrite = 0x20, // bit 5 : Indicates if the current StatusCode of the value is writable (0 means not writable, 1 means writable).
|
|
24
24
|
TimestampWrite = 0x40, // bit 6 : Indicates if the current SourceTimestamp of the value is writable (0 means not writable, 1 means writable).
|
|
25
25
|
// reserved bit 7
|
|
26
26
|
|
|
27
|
-
NonatomicRead
|
|
28
|
-
NonatomicWrite
|
|
29
|
-
WriteFullArrayOnly= 0x200, // bit 10 Indicates if Write of IndexRange is supported.(0 means Write of IndexRange is supported)
|
|
30
|
-
NoSubDataTypes
|
|
27
|
+
NonatomicRead = 0x80, // bit 8 Indicates non-atomicity for Read access (0 means that atomicity is assured).
|
|
28
|
+
NonatomicWrite = 0x100, // bit 9 Indicates non-atomicity for Write access (0 means that atomicity is assured).
|
|
29
|
+
WriteFullArrayOnly = 0x200, // bit 10 Indicates if Write of IndexRange is supported.(0 means Write of IndexRange is supported)
|
|
30
|
+
NoSubDataTypes = 0x400, // bit 11 Indicates if the Variable doesn’t allow its DataType to be subtyped (0 means the Variable accepts the defined DataType and subtypes of that DataType)
|
|
31
|
+
// new in 1.5.1
|
|
32
|
+
NonVolatile = 0x800, // bit 12 Indicates if the Variable is non-volatile (0 means it is volatile or not known to be, 1 means non-volatile
|
|
33
|
+
Constant = 0x1000, // bit 13 Indicates if the Value of the Variable can be considered constant (0 means the Value is not constant, 1 means the Value is constant)
|
|
34
|
+
|
|
31
35
|
// Reserved for future use. Shall always be zero.
|
|
32
|
-
None = 0x800
|
|
36
|
+
None = 0x800
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
|
|
36
39
|
// @example
|
|
37
40
|
// makeAccessLevelFlag("CurrentRead | CurrentWrite").should.eql(0x03);
|
|
38
41
|
export function makeAccessLevelExFlag(str: string | number | null): AccessLevelExFlag {
|
|
39
|
-
return _make_flag(str,AccessLevelExFlag.None, AccessLevelExFlag) as AccessLevelExFlag;
|
|
42
|
+
return _make_flag(str, AccessLevelExFlag.None, AccessLevelExFlag) as AccessLevelExFlag;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
export function randomAccessLevelEx(): AccessLevelExFlag {
|
|
43
46
|
return Math.ceil(Math.random() * 0x200);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
|
|
47
49
|
export function accessLevelExFlagToString(accessLevelFlag: AccessLevelExFlag): string {
|
|
48
50
|
const retVal = _accessLevelFlagToString(accessLevelFlag);
|
|
49
51
|
|
|
@@ -66,9 +68,8 @@ export function accessLevelExFlagToString(accessLevelFlag: AccessLevelExFlag): s
|
|
|
66
68
|
return retVal.join(" | ");
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
stream.writeUInt32(value & 0xFFFFF);
|
|
71
|
+
export function encodeAccessLevelExFlag(value: AccessLevelExFlag, stream: OutputBinaryStream): void {
|
|
72
|
+
stream.writeUInt32(value & 0xfffff);
|
|
72
73
|
}
|
|
73
74
|
export function decodeAccessLevelExFlag(stream: BinaryStream): AccessLevelExFlag {
|
|
74
75
|
const code = stream.readUInt32();
|
|
@@ -85,4 +86,4 @@ registerBasicType({
|
|
|
85
86
|
decode: decodeAccessLevelExFlag,
|
|
86
87
|
encode: encodeAccessLevelExFlag,
|
|
87
88
|
random: randomAccessLevelEx
|
|
88
|
-
});
|
|
89
|
+
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { _make_flag } from "./_make_flag";
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
export enum AccessRestrictionsFlag {
|
|
5
4
|
SigningRequired = 1,
|
|
6
5
|
EncryptionRequired = 2,
|
|
7
6
|
SessionRequired = 4,
|
|
8
7
|
ApplyRestrictionsToBrowse = 8,
|
|
9
|
-
None = 0x0
|
|
8
|
+
None = 0x0
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export function makeAccessRestrictionsFlag(str: string | number | null): AccessRestrictionsFlag {
|
|
@@ -31,5 +30,4 @@ export function accessRestrictionsFlagToString(flags: AccessRestrictionsFlag): s
|
|
|
31
30
|
retVal.push("None");
|
|
32
31
|
}
|
|
33
32
|
return retVal.join(" | ");
|
|
34
|
-
|
|
35
33
|
}
|
package/source/attributeIds.ts
CHANGED
package/source/data_encoding.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-data-model
|
|
3
|
-
*/
|
|
4
|
-
import { QualifiedName, QualifiedNameLike, QualifiedNameOptions } from "./qualified_name";
|
|
5
|
-
|
|
6
|
-
export function isDataEncoding(dataEncoding:
|
|
7
|
-
return dataEncoding && typeof dataEncoding.name === "string";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const validEncoding = ["DefaultBinary", "DefaultXml", "DefaultJson"];
|
|
11
|
-
export function isValidDataEncoding(dataEncoding?: string | null | QualifiedNameLike): boolean {
|
|
12
|
-
if (!dataEncoding) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if ((dataEncoding as any
|
|
17
|
-
dataEncoding = (dataEncoding as QualifiedNameOptions).name;
|
|
18
|
-
}
|
|
19
|
-
if (!dataEncoding) {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
return validEncoding.indexOf(dataEncoding as string) !== -1;
|
|
23
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-data-model
|
|
3
|
+
*/
|
|
4
|
+
import { QualifiedName, QualifiedNameLike, QualifiedNameOptions } from "./qualified_name";
|
|
5
|
+
|
|
6
|
+
export function isDataEncoding(dataEncoding: unknown): boolean {
|
|
7
|
+
return !!dataEncoding && typeof dataEncoding === "object" && typeof (dataEncoding as any).name === "string";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const validEncoding = ["DefaultBinary", "DefaultXml", "DefaultJson"];
|
|
11
|
+
export function isValidDataEncoding(dataEncoding?: string | null | QualifiedNameLike): boolean {
|
|
12
|
+
if (!dataEncoding) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (Object.prototype.hasOwnProperty.call(dataEncoding as any, "name")) {
|
|
17
|
+
dataEncoding = (dataEncoding as QualifiedNameOptions).name;
|
|
18
|
+
}
|
|
19
|
+
if (!dataEncoding) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return validEncoding.indexOf(dataEncoding as string) !== -1;
|
|
23
|
+
}
|