node-opcua-address-space 2.169.0 → 2.172.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/address_space_ts.d.ts +13 -13
- package/dist/source/address_space_ts.js +4 -0
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/continuation_points/continuation_point_manager.d.ts +6 -3
- package/dist/source/continuation_points/continuation_point_manager.js +4 -4
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -1
- package/dist/source/helpers/adjust_browse_direction.d.ts +1 -1
- package/dist/source/helpers/argument_list.d.ts +13 -11
- package/dist/source/helpers/argument_list.js +24 -15
- package/dist/source/helpers/argument_list.js.map +1 -1
- package/dist/source/helpers/call_helpers.d.ts +6 -3
- package/dist/source/helpers/call_helpers.js +5 -6
- package/dist/source/helpers/call_helpers.js.map +1 -1
- package/dist/source/helpers/coerce_enum_value.d.ts +2 -2
- package/dist/source/helpers/coerce_enum_value.js +2 -2
- package/dist/source/helpers/coerce_enum_value.js.map +1 -1
- package/dist/source/helpers/dump_tools.d.ts +3 -3
- package/dist/source/helpers/dump_tools.js +2 -2
- package/dist/source/helpers/dump_tools.js.map +1 -1
- package/dist/source/helpers/ensure_secure_access.d.ts +1 -1
- package/dist/source/helpers/ensure_secure_access.js +1 -1
- package/dist/source/helpers/ensure_secure_access.js.map +1 -1
- package/dist/source/helpers/make_optionals_map.js +0 -5
- package/dist/source/helpers/make_optionals_map.js.map +1 -1
- package/dist/source/helpers/multiform_func.d.ts +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -1
- package/dist/source/index.d.ts +38 -38
- package/dist/source/index.js +53 -54
- package/dist/source/index.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +11 -11
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +6 -6
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +4 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +10 -13
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +11 -11
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +11 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +21 -29
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +3 -7
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -23
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +8 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +4 -6
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +3 -3
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +7 -7
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +5 -8
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +5 -5
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +3 -3
- package/dist/source/interfaces/extension_object_constructor.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +2 -2
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +6 -6
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +7 -6
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +4 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -1
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -1
- package/dist/source/loader/decode_xml_extension_object.d.ts +4 -4
- package/dist/source/loader/decode_xml_extension_object.js +3 -3
- package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
- package/dist/source/loader/ensure_datatype_extracted.d.ts +2 -2
- package/dist/source/loader/ensure_datatype_extracted.js +5 -5
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +3 -3
- package/dist/source/loader/generateAddressSpaceRaw.js +6 -6
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +2 -2
- package/dist/source/loader/make_xml_extension_object_parser.js +19 -19
- package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/source/loader/namespace_post_step.d.ts +1 -1
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/loader/parsers/extension_object_parser.d.ts +4 -4
- package/dist/source/loader/parsers/extension_object_parser.js +22 -23
- package/dist/source/loader/parsers/extension_object_parser.js.map +1 -1
- package/dist/source/loader/parsers/localized_text_parser.d.ts +2 -2
- package/dist/source/loader/parsers/localized_text_parser.js.map +1 -1
- package/dist/source/loader/parsers/nodeid_parser.d.ts +1 -1
- package/dist/source/loader/parsers/nodeid_parser.js.map +1 -1
- package/dist/source/loader/parsers/qualified_name_parser.d.ts +3 -3
- package/dist/source/loader/parsers/qualified_name_parser.js.map +1 -1
- package/dist/source/loader/parsers/variant_parser.d.ts +5 -5
- package/dist/source/loader/parsers/variant_parser.js +13 -13
- package/dist/source/loader/parsers/variant_parser.js.map +1 -1
- package/dist/source/loader/register_node_promoter.d.ts +1 -1
- package/dist/source/loader/register_node_promoter.js.map +1 -1
- package/dist/source/namespace.d.ts +4 -4
- package/dist/source/namespace_alarm_and_condition.d.ts +22 -21
- package/dist/source/namespace_data_access.d.ts +11 -11
- package/dist/source/namespace_machine_state.d.ts +4 -4
- package/dist/source/pseudo_session.d.ts +8 -5
- package/dist/source/pseudo_session.js +28 -28
- package/dist/source/pseudo_session.js.map +1 -1
- package/dist/source/session_context.js +1 -1
- package/dist/source/session_context.js.map +1 -1
- package/dist/source/set_namespace_meta_data.d.ts +1 -1
- package/dist/source/set_namespace_meta_data.js +1 -1
- package/dist/source/set_namespace_meta_data.js.map +1 -1
- package/dist/source/ua_addin.d.ts +3 -3
- package/dist/source/ua_addin.js +1 -1
- package/dist/source/ua_addin.js.map +1 -1
- package/dist/source/ua_interface.d.ts +2 -3
- package/dist/source/ua_interface.js +13 -33
- package/dist/source/ua_interface.js.map +1 -1
- package/dist/source/ua_root_folder.d.ts +1 -1
- package/dist/source/ua_two_state_variable_ex.d.ts +5 -5
- package/dist/src/_instantiate_helpers.d.ts +1 -1
- package/dist/src/_instantiate_helpers.js +32 -9
- package/dist/src/_instantiate_helpers.js.map +1 -1
- package/dist/src/_mandatory_child_or_requested_optional_filter.d.ts +2 -2
- package/dist/src/_mandatory_child_or_requested_optional_filter.js +9 -10
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -1
- package/dist/src/address_space.d.ts +2 -2
- package/dist/src/address_space.js +13 -15
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/address_space_change_event_tools.d.ts +3 -3
- package/dist/src/address_space_change_event_tools.js +8 -10
- package/dist/src/address_space_change_event_tools.js.map +1 -1
- package/dist/src/address_space_private.d.ts +11 -11
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +6 -6
- package/dist/src/alarms_and_conditions/condition_info_impl.js +6 -15
- package/dist/src/alarms_and_conditions/condition_info_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +10 -10
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +77 -48
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +8 -5
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +15 -9
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/src/alarms_and_conditions/index.d.ts +3 -3
- package/dist/src/alarms_and_conditions/index.js +3 -3
- package/dist/src/alarms_and_conditions/index.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +21 -14
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +26 -21
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +6 -7
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +30 -28
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +9 -11
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +10 -10
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +3 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +6 -5
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +16 -42
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +100 -82
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +12 -7
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +9 -8
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +18 -18
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +16 -18
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +4 -4
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +2 -2
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +10 -9
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +20 -19
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +2 -4
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +12 -38
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +50 -65
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +15 -17
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +15 -11
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +22 -15
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +35 -24
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +15 -16
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +19 -14
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +4 -4
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/apply_condition_refresh.d.ts +4 -4
- package/dist/src/apply_condition_refresh.js +1 -1
- package/dist/src/apply_condition_refresh.js.map +1 -1
- package/dist/src/base_node_impl.d.ts +5 -7
- package/dist/src/base_node_impl.js +3 -3
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.d.ts +10 -7
- package/dist/src/base_node_private.js +73 -50
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/check_value_rank_compatibility.js +11 -7
- package/dist/src/check_value_rank_compatibility.js.map +1 -1
- package/dist/src/data_access/add_dataItem_stuff.d.ts +1 -1
- package/dist/src/data_access/add_dataItem_stuff.js +2 -22
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -1
- package/dist/src/data_access/adjust_datavalue_status_code.d.ts +6 -3
- package/dist/src/data_access/adjust_datavalue_status_code.js +3 -3
- package/dist/src/data_access/adjust_datavalue_status_code.js.map +1 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +13 -11
- package/dist/src/data_access/ua_multistate_discrete_impl.js +28 -23
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +19 -23
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +31 -31
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +10 -16
- package/dist/src/data_access/ua_two_state_discrete_impl.js +18 -14
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +1 -1
- package/dist/src/event_data.d.ts +8 -21
- package/dist/src/event_data.js +24 -19
- package/dist/src/event_data.js.map +1 -1
- package/dist/src/extension_object_array_node.d.ts +5 -2
- package/dist/src/extension_object_array_node.js +21 -24
- package/dist/src/extension_object_array_node.js.map +1 -1
- package/dist/src/get_basic_datatype.d.ts +2 -2
- package/dist/src/get_basic_datatype.js.map +1 -1
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +3 -3
- package/dist/src/historical_access/address_space_historical_data_node.js +24 -17
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/idx_iterator.js +1 -1
- package/dist/src/idx_iterator.js.map +1 -1
- package/dist/src/index_current.d.ts +31 -31
- package/dist/src/index_current.js +45 -45
- package/dist/src/index_current.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +4 -3
- package/dist/src/namespace_impl.js +17 -14
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/namespace_private.js.map +1 -1
- package/dist/src/nodeid_manager.d.ts +3 -3
- package/dist/src/nodeid_manager.js +19 -16
- package/dist/src/nodeid_manager.js.map +1 -1
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +1 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -2
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +7 -7
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.d.ts +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.js +15 -11
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +5 -3
- package/dist/src/nodeset_tools/nodeset_to_xml.js +64 -67
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/private_namespace.d.ts +2 -2
- package/dist/src/private_namespace.js.map +1 -1
- package/dist/src/reference_impl.d.ts +2 -2
- package/dist/src/reference_impl.js +9 -11
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/role_permissions.d.ts +1 -1
- package/dist/src/role_permissions.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +11 -14
- package/dist/src/state_machine/finite_state_machine.js +36 -30
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +8 -6
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +16 -18
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.d.ts +12 -11
- package/dist/src/state_machine/ua_two_state_variable.js +24 -29
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/tool_isSubtypeOf.d.ts +5 -5
- package/dist/src/tool_isSubtypeOf.js +21 -18
- package/dist/src/tool_isSubtypeOf.js.map +1 -1
- package/dist/src/ua_condition_type.d.ts +1 -1
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.d.ts +9 -5
- package/dist/src/ua_method_impl.js +1 -1
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.d.ts +10 -7
- package/dist/src/ua_object_impl.js +43 -15
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.d.ts +7 -5
- package/dist/src/ua_object_type_impl.js +6 -7
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.d.ts +6 -8
- package/dist/src/ua_reference_type_impl.js +16 -14
- package/dist/src/ua_reference_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.d.ts +44 -45
- package/dist/src/ua_variable_impl.js +177 -83
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +3 -3
- package/dist/src/ua_variable_impl_ext_obj.js +37 -29
- package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/src/ua_variable_type_impl.d.ts +11 -11
- package/dist/src/ua_variable_type_impl.js +13 -21
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/src/ua_view_impl.d.ts +3 -4
- package/dist/src/ua_view_impl.js +5 -6
- package/dist/src/ua_view_impl.js.map +1 -1
- package/dist/src/validate_data_type_correctness.d.ts +2 -2
- package/dist/src/validate_data_type_correctness.js +12 -3
- package/dist/src/validate_data_type_correctness.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distHelpers/add_event_generator_object.d.ts +5 -2
- package/distHelpers/add_event_generator_object.js +2 -2
- package/distHelpers/add_event_generator_object.js.map +1 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +1 -1
- package/distHelpers/alarms_and_conditions_demo.js +4 -6
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -1
- package/distHelpers/assertHasMatchingReference.d.ts +1 -1
- package/distHelpers/assertHasMatchingReference.js +2 -2
- package/distHelpers/assertHasMatchingReference.js.map +1 -1
- package/distHelpers/boiler_system.d.ts +6 -3
- package/distHelpers/boiler_system.js +44 -42
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.js +25 -27
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
- package/distHelpers/get_address_space_fixture.js +15 -15
- package/distHelpers/get_address_space_fixture.js.map +1 -1
- package/distHelpers/index.d.ts +2 -2
- package/distHelpers/index.js +2 -2
- package/distHelpers/index.js.map +1 -1
- package/distHelpers/mock_session.d.ts +7 -7
- package/distHelpers/mock_session.js +4 -4
- package/distHelpers/mock_session.js.map +1 -1
- package/distNodeJS/generate_address_space.d.ts +2 -2
- package/distNodeJS/generate_address_space.js +2 -2
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/package.json +36 -36
- package/source/address_space_ts.ts +29 -30
- package/source/continuation_points/continuation_point_manager.ts +8 -7
- package/source/helpers/adjust_browse_direction.ts +1 -1
- package/source/helpers/argument_list.ts +37 -25
- package/source/helpers/call_helpers.ts +10 -15
- package/source/helpers/coerce_enum_value.ts +4 -4
- package/source/helpers/dump_tools.ts +6 -11
- package/source/helpers/ensure_secure_access.ts +2 -2
- package/source/helpers/make_optionals_map.ts +3 -10
- package/source/helpers/multiform_func.ts +1 -1
- package/source/helpers/resolve_opaque_on_address_space.ts +2 -2
- package/source/index.ts +44 -54
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +3 -4
- package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +13 -13
- package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +8 -10
- package/source/interfaces/alarms_and_conditions/install_setpoint_options.ts +4 -5
- package/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +4 -6
- package/source/interfaces/alarms_and_conditions/instantiate_condition_options.ts +3 -3
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +6 -3
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +11 -11
- package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +11 -25
- package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +16 -13
- package/source/interfaces/alarms_and_conditions/ua_base_event_ex.ts +12 -0
- package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +5 -5
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +30 -54
- package/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +3 -34
- package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +18 -22
- package/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +8 -15
- package/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +4 -7
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +5 -6
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +3 -3
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +9 -16
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +5 -8
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +5 -5
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +3 -3
- package/source/interfaces/extension_object_constructor.ts +3 -4
- package/source/interfaces/i_condition_variable_type_setter_options.ts +1 -3
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +3 -3
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +2 -2
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +3 -3
- package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +10 -7
- package/source/interfaces/state_machine/ua_state_machine_type.ts +11 -8
- package/source/interfaces/state_machine/ua_transition_ex.ts +2 -2
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +3 -2
- package/source/loader/decode_xml_extension_object.ts +7 -7
- package/source/loader/ensure_datatype_extracted.ts +14 -19
- package/source/loader/generateAddressSpaceRaw.ts +12 -13
- package/source/loader/load_nodeset2.ts +3 -3
- package/source/loader/make_xml_extension_object_parser.ts +55 -39
- package/source/loader/namespace_post_step.ts +3 -4
- package/source/loader/parsers/extension_object_parser.ts +63 -62
- package/source/loader/parsers/localized_text_parser.ts +3 -3
- package/source/loader/parsers/nodeid_parser.ts +2 -3
- package/source/loader/parsers/qualified_name_parser.ts +6 -7
- package/source/loader/parsers/variant_parser.ts +48 -55
- package/source/loader/register_node_promoter.ts +2 -2
- package/source/namespace.ts +4 -4
- package/source/namespace_alarm_and_condition.ts +22 -22
- package/source/namespace_data_access.ts +12 -13
- package/source/namespace_machine_state.ts +10 -5
- package/source/pseudo_session.ts +53 -50
- package/source/session_context.ts +1 -1
- package/source/set_namespace_meta_data.ts +3 -3
- package/source/ua_addin.ts +10 -11
- package/source/ua_interface.ts +27 -38
- package/source/ua_root_folder.ts +1 -1
- package/source/ua_two_state_variable_ex.ts +5 -5
- package/source_nodejs/generate_address_space.ts +5 -9
- package/src/_instantiate_helpers.ts +78 -25
- package/src/_mandatory_child_or_requested_optional_filter.ts +20 -19
- package/src/address_space.ts +36 -45
- package/src/address_space_change_event_tools.ts +25 -30
- package/src/address_space_private.ts +20 -21
- package/src/alarms_and_conditions/condition.ts +0 -2
- package/src/alarms_and_conditions/condition_info_impl.ts +11 -19
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +109 -85
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +20 -15
- package/src/alarms_and_conditions/index.ts +3 -3
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +44 -32
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +35 -34
- package/src/alarms_and_conditions/ua_base_event_impl.ts +15 -19
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +6 -2
- package/src/alarms_and_conditions/ua_condition_impl.ts +140 -130
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +20 -12
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +40 -43
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +7 -7
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +28 -30
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +3 -6
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +59 -90
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +31 -27
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +57 -36
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +31 -27
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +6 -6
- package/src/apply_condition_refresh.ts +7 -8
- package/src/base_node_impl.ts +64 -45
- package/src/base_node_private.ts +171 -139
- package/src/check_value_rank_compatibility.ts +19 -15
- package/src/data_access/add_dataItem_stuff.ts +3 -4
- package/src/data_access/adjust_datavalue_status_code.ts +7 -7
- package/src/data_access/ua_multistate_discrete_impl.ts +44 -28
- package/src/data_access/ua_multistate_value_discrete_impl.ts +77 -66
- package/src/data_access/ua_two_state_discrete_impl.ts +29 -36
- package/src/event_data.ts +29 -26
- package/src/extension_object_array_node.ts +27 -28
- package/src/get_basic_datatype.ts +4 -5
- package/src/historical_access/address_space_historical_data_node.ts +65 -50
- package/src/idx_iterator.ts +4 -12
- package/src/index_current.ts +33 -45
- package/src/namespace_impl.ts +75 -62
- package/src/namespace_private.ts +2 -8
- package/src/nodeid_manager.ts +30 -27
- package/src/nodeset_tools/adjust_namespace_array.ts +1 -1
- package/src/nodeset_tools/construct_namespace_dependency.ts +15 -16
- package/src/nodeset_tools/dump_to_bsd.ts +27 -22
- package/src/nodeset_tools/nodeset_to_xml.ts +95 -114
- package/src/private_namespace.ts +3 -6
- package/src/reference_impl.ts +11 -14
- package/src/role_permissions.ts +1 -1
- package/src/state_machine/finite_state_machine.ts +60 -61
- package/src/state_machine/ua_shelving_state_machine_ex.ts +23 -23
- package/src/state_machine/ua_two_state_variable.ts +34 -31
- package/src/tool_isSubtypeOf.ts +48 -33
- package/src/ua_condition_type.ts +1 -1
- package/src/ua_data_type_impl.ts +12 -13
- package/src/ua_method_impl.ts +17 -12
- package/src/ua_object_impl.ts +73 -39
- package/src/ua_object_type_impl.ts +25 -25
- package/src/ua_reference_type_impl.ts +19 -19
- package/src/ua_variable_impl.ts +316 -219
- package/src/ua_variable_impl_ext_obj.ts +63 -50
- package/src/ua_variable_type_impl.ts +43 -49
- package/src/ua_view_impl.ts +5 -5
- package/src/validate_data_type_correctness.ts +17 -8
package/src/event_data.ts
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-address-space.Private
|
|
3
3
|
*/
|
|
4
|
+
|
|
5
|
+
import type { BaseNode, IEventData } from "node-opcua-address-space-base";
|
|
4
6
|
import { assert } from "node-opcua-assert";
|
|
5
7
|
import { coerceExpandedNodeId, NodeId, sameNodeId } from "node-opcua-nodeid";
|
|
6
8
|
import { StatusCodes } from "node-opcua-status-code";
|
|
7
|
-
import { BrowsePath, BrowsePathResult } from "node-opcua-types";
|
|
8
|
-
import { Variant, VariantLike } from "node-opcua-variant";
|
|
9
|
-
|
|
10
|
-
import { BaseNode, IEventData } from "node-opcua-address-space-base";
|
|
9
|
+
import { type BrowsePath, BrowsePathResult } from "node-opcua-types";
|
|
11
10
|
import { lowerFirstLetter } from "node-opcua-utils";
|
|
11
|
+
import { Variant, type VariantLike } from "node-opcua-variant";
|
|
12
12
|
|
|
13
13
|
type NodeIdString = string;
|
|
14
14
|
type FullBrowsePath = string;
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
/**
|
|
18
17
|
*/
|
|
19
18
|
export class EventData implements IEventData {
|
|
20
19
|
public eventId: NodeId;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
public $cache: {
|
|
20
|
+
#eventDataSource: BaseNode;
|
|
21
|
+
#cache: {
|
|
24
22
|
__values: { [key: NodeIdString]: Variant };
|
|
25
23
|
__nodeIdToNode: { [key: NodeIdString]: BaseNode };
|
|
26
24
|
__pathToNodeId: { [key: FullBrowsePath]: NodeId };
|
|
@@ -28,7 +26,7 @@ export class EventData implements IEventData {
|
|
|
28
26
|
};
|
|
29
27
|
|
|
30
28
|
constructor(eventTypeNode: BaseNode) {
|
|
31
|
-
this
|
|
29
|
+
this.#cache = {
|
|
32
30
|
__values: {},
|
|
33
31
|
__nodeIdToNode: {},
|
|
34
32
|
__pathToNodeId: {},
|
|
@@ -36,45 +34,50 @@ export class EventData implements IEventData {
|
|
|
36
34
|
};
|
|
37
35
|
|
|
38
36
|
this.eventId = new NodeId();
|
|
39
|
-
this
|
|
37
|
+
this.#eventDataSource = eventTypeNode;
|
|
40
38
|
}
|
|
41
39
|
|
|
40
|
+
public getEventDataSource(): BaseNode {
|
|
41
|
+
return this.#eventDataSource;
|
|
42
|
+
}
|
|
42
43
|
public _createValue(fullBrowsePath: string, node: BaseNode, variant: VariantLike): void {
|
|
43
|
-
const eventData = this as
|
|
44
|
-
assert(!eventData[fullBrowsePath],
|
|
44
|
+
const eventData = this as Record<string, unknown>;
|
|
45
|
+
assert(!eventData[fullBrowsePath], `already exists ${fullBrowsePath}`);
|
|
45
46
|
|
|
46
47
|
const lowerName = fullBrowsePath.split(".").map(lowerFirstLetter).join(".");
|
|
47
48
|
|
|
48
49
|
eventData[lowerName] = Variant.coerce(variant);
|
|
49
50
|
|
|
50
|
-
this
|
|
51
|
-
this
|
|
52
|
-
this
|
|
53
|
-
this
|
|
51
|
+
this.#cache.__pathToNodeId[fullBrowsePath] = node.nodeId;
|
|
52
|
+
this.#cache.__nodeIdToNode[node.nodeId.toString()] = node;
|
|
53
|
+
this.#cache.__nodeIdToFullPath[node.nodeId.toString()] = fullBrowsePath;
|
|
54
|
+
this.#cache.__values[node.nodeId.toString()] = eventData[lowerName] as Variant;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
public _browse(browsePath: BrowsePath): BrowsePathResult | null {
|
|
57
|
-
if (!sameNodeId(browsePath.startingNode, this
|
|
58
|
+
if (!sameNodeId(browsePath.startingNode, this.#eventDataSource.nodeId)) {
|
|
58
59
|
return null;
|
|
59
60
|
}
|
|
60
|
-
const fullBrowsePath = (browsePath.relativePath.elements || []).map((b=>b.targetName.toString())
|
|
61
|
-
const nodeId = this
|
|
61
|
+
const fullBrowsePath = (browsePath.relativePath.elements || []).map((b) => b.targetName.toString()).join(".");
|
|
62
|
+
const nodeId = this.#cache.__pathToNodeId[fullBrowsePath];
|
|
62
63
|
if (!nodeId) return null;
|
|
63
64
|
return new BrowsePathResult({
|
|
64
65
|
statusCode: StatusCodes.Good,
|
|
65
|
-
targets: [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
targets: [
|
|
67
|
+
{
|
|
68
|
+
remainingPathIndex: 0,
|
|
69
|
+
targetId: coerceExpandedNodeId(nodeId)
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
});
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
public _readValue(nodeId: NodeId): Variant | null {
|
|
73
76
|
const key = nodeId.toString();
|
|
74
|
-
const cached_value = this
|
|
77
|
+
const cached_value = this.#cache.__values[key];
|
|
75
78
|
if (cached_value) {
|
|
76
79
|
return cached_value;
|
|
77
80
|
}
|
|
78
81
|
return null;
|
|
79
82
|
}
|
|
80
|
-
}
|
|
83
|
+
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-address-space.Private
|
|
3
3
|
*/
|
|
4
|
-
import { assert } from "node-opcua-assert";
|
|
5
4
|
|
|
5
|
+
import type { UADataType, UADynamicVariableArray, UAObject, UAReferenceType, UAVariable } from "node-opcua-address-space-base";
|
|
6
|
+
import { assert } from "node-opcua-assert";
|
|
6
7
|
import { BrowseDirection, NodeClass } from "node-opcua-data-model";
|
|
7
8
|
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
8
|
-
import { NodeId } from "node-opcua-nodeid";
|
|
9
|
-
import { Variant } from "node-opcua-variant";
|
|
10
|
-
import { DataType } from "node-opcua-variant";
|
|
11
|
-
import { VariantArrayType } from "node-opcua-variant";
|
|
12
|
-
|
|
13
9
|
import { ExtensionObject } from "node-opcua-extension-object";
|
|
14
|
-
import {
|
|
10
|
+
import type { NodeId } from "node-opcua-nodeid";
|
|
11
|
+
import { DataType, Variant, VariantArrayType } from "node-opcua-variant";
|
|
15
12
|
import { UAVariableImpl } from "./ua_variable_impl";
|
|
16
13
|
|
|
17
|
-
const
|
|
18
|
-
const
|
|
14
|
+
const _doDebug = checkDebugFlag(__filename);
|
|
15
|
+
const _debugLog = make_debugLog(__filename);
|
|
19
16
|
const errorLog = make_errorLog(__filename);
|
|
20
|
-
const warningLog= make_warningLog(__filename);
|
|
17
|
+
const warningLog = make_warningLog(__filename);
|
|
21
18
|
|
|
22
19
|
/*
|
|
23
20
|
* define a complex Variable containing a array of extension objects
|
|
@@ -44,8 +41,8 @@ function removeElementByIndex<T extends ExtensionObject>(uaArrayVariableNode: UA
|
|
|
44
41
|
|
|
45
42
|
// remove element from global array (inefficient)
|
|
46
43
|
uaArrayVariableNode.$$extensionObjectArray.splice(elementIndex, 1);
|
|
47
|
-
if(uaArrayVariableNode.$$extensionObjectArray !== uaArrayVariableNode.$dataValue.value.value) {
|
|
48
|
-
|
|
44
|
+
if (uaArrayVariableNode.$$extensionObjectArray !== uaArrayVariableNode.$dataValue.value.value) {
|
|
45
|
+
// throw new Error("internal error");
|
|
49
46
|
}
|
|
50
47
|
uaArrayVariableNode.touchValue();
|
|
51
48
|
|
|
@@ -125,25 +122,27 @@ export function createExtObjArrayNode<T extends ExtensionObject>(parentFolder: U
|
|
|
125
122
|
return uaArrayVariableNode;
|
|
126
123
|
}
|
|
127
124
|
|
|
128
|
-
function _getElementBrowseName<T extends ExtensionObject>
|
|
129
|
-
|
|
125
|
+
function _getElementBrowseName<T extends ExtensionObject>(
|
|
126
|
+
this: UADynamicVariableArray<T>,
|
|
127
|
+
extObj: ExtensionObject,
|
|
128
|
+
_index: number | number[]
|
|
129
|
+
) {
|
|
130
130
|
const indexPropertyName1 = this.$$indexPropertyName;
|
|
131
131
|
|
|
132
|
-
if (!Object.
|
|
132
|
+
if (!Object.hasOwn(extObj, indexPropertyName1)) {
|
|
133
133
|
warningLog(" extension object does not have ", indexPropertyName1, extObj);
|
|
134
134
|
}
|
|
135
135
|
// assert(extObj.constructor === addressSpace.constructExtensionObject(dataType));
|
|
136
|
-
assert(Object.
|
|
136
|
+
assert(Object.hasOwn(extObj, indexPropertyName1));
|
|
137
137
|
const browseName = (extObj as any)[indexPropertyName1].toString();
|
|
138
138
|
return browseName;
|
|
139
|
-
}
|
|
139
|
+
}
|
|
140
140
|
|
|
141
141
|
export function bindExtObjArrayNode<T extends ExtensionObject>(
|
|
142
142
|
uaArrayVariableNode: UADynamicVariableArray<T>,
|
|
143
143
|
variableTypeNodeId: string | NodeId,
|
|
144
144
|
indexPropertyName: string
|
|
145
145
|
): UAVariable {
|
|
146
|
-
|
|
147
146
|
assert(uaArrayVariableNode.valueRank === 1, "expecting a one dimension array");
|
|
148
147
|
|
|
149
148
|
const addressSpace = uaArrayVariableNode.addressSpace;
|
|
@@ -151,7 +150,7 @@ export function bindExtObjArrayNode<T extends ExtensionObject>(
|
|
|
151
150
|
const variableType = addressSpace.findVariableType(variableTypeNodeId);
|
|
152
151
|
// c8 ignore next
|
|
153
152
|
if (!variableType || variableType.nodeId.isEmpty()) {
|
|
154
|
-
throw new Error(
|
|
153
|
+
throw new Error(`Cannot find VariableType ${variableTypeNodeId.toString()}`);
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
const structure = addressSpace.findDataType("Structure");
|
|
@@ -163,7 +162,7 @@ export function bindExtObjArrayNode<T extends ExtensionObject>(
|
|
|
163
162
|
let dataType = addressSpace.findDataType(variableType.dataType);
|
|
164
163
|
// c8 ignore next
|
|
165
164
|
if (!dataType) {
|
|
166
|
-
throw new Error(
|
|
165
|
+
throw new Error(`Cannot find DataType ${variableType.dataType.toString()}`);
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
assert(dataType.isSubtypeOf(structure), "expecting a structure (= ExtensionObject) here ");
|
|
@@ -174,13 +173,13 @@ export function bindExtObjArrayNode<T extends ExtensionObject>(
|
|
|
174
173
|
|
|
175
174
|
// verify that an object with same doesn't already exist
|
|
176
175
|
dataType = addressSpace.findDataType(variableType.dataType)! as UADataType;
|
|
177
|
-
assert(dataType
|
|
176
|
+
assert(dataType?.isSubtypeOf(structure), "expecting a structure (= ExtensionObject) here ");
|
|
178
177
|
assert(!uaArrayVariableNode.$$extensionObjectArray, "UAVariable ExtensionObject array already bounded");
|
|
179
178
|
uaArrayVariableNode.$$dataType = dataType;
|
|
180
179
|
uaArrayVariableNode.$$extensionObjectArray = [];
|
|
181
180
|
uaArrayVariableNode.$$indexPropertyName = indexPropertyName;
|
|
182
181
|
uaArrayVariableNode.$$getElementBrowseName = _getElementBrowseName;
|
|
183
|
-
uaArrayVariableNode.$dataValue.value.value =
|
|
182
|
+
uaArrayVariableNode.$dataValue.value.value = uaArrayVariableNode.$$extensionObjectArray;
|
|
184
183
|
uaArrayVariableNode.$dataValue.value.arrayType = VariantArrayType.Array;
|
|
185
184
|
|
|
186
185
|
const bindOptions: any = {
|
|
@@ -252,8 +251,8 @@ export function addElement<T extends ExtensionObject>(
|
|
|
252
251
|
elVar.bindExtensionObject(extensionObject, { force: true });
|
|
253
252
|
}
|
|
254
253
|
|
|
255
|
-
if(uaArrayVariableNode.$$extensionObjectArray !== uaArrayVariableNode.$dataValue.value.value) {
|
|
256
|
-
|
|
254
|
+
if (uaArrayVariableNode.$$extensionObjectArray !== uaArrayVariableNode.$dataValue.value.value) {
|
|
255
|
+
// throw new Error("internal error");
|
|
257
256
|
}
|
|
258
257
|
// also add the value inside
|
|
259
258
|
uaArrayVariableNode.$$extensionObjectArray.push(elVar.$extensionObject);
|
|
@@ -284,10 +283,10 @@ export function removeElement<T extends ExtensionObject>(
|
|
|
284
283
|
} else if (typeof element === "function") {
|
|
285
284
|
// find element by functor
|
|
286
285
|
elementIndex = _array.findIndex(element);
|
|
287
|
-
} else if (element
|
|
286
|
+
} else if (element?.nodeClass) {
|
|
288
287
|
// find element by name
|
|
289
|
-
const browseNameToFind = element.browseName.name
|
|
290
|
-
elementIndex = _array.findIndex((obj: any,
|
|
288
|
+
const browseNameToFind = element.browseName.name?.toString();
|
|
289
|
+
elementIndex = _array.findIndex((obj: any, _i: number) => {
|
|
291
290
|
const browseName = uaArrayVariableNode.$$getElementBrowseName(obj, elementIndex).toString();
|
|
292
291
|
return browseName === browseNameToFind;
|
|
293
292
|
});
|
|
@@ -297,7 +296,7 @@ export function removeElement<T extends ExtensionObject>(
|
|
|
297
296
|
|
|
298
297
|
// c8 ignore next
|
|
299
298
|
if (elementIndex < 0) {
|
|
300
|
-
throw new Error(
|
|
299
|
+
throw new Error(`removeElement: cannot find element matching ${element.toString()}`);
|
|
301
300
|
}
|
|
302
301
|
return removeElementByIndex(uaArrayVariableNode, elementIndex);
|
|
303
302
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { IAddressSpace } from "node-opcua-address-space-base";
|
|
1
|
+
import type { IAddressSpace } from "node-opcua-address-space-base";
|
|
2
2
|
import { DataType } from "node-opcua-basic-types";
|
|
3
|
-
import {
|
|
4
|
-
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
3
|
+
import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
5
4
|
|
|
6
5
|
export interface IBaseNodeVariableOrVariableType {
|
|
7
6
|
addressSpace: IAddressSpace;
|
|
@@ -15,7 +14,7 @@ export function _getBasicDataTypeFromDataTypeNodeId(
|
|
|
15
14
|
addressSpace: IAddressSpace,
|
|
16
15
|
dataTypeNodeId: { nodeId: NodeIdLike } | NodeIdLike
|
|
17
16
|
): DataType {
|
|
18
|
-
const dataTypeNodeId_
|
|
17
|
+
const dataTypeNodeId_ = (dataTypeNodeId as any).nodeId ? (dataTypeNodeId as any).nodeId : dataTypeNodeId;
|
|
19
18
|
const dataTypeNode = addressSpace.findDataType(dataTypeNodeId_);
|
|
20
19
|
if (!dataTypeNode) {
|
|
21
20
|
return DataType.Null;
|
|
@@ -36,6 +35,6 @@ export function _getBasicDataType(uaNode: IBaseNodeVariableOrVariableType): Data
|
|
|
36
35
|
// may be node has been deleted already
|
|
37
36
|
return DataType.Null;
|
|
38
37
|
}
|
|
39
|
-
_uaNode._basicDataType =
|
|
38
|
+
_uaNode._basicDataType = _getBasicDataTypeFromDataTypeNodeId(addressSpace, _uaNode.dataType);
|
|
40
39
|
return _uaNode._basicDataType;
|
|
41
40
|
}
|
|
@@ -4,13 +4,21 @@
|
|
|
4
4
|
// tslint:disable:no-console
|
|
5
5
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
-
|
|
7
|
+
import type {
|
|
8
|
+
ContinuationData,
|
|
9
|
+
IAddressSpace,
|
|
10
|
+
ISessionContext,
|
|
11
|
+
IVariableHistorian,
|
|
12
|
+
IVariableHistorianOptions,
|
|
13
|
+
UAVariable
|
|
14
|
+
} from "node-opcua-address-space-base";
|
|
8
15
|
import { assert } from "node-opcua-assert";
|
|
9
|
-
import { AccessLevelFlag, NodeClass, QualifiedNameLike } from "node-opcua-data-model";
|
|
10
|
-
import { DataValue } from "node-opcua-data-value";
|
|
16
|
+
import { AccessLevelFlag, NodeClass, type QualifiedNameLike } from "node-opcua-data-model";
|
|
17
|
+
import type { DataValue } from "node-opcua-data-value";
|
|
11
18
|
import { isMinDate, minDate } from "node-opcua-date-time";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
19
|
+
import { make_warningLog } from "node-opcua-debug";
|
|
20
|
+
import type { UAHistoricalDataConfiguration } from "node-opcua-nodeset-ua";
|
|
21
|
+
import type { NumericRange } from "node-opcua-numeric-range";
|
|
14
22
|
import {
|
|
15
23
|
HistoryData,
|
|
16
24
|
HistoryReadResult,
|
|
@@ -19,72 +27,73 @@ import {
|
|
|
19
27
|
ReadProcessedDetails,
|
|
20
28
|
ReadRawModifiedDetails
|
|
21
29
|
} from "node-opcua-service-history";
|
|
22
|
-
import { StatusCodes } from "node-opcua-status-code";
|
|
23
|
-
import { CallbackT } from "node-opcua-status-code";
|
|
30
|
+
import { type CallbackT, StatusCodes } from "node-opcua-status-code";
|
|
24
31
|
import { DataType } from "node-opcua-variant";
|
|
25
|
-
import {
|
|
26
|
-
IAddressSpace,
|
|
27
|
-
IVariableHistorian,
|
|
28
|
-
IVariableHistorianOptions,
|
|
29
|
-
UAVariable,
|
|
30
|
-
ContinuationData
|
|
31
|
-
} from "node-opcua-address-space-base";
|
|
32
|
-
import { make_warningLog } from "node-opcua-debug";
|
|
33
|
-
import { ISessionContext } from "node-opcua-address-space-base";
|
|
34
|
-
|
|
35
|
-
import { UAVariableImpl } from "../ua_variable_impl";
|
|
36
32
|
import { AddressSpace } from "../../source/address_space_ts";
|
|
37
|
-
import { AddressSpacePrivate } from "../address_space_private";
|
|
33
|
+
import type { AddressSpacePrivate } from "../address_space_private";
|
|
34
|
+
import { UAVariableImpl } from "../ua_variable_impl";
|
|
38
35
|
|
|
39
36
|
const warningLog = make_warningLog(__filename);
|
|
40
37
|
|
|
41
38
|
// tslint:disable:no-var-requires
|
|
39
|
+
interface DequeueItem<T> {
|
|
40
|
+
data: T | null;
|
|
41
|
+
next: DequeueItem<T>;
|
|
42
|
+
prev: DequeueItem<T>;
|
|
43
|
+
}
|
|
44
|
+
interface Dequeue<T> {
|
|
45
|
+
push(value: T): void;
|
|
46
|
+
shift(): T | undefined;
|
|
47
|
+
first(): T | undefined;
|
|
48
|
+
length: number;
|
|
49
|
+
head: DequeueItem<T>;
|
|
50
|
+
}
|
|
42
51
|
const Dequeue = require("dequeue");
|
|
43
52
|
|
|
44
53
|
/* interface Historian */
|
|
45
54
|
// {
|
|
46
55
|
//
|
|
47
56
|
// }
|
|
48
|
-
function inInTimeRange(historyReadDetails:
|
|
57
|
+
function inInTimeRange(historyReadDetails: ReadRawModifiedDetails, dataValue: DataValue): boolean {
|
|
49
58
|
if (
|
|
50
59
|
historyReadDetails.startTime &&
|
|
51
60
|
!isMinDate(historyReadDetails.startTime) &&
|
|
52
|
-
dataValue.sourceTimestamp
|
|
61
|
+
(dataValue.sourceTimestamp || 0) < historyReadDetails.startTime
|
|
53
62
|
) {
|
|
54
63
|
return false;
|
|
55
64
|
}
|
|
56
65
|
if (
|
|
57
66
|
historyReadDetails.endTime &&
|
|
58
67
|
!isMinDate(historyReadDetails.endTime) &&
|
|
59
|
-
dataValue.sourceTimestamp
|
|
68
|
+
(dataValue.sourceTimestamp || 0) > historyReadDetails.endTime
|
|
60
69
|
) {
|
|
61
70
|
return false;
|
|
62
71
|
}
|
|
63
72
|
return true;
|
|
64
73
|
}
|
|
65
74
|
|
|
66
|
-
function inInTimeRange2(historyReadDetails:
|
|
75
|
+
function inInTimeRange2(historyReadDetails: ReadRawModifiedDetails, dataValue: DataValue): boolean {
|
|
67
76
|
if (
|
|
68
77
|
historyReadDetails.endTime &&
|
|
69
78
|
!isMinDate(historyReadDetails.endTime) &&
|
|
70
|
-
dataValue.sourceTimestamp
|
|
79
|
+
(dataValue.sourceTimestamp || 0) > historyReadDetails.endTime
|
|
71
80
|
) {
|
|
72
81
|
return false;
|
|
73
82
|
}
|
|
74
83
|
return !(
|
|
75
84
|
historyReadDetails.startTime &&
|
|
76
85
|
!isMinDate(historyReadDetails.startTime) &&
|
|
77
|
-
dataValue.sourceTimestamp
|
|
86
|
+
(dataValue.sourceTimestamp || 0) < historyReadDetails.startTime
|
|
78
87
|
);
|
|
79
88
|
}
|
|
80
89
|
|
|
81
90
|
function filter_dequeue(
|
|
82
|
-
q:
|
|
91
|
+
q: Dequeue<DataValue>,
|
|
83
92
|
historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
84
93
|
onlyThisNumber: number,
|
|
85
94
|
isReversed: boolean
|
|
86
|
-
) {
|
|
87
|
-
const r:
|
|
95
|
+
): DataValue[] {
|
|
96
|
+
const r: DataValue[] = [];
|
|
88
97
|
const predicate = isReversed
|
|
89
98
|
? inInTimeRange2.bind(null, historyReadRawModifiedDetails)
|
|
90
99
|
: inInTimeRange.bind(null, historyReadRawModifiedDetails);
|
|
@@ -117,7 +126,7 @@ function filter_dequeue(
|
|
|
117
126
|
|
|
118
127
|
export class VariableHistorian implements IVariableHistorian {
|
|
119
128
|
public readonly node: UAVariable;
|
|
120
|
-
private readonly _timeline:
|
|
129
|
+
private readonly _timeline: Dequeue<DataValue>;
|
|
121
130
|
private readonly _maxOnlineValues: number;
|
|
122
131
|
private lastDate: Date;
|
|
123
132
|
private lastDatePicoSeconds: number;
|
|
@@ -149,8 +158,8 @@ export class VariableHistorian implements IVariableHistorian {
|
|
|
149
158
|
this.lastDate,
|
|
150
159
|
"\n last known picoSeconds = ",
|
|
151
160
|
this.lastDatePicoSeconds,
|
|
152
|
-
"\n lastValue = "
|
|
153
|
-
this._timeline[this._timeline.length - 1]?.toString()
|
|
161
|
+
"\n lastValue = "
|
|
162
|
+
/// this._timeline[this._timeline.length - 1]?.toString()
|
|
154
163
|
);
|
|
155
164
|
// artificially increment date by one 100 picoseconds
|
|
156
165
|
newDataValue.sourcePicoseconds++;
|
|
@@ -170,7 +179,7 @@ export class VariableHistorian implements IVariableHistorian {
|
|
|
170
179
|
|
|
171
180
|
if (this._timeline.length >= this._maxOnlineValues || this._timeline.length === 1) {
|
|
172
181
|
const first = this._timeline.first();
|
|
173
|
-
(this.node as UAVariableImpl)._update_startOfOnlineArchive(first
|
|
182
|
+
(this.node as UAVariableImpl)._update_startOfOnlineArchive(first?.sourceTimestamp || minDate);
|
|
174
183
|
// we update the node startOnlineDate
|
|
175
184
|
}
|
|
176
185
|
}
|
|
@@ -204,7 +213,7 @@ function _get_startOfArchive(node: UAVariableImpl) {
|
|
|
204
213
|
if (!node.$historicalDataConfiguration) {
|
|
205
214
|
throw new Error("this variable has no HistoricalDataConfiguration");
|
|
206
215
|
}
|
|
207
|
-
return node.$historicalDataConfiguration
|
|
216
|
+
return node.$historicalDataConfiguration?.startOfArchive?.readValue();
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
function _update_startOfArchive(this: UAVariableImpl, newDate: Date): void {
|
|
@@ -255,7 +264,7 @@ function _historyPush(this: UAVariableImpl, newDataValue: DataValue) {
|
|
|
255
264
|
if (!this.varHistorian) {
|
|
256
265
|
throw new Error("this variable has no HistoricalDataConfiguration");
|
|
257
266
|
}
|
|
258
|
-
assert(Object.
|
|
267
|
+
assert(Object.hasOwn(this, "historizing"), "expecting a historizing attribute on node");
|
|
259
268
|
if (!this.historizing) {
|
|
260
269
|
return; //
|
|
261
270
|
}
|
|
@@ -265,11 +274,11 @@ function _historyPush(this: UAVariableImpl, newDataValue: DataValue) {
|
|
|
265
274
|
|
|
266
275
|
function _historyReadModify(
|
|
267
276
|
this: UAVariable,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
277
|
+
_context: ISessionContext,
|
|
278
|
+
_historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
279
|
+
_indexRange: NumericRange | null,
|
|
280
|
+
_dataEncoding: QualifiedNameLike | null,
|
|
281
|
+
_continuationData: ContinuationData,
|
|
273
282
|
callback: CallbackT<HistoryReadResult>
|
|
274
283
|
) {
|
|
275
284
|
//
|
|
@@ -338,15 +347,18 @@ function _historyReadRawAsync(
|
|
|
338
347
|
callback: CallbackT<DataValue[]>
|
|
339
348
|
) {
|
|
340
349
|
assert(typeof callback === "function");
|
|
341
|
-
this.varHistorian
|
|
350
|
+
if (!this.varHistorian) {
|
|
351
|
+
return callback(new Error("this variable has no HistoricalDataConfiguration"));
|
|
352
|
+
}
|
|
353
|
+
this.varHistorian.extractDataValues(historyReadRawModifiedDetails, maxNumberToExtract, isReversed, reverseDataValue, callback);
|
|
342
354
|
}
|
|
343
355
|
|
|
344
356
|
function _historyReadRaw(
|
|
345
357
|
this: UAVariable,
|
|
346
358
|
context: ISessionContext,
|
|
347
359
|
historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
_indexRange: NumericRange | null,
|
|
361
|
+
_dataEncoding: QualifiedNameLike | null,
|
|
350
362
|
continuationData: ContinuationData,
|
|
351
363
|
callback: CallbackT<HistoryReadResult>
|
|
352
364
|
): void {
|
|
@@ -455,7 +467,8 @@ function _historyReadRaw(
|
|
|
455
467
|
historyData: new HistoryData({ dataValues: values }),
|
|
456
468
|
statusCode
|
|
457
469
|
});
|
|
458
|
-
|
|
470
|
+
callback(null, result2);
|
|
471
|
+
return;
|
|
459
472
|
}
|
|
460
473
|
|
|
461
474
|
// todo add special treatment for when startTime > endTime
|
|
@@ -464,17 +477,18 @@ function _historyReadRaw(
|
|
|
464
477
|
let maxNumberToExtract = 0;
|
|
465
478
|
let isReversed = false;
|
|
466
479
|
let reverseDataValue = false;
|
|
467
|
-
if (isMinDate(historyReadRawModifiedDetails.endTime
|
|
480
|
+
if (isMinDate(historyReadRawModifiedDetails.endTime)) {
|
|
468
481
|
// end time is not specified
|
|
469
482
|
maxNumberToExtract = historyReadRawModifiedDetails.numValuesPerNode;
|
|
470
|
-
if (isMinDate(historyReadRawModifiedDetails.startTime
|
|
483
|
+
if (isMinDate(historyReadRawModifiedDetails.startTime)) {
|
|
471
484
|
// end start and start time are not specified, this is invalid
|
|
472
485
|
const result = new HistoryReadResult({
|
|
473
486
|
statusCode: StatusCodes.BadHistoryOperationUnsupported // should be an error
|
|
474
487
|
});
|
|
475
|
-
|
|
488
|
+
callback(null, result);
|
|
489
|
+
return;
|
|
476
490
|
}
|
|
477
|
-
} else if (isMinDate(historyReadRawModifiedDetails.startTime
|
|
491
|
+
} else if (isMinDate(historyReadRawModifiedDetails.startTime)) {
|
|
478
492
|
// start time is not specified
|
|
479
493
|
// end time is specified
|
|
480
494
|
maxNumberToExtract = historyReadRawModifiedDetails.numValuesPerNode;
|
|
@@ -488,12 +502,13 @@ function _historyReadRaw(
|
|
|
488
502
|
const result = new HistoryReadResult({
|
|
489
503
|
statusCode: StatusCodes.BadHistoryOperationUnsupported // should be an error
|
|
490
504
|
});
|
|
491
|
-
|
|
505
|
+
callback(null, result);
|
|
506
|
+
return;
|
|
492
507
|
}
|
|
493
508
|
} else {
|
|
494
509
|
// start time is specified
|
|
495
510
|
// end time is specified
|
|
496
|
-
if (historyReadRawModifiedDetails.endTime
|
|
511
|
+
if ((historyReadRawModifiedDetails.endTime?.getTime() || 0) < (historyReadRawModifiedDetails.startTime?.getTime() || 0)) {
|
|
497
512
|
reverseDataValue = true;
|
|
498
513
|
const tmp = historyReadRawModifiedDetails.endTime;
|
|
499
514
|
historyReadRawModifiedDetails.endTime = historyReadRawModifiedDetails.startTime;
|
|
@@ -714,7 +729,7 @@ export function AddressSpace_installHistoricalDataNode(
|
|
|
714
729
|
node._historyReadRaw = _historyReadRaw;
|
|
715
730
|
node._historyReadRawAsync = _historyReadRawAsync;
|
|
716
731
|
|
|
717
|
-
node.varHistorian = (options as
|
|
732
|
+
node.varHistorian = (options as { historian?: boolean }).historian || AddressSpace.historizerFactory.create(node, options);
|
|
718
733
|
|
|
719
734
|
const historicalDataConfigurationType = addressSpace.findObjectType("HistoricalDataConfigurationType");
|
|
720
735
|
if (!historicalDataConfigurationType) {
|
package/src/idx_iterator.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
1
|
export class IndexIterator {
|
|
6
|
-
|
|
7
2
|
public current: number[] | null = null;
|
|
8
3
|
constructor(private limits: number[]) {
|
|
9
4
|
this.reset();
|
|
@@ -17,14 +12,13 @@ export class IndexIterator {
|
|
|
17
12
|
public increment() {
|
|
18
13
|
if (!this.current) return;
|
|
19
14
|
|
|
20
|
-
|
|
21
15
|
const increase = (n: number): boolean => {
|
|
22
16
|
if (n < 0) {
|
|
23
17
|
return false;
|
|
24
18
|
}
|
|
25
19
|
if (!this.current) return false;
|
|
26
20
|
if (this.current[n] + 1 >= this.limits[n]) {
|
|
27
|
-
if (n
|
|
21
|
+
if (n === 0) {
|
|
28
22
|
this.current = null;
|
|
29
23
|
return false;
|
|
30
24
|
}
|
|
@@ -33,7 +27,7 @@ export class IndexIterator {
|
|
|
33
27
|
}
|
|
34
28
|
this.current[n] = this.current[n] + 1;
|
|
35
29
|
return true;
|
|
36
|
-
}
|
|
30
|
+
};
|
|
37
31
|
const n = this.limits.length - 1;
|
|
38
32
|
if (!increase(n)) {
|
|
39
33
|
this.current = null;
|
|
@@ -43,10 +37,8 @@ export class IndexIterator {
|
|
|
43
37
|
if (!this.current) {
|
|
44
38
|
throw new Error("Outof bond");
|
|
45
39
|
}
|
|
46
|
-
const r = [...
|
|
40
|
+
const r = [...this.current];
|
|
47
41
|
this.increment();
|
|
48
42
|
return r;
|
|
49
43
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
44
|
+
}
|