node-opcua-address-space 2.113.0 → 2.114.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/dist/source/helpers/call_helpers.js +1 -2
- package/dist/source/helpers/call_helpers.js.map +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js +15 -26
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -1
- package/dist/source/loader/ensure_datatype_extracted.js +19 -30
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.js +16 -27
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/source/loader/load_nodeset2.js +98 -97
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.js +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/source/loader/namespace_post_step.js +24 -38
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/session_context.js +3 -6
- package/dist/source/session_context.js.map +1 -1
- package/dist/source/set_namespace_meta_data.js +2 -3
- package/dist/source/set_namespace_meta_data.js.map +1 -1
- package/dist/src/address_space.js +12 -23
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/address_space_change_event_tools.js +1 -1
- package/dist/src/address_space_change_event_tools.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +1 -2
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +1 -2
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +2 -4
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/base_node_private.js +17 -11
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.js +7 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +2 -2
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +10 -5
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
- package/dist/src/extension_object_array_node.js +1 -2
- package/dist/src/extension_object_array_node.js.map +1 -1
- package/dist/src/get_basic_datatype.d.ts +8 -0
- package/dist/src/get_basic_datatype.js +26 -0
- package/dist/src/get_basic_datatype.js.map +1 -0
- package/dist/src/historical_access/address_space_historical_data_node.js +31 -48
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/namespace_impl.js +12 -7
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +47 -3
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.js +4 -6
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.js +29 -27
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/private_namespace.js +1 -1
- package/dist/src/private_namespace.js.map +1 -1
- package/dist/src/reference_impl.js +1 -1
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.js +1 -2
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/ua_data_type_impl.js +6 -6
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.js +6 -4
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.js +5 -1
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.js +1 -2
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.d.ts +1 -1
- package/dist/src/ua_variable_impl.js +18 -26
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_impl_ext_obj.js +10 -9
- package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/src/ua_variable_type_impl.d.ts +2 -0
- package/dist/src/ua_variable_type_impl.js +7 -6
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/tsconfig_common.tsbuildinfo +1 -1
- package/distNodeJS/generate_address_space.js +10 -21
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/package.json +38 -38
- package/source/loader/load_nodeset2.ts +12 -10
- package/src/data_access/ua_multistate_value_discrete_impl.ts +9 -11
- package/src/get_basic_datatype.ts +32 -0
- package/src/nodeset_tools/construct_namespace_dependency.ts +48 -11
- package/src/nodeset_tools/nodeset_to_xml.ts +35 -31
- package/src/ua_data_type_impl.ts +6 -2
- package/src/ua_variable_impl.ts +5 -22
- package/src/ua_variable_impl_ext_obj.ts +9 -4
- package/src/ua_variable_type_impl.ts +5 -4
package/src/ua_data_type_impl.ts
CHANGED
|
@@ -30,6 +30,7 @@ import * as tools from "./tool_isSubtypeOf";
|
|
|
30
30
|
import { get_subtypeOf } from "./tool_isSubtypeOf";
|
|
31
31
|
import { get_subtypeOfObj } from "./tool_isSubtypeOf";
|
|
32
32
|
import { BaseNode_getCache } from "./base_node_private";
|
|
33
|
+
import { Int64, coerceInt32, coerceInt64, coerceInt64toInt32 } from "node-opcua-basic-types";
|
|
33
34
|
|
|
34
35
|
export interface UADataTypeImpl {
|
|
35
36
|
_extensionObjectConstructor: ExtensionObjectConstructorFuncWithSchema;
|
|
@@ -230,7 +231,7 @@ export class UADataTypeImpl extends BaseNodeImpl implements UADataType {
|
|
|
230
231
|
definition = enumValues.map((e: any) => {
|
|
231
232
|
return {
|
|
232
233
|
name: e.displayName.text,
|
|
233
|
-
value: e.value
|
|
234
|
+
value: coerceInt64toInt32(e.value)
|
|
234
235
|
};
|
|
235
236
|
});
|
|
236
237
|
}
|
|
@@ -395,12 +396,15 @@ export function DataType_toString(this: UADataTypeImpl, options: ToStringOption)
|
|
|
395
396
|
dataTypeDefinition_toString.call(this, options);
|
|
396
397
|
}
|
|
397
398
|
|
|
399
|
+
|
|
400
|
+
const defaultEnumValue: Int64 = coerceInt64(-1);
|
|
401
|
+
|
|
398
402
|
function makeEnumDefinition(definitionFields: EnumFieldOptions[]) {
|
|
399
403
|
return new EnumDefinition({
|
|
400
404
|
fields: definitionFields.map((x) => ({
|
|
401
405
|
description: x.description,
|
|
402
406
|
name: x.name,
|
|
403
|
-
value: x.value
|
|
407
|
+
value: x.value === undefined ? defaultEnumValue : coerceInt64(x.value)
|
|
404
408
|
}))
|
|
405
409
|
});
|
|
406
410
|
}
|
package/src/ua_variable_impl.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-statements */
|
|
2
|
-
/* eslint-disable complexity */
|
|
3
2
|
/**
|
|
4
3
|
* @module node-opcua-address-space
|
|
5
4
|
*/
|
|
6
|
-
// tslint:disable:no-bitwise
|
|
7
|
-
// tslint:disable:no-console
|
|
8
|
-
// tslint:disable:max-line-length
|
|
9
5
|
import { types } from "util";
|
|
10
6
|
import chalk from "chalk";
|
|
11
7
|
|
|
@@ -97,6 +93,7 @@ import {
|
|
|
97
93
|
_touchValue
|
|
98
94
|
} from "./ua_variable_impl_ext_obj";
|
|
99
95
|
import { adjustDataValueStatusCode } from "./data_access/adjust_datavalue_status_code";
|
|
96
|
+
import { _getBasicDataType } from "./get_basic_datatype";
|
|
100
97
|
|
|
101
98
|
const debugLog = make_debugLog(__filename);
|
|
102
99
|
const warningLog = make_warningLog(__filename);
|
|
@@ -714,23 +711,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
714
711
|
}
|
|
715
712
|
|
|
716
713
|
public getBasicDataType(): DataType {
|
|
717
|
-
|
|
718
|
-
return this._basicDataType;
|
|
719
|
-
}
|
|
720
|
-
if (this.dataType.namespace === 0 && this.dataType.value === 0) {
|
|
721
|
-
return DataType.Null;
|
|
722
|
-
}
|
|
723
|
-
const addressSpace = this.addressSpace;
|
|
724
|
-
if (!addressSpace) {
|
|
725
|
-
// may be node has been deleted already
|
|
726
|
-
return DataType.Null;
|
|
727
|
-
}
|
|
728
|
-
const dataTypeNode = addressSpace.findDataType(this.dataType)!;
|
|
729
|
-
const basicDataType =
|
|
730
|
-
dataTypeNode && dataTypeNode.nodeClass === NodeClass.DataType ? dataTypeNode.getBasicDataType() : DataType.Null;
|
|
731
|
-
// const basicDataType = addressSpace.findCorrespondingBasicDataType(this.dataType);
|
|
732
|
-
this._basicDataType = basicDataType;
|
|
733
|
-
return basicDataType;
|
|
714
|
+
return _getBasicDataType(this);
|
|
734
715
|
}
|
|
735
716
|
public adjustVariant(variant: Variant): Variant {
|
|
736
717
|
return adjustVariant(variant, this.valueRank, this.getBasicDataType());
|
|
@@ -1425,7 +1406,9 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1425
1406
|
// has not yet been loaded !
|
|
1426
1407
|
return true;
|
|
1427
1408
|
}
|
|
1428
|
-
|
|
1409
|
+
if (dataType.nodeId.namespace === 0 && dataType.nodeId.value === DataType.ExtensionObject) {
|
|
1410
|
+
return true;
|
|
1411
|
+
}
|
|
1429
1412
|
const Constructor = addressSpace.getExtensionObjectConstructor(this.dataType);
|
|
1430
1413
|
|
|
1431
1414
|
if (this.valueRank === -1) {
|
|
@@ -523,11 +523,16 @@ export function _bindExtensionObject(
|
|
|
523
523
|
return uaVariable.$extensionObject;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
-
// istanbul ignore next
|
|
527
526
|
if (uaVariable.dataTypeObj.isAbstract) {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
527
|
+
// istanbul ignore next
|
|
528
|
+
if (!optionalExtensionObject) {
|
|
529
|
+
warningLog(
|
|
530
|
+
"Warning the DataType associated with this Variable is abstract ",
|
|
531
|
+
uaVariable.dataTypeObj.browseName.toString()
|
|
532
|
+
);
|
|
533
|
+
warningLog("You need to provide a extension object yourself ");
|
|
534
|
+
throw new Error("bindExtensionObject requires a extensionObject as associated dataType is only abstract");
|
|
535
|
+
}
|
|
531
536
|
}
|
|
532
537
|
|
|
533
538
|
const s = uaVariable.readValue();
|
|
@@ -13,10 +13,9 @@ import {
|
|
|
13
13
|
ModellingRuleType,
|
|
14
14
|
INamespace,
|
|
15
15
|
UAVariable,
|
|
16
|
-
UAVariableType
|
|
16
|
+
UAVariableType
|
|
17
17
|
} from "node-opcua-address-space-base";
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
import { coerceQualifiedName, NodeClass, QualifiedName, BrowseDirection, AttributeIds } from "node-opcua-data-model";
|
|
21
20
|
import { DataValue, DataValueLike } from "node-opcua-data-value";
|
|
22
21
|
import { checkDebugFlag, make_debugLog, make_warningLog, make_errorLog } from "node-opcua-debug";
|
|
@@ -36,6 +35,7 @@ import * as tools from "./tool_isSubtypeOf";
|
|
|
36
35
|
import { get_subtypeOfObj } from "./tool_isSubtypeOf";
|
|
37
36
|
import { get_subtypeOf } from "./tool_isSubtypeOf";
|
|
38
37
|
import { checkValueRankCompatibility } from "./check_value_rank_compatibility";
|
|
38
|
+
import { _getBasicDataType } from "./get_basic_datatype";
|
|
39
39
|
|
|
40
40
|
const debugLog = make_debugLog(__filename);
|
|
41
41
|
const doDebug = checkDebugFlag(__filename);
|
|
@@ -306,9 +306,11 @@ export class UAVariableTypeImpl extends BaseNodeImpl implements UAVariableType {
|
|
|
306
306
|
|
|
307
307
|
return instance;
|
|
308
308
|
}
|
|
309
|
+
public getBasicDataType(): DataType {
|
|
310
|
+
return _getBasicDataType(this);
|
|
311
|
+
}
|
|
309
312
|
}
|
|
310
313
|
|
|
311
|
-
|
|
312
314
|
/**
|
|
313
315
|
* @method hasChildWithBrowseName
|
|
314
316
|
* returns true if the parent object has a child with the provided browseName
|
|
@@ -365,4 +367,3 @@ export function assertUnusedChildBrowseName(addressSpace: AddressSpacePrivate, o
|
|
|
365
367
|
);
|
|
366
368
|
}
|
|
367
369
|
}
|
|
368
|
-
|