node-opcua-address-space 2.96.0 → 2.98.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/package.json +37 -37
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +4 -3
- package/source/loader/make_xml_extension_object_parser.ts +10 -9
- package/src/address_space.ts +6 -5
- package/src/alarms_and_conditions/ua_condition_impl.ts +14 -9
- package/src/base_node_impl.ts +6 -2
- package/src/base_node_private.ts +73 -28
- package/src/data_access/ua_two_state_discrete_impl.ts +2 -0
- package/src/ua_variable_impl.ts +2039 -2037
- package/src/ua_variable_type_impl.ts +35 -17
- package/dist/source/address_space_ts.d.ts +0 -118
- package/dist/source/address_space_ts.js +0 -18
- package/dist/source/address_space_ts.js.map +0 -1
- package/dist/source/continuation_points/continuation_point_manager.d.ts +0 -91
- package/dist/source/continuation_points/continuation_point_manager.js +0 -201
- package/dist/source/continuation_points/continuation_point_manager.js.map +0 -1
- package/dist/source/helpers/adjust_browse_direction.d.ts +0 -5
- package/dist/source/helpers/adjust_browse_direction.js +0 -12
- package/dist/source/helpers/adjust_browse_direction.js.map +0 -1
- package/dist/source/helpers/argument_list.d.ts +0 -33
- package/dist/source/helpers/argument_list.js +0 -255
- package/dist/source/helpers/argument_list.js.map +0 -1
- package/dist/source/helpers/call_helpers.d.ts +0 -6
- package/dist/source/helpers/call_helpers.js +0 -72
- package/dist/source/helpers/call_helpers.js.map +0 -1
- package/dist/source/helpers/coerce_enum_value.d.ts +0 -6
- package/dist/source/helpers/coerce_enum_value.js +0 -34
- package/dist/source/helpers/coerce_enum_value.js.map +0 -1
- package/dist/source/helpers/dump_tools.d.ts +0 -14
- package/dist/source/helpers/dump_tools.js +0 -79
- package/dist/source/helpers/dump_tools.js.map +0 -1
- package/dist/source/helpers/ensure_secure_access.d.ts +0 -9
- package/dist/source/helpers/ensure_secure_access.js +0 -77
- package/dist/source/helpers/ensure_secure_access.js.map +0 -1
- package/dist/source/helpers/make_optionals_map.d.ts +0 -21
- package/dist/source/helpers/make_optionals_map.js +0 -30
- package/dist/source/helpers/make_optionals_map.js.map +0 -1
- package/dist/source/helpers/multiform_func.d.ts +0 -11
- package/dist/source/helpers/multiform_func.js +0 -76
- package/dist/source/helpers/multiform_func.js.map +0 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +0 -3
- package/dist/source/helpers/resolve_opaque_on_address_space.js +0 -37
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +0 -1
- package/dist/source/index.d.ts +0 -61
- package/dist/source/index.js +0 -90
- package/dist/source/index.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +0 -19
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +0 -193
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +0 -12
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +0 -10
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +0 -9
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +0 -20
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +0 -23
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +0 -32
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +0 -19
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +0 -42
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -26
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +0 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +0 -20
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +0 -26
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +0 -8
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +0 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +0 -21
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +0 -24
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +0 -12
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +0 -8
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +0 -1
- package/dist/source/interfaces/extension_object_constructor.d.ts +0 -10
- package/dist/source/interfaces/extension_object_constructor.js +0 -3
- package/dist/source/interfaces/extension_object_constructor.js.map +0 -1
- package/dist/source/interfaces/nodeset_loader_options.d.ts +0 -4
- package/dist/source/interfaces/nodeset_loader_options.js +0 -3
- package/dist/source/interfaces/nodeset_loader_options.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +0 -12
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +0 -3
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +0 -49
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +0 -3
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +0 -11
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +0 -3
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +0 -30
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js +0 -3
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +0 -234
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +0 -3
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +0 -6
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +0 -3
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +0 -1
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +0 -8
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +0 -3
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +0 -1
- package/dist/source/loader/decode_xml_extension_object.d.ts +0 -6
- package/dist/source/loader/decode_xml_extension_object.js +0 -72
- package/dist/source/loader/decode_xml_extension_object.js.map +0 -1
- package/dist/source/loader/ensure_datatype_extracted.d.ts +0 -5
- package/dist/source/loader/ensure_datatype_extracted.js +0 -71
- package/dist/source/loader/ensure_datatype_extracted.js.map +0 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +0 -11
- package/dist/source/loader/generateAddressSpaceRaw.js +0 -46
- package/dist/source/loader/generateAddressSpaceRaw.js.map +0 -1
- package/dist/source/loader/load_nodeset2.d.ts +0 -17
- package/dist/source/loader/load_nodeset2.js +0 -1484
- package/dist/source/loader/load_nodeset2.js.map +0 -1
- package/dist/source/loader/make_semver_compatible.d.ts +0 -6
- package/dist/source/loader/make_semver_compatible.js +0 -26
- package/dist/source/loader/make_semver_compatible.js.map +0 -1
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +0 -28
- package/dist/source/loader/make_xml_extension_object_parser.js +0 -326
- package/dist/source/loader/make_xml_extension_object_parser.js.map +0 -1
- package/dist/source/loader/namespace_post_step.d.ts +0 -10
- package/dist/source/loader/namespace_post_step.js +0 -62
- package/dist/source/loader/namespace_post_step.js.map +0 -1
- package/dist/source/loader/register_node_promoter.d.ts +0 -2
- package/dist/source/loader/register_node_promoter.js +0 -10
- package/dist/source/loader/register_node_promoter.js.map +0 -1
- package/dist/source/namespace.d.ts +0 -6
- package/dist/source/namespace.js +0 -3
- package/dist/source/namespace.js.map +0 -1
- package/dist/source/namespace_alarm_and_condition.d.ts +0 -32
- package/dist/source/namespace_alarm_and_condition.js +0 -3
- package/dist/source/namespace_alarm_and_condition.js.map +0 -1
- package/dist/source/namespace_data_access.d.ts +0 -42
- package/dist/source/namespace_data_access.js +0 -3
- package/dist/source/namespace_data_access.js.map +0 -1
- package/dist/source/namespace_machine_state.d.ts +0 -8
- package/dist/source/namespace_machine_state.js +0 -3
- package/dist/source/namespace_machine_state.js.map +0 -1
- package/dist/source/pseudo_session.d.ts +0 -72
- package/dist/source/pseudo_session.js +0 -255
- package/dist/source/pseudo_session.js.map +0 -1
- package/dist/source/session_context.d.ts +0 -111
- package/dist/source/session_context.js +0 -265
- package/dist/source/session_context.js.map +0 -1
- package/dist/source/set_namespace_meta_data.d.ts +0 -2
- package/dist/source/set_namespace_meta_data.js +0 -60
- package/dist/source/set_namespace_meta_data.js.map +0 -1
- package/dist/source/ua_root_folder.d.ts +0 -9
- package/dist/source/ua_root_folder.js +0 -3
- package/dist/source/ua_root_folder.js.map +0 -1
- package/dist/source/ua_two_state_variable_ex.d.ts +0 -23
- package/dist/source/ua_two_state_variable_ex.js +0 -3
- package/dist/source/ua_two_state_variable_ex.js.map +0 -1
- package/dist/source/xml_writer.d.ts +0 -18
- package/dist/source/xml_writer.js +0 -3
- package/dist/source/xml_writer.js.map +0 -1
- package/dist/src/address_space.d.ts +0 -387
- package/dist/src/address_space.js +0 -1385
- package/dist/src/address_space.js.map +0 -1
- package/dist/src/address_space_change_event_tools.d.ts +0 -6
- package/dist/src/address_space_change_event_tools.js +0 -153
- package/dist/src/address_space_change_event_tools.js.map +0 -1
- package/dist/src/address_space_private.d.ts +0 -43
- package/dist/src/address_space_private.js +0 -3
- package/dist/src/address_space_private.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition.d.ts +0 -5
- package/dist/src/alarms_and_conditions/condition.js +0 -79
- package/dist/src/alarms_and_conditions/condition.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +0 -26
- package/dist/src/alarms_and_conditions/condition_info_impl.js +0 -55
- package/dist/src/alarms_and_conditions/condition_info_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +0 -222
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +0 -658
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +0 -9
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +0 -61
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +0 -1
- package/dist/src/alarms_and_conditions/index.d.ts +0 -16
- package/dist/src/alarms_and_conditions/index.js +0 -33
- package/dist/src/alarms_and_conditions/index.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +0 -44
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +0 -245
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +0 -93
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +0 -419
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +0 -26
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +0 -39
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +0 -44
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +0 -184
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +0 -153
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +0 -1029
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +0 -14
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +0 -35
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +0 -24
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +0 -57
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +0 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +0 -12
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +0 -23
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +0 -87
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +0 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +0 -8
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +0 -79
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +0 -251
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +0 -24
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +0 -51
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +0 -19
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -163
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +0 -46
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +0 -166
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +0 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +0 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +0 -1
- package/dist/src/apply_condition_refresh.d.ts +0 -6
- package/dist/src/apply_condition_refresh.js +0 -28
- package/dist/src/apply_condition_refresh.js.map +0 -1
- package/dist/src/base_node_impl.d.ts +0 -283
- package/dist/src/base_node_impl.js +0 -1452
- package/dist/src/base_node_impl.js.map +0 -1
- package/dist/src/base_node_private.d.ts +0 -81
- package/dist/src/base_node_private.js +0 -804
- package/dist/src/base_node_private.js.map +0 -1
- package/dist/src/check_value_rank_compatibility.d.ts +0 -15
- package/dist/src/check_value_rank_compatibility.js +0 -82
- package/dist/src/check_value_rank_compatibility.js.map +0 -1
- package/dist/src/data_access/add_dataItem_stuff.d.ts +0 -11
- package/dist/src/data_access/add_dataItem_stuff.js +0 -62
- package/dist/src/data_access/add_dataItem_stuff.js.map +0 -1
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +0 -1
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +0 -35
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +0 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +0 -32
- package/dist/src/data_access/ua_multistate_discrete_impl.js +0 -131
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +0 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +0 -52
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +0 -254
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +0 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +0 -25
- package/dist/src/data_access/ua_two_state_discrete_impl.js +0 -154
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +0 -1
- package/dist/src/event_data.d.ts +0 -34
- package/dist/src/event_data.js +0 -65
- package/dist/src/event_data.js.map +0 -1
- package/dist/src/extension_object_array_node.d.ts +0 -23
- package/dist/src/extension_object_array_node.js +0 -249
- package/dist/src/extension_object_array_node.js.map +0 -1
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +0 -26
- package/dist/src/historical_access/address_space_historical_data_node.js +0 -653
- package/dist/src/historical_access/address_space_historical_data_node.js.map +0 -1
- package/dist/src/idx_iterator.d.ts +0 -8
- package/dist/src/idx_iterator.js +0 -51
- package/dist/src/idx_iterator.js.map +0 -1
- package/dist/src/index_current.d.ts +0 -46
- package/dist/src/index_current.js +0 -78
- package/dist/src/index_current.js.map +0 -1
- package/dist/src/namespace_impl.d.ts +0 -456
- package/dist/src/namespace_impl.js +0 -1763
- package/dist/src/namespace_impl.js.map +0 -1
- package/dist/src/namespace_private.d.ts +0 -23
- package/dist/src/namespace_private.js +0 -33
- package/dist/src/namespace_private.js.map +0 -1
- package/dist/src/nodeid_manager.d.ts +0 -37
- package/dist/src/nodeid_manager.js +0 -184
- package/dist/src/nodeid_manager.js.map +0 -1
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +0 -2
- package/dist/src/nodeset_tools/adjust_namespace_array.js +0 -14
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +0 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +0 -18
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +0 -141
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +0 -1
- package/dist/src/nodeset_tools/dump_to_bsd.d.ts +0 -2
- package/dist/src/nodeset_tools/dump_to_bsd.js +0 -164
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +0 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +0 -10
- package/dist/src/nodeset_tools/nodeset_to_xml.js +0 -1288
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +0 -1
- package/dist/src/private_namespace.d.ts +0 -5
- package/dist/src/private_namespace.js +0 -20
- package/dist/src/private_namespace.js.map +0 -1
- package/dist/src/reference_impl.d.ts +0 -43
- package/dist/src/reference_impl.js +0 -140
- package/dist/src/reference_impl.js.map +0 -1
- package/dist/src/role_permissions.d.ts +0 -2
- package/dist/src/role_permissions.js +0 -11
- package/dist/src/role_permissions.js.map +0 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +0 -81
- package/dist/src/state_machine/finite_state_machine.js +0 -389
- package/dist/src/state_machine/finite_state_machine.js.map +0 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +0 -38
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +0 -251
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +0 -1
- package/dist/src/state_machine/ua_two_state_variable.d.ts +0 -61
- package/dist/src/state_machine/ua_two_state_variable.js +0 -332
- package/dist/src/state_machine/ua_two_state_variable.js.map +0 -1
- package/dist/src/tool_isSubtypeOf.d.ts +0 -18
- package/dist/src/tool_isSubtypeOf.js +0 -125
- package/dist/src/tool_isSubtypeOf.js.map +0 -1
- package/dist/src/tool_isSupertypeOf.d.ts +0 -18
- package/dist/src/tool_isSupertypeOf.js +0 -125
- package/dist/src/tool_isSupertypeOf.js.map +0 -1
- package/dist/src/ua_condition_type.d.ts +0 -8
- package/dist/src/ua_condition_type.js +0 -3
- package/dist/src/ua_condition_type.js.map +0 -1
- package/dist/src/ua_data_type_impl.d.ts +0 -89
- package/dist/src/ua_data_type_impl.js +0 -369
- package/dist/src/ua_data_type_impl.js.map +0 -1
- package/dist/src/ua_method_impl.d.ts +0 -42
- package/dist/src/ua_method_impl.js +0 -218
- package/dist/src/ua_method_impl.js.map +0 -1
- package/dist/src/ua_object_impl.d.ts +0 -35
- package/dist/src/ua_object_impl.js +0 -169
- package/dist/src/ua_object_impl.js.map +0 -1
- package/dist/src/ua_object_type_impl.d.ts +0 -50
- package/dist/src/ua_object_type_impl.js +0 -127
- package/dist/src/ua_object_type_impl.js.map +0 -1
- package/dist/src/ua_reference_type_impl.d.ts +0 -45
- package/dist/src/ua_reference_type_impl.js +0 -142
- package/dist/src/ua_reference_type_impl.js.map +0 -1
- package/dist/src/ua_variable_impl.d.ts +0 -380
- package/dist/src/ua_variable_impl.js +0 -1738
- package/dist/src/ua_variable_impl.js.map +0 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +0 -23
- package/dist/src/ua_variable_impl_ext_obj.js +0 -671
- package/dist/src/ua_variable_impl_ext_obj.js.map +0 -1
- package/dist/src/ua_variable_type_impl.d.ts +0 -74
- package/dist/src/ua_variable_type_impl.js +0 -582
- package/dist/src/ua_variable_type_impl.js.map +0 -1
- package/dist/src/ua_view_impl.d.ts +0 -19
- package/dist/src/ua_view_impl.js +0 -44
- package/dist/src/ua_view_impl.js.map +0 -1
- package/distHelpers/add_event_generator_object.d.ts +0 -3
- package/distHelpers/add_event_generator_object.js +0 -65
- package/distHelpers/add_event_generator_object.js.map +0 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +0 -9
- package/distHelpers/alarms_and_conditions_demo.js +0 -116
- package/distHelpers/alarms_and_conditions_demo.js.map +0 -1
- package/distHelpers/assertHasMatchingReference.d.ts +0 -19
- package/distHelpers/assertHasMatchingReference.js +0 -41
- package/distHelpers/assertHasMatchingReference.js.map +0 -1
- package/distHelpers/boiler_system.d.ts +0 -113
- package/distHelpers/boiler_system.js +0 -396
- package/distHelpers/boiler_system.js.map +0 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +0 -5
- package/distHelpers/create_minimalist_address_space_nodeset.js +0 -172
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +0 -1
- package/distHelpers/date_utils.d.ts +0 -3
- package/distHelpers/date_utils.js +0 -10
- package/distHelpers/date_utils.js.map +0 -1
- package/distHelpers/dump_statemachine.d.ts +0 -0
- package/distHelpers/dump_statemachine.js +0 -128
- package/distHelpers/dump_statemachine.js.map +0 -1
- package/distHelpers/get_address_space_fixture.d.ts +0 -1
- package/distHelpers/get_address_space_fixture.js +0 -31
- package/distHelpers/get_address_space_fixture.js.map +0 -1
- package/distHelpers/get_mini_address_space.d.ts +0 -7
- package/distHelpers/get_mini_address_space.js +0 -37
- package/distHelpers/get_mini_address_space.js.map +0 -1
- package/distHelpers/index.d.ts +0 -12
- package/distHelpers/index.js +0 -29
- package/distHelpers/index.js.map +0 -1
- package/distHelpers/mock_session.d.ts +0 -10
- package/distHelpers/mock_session.js +0 -26
- package/distHelpers/mock_session.js.map +0 -1
- package/distNodeJS/generate_address_space.d.ts +0 -6
- package/distNodeJS/generate_address_space.js +0 -53
- package/distNodeJS/generate_address_space.js.map +0 -1
- package/distNodeJS/index.d.ts +0 -1
- package/distNodeJS/index.js +0 -18
- package/distNodeJS/index.js.map +0 -1
- package/source/helpers/dump_tools.ts +0 -92
- package/src/nodeset_tools/dump_to_bsd.ts +0 -196
- package/test_helpers/dump_statemachine.ts +0 -155
|
@@ -1,804 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseNode_add_backward_reference = exports.BaseNode_remove_backward_reference = exports._constructReferenceDescription = exports._handle_HierarchicalReference = exports._clone = exports._clone_non_hierarchical_references = exports._clone_children_references = exports.VariableOrVariableType_toString = exports.valueRankToString = exports.UAObjectType_toString = exports.UAObject_toString = exports.UAVariable_toString = exports.UAVariableType_toString = exports.BaseNode_References_toString = exports.BaseNode_toString = exports.ToStringBuilder = exports.BaseNode_clearCache = exports.BaseNode_getCache = exports.BaseNode_getPrivate = exports.BaseNode_removePrivate = exports.BaseNode_initPrivate = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-address-space.Private
|
|
6
|
-
*/
|
|
7
|
-
// tslint:disable:no-bitwise
|
|
8
|
-
const chalk = require("chalk");
|
|
9
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
10
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
11
|
-
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
12
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
13
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
14
|
-
const node_opcua_constants_1 = require("node-opcua-constants");
|
|
15
|
-
const namespace_private_1 = require("./namespace_private");
|
|
16
|
-
const reference_impl_1 = require("./reference_impl");
|
|
17
|
-
const base_node_impl_1 = require("./base_node_impl");
|
|
18
|
-
const tool_isSubtypeOf_1 = require("./tool_isSubtypeOf");
|
|
19
|
-
// eslint-disable-next-line prefer-const
|
|
20
|
-
const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
|
|
21
|
-
const doTrace = (0, node_opcua_debug_1.checkDebugFlag)("INSTANTIATE");
|
|
22
|
-
const traceLog = errorLog;
|
|
23
|
-
const g_weakMap = new WeakMap();
|
|
24
|
-
const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
|
|
25
|
-
function BaseNode_initPrivate(self) {
|
|
26
|
-
const _private = {
|
|
27
|
-
__address_space: null,
|
|
28
|
-
_referenceIdx: {},
|
|
29
|
-
_back_referenceIdx: {},
|
|
30
|
-
_browseFilter: undefined,
|
|
31
|
-
_cache: {},
|
|
32
|
-
_description: undefined,
|
|
33
|
-
_displayName: [],
|
|
34
|
-
_parent: undefined,
|
|
35
|
-
_subtype_idx: {},
|
|
36
|
-
_subtype_idxVersion: 0
|
|
37
|
-
};
|
|
38
|
-
g_weakMap.set(self, _private);
|
|
39
|
-
return _private;
|
|
40
|
-
}
|
|
41
|
-
exports.BaseNode_initPrivate = BaseNode_initPrivate;
|
|
42
|
-
function BaseNode_removePrivate(self) {
|
|
43
|
-
// there is no need to delete object from weak map
|
|
44
|
-
// the GC will take care of this in due course
|
|
45
|
-
// g_weakMap.delete(self);
|
|
46
|
-
const _private = BaseNode_getPrivate(self);
|
|
47
|
-
_private._cache = {};
|
|
48
|
-
_private.__address_space = null;
|
|
49
|
-
_private._back_referenceIdx = {};
|
|
50
|
-
_private._referenceIdx = {};
|
|
51
|
-
_private._description = undefined;
|
|
52
|
-
_private._displayName = [];
|
|
53
|
-
}
|
|
54
|
-
exports.BaseNode_removePrivate = BaseNode_removePrivate;
|
|
55
|
-
function BaseNode_getPrivate(self) {
|
|
56
|
-
return g_weakMap.get(self);
|
|
57
|
-
}
|
|
58
|
-
exports.BaseNode_getPrivate = BaseNode_getPrivate;
|
|
59
|
-
function BaseNode_getCache(node) {
|
|
60
|
-
return BaseNode_getPrivate(node)._cache;
|
|
61
|
-
}
|
|
62
|
-
exports.BaseNode_getCache = BaseNode_getCache;
|
|
63
|
-
function BaseNode_clearCache(node) {
|
|
64
|
-
const _private = BaseNode_getPrivate(node);
|
|
65
|
-
if (_private && _private._cache) {
|
|
66
|
-
_private._cache = {};
|
|
67
|
-
}
|
|
68
|
-
(0, tool_isSubtypeOf_1.wipeMemorizedStuff)(node);
|
|
69
|
-
}
|
|
70
|
-
exports.BaseNode_clearCache = BaseNode_clearCache;
|
|
71
|
-
const hasTypeDefinition_ReferenceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("HasTypeDefinition");
|
|
72
|
-
class ToStringBuilder {
|
|
73
|
-
constructor() {
|
|
74
|
-
this.level = 0;
|
|
75
|
-
this.cycleDetector = {};
|
|
76
|
-
this.padding = "";
|
|
77
|
-
this.str = [];
|
|
78
|
-
//
|
|
79
|
-
this.str = [];
|
|
80
|
-
}
|
|
81
|
-
add(line) {
|
|
82
|
-
this.str.push(line);
|
|
83
|
-
}
|
|
84
|
-
toString() {
|
|
85
|
-
return this.str.join("\n");
|
|
86
|
-
}
|
|
87
|
-
indent(str, padding) {
|
|
88
|
-
padding = padding || " ";
|
|
89
|
-
return str
|
|
90
|
-
.split("\n")
|
|
91
|
-
.map((r) => {
|
|
92
|
-
return padding + r;
|
|
93
|
-
})
|
|
94
|
-
.join("\n");
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
exports.ToStringBuilder = ToStringBuilder;
|
|
98
|
-
function set_as_processed(options, nodeId) {
|
|
99
|
-
options.cycleDetector[nodeId.toString()] = nodeId;
|
|
100
|
-
}
|
|
101
|
-
function is_already_processed(options, nodeId) {
|
|
102
|
-
return !!options.cycleDetector[nodeId.toString()];
|
|
103
|
-
}
|
|
104
|
-
function BaseNode_toString(options) {
|
|
105
|
-
options.level = options.level || 1;
|
|
106
|
-
set_as_processed(options, this.nodeId);
|
|
107
|
-
options.add("");
|
|
108
|
-
options.add(options.padding + chalk.yellow(" nodeId : ") + this.nodeId.toString());
|
|
109
|
-
options.add(options.padding + chalk.yellow(" nodeClass : ") + node_opcua_data_model_1.NodeClass[this.nodeClass] + " (" + this.nodeClass + ")");
|
|
110
|
-
options.add(options.padding + chalk.yellow(" browseName : ") + this.browseName.toString());
|
|
111
|
-
options.add(options.padding +
|
|
112
|
-
chalk.yellow(" displayName : ") +
|
|
113
|
-
this.displayName.map((f) => f.locale + " " + f.text).join(" | "));
|
|
114
|
-
options.add(options.padding + chalk.yellow(" description : ") + (this.description ? this.description.toString() : ""));
|
|
115
|
-
}
|
|
116
|
-
exports.BaseNode_toString = BaseNode_toString;
|
|
117
|
-
function BaseNode_References_toString(options) {
|
|
118
|
-
const _private = BaseNode_getPrivate(this);
|
|
119
|
-
const displayOptions = {
|
|
120
|
-
addressSpace: this.addressSpace
|
|
121
|
-
};
|
|
122
|
-
const addressSpace = this.addressSpace;
|
|
123
|
-
options.add(options.padding +
|
|
124
|
-
chalk.yellow(" references : ") +
|
|
125
|
-
" length =" +
|
|
126
|
-
Object.keys(_private._referenceIdx).length);
|
|
127
|
-
function dump_reference(follow, reference) {
|
|
128
|
-
if (!reference) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const o = reference_impl_1.ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
132
|
-
if (!o) {
|
|
133
|
-
warningLog("cannot find referece", reference.toString());
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const name = o.browseName.toString();
|
|
137
|
-
const modellingRule = o.modellingRule || " ";
|
|
138
|
-
const extra = modellingRule[0] +
|
|
139
|
-
(() => {
|
|
140
|
-
switch (o.nodeClass) {
|
|
141
|
-
case node_opcua_data_model_1.NodeClass.Object:
|
|
142
|
-
return "[O] ";
|
|
143
|
-
case node_opcua_data_model_1.NodeClass.Variable:
|
|
144
|
-
return "[V] " + o.dataType.toString(displayOptions).padEnd(10);
|
|
145
|
-
case node_opcua_data_model_1.NodeClass.Method:
|
|
146
|
-
return "[M] ";
|
|
147
|
-
case node_opcua_data_model_1.NodeClass.DataType:
|
|
148
|
-
return "[DT]";
|
|
149
|
-
case node_opcua_data_model_1.NodeClass.ReferenceType:
|
|
150
|
-
return "[RT]";
|
|
151
|
-
case node_opcua_data_model_1.NodeClass.ObjectType:
|
|
152
|
-
return "[OT]";
|
|
153
|
-
case node_opcua_data_model_1.NodeClass.VariableType:
|
|
154
|
-
return "[VT]";
|
|
155
|
-
case node_opcua_data_model_1.NodeClass.View:
|
|
156
|
-
return "[V] ";
|
|
157
|
-
}
|
|
158
|
-
return "";
|
|
159
|
-
})();
|
|
160
|
-
options.add(options.padding +
|
|
161
|
-
chalk.yellow(" +-> ") +
|
|
162
|
-
reference.toString(displayOptions) +
|
|
163
|
-
" " +
|
|
164
|
-
chalk.cyan(name.padEnd(25, " ")) +
|
|
165
|
-
" " +
|
|
166
|
-
chalk.magentaBright(extra));
|
|
167
|
-
// ignore HasTypeDefinition as it has been already handled
|
|
168
|
-
if ((0, node_opcua_nodeid_1.sameNodeId)(reference.referenceType, hasTypeDefinition_ReferenceTypeNodeId) && reference.nodeId.namespace === 0) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (o) {
|
|
172
|
-
if (!is_already_processed(options, o.nodeId)) {
|
|
173
|
-
set_as_processed(options, o.nodeId);
|
|
174
|
-
if (options.level > 1 && follow) {
|
|
175
|
-
const rr = o.toString({
|
|
176
|
-
cycleDetector: options.cycleDetector,
|
|
177
|
-
level: options.level - 1,
|
|
178
|
-
padding: options.padding + " "
|
|
179
|
-
});
|
|
180
|
-
options.add(rr);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
// direct reference
|
|
186
|
-
Object.values(_private._referenceIdx).forEach(dump_reference.bind(null, true));
|
|
187
|
-
const br = Object.values(_private._back_referenceIdx).map((x) => x);
|
|
188
|
-
options.add(options.padding +
|
|
189
|
-
chalk.yellow(" back_references : ") +
|
|
190
|
-
chalk.cyan(" length =") +
|
|
191
|
-
br.length +
|
|
192
|
-
chalk.grey(" ( references held by other nodes involving this node)"));
|
|
193
|
-
// backward reference
|
|
194
|
-
br.forEach(dump_reference.bind(null, false));
|
|
195
|
-
}
|
|
196
|
-
exports.BaseNode_References_toString = BaseNode_References_toString;
|
|
197
|
-
function _UAType_toString(options) {
|
|
198
|
-
if (this.subtypeOfObj) {
|
|
199
|
-
options.add(options.padding +
|
|
200
|
-
chalk.yellow(" subtypeOf : ") +
|
|
201
|
-
this.subtypeOfObj.browseName.toString() +
|
|
202
|
-
" (" +
|
|
203
|
-
this.subtypeOfObj.nodeId.toString() +
|
|
204
|
-
")");
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function _UAInstance_toString(options) {
|
|
208
|
-
if (this.typeDefinitionObj) {
|
|
209
|
-
options.add(options.padding +
|
|
210
|
-
chalk.yellow(" typeDefinition : ") +
|
|
211
|
-
this.typeDefinitionObj.browseName.toString() +
|
|
212
|
-
" (" +
|
|
213
|
-
this.typeDefinitionObj.nodeId.toString() +
|
|
214
|
-
")");
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function UAVariableType_toString(options) {
|
|
218
|
-
BaseNode_toString.call(this, options);
|
|
219
|
-
_UAType_toString.call(this, options);
|
|
220
|
-
VariableOrVariableType_toString.call(this, options);
|
|
221
|
-
BaseNode_References_toString.call(this, options);
|
|
222
|
-
}
|
|
223
|
-
exports.UAVariableType_toString = UAVariableType_toString;
|
|
224
|
-
function UAVariable_toString(options) {
|
|
225
|
-
BaseNode_toString.call(this, options);
|
|
226
|
-
_UAInstance_toString.call(this, options);
|
|
227
|
-
VariableOrVariableType_toString.call(this, options);
|
|
228
|
-
AccessLevelFlags_toString.call(this, options);
|
|
229
|
-
BaseNode_References_toString.call(this, options);
|
|
230
|
-
}
|
|
231
|
-
exports.UAVariable_toString = UAVariable_toString;
|
|
232
|
-
function UAObject_toString(options) {
|
|
233
|
-
BaseNode_toString.call(this, options);
|
|
234
|
-
_UAInstance_toString.call(this, options);
|
|
235
|
-
BaseNode_References_toString.call(this, options);
|
|
236
|
-
}
|
|
237
|
-
exports.UAObject_toString = UAObject_toString;
|
|
238
|
-
function UAObjectType_toString(options) {
|
|
239
|
-
BaseNode_toString.call(this, options);
|
|
240
|
-
_UAType_toString.call(this, options);
|
|
241
|
-
BaseNode_References_toString.call(this, options);
|
|
242
|
-
}
|
|
243
|
-
exports.UAObjectType_toString = UAObjectType_toString;
|
|
244
|
-
function valueRankToString(valueRank) {
|
|
245
|
-
switch (valueRank) {
|
|
246
|
-
case 1:
|
|
247
|
-
return "OneDimension (1)";
|
|
248
|
-
case 0:
|
|
249
|
-
return "OneOrMoreDimensions (0)"; // The value is an array with one or more dimensions
|
|
250
|
-
case -1:
|
|
251
|
-
return "Scalar (-1)";
|
|
252
|
-
case -2:
|
|
253
|
-
return "Any (-2)"; // The value can be a scalar or an array with any number of dimensions
|
|
254
|
-
case -3:
|
|
255
|
-
return "ScalarOrOneDimension (2)"; // The value can be a scalar or a one dimensional array.
|
|
256
|
-
default:
|
|
257
|
-
if (valueRank > 0) {
|
|
258
|
-
return "" + valueRank + "-Dimensions";
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
return "Invalid (" + valueRank + ")";
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
exports.valueRankToString = valueRankToString;
|
|
266
|
-
function accessLevelFlagToString(flag) {
|
|
267
|
-
const str = [];
|
|
268
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.CurrentRead) {
|
|
269
|
-
str.push("CurrentRead");
|
|
270
|
-
}
|
|
271
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.CurrentWrite) {
|
|
272
|
-
str.push("CurrentWrite");
|
|
273
|
-
}
|
|
274
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.HistoryRead) {
|
|
275
|
-
str.push("HistoryRead");
|
|
276
|
-
}
|
|
277
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.HistoryWrite) {
|
|
278
|
-
str.push("HistoryWrite");
|
|
279
|
-
}
|
|
280
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.SemanticChange) {
|
|
281
|
-
str.push("SemanticChange");
|
|
282
|
-
}
|
|
283
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.StatusWrite) {
|
|
284
|
-
str.push("StatusWrite");
|
|
285
|
-
}
|
|
286
|
-
if (flag & node_opcua_data_model_1.AccessLevelFlag.TimestampWrite) {
|
|
287
|
-
str.push("TimestampWrite");
|
|
288
|
-
}
|
|
289
|
-
return str.join(" | ");
|
|
290
|
-
}
|
|
291
|
-
function AccessLevelFlags_toString(options) {
|
|
292
|
-
(0, node_opcua_assert_1.assert)(options);
|
|
293
|
-
options.add(options.padding + chalk.yellow(" accessLevel : ") + " " + accessLevelFlagToString(this.accessLevel));
|
|
294
|
-
if (this.userAccessLevel !== undefined) {
|
|
295
|
-
options.add(options.padding + chalk.yellow(" userAccessLevel : ") + " " + accessLevelFlagToString(this.userAccessLevel));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function VariableOrVariableType_toString(options) {
|
|
299
|
-
(0, node_opcua_assert_1.assert)(options);
|
|
300
|
-
if (this.dataType) {
|
|
301
|
-
const addressSpace = this.addressSpace;
|
|
302
|
-
const d = addressSpace.findNode(this.dataType);
|
|
303
|
-
const n = d ? "(" + d.browseName.toString() + ")" : " (???)";
|
|
304
|
-
options.add(options.padding + chalk.yellow(" dataType : ") + this.dataType + " " + n);
|
|
305
|
-
}
|
|
306
|
-
if (this.nodeClass === node_opcua_data_model_1.NodeClass.Variable) {
|
|
307
|
-
const _dataValue = this.$dataValue;
|
|
308
|
-
if (_dataValue) {
|
|
309
|
-
options.add(options.padding +
|
|
310
|
-
chalk.yellow(" value : ") +
|
|
311
|
-
"\n" +
|
|
312
|
-
options.indent(_dataValue.toString(), options.padding + " | "));
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (Object.prototype.hasOwnProperty.call(this, "valueRank")) {
|
|
316
|
-
if (this.valueRank !== undefined) {
|
|
317
|
-
options.add(options.padding + chalk.yellow(" valueRank : ") + " " + valueRankToString(this.valueRank));
|
|
318
|
-
}
|
|
319
|
-
else {
|
|
320
|
-
options.add(options.padding + chalk.yellow(" valueRank : ") + " undefined");
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
if (this.minimumSamplingInterval !== undefined) {
|
|
324
|
-
options.add(options.padding +
|
|
325
|
-
chalk.yellow(" minimumSamplingInterval : ") +
|
|
326
|
-
" " +
|
|
327
|
-
this.minimumSamplingInterval.toString() +
|
|
328
|
-
" ms");
|
|
329
|
-
}
|
|
330
|
-
if (this.arrayDimensions) {
|
|
331
|
-
options.add(options.padding +
|
|
332
|
-
chalk.yellow(" arrayDimension : ") +
|
|
333
|
-
" [" +
|
|
334
|
-
this.arrayDimensions.join(",").toString() +
|
|
335
|
-
" ]");
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
exports.VariableOrVariableType_toString = VariableOrVariableType_toString;
|
|
339
|
-
const defaultExtraInfo = {
|
|
340
|
-
level: 0,
|
|
341
|
-
pad() {
|
|
342
|
-
return "";
|
|
343
|
-
},
|
|
344
|
-
registerClonedObject(node, node1) {
|
|
345
|
-
/** */
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
/**
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
* MyDeriveType ------------------- -> MyBaseType --------------> TopologyElementType
|
|
352
|
-
* | | |
|
|
353
|
-
* +- ParamaterSet +-> ParameterSet +-> ParamaterSet
|
|
354
|
-
* | |
|
|
355
|
-
* +- Foo1 |
|
|
356
|
-
* +- Bar
|
|
357
|
-
*
|
|
358
|
-
* Instance
|
|
359
|
-
*
|
|
360
|
-
* @param newParent
|
|
361
|
-
* @param node
|
|
362
|
-
* @param copyAlsoModellingRules
|
|
363
|
-
* @param optionalFilter
|
|
364
|
-
* @param extraInfo
|
|
365
|
-
* @param browseNameMap
|
|
366
|
-
* @returns
|
|
367
|
-
*/
|
|
368
|
-
function _clone_children_on_template(nodeToClone, newParent, node, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap) {
|
|
369
|
-
/**
|
|
370
|
-
* the type definition node of the node to clone
|
|
371
|
-
*/
|
|
372
|
-
const nodeToCloneTypeDefinition = nodeToClone.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType || nodeToClone.nodeClass === node_opcua_data_model_1.NodeClass.VariableType
|
|
373
|
-
? nodeToClone.subtypeOfObj
|
|
374
|
-
: null;
|
|
375
|
-
if (!nodeToCloneTypeDefinition)
|
|
376
|
-
return;
|
|
377
|
-
doTrace &&
|
|
378
|
-
traceLog(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad(), chalk.green("-------------------- now cloning children on template ", node.browseName.toString(), node.nodeId.toString(), nodeToCloneTypeDefinition.browseName.toString()));
|
|
379
|
-
const namespace = newParent.namespace;
|
|
380
|
-
/**
|
|
381
|
-
* the child node of the new parent that match the node to clone or enrich
|
|
382
|
-
*/
|
|
383
|
-
const newParentChild = newParent.getChildByName(node.browseName);
|
|
384
|
-
if (!newParentChild) {
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
// we have found a matching child on the new parent.
|
|
388
|
-
// the mission is to enrich this child node with compoents and property that
|
|
389
|
-
// exists also in the template
|
|
390
|
-
let typeDefinitionNode = nodeToCloneTypeDefinition;
|
|
391
|
-
while (typeDefinitionNode) {
|
|
392
|
-
doTrace &&
|
|
393
|
-
traceLog(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad(), chalk.green("-------------------- now cloning children on ", newParentChild.browseName.toString(), newParentChild.nodeId.toString(), " (child of ", node.browseName.toString(), node.nodeId.toString(), ") from ", typeDefinitionNode.browseName.toString()));
|
|
394
|
-
const typeDefinitionChild = typeDefinitionNode.getChildByName(node.browseName);
|
|
395
|
-
if (typeDefinitionChild) {
|
|
396
|
-
const references = typeDefinitionChild.findReferencesEx("Aggregates", node_opcua_data_model_1.BrowseDirection.Forward);
|
|
397
|
-
for (const ref of references) {
|
|
398
|
-
const grandChild = ref.node;
|
|
399
|
-
if (grandChild.modellingRule === "MandatoryPlaceholder" || grandChild.modellingRule === "OptionalPlaceholder")
|
|
400
|
-
continue;
|
|
401
|
-
// if not already node present in new Parent => just ignore
|
|
402
|
-
const hasAlready = newParentChild.getChildByName(grandChild.browseName) !== null;
|
|
403
|
-
if (!hasAlready) {
|
|
404
|
-
if (optionalFilter && node && !optionalFilter.shouldKeep(node)) {
|
|
405
|
-
doTrace &&
|
|
406
|
-
traceLog(extraInfo.pad(), "skipping optional ", node.browseName.toString(), "that doesn't appear in the filter");
|
|
407
|
-
continue; // skip this node
|
|
408
|
-
}
|
|
409
|
-
const options = {
|
|
410
|
-
namespace,
|
|
411
|
-
references: [
|
|
412
|
-
new reference_impl_1.ReferenceImpl({
|
|
413
|
-
referenceType: ref.referenceType,
|
|
414
|
-
isForward: false,
|
|
415
|
-
nodeId: newParentChild.nodeId
|
|
416
|
-
})
|
|
417
|
-
],
|
|
418
|
-
copyAlsoModellingRules
|
|
419
|
-
};
|
|
420
|
-
const a = grandChild.clone(options, optionalFilter, extraInfo);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
typeDefinitionNode = typeDefinitionNode.subtypeOfObj;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* clone properties and methods
|
|
429
|
-
* @private
|
|
430
|
-
*/
|
|
431
|
-
function _clone_collection_new(nodeToClone, newParent, collectionRef, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap) {
|
|
432
|
-
var _a;
|
|
433
|
-
const namespace = newParent.namespace;
|
|
434
|
-
extraInfo = extraInfo || defaultExtraInfo;
|
|
435
|
-
const addressSpace = newParent.addressSpace;
|
|
436
|
-
(0, node_opcua_assert_1.assert)(!optionalFilter || (typeof optionalFilter.shouldKeep === "function" && typeof optionalFilter.filterFor === "function"));
|
|
437
|
-
for (const reference of collectionRef) {
|
|
438
|
-
const node = reference_impl_1.ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
439
|
-
// ensure node is of the correct type,
|
|
440
|
-
// it may happen that the xml nodeset2 file was malformed
|
|
441
|
-
// istanbul ignore next
|
|
442
|
-
if (typeof node.clone !== "function") {
|
|
443
|
-
// tslint:disable-next-line:no-console
|
|
444
|
-
warningLog(chalk.red("Warning : cannot clone node ") +
|
|
445
|
-
node.browseName.toString() +
|
|
446
|
-
" of class " +
|
|
447
|
-
node_opcua_data_model_1.NodeClass[node.nodeClass].toString() +
|
|
448
|
-
" while cloning " +
|
|
449
|
-
newParent.browseName.toString());
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
if (optionalFilter && node && !optionalFilter.shouldKeep(node)) {
|
|
453
|
-
doTrace &&
|
|
454
|
-
traceLog(extraInfo.pad(), "skipping optional ", node.browseName.toString(), "that doesn't appear in the filter");
|
|
455
|
-
continue; // skip this node
|
|
456
|
-
}
|
|
457
|
-
const key = node.browseName.toString();
|
|
458
|
-
if (browseNameMap === null || browseNameMap === void 0 ? void 0 : browseNameMap.has(key)) {
|
|
459
|
-
_clone_children_on_template(nodeToClone, newParent, node, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap);
|
|
460
|
-
continue; // skipping node with same browseName
|
|
461
|
-
}
|
|
462
|
-
browseNameMap === null || browseNameMap === void 0 ? void 0 : browseNameMap.add(key);
|
|
463
|
-
// assert(reference.isForward);
|
|
464
|
-
// assert(reference.referenceType instanceof NodeId, "" + reference.referenceType.toString());
|
|
465
|
-
const options = {
|
|
466
|
-
namespace,
|
|
467
|
-
references: [new reference_impl_1.ReferenceImpl({ referenceType: reference.referenceType, isForward: false, nodeId: newParent.nodeId })],
|
|
468
|
-
copyAlsoModellingRules
|
|
469
|
-
};
|
|
470
|
-
doTrace &&
|
|
471
|
-
traceLog(extraInfo.pad(), "cloning => ", reference.referenceType.toString({ addressSpace }), "=>", node.browseName.toString(), chalk.magentaBright((_a = node.typeDefinitionObj) === null || _a === void 0 ? void 0 : _a.browseName.toString()));
|
|
472
|
-
extraInfo.level += 4;
|
|
473
|
-
const clone = node.clone(options, optionalFilter, extraInfo);
|
|
474
|
-
extraInfo.level -= 4;
|
|
475
|
-
doTrace && traceLog(extraInfo.pad(), "cloning => ", node.browseName.toString(), "nodeId", clone.nodeId.toString());
|
|
476
|
-
extraInfo.level++;
|
|
477
|
-
_clone_children_on_template(nodeToClone, newParent, node, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap);
|
|
478
|
-
extraInfo.level--;
|
|
479
|
-
// also clone or instantiate interface members that may be required in the optionals
|
|
480
|
-
extraInfo.level++;
|
|
481
|
-
_cloneInterface(nodeToClone, newParent, node, optionalFilter, extraInfo, browseNameMap);
|
|
482
|
-
extraInfo.level--;
|
|
483
|
-
if (extraInfo) {
|
|
484
|
-
extraInfo.registerClonedObject(node, clone);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
function _extractInterfaces2(typeDefinitionNode, extraInfo) {
|
|
489
|
-
if (!typeDefinitionNode ||
|
|
490
|
-
(typeDefinitionNode.nodeId.namespace === 0 &&
|
|
491
|
-
(typeDefinitionNode.nodeId.value === node_opcua_constants_1.ObjectTypeIds.BaseObjectType ||
|
|
492
|
-
typeDefinitionNode.nodeId.value === node_opcua_constants_1.VariableTypeIds.BaseVariableType))) {
|
|
493
|
-
return [];
|
|
494
|
-
}
|
|
495
|
-
const addressSpace = typeDefinitionNode.addressSpace;
|
|
496
|
-
const hasInterfaceReference = addressSpace.findReferenceType("HasInterface");
|
|
497
|
-
if (!hasInterfaceReference) {
|
|
498
|
-
// this version of the standard UA namespace doesn't support Interface yet
|
|
499
|
-
return [];
|
|
500
|
-
}
|
|
501
|
-
// example:
|
|
502
|
-
// FolderType
|
|
503
|
-
// FunctionalGroupType
|
|
504
|
-
// MachineryItemIdentificationType : IMachineryItemVendorNameplateType
|
|
505
|
-
// MachineIdentificationType : IMachineTagNameplateType, IMachineVendorNamePlateType
|
|
506
|
-
// MachineToolIdentificationType
|
|
507
|
-
//
|
|
508
|
-
//
|
|
509
|
-
// IMachineTagNameplateType -subtypeOf-> ITagNameplateType
|
|
510
|
-
// IMachineVendorNamePlateType -subtypeOf-> IMachineryItemVendorNamePlateType
|
|
511
|
-
// IMachineryItemVendorNamePlateType -subtypeOf-> IVendorNameplateType
|
|
512
|
-
const interfacesRef = typeDefinitionNode.findReferencesEx("HasInterface", node_opcua_data_model_1.BrowseDirection.Forward);
|
|
513
|
-
const interfaces = interfacesRef.map((r) => addressSpace.findNode(r.nodeId));
|
|
514
|
-
const baseInterfaces = [];
|
|
515
|
-
for (const iface of interfaces) {
|
|
516
|
-
doTrace &&
|
|
517
|
-
traceLog(extraInfo.pad(), typeDefinitionNode.browseName.toString(), " - has interface -> ", iface.browseName.toString());
|
|
518
|
-
baseInterfaces.push(iface);
|
|
519
|
-
if (iface.subtypeOfObj) {
|
|
520
|
-
extraInfo.level++;
|
|
521
|
-
baseInterfaces.push(..._extractInterfaces2(iface.subtypeOfObj, extraInfo));
|
|
522
|
-
extraInfo.level--;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
interfaces.push(...baseInterfaces);
|
|
526
|
-
if (typeDefinitionNode.subtypeOfObj) {
|
|
527
|
-
doTrace &&
|
|
528
|
-
traceLog(extraInfo.pad(), typeDefinitionNode.browseName.toString(), " - subtypef -> ", typeDefinitionNode.subtypeOfObj.browseName.toString());
|
|
529
|
-
extraInfo.level++;
|
|
530
|
-
interfaces.push(..._extractInterfaces2(typeDefinitionNode.subtypeOfObj, extraInfo));
|
|
531
|
-
extraInfo.level--;
|
|
532
|
-
}
|
|
533
|
-
const dedupedInterfaces = [...new Set(interfaces)];
|
|
534
|
-
doTrace &&
|
|
535
|
-
dedupedInterfaces.length &&
|
|
536
|
-
traceLog(extraInfo.pad(), chalk.yellow("Interface for ", typeDefinitionNode.browseName.toString()), "=", dedupedInterfaces.map((x) => x.browseName.toString()).join(" "));
|
|
537
|
-
return dedupedInterfaces;
|
|
538
|
-
}
|
|
539
|
-
/*
|
|
540
|
-
|
|
541
|
-
// also find all related interfaces
|
|
542
|
-
if (false && typeDefinitionNode) {
|
|
543
|
-
dotrace && tracelog("typeDefinitionNode = ", typeDefinitionNode.browseName.toString());
|
|
544
|
-
const interfaces = _extractInterfaces(typeDefinitionNode);
|
|
545
|
-
for (const interfaceNode of interfaces) {
|
|
546
|
-
dotrace && tracelog(" adding member of interface ", interfaceNode.browseName.toString());
|
|
547
|
-
const fromInterface = interfaceNode.findReferencesEx("Aggregates", BrowseDirection.Forward);
|
|
548
|
-
dotrace && tracelog(
|
|
549
|
-
" B ",
|
|
550
|
-
fromInterface.map((r) => r.toString({ addressSpace }) + " " + r.node!.browseName.toString()).join("\n")
|
|
551
|
-
);
|
|
552
|
-
add(fromInterface);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
*/
|
|
556
|
-
function _crap_extractInterfaces(typeDefinitionNode, extraInfo) {
|
|
557
|
-
if (typeDefinitionNode.nodeId.namespace === 0 &&
|
|
558
|
-
(typeDefinitionNode.nodeId.value === node_opcua_constants_1.ObjectTypeIds.BaseObjectType ||
|
|
559
|
-
typeDefinitionNode.nodeId.value === node_opcua_constants_1.VariableTypeIds.BaseVariableType)) {
|
|
560
|
-
return [];
|
|
561
|
-
}
|
|
562
|
-
const addressSpace = typeDefinitionNode.addressSpace;
|
|
563
|
-
// example:
|
|
564
|
-
// FolderType
|
|
565
|
-
// FunctionalGroupType
|
|
566
|
-
// MachineryItemIdentificationType : IMachineryItemVendorNameplateType
|
|
567
|
-
// MachineIdentificationType : IMachineTagNameplateType, IMachineVendorNamePlateType
|
|
568
|
-
// MachineToolIdentificationType
|
|
569
|
-
//
|
|
570
|
-
//
|
|
571
|
-
// IMachineTagNameplateType -subtypeOf-> ITagNameplateType
|
|
572
|
-
// IMachineVendorNamePlateType -subtypeOf-> IMachineryItemVendorNamePlateType
|
|
573
|
-
// IMachineryItemVendorNamePlateType -subtypeOf-> IVendorNameplateType
|
|
574
|
-
const interfacesRef = typeDefinitionNode.findReferencesEx("HasInterface", node_opcua_data_model_1.BrowseDirection.Forward);
|
|
575
|
-
const interfaces = interfacesRef.map((r) => r.node);
|
|
576
|
-
for (const iface of interfaces) {
|
|
577
|
-
doTrace && traceLog(extraInfo.pad(), " interface ", iface.browseName.toString());
|
|
578
|
-
}
|
|
579
|
-
return interfaces;
|
|
580
|
-
}
|
|
581
|
-
function _cloneInterface(nodeToClone, newParent, node, optionalFilter, extraInfo, browseNameMap) {
|
|
582
|
-
doTrace &&
|
|
583
|
-
traceLog(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad(), chalk.green("-------------------- now cloning interfaces of ", node.browseName.toString(), node.nodeId.toString()));
|
|
584
|
-
extraInfo = extraInfo || defaultExtraInfo;
|
|
585
|
-
const addressSpace = node.addressSpace;
|
|
586
|
-
if (node.nodeClass !== node_opcua_data_model_1.NodeClass.Object && node.nodeClass !== node_opcua_data_model_1.NodeClass.Variable) {
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
const typeDefinitionNode = node.typeDefinitionObj;
|
|
590
|
-
if (!typeDefinitionNode) {
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
const interfaces = _extractInterfaces2(typeDefinitionNode, extraInfo);
|
|
594
|
-
if (interfaces.length === 0) {
|
|
595
|
-
doTrace &&
|
|
596
|
-
false &&
|
|
597
|
-
traceLog(extraInfo.pad(), chalk.yellow("No interface for ", node.browseName.toString(), node.nodeId.toString()));
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
doTrace && traceLog(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad(), chalk.green("-------------------- interfaces are ", interfaces.length));
|
|
601
|
-
const localFilter = optionalFilter.filterFor(node);
|
|
602
|
-
for (const iface of interfaces) {
|
|
603
|
-
const aggregates = iface.findReferencesEx("Aggregates", node_opcua_data_model_1.BrowseDirection.Forward);
|
|
604
|
-
doTrace &&
|
|
605
|
-
traceLog(extraInfo.pad(), chalk.magentaBright(" interface ", iface.browseName.toString()), "\n" + (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad()), aggregates.map((r) => r.toString({ addressSpace })).join("\n" + (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad())));
|
|
606
|
-
_clone_collection_new(nodeToClone, node, aggregates, false, localFilter, extraInfo, browseNameMap);
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
function _clone_children_references(node, newParent, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap) {
|
|
610
|
-
// find all reference that derives from the Aggregates
|
|
611
|
-
const aggregatesRef = node.findReferencesEx("Aggregates", node_opcua_data_model_1.BrowseDirection.Forward);
|
|
612
|
-
_clone_collection_new(node, newParent, aggregatesRef, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap);
|
|
613
|
-
}
|
|
614
|
-
exports._clone_children_references = _clone_children_references;
|
|
615
|
-
function _clone_non_hierarchical_references(nodeToClone, newParent, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap) {
|
|
616
|
-
// clone only some non hierarchical_references that we do want to clone
|
|
617
|
-
// such as:
|
|
618
|
-
// HasSubStateMachine
|
|
619
|
-
// (may be other as well later ... to do )
|
|
620
|
-
(0, node_opcua_assert_1.assert)(newParent instanceof base_node_impl_1.BaseNodeImpl);
|
|
621
|
-
// find all reference that derives from the HasSubStateMachine
|
|
622
|
-
const references = nodeToClone.findReferencesEx("HasSubStateMachine", node_opcua_data_model_1.BrowseDirection.Forward);
|
|
623
|
-
_clone_collection_new(nodeToClone, newParent, references, copyAlsoModellingRules, optionalFilter, extraInfo, browseNameMap);
|
|
624
|
-
}
|
|
625
|
-
exports._clone_non_hierarchical_references = _clone_non_hierarchical_references;
|
|
626
|
-
/**
|
|
627
|
-
* @method _clone
|
|
628
|
-
* @private
|
|
629
|
-
*/
|
|
630
|
-
function _clone(Constructor, options, optionalFilter, extraInfo) {
|
|
631
|
-
(0, node_opcua_assert_1.assert)(typeof Constructor === "function");
|
|
632
|
-
(0, node_opcua_assert_1.assert)(options !== null && typeof options === "object");
|
|
633
|
-
(0, node_opcua_assert_1.assert)(!extraInfo || (extraInfo !== null && typeof extraInfo === "object" && typeof extraInfo.registerClonedObject === "function"));
|
|
634
|
-
(0, node_opcua_assert_1.assert)(!this.subtypeOf, "We do not do cloning of Type yet");
|
|
635
|
-
const namespace = options.namespace;
|
|
636
|
-
const constructorOptions = Object.assign(Object.assign({}, options), { addressSpace: namespace.addressSpace, browseName: this.browseName, description: this.description, displayName: this.displayName, nodeClass: this.nodeClass });
|
|
637
|
-
constructorOptions.references = options.references || [];
|
|
638
|
-
if (this.nodeClass === node_opcua_data_model_1.NodeClass.Variable || this.nodeClass === node_opcua_data_model_1.NodeClass.Object) {
|
|
639
|
-
const voThis = this;
|
|
640
|
-
if (voThis.typeDefinition) {
|
|
641
|
-
constructorOptions.references.push(new reference_impl_1.ReferenceImpl({
|
|
642
|
-
isForward: true,
|
|
643
|
-
nodeId: voThis.typeDefinition,
|
|
644
|
-
referenceType: (0, node_opcua_nodeid_1.resolveNodeId)("HasTypeDefinition")
|
|
645
|
-
}));
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
if (!constructorOptions.modellingRule) {
|
|
649
|
-
if (this.modellingRule && options.copyAlsoModellingRules) {
|
|
650
|
-
const modellingRuleNode = this.findReferencesAsObject("HasModellingRule", true)[0];
|
|
651
|
-
(0, node_opcua_assert_1.assert)(modellingRuleNode);
|
|
652
|
-
constructorOptions.references.push(new reference_impl_1.ReferenceImpl({
|
|
653
|
-
isForward: true,
|
|
654
|
-
nodeId: modellingRuleNode.nodeId,
|
|
655
|
-
referenceType: (0, node_opcua_nodeid_1.resolveNodeId)("HasModellingRule")
|
|
656
|
-
}));
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
(0, namespace_private_1.UANamespace_process_modelling_rule)(constructorOptions.references, constructorOptions.modellingRule);
|
|
661
|
-
}
|
|
662
|
-
constructorOptions.nodeId = namespace.constructNodeId(constructorOptions);
|
|
663
|
-
(0, node_opcua_assert_1.assert)(constructorOptions.nodeId instanceof node_opcua_nodeid_1.NodeId);
|
|
664
|
-
const cloneObj = new Constructor(constructorOptions);
|
|
665
|
-
this.addressSpace._register(cloneObj);
|
|
666
|
-
if (!options.ignoreChildren) {
|
|
667
|
-
// clone children and the rest ....
|
|
668
|
-
options.copyAlsoModellingRules = options.copyAlsoModellingRules || false;
|
|
669
|
-
const newFilter = optionalFilter.filterFor(cloneObj);
|
|
670
|
-
const browseNameMap = new Set();
|
|
671
|
-
_clone_children_references(this, cloneObj, options.copyAlsoModellingRules, newFilter, extraInfo, browseNameMap);
|
|
672
|
-
if (this.nodeClass === node_opcua_data_model_1.NodeClass.Object || this.nodeClass === node_opcua_data_model_1.NodeClass.Variable) {
|
|
673
|
-
let typeDefinitionNode = this.typeDefinitionObj;
|
|
674
|
-
while (typeDefinitionNode) {
|
|
675
|
-
doTrace &&
|
|
676
|
-
traceLog(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.pad(), chalk.blueBright("---------------------- Exploring ", typeDefinitionNode.browseName.toString()));
|
|
677
|
-
_clone_children_references(typeDefinitionNode, cloneObj, options.copyAlsoModellingRules, newFilter, extraInfo, browseNameMap);
|
|
678
|
-
typeDefinitionNode = typeDefinitionNode.subtypeOfObj;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
_clone_non_hierarchical_references(this, cloneObj, options.copyAlsoModellingRules, newFilter, extraInfo, browseNameMap);
|
|
682
|
-
}
|
|
683
|
-
cloneObj.propagate_back_references();
|
|
684
|
-
cloneObj.install_extra_properties();
|
|
685
|
-
return cloneObj;
|
|
686
|
-
}
|
|
687
|
-
exports._clone = _clone;
|
|
688
|
-
function _handle_HierarchicalReference(node, reference) {
|
|
689
|
-
const _cache = BaseNode_getCache(node);
|
|
690
|
-
if (!reference.isForward)
|
|
691
|
-
return;
|
|
692
|
-
if (_cache._childByNameMap) {
|
|
693
|
-
const addressSpace = node.addressSpace;
|
|
694
|
-
const referenceType = reference_impl_1.ReferenceImpl.resolveReferenceType(addressSpace, reference);
|
|
695
|
-
if (referenceType) {
|
|
696
|
-
const HierarchicalReferencesType = addressSpace.findReferenceType("HierarchicalReferences");
|
|
697
|
-
if (referenceType.isSubtypeOf(HierarchicalReferencesType)) {
|
|
698
|
-
(0, node_opcua_assert_1.assert)(reference.isForward);
|
|
699
|
-
const targetNode = reference_impl_1.ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
700
|
-
_cache._childByNameMap[targetNode.browseName.name.toString()] = targetNode;
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
exports._handle_HierarchicalReference = _handle_HierarchicalReference;
|
|
706
|
-
function _remove_HierarchicalReference(node, reference) {
|
|
707
|
-
const _cache = BaseNode_getCache(node);
|
|
708
|
-
if (_cache._childByNameMap) {
|
|
709
|
-
const addressSpace = node.addressSpace;
|
|
710
|
-
const referenceType = reference_impl_1.ReferenceImpl.resolveReferenceType(addressSpace, reference);
|
|
711
|
-
if (referenceType) {
|
|
712
|
-
const HierarchicalReferencesType = addressSpace.findReferenceType("HierarchicalReferences");
|
|
713
|
-
if (referenceType.isSubtypeOf(HierarchicalReferencesType)) {
|
|
714
|
-
(0, node_opcua_assert_1.assert)(reference.isForward);
|
|
715
|
-
const targetNode = reference_impl_1.ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
716
|
-
// Xx dotrace && tracelog(" adding object to map");
|
|
717
|
-
delete _cache._childByNameMap[targetNode.browseName.name.toString()];
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
function _makeReferenceDescription(addressSpace, reference, resultMask) {
|
|
723
|
-
const isForward = reference.isForward;
|
|
724
|
-
const referenceTypeId = reference_impl_1.ReferenceImpl.resolveReferenceType(addressSpace, reference).nodeId;
|
|
725
|
-
(0, node_opcua_assert_1.assert)(referenceTypeId instanceof node_opcua_nodeid_1.NodeId);
|
|
726
|
-
const obj = reference_impl_1.ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
727
|
-
let data = {};
|
|
728
|
-
if (!obj) {
|
|
729
|
-
// cannot find reference node
|
|
730
|
-
data = {
|
|
731
|
-
isForward,
|
|
732
|
-
nodeId: reference.nodeId,
|
|
733
|
-
referenceTypeId: resultMask & node_opcua_data_model_1.ResultMask.ReferenceType ? referenceTypeId : null,
|
|
734
|
-
typeDefinition: null
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
else {
|
|
738
|
-
(0, node_opcua_assert_1.assert)(reference.nodeId, " obj.nodeId");
|
|
739
|
-
data = {
|
|
740
|
-
browseName: resultMask & node_opcua_data_model_1.ResultMask.BrowseName ? (0, node_opcua_data_model_1.coerceQualifiedName)(obj.browseName) : null,
|
|
741
|
-
displayName: resultMask & node_opcua_data_model_1.ResultMask.DisplayName ? (0, node_opcua_data_model_1.coerceLocalizedText)(obj.displayName[0]) : null,
|
|
742
|
-
isForward: resultMask & node_opcua_data_model_1.ResultMask.IsForward ? isForward : false,
|
|
743
|
-
nodeClass: resultMask & node_opcua_data_model_1.ResultMask.NodeClass ? obj.nodeClass : node_opcua_data_model_1.NodeClass.Unspecified,
|
|
744
|
-
nodeId: obj.nodeId,
|
|
745
|
-
referenceTypeId: resultMask & node_opcua_data_model_1.ResultMask.ReferenceType ? referenceTypeId : null,
|
|
746
|
-
typeDefinition: resultMask & node_opcua_data_model_1.ResultMask.TypeDefinition ? obj.typeDefinition : null
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
if (data.typeDefinition === null) {
|
|
750
|
-
data.typeDefinition = new node_opcua_nodeid_1.NodeId();
|
|
751
|
-
}
|
|
752
|
-
const referenceDescription = new node_opcua_types_1.ReferenceDescription(data);
|
|
753
|
-
return referenceDescription;
|
|
754
|
-
}
|
|
755
|
-
function _constructReferenceDescription(addressSpace, references, resultMask) {
|
|
756
|
-
(0, node_opcua_assert_1.assert)(Array.isArray(references));
|
|
757
|
-
return references.map((reference) => _makeReferenceDescription(addressSpace, reference, resultMask));
|
|
758
|
-
}
|
|
759
|
-
exports._constructReferenceDescription = _constructReferenceDescription;
|
|
760
|
-
function BaseNode_remove_backward_reference(reference) {
|
|
761
|
-
const _private = BaseNode_getPrivate(this);
|
|
762
|
-
_remove_HierarchicalReference(this, reference);
|
|
763
|
-
const h = reference.hash;
|
|
764
|
-
if (_private._back_referenceIdx && _private._back_referenceIdx[h]) {
|
|
765
|
-
// note : h may not exist in _back_referenceIdx since we are not indexing
|
|
766
|
-
// _back_referenceIdx to UAObjectType and UAVariableType for performance reasons
|
|
767
|
-
_private._back_referenceIdx[h].dispose();
|
|
768
|
-
delete _private._back_referenceIdx[h];
|
|
769
|
-
}
|
|
770
|
-
reference.dispose();
|
|
771
|
-
}
|
|
772
|
-
exports.BaseNode_remove_backward_reference = BaseNode_remove_backward_reference;
|
|
773
|
-
function BaseNode_add_backward_reference(reference) {
|
|
774
|
-
const _private = BaseNode_getPrivate(this);
|
|
775
|
-
const h = reference.hash;
|
|
776
|
-
(0, node_opcua_assert_1.assert)(typeof h === "string");
|
|
777
|
-
// istanbul ignore next
|
|
778
|
-
if (_private._referenceIdx[h]) {
|
|
779
|
-
// the reference exists already in the forward references
|
|
780
|
-
// this append for instance when the XML NotSetFile has redundant <UAReference>
|
|
781
|
-
// in this case there is nothing to do
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
// istanbul ignore next
|
|
785
|
-
if (_private._back_referenceIdx[h]) {
|
|
786
|
-
const opts = { addressSpace: this.addressSpace };
|
|
787
|
-
warningLog(" Warning !", this.browseName.toString());
|
|
788
|
-
warningLog(" ", reference.toString(opts));
|
|
789
|
-
warningLog(" already found in ===>");
|
|
790
|
-
warningLog(Object.values(_private._back_referenceIdx).map((c) => c.toString(opts)).join("\n"));
|
|
791
|
-
// tslint:disable-next-line:no-console
|
|
792
|
-
warningLog("===>");
|
|
793
|
-
throw new Error("reference exists already in _back_references");
|
|
794
|
-
}
|
|
795
|
-
if (!(0, base_node_impl_1.getReferenceType)(reference)) {
|
|
796
|
-
const stop_here = 1;
|
|
797
|
-
}
|
|
798
|
-
// assert(reference._referenceType instanceof ReferenceType);
|
|
799
|
-
_private._back_referenceIdx[h] = reference;
|
|
800
|
-
_handle_HierarchicalReference(this, reference);
|
|
801
|
-
this._clear_caches();
|
|
802
|
-
}
|
|
803
|
-
exports.BaseNode_add_backward_reference = BaseNode_add_backward_reference;
|
|
804
|
-
//# sourceMappingURL=base_node_private.js.map
|