node-opcua-address-space 2.51.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 +12 -0
- package/LICENSE +20 -0
- package/dist/source/address_space_ts.d.ts +122 -0
- package/dist/source/address_space_ts.js +18 -0
- package/dist/source/address_space_ts.js.map +1 -0
- package/dist/source/continuation_points/continuation_point_manager.d.ts +21 -0
- package/dist/source/continuation_points/continuation_point_manager.js +100 -0
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -0
- package/dist/source/helpers/adjust_browse_direction.d.ts +5 -0
- package/dist/source/helpers/adjust_browse_direction.js +12 -0
- package/dist/source/helpers/adjust_browse_direction.js.map +1 -0
- package/dist/source/helpers/argument_list.d.ts +30 -0
- package/dist/source/helpers/argument_list.js +237 -0
- package/dist/source/helpers/argument_list.js.map +1 -0
- package/dist/source/helpers/call_helpers.d.ts +6 -0
- package/dist/source/helpers/call_helpers.js +71 -0
- package/dist/source/helpers/call_helpers.js.map +1 -0
- package/dist/source/helpers/check_event_clause.d.ts +17 -0
- package/dist/source/helpers/check_event_clause.js +53 -0
- package/dist/source/helpers/check_event_clause.js.map +1 -0
- package/dist/source/helpers/coerce_enum_value.d.ts +6 -0
- package/dist/source/helpers/coerce_enum_value.js +34 -0
- package/dist/source/helpers/coerce_enum_value.js.map +1 -0
- package/dist/source/helpers/dump_tools.d.ts +14 -0
- package/dist/source/helpers/dump_tools.js +79 -0
- package/dist/source/helpers/dump_tools.js.map +1 -0
- package/dist/source/helpers/ensure_secure_access.d.ts +9 -0
- package/dist/source/helpers/ensure_secure_access.js +90 -0
- package/dist/source/helpers/ensure_secure_access.js.map +1 -0
- package/dist/source/helpers/make_optionals_map.d.ts +21 -0
- package/dist/source/helpers/make_optionals_map.js +30 -0
- package/dist/source/helpers/make_optionals_map.js.map +1 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +3 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js +37 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -0
- package/dist/source/index.d.ts +39 -0
- package/dist/source/index.js +62 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +12 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +25 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +21 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +27 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +24 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +17 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +12 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +8 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +11 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +69 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +74 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/state_machine.d.ts +342 -0
- package/dist/source/interfaces/state_machine/state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +18 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +222 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +29 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +6 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +26 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +41 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js +3 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js.map +1 -0
- package/dist/source/interfaces/ua_authorisation_service.d.ts +1 -0
- package/dist/source/interfaces/ua_authorisation_service.js +3 -0
- package/dist/source/interfaces/ua_authorisation_service.js.map +1 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +8 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +10 -0
- package/dist/source/loader/generateAddressSpaceRaw.js +59 -0
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -0
- package/dist/source/loader/load_nodeset2.d.ts +13 -0
- package/dist/source/loader/load_nodeset2.js +1392 -0
- package/dist/source/loader/load_nodeset2.js.map +1 -0
- package/dist/source/loader/namespace_post_step.d.ts +6 -0
- package/dist/source/loader/namespace_post_step.js +48 -0
- package/dist/source/loader/namespace_post_step.js.map +1 -0
- package/dist/source/loader/register_node_promoter.d.ts +3 -0
- package/dist/source/loader/register_node_promoter.js +10 -0
- package/dist/source/loader/register_node_promoter.js.map +1 -0
- package/dist/source/namespace.d.ts +6 -0
- package/dist/source/namespace.js +3 -0
- package/dist/source/namespace.js.map +1 -0
- package/dist/source/namespace_alarm_and_condition.d.ts +24 -0
- package/dist/source/namespace_alarm_and_condition.js +3 -0
- package/dist/source/namespace_alarm_and_condition.js.map +1 -0
- package/dist/source/namespace_data_access.d.ts +42 -0
- package/dist/source/namespace_data_access.js +3 -0
- package/dist/source/namespace_data_access.js.map +1 -0
- package/dist/source/namespace_machine_state.d.ts +7 -0
- package/dist/source/namespace_machine_state.js +3 -0
- package/dist/source/namespace_machine_state.js.map +1 -0
- package/dist/source/pseudo_session.d.ts +55 -0
- package/dist/source/pseudo_session.js +205 -0
- package/dist/source/pseudo_session.js.map +1 -0
- package/dist/source/session_context.d.ts +111 -0
- package/dist/source/session_context.js +266 -0
- package/dist/source/session_context.js.map +1 -0
- package/dist/source/set_namespace_meta_data.d.ts +2 -0
- package/dist/source/set_namespace_meta_data.js +60 -0
- package/dist/source/set_namespace_meta_data.js.map +1 -0
- package/dist/source/ua_namespace_meta_data_type.d.ts +71 -0
- package/dist/source/ua_namespace_meta_data_type.js +3 -0
- package/dist/source/ua_namespace_meta_data_type.js.map +1 -0
- package/dist/source/ua_root_folder.d.ts +9 -0
- package/dist/source/ua_root_folder.js +3 -0
- package/dist/source/ua_root_folder.js.map +1 -0
- package/dist/source/ua_two_state_variable_ex.d.ts +23 -0
- package/dist/source/ua_two_state_variable_ex.js +3 -0
- package/dist/source/ua_two_state_variable_ex.js.map +1 -0
- package/dist/source/xml_writer.d.ts +9 -0
- package/dist/source/xml_writer.js +3 -0
- package/dist/source/xml_writer.js.map +1 -0
- package/dist/src/address_space.d.ts +393 -0
- package/dist/src/address_space.js +1375 -0
- package/dist/src/address_space.js.map +1 -0
- package/dist/src/address_space_change_event_tools.d.ts +6 -0
- package/dist/src/address_space_change_event_tools.js +150 -0
- package/dist/src/address_space_change_event_tools.js.map +1 -0
- package/dist/src/address_space_private.d.ts +44 -0
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -0
- package/dist/src/alarms_and_conditions/base_event_type.d.ts +26 -0
- package/dist/src/alarms_and_conditions/base_event_type.js +41 -0
- package/dist/src/alarms_and_conditions/base_event_type.js.map +1 -0
- package/dist/src/alarms_and_conditions/check_where_clause.d.ts +4 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js +110 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition.d.ts +5 -0
- package/dist/src/alarms_and_conditions/condition.js +81 -0
- package/dist/src/alarms_and_conditions/condition.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_info.d.ts +27 -0
- package/dist/src/alarms_and_conditions/condition_info.js +55 -0
- package/dist/src/alarms_and_conditions/condition_info.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +232 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js +667 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +21 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +47 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +10 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js +90 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js.map +1 -0
- package/dist/src/alarms_and_conditions/index.d.ts +18 -0
- package/dist/src/alarms_and_conditions/index.js +31 -0
- package/dist/src/alarms_and_conditions/index.js.map +1 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +22 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js +241 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +1 -0
- package/dist/src/alarms_and_conditions/trip_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js +21 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +54 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +255 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +62 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +138 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +460 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +118 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +417 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +29 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +39 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +35 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +32 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +21 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +26 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +191 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js +1029 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +182 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1021 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +11 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +17 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +24 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +59 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +57 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +14 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +17 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +9 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +12 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +22 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +38 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +6 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +11 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +76 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js +237 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +98 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +233 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +62 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +51 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +49 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +176 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +25 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +163 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +47 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +151 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +39 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +136 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/apply_condition_refresh.d.ts +6 -0
- package/dist/src/apply_condition_refresh.js +28 -0
- package/dist/src/apply_condition_refresh.js.map +1 -0
- package/dist/src/base_node.d.ts +279 -0
- package/dist/src/base_node.js +1364 -0
- package/dist/src/base_node.js.map +1 -0
- package/dist/src/base_node_impl.d.ts +281 -0
- package/dist/src/base_node_impl.js +1394 -0
- package/dist/src/base_node_impl.js.map +1 -0
- package/dist/src/base_node_private.d.ts +61 -0
- package/dist/src/base_node_private.js +521 -0
- package/dist/src/base_node_private.js.map +1 -0
- package/dist/src/data_access/add_dataItem_stuff.d.ts +11 -0
- package/dist/src/data_access/add_dataItem_stuff.js +62 -0
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +35 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_analog_item.d.ts +13 -0
- package/dist/src/data_access/ua_analog_item.js +37 -0
- package/dist/src/data_access/ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_data_item.d.ts +16 -0
- package/dist/src/data_access/ua_data_item.js +66 -0
- package/dist/src/data_access/ua_data_item.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete.d.ts +23 -0
- package/dist/src/data_access/ua_multistate_discrete.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +32 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -0
- package/dist/src/data_access/ua_multistate_value_discrete.d.ts +51 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js +249 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/src/data_access/ua_two_state_discrete.d.ts +25 -0
- package/dist/src/data_access/ua_two_state_discrete.js +154 -0
- package/dist/src/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/src/event_data.d.ts +29 -0
- package/dist/src/event_data.js +96 -0
- package/dist/src/event_data.js.map +1 -0
- package/dist/src/extension_object_array_node.d.ts +61 -0
- package/dist/src/extension_object_array_node.js +266 -0
- package/dist/src/extension_object_array_node.js.map +1 -0
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +26 -0
- package/dist/src/historical_access/address_space_historical_data_node.js +662 -0
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -0
- package/dist/src/index_current.d.ts +42 -0
- package/dist/src/index_current.js +71 -0
- package/dist/src/index_current.js.map +1 -0
- package/dist/src/namespace.d.ts +475 -0
- package/dist/src/namespace.js +1775 -0
- package/dist/src/namespace.js.map +1 -0
- package/dist/src/namespace_impl.d.ts +463 -0
- package/dist/src/namespace_impl.js +1763 -0
- package/dist/src/namespace_impl.js.map +1 -0
- package/dist/src/namespace_private.d.ts +21 -0
- package/dist/src/namespace_private.js +29 -0
- package/dist/src/namespace_private.js.map +1 -0
- package/dist/src/nodeid_manager.d.ts +36 -0
- package/dist/src/nodeid_manager.js +196 -0
- package/dist/src/nodeid_manager.js.map +1 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +2 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js +14 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +1 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +39 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js +1155 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js +147 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -0
- package/dist/src/reference.d.ts +43 -0
- package/dist/src/reference.js +138 -0
- package/dist/src/reference.js.map +1 -0
- package/dist/src/reference_impl.d.ts +43 -0
- package/dist/src/reference_impl.js +138 -0
- package/dist/src/reference_impl.js.map +1 -0
- package/dist/src/role_permissions.d.ts +2 -0
- package/dist/src/role_permissions.js +11 -0
- package/dist/src/role_permissions.js.map +1 -0
- package/dist/src/session_context.d.ts +4 -0
- package/dist/src/session_context.js +9 -0
- package/dist/src/session_context.js.map +1 -0
- package/dist/src/state_machine/finite_state_machine.d.ts +67 -0
- package/dist/src/state_machine/finite_state_machine.js +354 -0
- package/dist/src/state_machine/finite_state_machine.js.map +1 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +34 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +244 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
- package/dist/src/state_machine/ua_two_state_variable.d.ts +61 -0
- package/dist/src/state_machine/ua_two_state_variable.js +332 -0
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/src/tool_isSupertypeOf.d.ts +17 -0
- package/dist/src/tool_isSupertypeOf.js +103 -0
- package/dist/src/tool_isSupertypeOf.js.map +1 -0
- package/dist/src/ua_condition_type.d.ts +8 -0
- package/dist/src/ua_condition_type.js +3 -0
- package/dist/src/ua_condition_type.js.map +1 -0
- package/dist/src/ua_data_type.d.ts +83 -0
- package/dist/src/ua_data_type.js +289 -0
- package/dist/src/ua_data_type.js.map +1 -0
- package/dist/src/ua_data_type_impl.d.ts +83 -0
- package/dist/src/ua_data_type_impl.js +291 -0
- package/dist/src/ua_data_type_impl.js.map +1 -0
- package/dist/src/ua_method.d.ts +42 -0
- package/dist/src/ua_method.js +204 -0
- package/dist/src/ua_method.js.map +1 -0
- package/dist/src/ua_method_impl.d.ts +40 -0
- package/dist/src/ua_method_impl.js +203 -0
- package/dist/src/ua_method_impl.js.map +1 -0
- package/dist/src/ua_object.d.ts +29 -0
- package/dist/src/ua_object.js +153 -0
- package/dist/src/ua_object.js.map +1 -0
- package/dist/src/ua_object_impl.d.ts +29 -0
- package/dist/src/ua_object_impl.js +156 -0
- package/dist/src/ua_object_impl.js.map +1 -0
- package/dist/src/ua_object_type.d.ts +49 -0
- package/dist/src/ua_object_type.js +124 -0
- package/dist/src/ua_object_type.js.map +1 -0
- package/dist/src/ua_object_type_impl.d.ts +48 -0
- package/dist/src/ua_object_type_impl.js +124 -0
- package/dist/src/ua_object_type_impl.js.map +1 -0
- package/dist/src/ua_reference_type.d.ts +42 -0
- package/dist/src/ua_reference_type.js +138 -0
- package/dist/src/ua_reference_type.js.map +1 -0
- package/dist/src/ua_reference_type_impl.d.ts +43 -0
- package/dist/src/ua_reference_type_impl.js +138 -0
- package/dist/src/ua_reference_type_impl.js.map +1 -0
- package/dist/src/ua_variable.d.ts +346 -0
- package/dist/src/ua_variable.js +1721 -0
- package/dist/src/ua_variable.js.map +1 -0
- package/dist/src/ua_variable_impl.d.ts +353 -0
- package/dist/src/ua_variable_impl.js +1719 -0
- package/dist/src/ua_variable_impl.js.map +1 -0
- package/dist/src/ua_variable_type.d.ts +54 -0
- package/dist/src/ua_variable_type.js +555 -0
- package/dist/src/ua_variable_type.js.map +1 -0
- package/dist/src/ua_variable_type_impl.d.ts +63 -0
- package/dist/src/ua_variable_type_impl.js +556 -0
- package/dist/src/ua_variable_type_impl.js.map +1 -0
- package/dist/src/ua_view.d.ts +16 -0
- package/dist/src/ua_view.js +42 -0
- package/dist/src/ua_view.js.map +1 -0
- package/dist/src/ua_view_impl.d.ts +15 -0
- package/dist/src/ua_view_impl.js +37 -0
- package/dist/src/ua_view_impl.js.map +1 -0
- package/distHelpers/add_event_generator_object.d.ts +3 -0
- package/distHelpers/add_event_generator_object.js +66 -0
- package/distHelpers/add_event_generator_object.js.map +1 -0
- package/distHelpers/alarms_and_conditions_demo.d.ts +10 -0
- package/distHelpers/alarms_and_conditions_demo.js +115 -0
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -0
- package/distHelpers/assertHasMatchingReference.d.ts +19 -0
- package/distHelpers/assertHasMatchingReference.js +41 -0
- package/distHelpers/assertHasMatchingReference.js.map +1 -0
- package/distHelpers/boiler_system.d.ts +113 -0
- package/distHelpers/boiler_system.js +397 -0
- package/distHelpers/boiler_system.js.map +1 -0
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +5 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js +171 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -0
- package/distHelpers/dump_statemachine.d.ts +6 -0
- package/distHelpers/dump_statemachine.js +116 -0
- package/distHelpers/dump_statemachine.js.map +1 -0
- package/distHelpers/get_address_space_fixture.d.ts +1 -0
- package/distHelpers/get_address_space_fixture.js +31 -0
- package/distHelpers/get_address_space_fixture.js.map +1 -0
- package/distHelpers/get_mini_address_space.d.ts +7 -0
- package/distHelpers/get_mini_address_space.js +37 -0
- package/distHelpers/get_mini_address_space.js.map +1 -0
- package/distHelpers/index.d.ts +11 -0
- package/distHelpers/index.js +24 -0
- package/distHelpers/index.js.map +1 -0
- package/distNodeJS/generate_address_space.d.ts +4 -0
- package/distNodeJS/generate_address_space.js +31 -0
- package/distNodeJS/generate_address_space.js.map +1 -0
- package/distNodeJS/index.d.ts +1 -0
- package/distNodeJS/index.js +14 -0
- package/distNodeJS/index.js.map +1 -0
- package/generate.js +1 -0
- package/nodeJS.d.ts +1 -0
- package/nodeJS.js +1 -0
- package/package.json +87 -0
- package/source/address_space_ts.ts +217 -0
- package/source/continuation_points/continuation_point_manager.ts +121 -0
- package/source/helpers/adjust_browse_direction.ts +15 -0
- package/source/helpers/argument_list.ts +286 -0
- package/source/helpers/call_helpers.ts +112 -0
- package/source/helpers/check_event_clause.ts +62 -0
- package/source/helpers/coerce_enum_value.ts +33 -0
- package/source/helpers/dump_tools.ts +92 -0
- package/source/helpers/ensure_secure_access.ts +88 -0
- package/source/helpers/make_optionals_map.ts +49 -0
- package/source/helpers/resolve_opaque_on_address_space.ts +23 -0
- package/source/index.ts +49 -0
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +13 -0
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +26 -0
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +34 -0
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +14 -0
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +10 -0
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +14 -0
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +13 -0
- package/source/interfaces/state_machine/ua_state_machine_type.ts +261 -0
- package/source/interfaces/state_machine/ua_transition_ex.ts +7 -0
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +8 -0
- package/source/loader/generateAddressSpaceRaw.ts +79 -0
- package/source/loader/load_nodeset2.ts +1600 -0
- package/source/loader/namespace_post_step.ts +36 -0
- package/source/loader/register_node_promoter.ts +8 -0
- package/source/namespace.ts +9 -0
- package/source/namespace_alarm_and_condition.ts +47 -0
- package/source/namespace_data_access.ts +60 -0
- package/source/namespace_machine_state.ts +13 -0
- package/source/pseudo_session.ts +288 -0
- package/source/session_context.ts +345 -0
- package/source/set_namespace_meta_data.ts +68 -0
- package/source/ua_root_folder.ts +10 -0
- package/source/ua_two_state_variable_ex.ts +35 -0
- package/source/xml_writer.ts +15 -0
- package/source_nodejs/generate_address_space.ts +36 -0
- package/source_nodejs/index.ts +1 -0
- package/src/address_space.ts +1575 -0
- package/src/address_space_change_event_tools.ts +177 -0
- package/src/address_space_private.ts +98 -0
- package/src/alarms_and_conditions/check_where_clause.ts +148 -0
- package/src/alarms_and_conditions/condition.ts +89 -0
- package/src/alarms_and_conditions/condition_info.ts +66 -0
- package/src/alarms_and_conditions/condition_snapshot.ts +766 -0
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +66 -0
- package/src/alarms_and_conditions/extract_event_fields.ts +104 -0
- package/src/alarms_and_conditions/index.ts +18 -0
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +339 -0
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +513 -0
- package/src/alarms_and_conditions/ua_base_event_impl.ts +55 -0
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +50 -0
- package/src/alarms_and_conditions/ua_condition_impl.ts +1298 -0
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +81 -0
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +110 -0
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +19 -0
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +130 -0
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +24 -0
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +305 -0
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +108 -0
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +224 -0
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +186 -0
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +27 -0
- package/src/apply_condition_refresh.ts +30 -0
- package/src/base_node_impl.ts +1749 -0
- package/src/base_node_private.ts +690 -0
- package/src/data_access/add_dataItem_stuff.ts +75 -0
- package/src/data_access/check_variant_compatibility_ua_analog_item.ts +41 -0
- package/src/data_access/ua_multistate_discrete_impl.ts +168 -0
- package/src/data_access/ua_multistate_value_discrete.ts +299 -0
- package/src/data_access/ua_two_state_discrete.ts +185 -0
- package/src/event_data.ts +117 -0
- package/src/extension_object_array_node.ts +325 -0
- package/src/historical_access/address_space_historical_data_node.ts +828 -0
- package/src/index_current.ts +52 -0
- package/src/namespace_impl.ts +2181 -0
- package/src/namespace_private.ts +60 -0
- package/src/nodeid_manager.ts +228 -0
- package/src/nodeset_tools/adjust_namespace_array.ts +11 -0
- package/src/nodeset_tools/construct_namespace_dependency.ts +40 -0
- package/src/nodeset_tools/nodeset_to_xml.ts +1317 -0
- package/src/nodeset_tools/typedictionary_to_xml.ts +175 -0
- package/src/reference_impl.ts +169 -0
- package/src/role_permissions.ts +6 -0
- package/src/state_machine/finite_state_machine.ts +428 -0
- package/src/state_machine/ua_shelving_state_machine_ex.ts +314 -0
- package/src/state_machine/ua_two_state_variable.ts +421 -0
- package/src/tool_isSupertypeOf.ts +129 -0
- package/src/ua_condition_type.ts +10 -0
- package/src/ua_data_type_impl.ts +356 -0
- package/src/ua_method_impl.ts +278 -0
- package/src/ua_object_impl.ts +203 -0
- package/src/ua_object_type_impl.ts +158 -0
- package/src/ua_reference_type_impl.ts +174 -0
- package/src/ua_variable_impl.ts +2277 -0
- package/src/ua_variable_type_impl.ts +741 -0
- package/src/ua_view_impl.ts +54 -0
- package/testHelpers.d.ts +1 -0
- package/testHelpers.js +1 -0
- package/test_helpers/add_event_generator_object.ts +71 -0
- package/test_helpers/alarms_and_conditions_demo.ts +147 -0
- package/test_helpers/assertHasMatchingReference.ts +43 -0
- package/test_helpers/boiler_system.ts +618 -0
- package/test_helpers/create_minimalist_address_space_nodeset.ts +208 -0
- package/test_helpers/dump_statemachine.ts +155 -0
- package/test_helpers/get_address_space_fixture.ts +30 -0
- package/test_helpers/get_mini_address_space.ts +42 -0
- package/test_helpers/index.ts +11 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +136 -0
- package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -0
- package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -0
- package/test_helpers/test_fixtures/dataType_with_structures.xml +605 -0
- package/test_helpers/test_fixtures/dataType_with_union.xml +1 -0
- package/test_helpers/test_fixtures/datatype_as_per_1.04.xml +91 -0
- package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -0
- package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1303 -0
- package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -0
- package/test_helpers/test_fixtures/issue_846.xml +3172 -0
- package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +33 -0
- package/test_helpers/test_fixtures/mini.Node.Set2.xml +4508 -0
- package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -0
- package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -0
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.Private
|
|
3
|
+
*/
|
|
4
|
+
// tslint:disable:no-bitwise
|
|
5
|
+
import * as chalk from "chalk";
|
|
6
|
+
import { assert } from "node-opcua-assert";
|
|
7
|
+
import {
|
|
8
|
+
AccessLevelFlag,
|
|
9
|
+
BrowseDirection,
|
|
10
|
+
coerceLocalizedText,
|
|
11
|
+
coerceQualifiedName,
|
|
12
|
+
LocalizedText,
|
|
13
|
+
NodeClass,
|
|
14
|
+
ResultMask
|
|
15
|
+
} from "node-opcua-data-model";
|
|
16
|
+
import { make_warningLog } from "node-opcua-debug";
|
|
17
|
+
import { NodeId, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
18
|
+
import { ReferenceDescription } from "node-opcua-types";
|
|
19
|
+
import {
|
|
20
|
+
IAddressSpace,
|
|
21
|
+
UADataType,
|
|
22
|
+
UAReferenceType,
|
|
23
|
+
ConstructNodeIdOptions,
|
|
24
|
+
CloneExtraInfo,
|
|
25
|
+
CloneFilter,
|
|
26
|
+
BaseNode,
|
|
27
|
+
UAVariable,
|
|
28
|
+
UAMethod,
|
|
29
|
+
UAObject,
|
|
30
|
+
UAObjectType,
|
|
31
|
+
UAVariableType,
|
|
32
|
+
ISessionContext,
|
|
33
|
+
UAReference,
|
|
34
|
+
CloneOptions
|
|
35
|
+
} from "node-opcua-address-space-base";
|
|
36
|
+
import { DataValue } from "node-opcua-data-value";
|
|
37
|
+
|
|
38
|
+
import { UANamespace_process_modelling_rule } from "./namespace_private";
|
|
39
|
+
import { ReferenceImpl } from "./reference_impl";
|
|
40
|
+
import { BaseNodeImpl, getReferenceType } from "./base_node_impl";
|
|
41
|
+
import { AddressSpacePrivate } from "./address_space_private";
|
|
42
|
+
import { UAObjectImpl } from "./ua_object_impl";
|
|
43
|
+
|
|
44
|
+
const g_weakMap = new WeakMap();
|
|
45
|
+
|
|
46
|
+
const warningLog = make_warningLog(__filename);
|
|
47
|
+
|
|
48
|
+
interface BaseNodeCache {
|
|
49
|
+
__address_space: IAddressSpace | null;
|
|
50
|
+
_browseFilter?: (this: BaseNode, context?: ISessionContext) => boolean;
|
|
51
|
+
_cache: any;
|
|
52
|
+
_description?: LocalizedText;
|
|
53
|
+
_displayName: LocalizedText[];
|
|
54
|
+
_parent?: BaseNode | null;
|
|
55
|
+
|
|
56
|
+
_back_referenceIdx: { [key: string]: UAReference };
|
|
57
|
+
_referenceIdx: { [key: string]: UAReference };
|
|
58
|
+
|
|
59
|
+
_subtype_idxVersion: number;
|
|
60
|
+
_subtype_idx: any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function BaseNode_initPrivate(self: BaseNode): BaseNodeCache {
|
|
64
|
+
const _private: BaseNodeCache = {
|
|
65
|
+
__address_space: null,
|
|
66
|
+
|
|
67
|
+
_referenceIdx: {},
|
|
68
|
+
_back_referenceIdx: {},
|
|
69
|
+
|
|
70
|
+
_browseFilter: undefined,
|
|
71
|
+
_cache: {},
|
|
72
|
+
_description: undefined,
|
|
73
|
+
_displayName: [],
|
|
74
|
+
_parent: undefined,
|
|
75
|
+
_subtype_idx: {},
|
|
76
|
+
_subtype_idxVersion: 0
|
|
77
|
+
};
|
|
78
|
+
g_weakMap.set(self, _private);
|
|
79
|
+
return _private;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function BaseNode_removePrivate(self: BaseNode): void {
|
|
83
|
+
// there is no need to delete object from weak map
|
|
84
|
+
// the GC will take care of this in due course
|
|
85
|
+
// g_weakMap.delete(self);
|
|
86
|
+
const _private = BaseNode_getPrivate(self);
|
|
87
|
+
_private._cache = {};
|
|
88
|
+
_private.__address_space = null;
|
|
89
|
+
_private._back_referenceIdx = {};
|
|
90
|
+
_private._referenceIdx = {};
|
|
91
|
+
_private._description = undefined;
|
|
92
|
+
_private._displayName = [];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function BaseNode_getPrivate(self: BaseNode): BaseNodeCache {
|
|
96
|
+
return g_weakMap.get(self);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function BaseNode_getCache(node: BaseNode): any {
|
|
100
|
+
return BaseNode_getPrivate(node)._cache;
|
|
101
|
+
}
|
|
102
|
+
export function BaseNode_clearCache(node: BaseNode): void {
|
|
103
|
+
const _private = BaseNode_getPrivate(node);
|
|
104
|
+
if (_private && _private._cache) {
|
|
105
|
+
_private._cache = {};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const hasTypeDefinition_ReferenceTypeNodeId = resolveNodeId("HasTypeDefinition");
|
|
109
|
+
|
|
110
|
+
export interface ToStringOption {
|
|
111
|
+
level: number;
|
|
112
|
+
cycleDetector: any;
|
|
113
|
+
padding: string;
|
|
114
|
+
|
|
115
|
+
add(someLine: string): void;
|
|
116
|
+
indent(a: string, b: string | null): void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export class ToStringBuilder implements ToStringOption {
|
|
120
|
+
public level = 0;
|
|
121
|
+
public cycleDetector: any = {};
|
|
122
|
+
public padding = "";
|
|
123
|
+
|
|
124
|
+
private str: string[] = [];
|
|
125
|
+
|
|
126
|
+
constructor() {
|
|
127
|
+
//
|
|
128
|
+
this.str = [];
|
|
129
|
+
}
|
|
130
|
+
public add(line: string): void {
|
|
131
|
+
this.str.push(line);
|
|
132
|
+
}
|
|
133
|
+
public toString(): string {
|
|
134
|
+
return this.str.join("\n");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
public indent(str: string, padding: string | null): string {
|
|
138
|
+
padding = padding || " ";
|
|
139
|
+
return str
|
|
140
|
+
.split("\n")
|
|
141
|
+
.map((r) => {
|
|
142
|
+
return padding + r;
|
|
143
|
+
})
|
|
144
|
+
.join("\n");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function set_as_processed(options: ToStringOption, nodeId: NodeId) {
|
|
149
|
+
options.cycleDetector[nodeId.toString()] = nodeId;
|
|
150
|
+
}
|
|
151
|
+
function is_already_processed(options: ToStringOption, nodeId: NodeId): boolean {
|
|
152
|
+
return !!options.cycleDetector[nodeId.toString()];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function BaseNode_toString(this: BaseNode, options: ToStringOption): void {
|
|
156
|
+
options.level = options.level || 1;
|
|
157
|
+
|
|
158
|
+
set_as_processed(options, this.nodeId);
|
|
159
|
+
|
|
160
|
+
options.add("");
|
|
161
|
+
options.add(options.padding + chalk.yellow(" nodeId : ") + this.nodeId.toString());
|
|
162
|
+
options.add(
|
|
163
|
+
options.padding + chalk.yellow(" nodeClass : ") + NodeClass[this.nodeClass] + " (" + this.nodeClass + ")"
|
|
164
|
+
);
|
|
165
|
+
options.add(options.padding + chalk.yellow(" browseName : ") + this.browseName.toString());
|
|
166
|
+
options.add(
|
|
167
|
+
options.padding +
|
|
168
|
+
chalk.yellow(" displayName : ") +
|
|
169
|
+
this.displayName.map((f) => f.locale + " " + f.text).join(" | ")
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
options.add(
|
|
173
|
+
options.padding + chalk.yellow(" description : ") + (this.description ? this.description.toString() : "")
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function BaseNode_References_toString(this: BaseNode, options: ToStringOption): void {
|
|
178
|
+
const _private = BaseNode_getPrivate(this);
|
|
179
|
+
|
|
180
|
+
const displayOptions = {
|
|
181
|
+
addressSpace: this.addressSpace
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const addressSpace = this.addressSpace;
|
|
185
|
+
|
|
186
|
+
options.add(
|
|
187
|
+
options.padding + chalk.yellow(" references : ") + " length =" + Object.keys(_private._referenceIdx).length
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
function dump_reference(follow: boolean, reference: UAReference | null) {
|
|
191
|
+
if (!reference) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
const o = ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
195
|
+
const name = o ? o.browseName.toString() : "<???>";
|
|
196
|
+
options.add(
|
|
197
|
+
options.padding + chalk.yellow(" +-> ") + reference.toString(displayOptions) + " " + chalk.cyan(name)
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
// ignore HasTypeDefinition as it has been already handled
|
|
201
|
+
if (sameNodeId(reference.referenceType, hasTypeDefinition_ReferenceTypeNodeId) && reference.nodeId.namespace === 0) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (o) {
|
|
205
|
+
if (!is_already_processed(options, o.nodeId)) {
|
|
206
|
+
set_as_processed(options, o.nodeId);
|
|
207
|
+
if (options.level > 1 && follow) {
|
|
208
|
+
const rr = (o as any).toString({
|
|
209
|
+
cycleDetector: options.cycleDetector,
|
|
210
|
+
level: options.level - 1,
|
|
211
|
+
padding: options.padding + " "
|
|
212
|
+
});
|
|
213
|
+
options.add(rr);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// direct reference
|
|
220
|
+
(Object.values(_private._referenceIdx) as UAReference[]).forEach(dump_reference.bind(null, true));
|
|
221
|
+
|
|
222
|
+
const br = Object.values(_private._back_referenceIdx).map((x) => x);
|
|
223
|
+
|
|
224
|
+
options.add(
|
|
225
|
+
options.padding +
|
|
226
|
+
chalk.yellow(" back_references : ") +
|
|
227
|
+
chalk.cyan(" length =") +
|
|
228
|
+
br.length +
|
|
229
|
+
chalk.grey(" ( references held by other nodes involving this node)")
|
|
230
|
+
);
|
|
231
|
+
// backward reference
|
|
232
|
+
br.forEach(dump_reference.bind(null, false));
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function _UAType_toString(this: UAReferenceType | UADataType | UAObjectType | UAVariableType, options: ToStringOption): void {
|
|
236
|
+
if (this.subtypeOfObj) {
|
|
237
|
+
options.add(
|
|
238
|
+
options.padding +
|
|
239
|
+
chalk.yellow(" subtypeOf : ") +
|
|
240
|
+
this.subtypeOfObj.browseName.toString() +
|
|
241
|
+
" (" +
|
|
242
|
+
this.subtypeOfObj.nodeId.toString() +
|
|
243
|
+
")"
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function _UAInstance_toString(this: UAVariable | UAMethod | UAObject, options: ToStringOption): void {
|
|
249
|
+
if (this.typeDefinitionObj) {
|
|
250
|
+
options.add(
|
|
251
|
+
options.padding +
|
|
252
|
+
chalk.yellow(" typeDefinition : ") +
|
|
253
|
+
this.typeDefinitionObj.browseName.toString() +
|
|
254
|
+
" (" +
|
|
255
|
+
this.typeDefinitionObj.nodeId.toString() +
|
|
256
|
+
")"
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function UAVariableType_toString(this: UAVariableType, options: ToStringOption): void {
|
|
262
|
+
BaseNode_toString.call(this, options);
|
|
263
|
+
_UAType_toString.call(this, options);
|
|
264
|
+
VariableOrVariableType_toString.call(this, options);
|
|
265
|
+
BaseNode_References_toString.call(this, options);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export function UAVariable_toString(this: UAVariable, options: ToStringOption): void {
|
|
269
|
+
BaseNode_toString.call(this, options);
|
|
270
|
+
_UAInstance_toString.call(this, options);
|
|
271
|
+
VariableOrVariableType_toString.call(this, options);
|
|
272
|
+
AccessLevelFlags_toString.call(this, options);
|
|
273
|
+
BaseNode_References_toString.call(this, options);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function UAObject_toString(this: UAObject, options: ToStringOption): void {
|
|
277
|
+
BaseNode_toString.call(this, options);
|
|
278
|
+
_UAInstance_toString.call(this, options);
|
|
279
|
+
BaseNode_References_toString.call(this, options);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export function UAObjectType_toString(this: UAObjectType, options: ToStringOption): void {
|
|
283
|
+
BaseNode_toString.call(this, options);
|
|
284
|
+
_UAType_toString.call(this, options);
|
|
285
|
+
BaseNode_References_toString.call(this, options);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function valueRankToString(valueRank: number): string {
|
|
289
|
+
switch (valueRank) {
|
|
290
|
+
case 1:
|
|
291
|
+
return "OneDimension (1)";
|
|
292
|
+
case 0:
|
|
293
|
+
return "OneOrMoreDimensions (0)"; // The value is an array with one or more dimensions
|
|
294
|
+
case -1:
|
|
295
|
+
return "Scalar (-1)";
|
|
296
|
+
case -2:
|
|
297
|
+
return "Any (-2)"; // The value can be a scalar or an array with any number of dimensions
|
|
298
|
+
case -3:
|
|
299
|
+
return "ScalarOrOneDimension (2)"; // The value can be a scalar or a one dimensional array.
|
|
300
|
+
default:
|
|
301
|
+
if (valueRank > 0) {
|
|
302
|
+
return "" + valueRank + "-Dimensions";
|
|
303
|
+
} else {
|
|
304
|
+
return "Invalid (" + valueRank + ")";
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function accessLevelFlagToString(flag: AccessLevelFlag): string {
|
|
310
|
+
const str: string[] = [];
|
|
311
|
+
if (flag & AccessLevelFlag.CurrentRead) {
|
|
312
|
+
str.push("CurrentRead");
|
|
313
|
+
}
|
|
314
|
+
if (flag & AccessLevelFlag.CurrentWrite) {
|
|
315
|
+
str.push("CurrentWrite");
|
|
316
|
+
}
|
|
317
|
+
if (flag & AccessLevelFlag.HistoryRead) {
|
|
318
|
+
str.push("HistoryRead");
|
|
319
|
+
}
|
|
320
|
+
if (flag & AccessLevelFlag.HistoryWrite) {
|
|
321
|
+
str.push("HistoryWrite");
|
|
322
|
+
}
|
|
323
|
+
if (flag & AccessLevelFlag.SemanticChange) {
|
|
324
|
+
str.push("SemanticChange");
|
|
325
|
+
}
|
|
326
|
+
if (flag & AccessLevelFlag.StatusWrite) {
|
|
327
|
+
str.push("StatusWrite");
|
|
328
|
+
}
|
|
329
|
+
if (flag & AccessLevelFlag.TimestampWrite) {
|
|
330
|
+
str.push("TimestampWrite");
|
|
331
|
+
}
|
|
332
|
+
return str.join(" | ");
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function AccessLevelFlags_toString(this: UAVariable, options: ToStringOption) {
|
|
336
|
+
assert(options);
|
|
337
|
+
options.add(
|
|
338
|
+
options.padding + chalk.yellow(" accessLevel : ") + " " + accessLevelFlagToString(this.accessLevel)
|
|
339
|
+
);
|
|
340
|
+
if (this.userAccessLevel !== undefined) {
|
|
341
|
+
options.add(
|
|
342
|
+
options.padding + chalk.yellow(" userAccessLevel : ") + " " + accessLevelFlagToString(this.userAccessLevel)
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
export function VariableOrVariableType_toString(this: UAVariableType | UAVariable, options: ToStringOption): void {
|
|
347
|
+
assert(options);
|
|
348
|
+
if (this.dataType) {
|
|
349
|
+
const addressSpace = this.addressSpace;
|
|
350
|
+
const d = addressSpace.findNode(this.dataType);
|
|
351
|
+
const n = d ? "(" + d.browseName.toString() + ")" : " (???)";
|
|
352
|
+
options.add(options.padding + chalk.yellow(" dataType : ") + this.dataType + " " + n);
|
|
353
|
+
}
|
|
354
|
+
if (this.nodeClass === NodeClass.Variable) {
|
|
355
|
+
const _dataValue = (<any>this)._dataValue as DataValue | undefined;
|
|
356
|
+
if (_dataValue) {
|
|
357
|
+
options.add(
|
|
358
|
+
options.padding +
|
|
359
|
+
chalk.yellow(" value : ") +
|
|
360
|
+
"\n" +
|
|
361
|
+
options.indent(_dataValue.toString(), options.padding + " | ")
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (Object.prototype.hasOwnProperty.call(this, "valueRank")) {
|
|
367
|
+
if (this.valueRank !== undefined) {
|
|
368
|
+
options.add(
|
|
369
|
+
options.padding + chalk.yellow(" valueRank : ") + " " + valueRankToString(this.valueRank)
|
|
370
|
+
);
|
|
371
|
+
} else {
|
|
372
|
+
options.add(options.padding + chalk.yellow(" valueRank : ") + " undefined");
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (this.minimumSamplingInterval !== undefined) {
|
|
376
|
+
options.add(
|
|
377
|
+
options.padding +
|
|
378
|
+
chalk.yellow(" minimumSamplingInterval : ") +
|
|
379
|
+
" " +
|
|
380
|
+
this.minimumSamplingInterval.toString() +
|
|
381
|
+
" ms"
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
if (this.arrayDimensions) {
|
|
385
|
+
options.add(
|
|
386
|
+
options.padding +
|
|
387
|
+
chalk.yellow(" arrayDimension : ") +
|
|
388
|
+
" [" +
|
|
389
|
+
this.arrayDimensions.join(",").toString() +
|
|
390
|
+
" ]"
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* clone properties and methods
|
|
397
|
+
* @private
|
|
398
|
+
*/
|
|
399
|
+
function _clone_collection_new(
|
|
400
|
+
newParent: BaseNode,
|
|
401
|
+
collectionRef: UAReference[],
|
|
402
|
+
copyAlsoModellingRules: boolean,
|
|
403
|
+
optionalFilter?: CloneFilter,
|
|
404
|
+
extraInfo?: CloneExtraInfo
|
|
405
|
+
): void {
|
|
406
|
+
const namespace = newParent.namespace;
|
|
407
|
+
|
|
408
|
+
const addressSpace = newParent.addressSpace;
|
|
409
|
+
assert(!optionalFilter || (typeof optionalFilter.shouldKeep === "function" && typeof optionalFilter.filterFor === "function"));
|
|
410
|
+
|
|
411
|
+
for (const reference of collectionRef) {
|
|
412
|
+
const node: BaseNode = ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
413
|
+
|
|
414
|
+
// ensure node is of the correct type,
|
|
415
|
+
// it may happen that the xml nodeset2 file was malformed
|
|
416
|
+
|
|
417
|
+
// istanbul ignore next
|
|
418
|
+
if (typeof (node as any).clone !== "function") {
|
|
419
|
+
// tslint:disable-next-line:no-console
|
|
420
|
+
warningLog(
|
|
421
|
+
chalk.red("Warning : cannot clone node ") +
|
|
422
|
+
node.browseName.toString() +
|
|
423
|
+
" of class " +
|
|
424
|
+
NodeClass[node.nodeClass].toString() +
|
|
425
|
+
" while cloning " +
|
|
426
|
+
newParent.browseName.toString()
|
|
427
|
+
);
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (optionalFilter && node && !optionalFilter.shouldKeep(node)) {
|
|
432
|
+
continue; // skip this node
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
assert(reference.isForward);
|
|
436
|
+
assert(reference.referenceType instanceof NodeId, "" + reference.referenceType.toString());
|
|
437
|
+
const options = {
|
|
438
|
+
namespace,
|
|
439
|
+
references: [new ReferenceImpl({ referenceType: reference.referenceType, isForward: false, nodeId: newParent.nodeId })],
|
|
440
|
+
copyAlsoModellingRules
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
const clone = (node as UAVariable | UAMethod | UAObject).clone(options, optionalFilter, extraInfo);
|
|
444
|
+
|
|
445
|
+
if (extraInfo) {
|
|
446
|
+
extraInfo.registerClonedObject(node, clone);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export function _clone_children_references(
|
|
452
|
+
node: BaseNode,
|
|
453
|
+
newParent: BaseNode,
|
|
454
|
+
copyAlsoModellingRules: boolean,
|
|
455
|
+
optionalFilter?: CloneFilter,
|
|
456
|
+
extraInfo?: CloneExtraInfo
|
|
457
|
+
): void {
|
|
458
|
+
// find all reference that derives from the Aggregates
|
|
459
|
+
const aggregatesRef = node.findReferencesEx("Aggregates", BrowseDirection.Forward);
|
|
460
|
+
_clone_collection_new(newParent, aggregatesRef, copyAlsoModellingRules, optionalFilter, extraInfo);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export function _clone_non_hierarchical_references(
|
|
464
|
+
node: BaseNode,
|
|
465
|
+
newParent: BaseNode,
|
|
466
|
+
copyAlsoModellingRules: boolean,
|
|
467
|
+
optionalFilter?: CloneFilter,
|
|
468
|
+
extraInfo?: CloneExtraInfo
|
|
469
|
+
): void {
|
|
470
|
+
// clone only some non hierarchical_references that we do want to clone
|
|
471
|
+
// such as:
|
|
472
|
+
// HasSubStateMachine
|
|
473
|
+
// (may be other as well later ... to do )
|
|
474
|
+
assert(newParent instanceof BaseNodeImpl);
|
|
475
|
+
// find all reference that derives from the HasSubStateMachine
|
|
476
|
+
const references = node.findReferencesEx("HasSubStateMachine", BrowseDirection.Forward);
|
|
477
|
+
_clone_collection_new(newParent, references, copyAlsoModellingRules, optionalFilter, extraInfo);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @method _clone
|
|
482
|
+
* @private
|
|
483
|
+
*/
|
|
484
|
+
export function _clone<T extends UAObject | UAVariable | UAMethod>(
|
|
485
|
+
this: T,
|
|
486
|
+
Constructor: new (options: any) => T,
|
|
487
|
+
options: CloneOptions,
|
|
488
|
+
optionalFilter?: CloneFilter,
|
|
489
|
+
extraInfo?: CloneExtraInfo
|
|
490
|
+
): T {
|
|
491
|
+
assert(typeof Constructor === "function");
|
|
492
|
+
assert(options !== null && typeof options === "object");
|
|
493
|
+
assert(
|
|
494
|
+
!extraInfo || (extraInfo !== null && typeof extraInfo === "object" && typeof extraInfo.registerClonedObject === "function")
|
|
495
|
+
);
|
|
496
|
+
assert(!(this as any).subtypeOf, "We do not do cloning of Type yet");
|
|
497
|
+
|
|
498
|
+
const namespace = options.namespace;
|
|
499
|
+
const constructorOptions: any = {
|
|
500
|
+
...options,
|
|
501
|
+
addressSpace: namespace.addressSpace,
|
|
502
|
+
browseName: this.browseName,
|
|
503
|
+
description: this.description,
|
|
504
|
+
displayName: this.displayName,
|
|
505
|
+
nodeClass: this.nodeClass
|
|
506
|
+
};
|
|
507
|
+
constructorOptions.references = options.references || [];
|
|
508
|
+
|
|
509
|
+
if (this.nodeClass === NodeClass.Variable || this.nodeClass === NodeClass.Object) {
|
|
510
|
+
const voThis = this as UAObject | UAVariable;
|
|
511
|
+
if (voThis.typeDefinition) {
|
|
512
|
+
constructorOptions.references.push(
|
|
513
|
+
new ReferenceImpl({
|
|
514
|
+
isForward: true,
|
|
515
|
+
nodeId: voThis.typeDefinition,
|
|
516
|
+
referenceType: resolveNodeId("HasTypeDefinition")
|
|
517
|
+
})
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (!constructorOptions.modellingRule) {
|
|
523
|
+
if (this.modellingRule && options.copyAlsoModellingRules) {
|
|
524
|
+
const modellingRuleNode = this.findReferencesAsObject("HasModellingRule", true)[0];
|
|
525
|
+
assert(modellingRuleNode);
|
|
526
|
+
constructorOptions.references.push(
|
|
527
|
+
new ReferenceImpl({
|
|
528
|
+
isForward: true,
|
|
529
|
+
nodeId: modellingRuleNode.nodeId,
|
|
530
|
+
referenceType: resolveNodeId("HasModellingRule")
|
|
531
|
+
})
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
} else {
|
|
535
|
+
UANamespace_process_modelling_rule(constructorOptions.references, constructorOptions.modellingRule);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
constructorOptions.nodeId = namespace.constructNodeId(constructorOptions as ConstructNodeIdOptions);
|
|
539
|
+
|
|
540
|
+
assert(constructorOptions.nodeId instanceof NodeId);
|
|
541
|
+
|
|
542
|
+
const cloneObj = new Constructor(constructorOptions);
|
|
543
|
+
(this.addressSpace as AddressSpacePrivate)._register(cloneObj);
|
|
544
|
+
|
|
545
|
+
options.copyAlsoModellingRules = options.copyAlsoModellingRules || false;
|
|
546
|
+
|
|
547
|
+
const newFilter = optionalFilter ? optionalFilter.filterFor(cloneObj) : undefined;
|
|
548
|
+
_clone_children_references(this, cloneObj, options.copyAlsoModellingRules, newFilter, extraInfo);
|
|
549
|
+
_clone_non_hierarchical_references(this, cloneObj, options.copyAlsoModellingRules, newFilter, extraInfo);
|
|
550
|
+
|
|
551
|
+
cloneObj.propagate_back_references();
|
|
552
|
+
|
|
553
|
+
cloneObj.install_extra_properties();
|
|
554
|
+
|
|
555
|
+
return cloneObj;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export function _handle_HierarchicalReference(node: BaseNode, reference: UAReference): void {
|
|
559
|
+
const _cache = BaseNode_getCache(node);
|
|
560
|
+
if (!reference.isForward) return;
|
|
561
|
+
if (_cache._childByNameMap) {
|
|
562
|
+
const addressSpace = node.addressSpace;
|
|
563
|
+
const referenceType = ReferenceImpl.resolveReferenceType(addressSpace, reference);
|
|
564
|
+
|
|
565
|
+
if (referenceType) {
|
|
566
|
+
const HierarchicalReferencesType = addressSpace.findReferenceType("HierarchicalReferences");
|
|
567
|
+
if (referenceType.isSupertypeOf(HierarchicalReferencesType!)) {
|
|
568
|
+
assert(reference.isForward);
|
|
569
|
+
const targetNode = ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
570
|
+
_cache._childByNameMap[targetNode.browseName!.name!.toString()] = targetNode;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function _remove_HierarchicalReference(node: BaseNode, reference: UAReference) {
|
|
577
|
+
const _cache = BaseNode_getCache(node);
|
|
578
|
+
if (_cache._childByNameMap) {
|
|
579
|
+
const addressSpace = node.addressSpace;
|
|
580
|
+
const referenceType = ReferenceImpl.resolveReferenceType(addressSpace, reference);
|
|
581
|
+
|
|
582
|
+
if (referenceType) {
|
|
583
|
+
const HierarchicalReferencesType = addressSpace.findReferenceType("HierarchicalReferences");
|
|
584
|
+
if (referenceType.isSupertypeOf(HierarchicalReferencesType!)) {
|
|
585
|
+
assert(reference.isForward);
|
|
586
|
+
const targetNode = ReferenceImpl.resolveReferenceNode(addressSpace, reference);
|
|
587
|
+
// Xx console.log(" adding object to map");
|
|
588
|
+
delete _cache._childByNameMap[targetNode.browseName!.name!.toString()];
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
function _makeReferenceDescription(addressSpace: IAddressSpace, reference: UAReference, resultMask: number): ReferenceDescription {
|
|
595
|
+
const isForward = reference.isForward;
|
|
596
|
+
|
|
597
|
+
const referenceTypeId = ReferenceImpl.resolveReferenceType(addressSpace, reference).nodeId;
|
|
598
|
+
assert(referenceTypeId instanceof NodeId);
|
|
599
|
+
|
|
600
|
+
const obj = ReferenceImpl.resolveReferenceNode(addressSpace, reference) as any;
|
|
601
|
+
|
|
602
|
+
let data: any = {};
|
|
603
|
+
|
|
604
|
+
if (!obj) {
|
|
605
|
+
// cannot find reference node
|
|
606
|
+
data = {
|
|
607
|
+
isForward,
|
|
608
|
+
nodeId: reference.nodeId,
|
|
609
|
+
referenceTypeId: resultMask & ResultMask.ReferenceType ? referenceTypeId : null,
|
|
610
|
+
typeDefinition: null
|
|
611
|
+
};
|
|
612
|
+
} else {
|
|
613
|
+
assert(reference.nodeId, " obj.nodeId");
|
|
614
|
+
data = {
|
|
615
|
+
browseName: resultMask & ResultMask.BrowseName ? coerceQualifiedName(obj.browseName) : null,
|
|
616
|
+
displayName: resultMask & ResultMask.DisplayName ? coerceLocalizedText(obj.displayName[0]) : null,
|
|
617
|
+
isForward: resultMask & ResultMask.IsForward ? isForward : false,
|
|
618
|
+
nodeClass: resultMask & ResultMask.NodeClass ? obj.nodeClass : NodeClass.Unspecified,
|
|
619
|
+
nodeId: obj.nodeId,
|
|
620
|
+
referenceTypeId: resultMask & ResultMask.ReferenceType ? referenceTypeId : null,
|
|
621
|
+
typeDefinition: resultMask & ResultMask.TypeDefinition ? obj.typeDefinition : null
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
if (data.typeDefinition === null) {
|
|
625
|
+
data.typeDefinition = NodeId.nullNodeId;
|
|
626
|
+
}
|
|
627
|
+
const referenceDescription = new ReferenceDescription(data);
|
|
628
|
+
return referenceDescription;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
export function _constructReferenceDescription(
|
|
632
|
+
addressSpace: IAddressSpace,
|
|
633
|
+
references: UAReference[],
|
|
634
|
+
resultMask: number
|
|
635
|
+
): ReferenceDescription[] {
|
|
636
|
+
assert(Array.isArray(references));
|
|
637
|
+
return references.map((reference: UAReference) => _makeReferenceDescription(addressSpace, reference, resultMask));
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export function BaseNode_remove_backward_reference(this: BaseNode, reference: UAReference): void {
|
|
641
|
+
const _private = BaseNode_getPrivate(this);
|
|
642
|
+
_remove_HierarchicalReference(this, reference);
|
|
643
|
+
const h = (<ReferenceImpl>reference).hash;
|
|
644
|
+
if (_private._back_referenceIdx && _private._back_referenceIdx[h]) {
|
|
645
|
+
// note : h may not exist in _back_referenceIdx since we are not indexing
|
|
646
|
+
// _back_referenceIdx to UAObjectType and UAVariableType for performance reasons
|
|
647
|
+
(<ReferenceImpl>_private._back_referenceIdx[h]).dispose();
|
|
648
|
+
delete _private._back_referenceIdx[h];
|
|
649
|
+
}
|
|
650
|
+
(<ReferenceImpl>reference).dispose();
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export function BaseNode_add_backward_reference(this: BaseNode, reference: UAReference): void {
|
|
654
|
+
const _private = BaseNode_getPrivate(this);
|
|
655
|
+
|
|
656
|
+
const h = (<ReferenceImpl>reference).hash;
|
|
657
|
+
assert(typeof h === "string");
|
|
658
|
+
// istanbul ignore next
|
|
659
|
+
if (_private._referenceIdx[h]) {
|
|
660
|
+
// the reference exists already in the forward references
|
|
661
|
+
// this append for instance when the XML NotSetFile has redundant <UAReference>
|
|
662
|
+
// in this case there is nothing to do
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
// istanbul ignore next
|
|
666
|
+
if (_private._back_referenceIdx[h]) {
|
|
667
|
+
const opts = { addressSpace: this.addressSpace };
|
|
668
|
+
// tslint:disable-next-line:no-console
|
|
669
|
+
console.warn(" Warning !", this.browseName.toString());
|
|
670
|
+
// tslint:disable-next-line:no-console
|
|
671
|
+
console.warn(" ", reference.toString(opts));
|
|
672
|
+
// tslint:disable-next-line:no-console
|
|
673
|
+
console.warn(" already found in ===>");
|
|
674
|
+
// tslint:disable-next-line:no-console
|
|
675
|
+
console.warn(
|
|
676
|
+
(Object.values(_private._back_referenceIdx) as UAReference[]).map((c: UAReference) => c.toString(opts)).join("\n")
|
|
677
|
+
);
|
|
678
|
+
// tslint:disable-next-line:no-console
|
|
679
|
+
console.warn("===>");
|
|
680
|
+
throw new Error("reference exists already in _back_references");
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if (!getReferenceType(reference)) {
|
|
684
|
+
const stop_here = 1;
|
|
685
|
+
}
|
|
686
|
+
// assert(reference._referenceType instanceof ReferenceType);
|
|
687
|
+
_private._back_referenceIdx[h] = reference;
|
|
688
|
+
_handle_HierarchicalReference(this, reference);
|
|
689
|
+
(this as any)._clear_caches();
|
|
690
|
+
}
|