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
|
@@ -10,7 +10,7 @@ exports.adjust_userAccessLevel = adjust_userAccessLevel;
|
|
|
10
10
|
/**
|
|
11
11
|
* @module node-opcua-address-space
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const node_util_1 = require("node:util");
|
|
14
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
15
|
const node_opcua_address_space_base_1 = require("node-opcua-address-space-base");
|
|
16
16
|
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
@@ -24,27 +24,26 @@ const node_opcua_numeric_range_1 = require("node-opcua-numeric-range");
|
|
|
24
24
|
const node_opcua_service_write_1 = require("node-opcua-service-write");
|
|
25
25
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
26
26
|
const node_opcua_types_1 = require("node-opcua-types");
|
|
27
|
-
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
28
27
|
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
29
|
-
const session_context_1 = require("../source/session_context");
|
|
30
28
|
const multiform_func_1 = require("../source/helpers/multiform_func");
|
|
29
|
+
const session_context_1 = require("../source/session_context");
|
|
30
|
+
const apply_condition_refresh_1 = require("./apply_condition_refresh");
|
|
31
31
|
const base_node_impl_1 = require("./base_node_impl");
|
|
32
32
|
const base_node_private_1 = require("./base_node_private");
|
|
33
|
-
const ua_data_type_impl_1 = require("./ua_data_type_impl");
|
|
34
|
-
const apply_condition_refresh_1 = require("./apply_condition_refresh");
|
|
35
|
-
const ua_variable_impl_ext_obj_1 = require("./ua_variable_impl_ext_obj");
|
|
36
33
|
const adjust_datavalue_status_code_1 = require("./data_access/adjust_datavalue_status_code");
|
|
37
34
|
const get_basic_datatype_1 = require("./get_basic_datatype");
|
|
35
|
+
const ua_data_type_impl_1 = require("./ua_data_type_impl");
|
|
36
|
+
const ua_variable_impl_ext_obj_1 = require("./ua_variable_impl_ext_obj");
|
|
38
37
|
const validate_data_type_correctness_1 = require("./validate_data_type_correctness");
|
|
39
38
|
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
40
39
|
const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
|
|
41
40
|
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
|
|
42
41
|
const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
|
|
42
|
+
const plainChalk = new Proxy(chalk_1.default, { get: () => (s) => s });
|
|
43
43
|
function adjust_accessLevel(accessLevel) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return accessLevel;
|
|
44
|
+
const flag = (0, node_opcua_data_model_1.makeAccessLevelFlag)(accessLevel ?? "CurrentRead | CurrentWrite");
|
|
45
|
+
(0, node_opcua_assert_1.assert)(Number.isFinite(flag));
|
|
46
|
+
return flag;
|
|
48
47
|
}
|
|
49
48
|
function adjust_userAccessLevel(userAccessLevel, accessLevel) {
|
|
50
49
|
if (userAccessLevel === undefined) {
|
|
@@ -55,7 +54,7 @@ function adjust_userAccessLevel(userAccessLevel, accessLevel) {
|
|
|
55
54
|
return (0, node_opcua_data_model_1.makeAccessLevelFlag)(accessLevel & userAccessLevel);
|
|
56
55
|
}
|
|
57
56
|
function adjust_samplingInterval(minimumSamplingInterval) {
|
|
58
|
-
(0, node_opcua_assert_1.assert)(isFinite(minimumSamplingInterval));
|
|
57
|
+
(0, node_opcua_assert_1.assert)(Number.isFinite(minimumSamplingInterval));
|
|
59
58
|
if (minimumSamplingInterval < 0) {
|
|
60
59
|
return -1; // only -1 is a valid negative value for samplingInterval and means "unspecified"
|
|
61
60
|
}
|
|
@@ -65,8 +64,7 @@ function is_Variant(v) {
|
|
|
65
64
|
return v instanceof node_opcua_variant_1.Variant;
|
|
66
65
|
}
|
|
67
66
|
function is_StatusCode(v) {
|
|
68
|
-
return (v &&
|
|
69
|
-
v.constructor &&
|
|
67
|
+
return !!(v?.constructor &&
|
|
70
68
|
(v instanceof node_opcua_status_code_1.StatusCode ||
|
|
71
69
|
v.constructor.name === "ConstantStatusCode" ||
|
|
72
70
|
v.constructor.name === "StatusCode" ||
|
|
@@ -108,6 +106,13 @@ function default_func(dataValue1, callback1) {
|
|
|
108
106
|
*
|
|
109
107
|
*/
|
|
110
108
|
class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
109
|
+
// -------------- UAvaraibleImplExArray
|
|
110
|
+
$$variableType;
|
|
111
|
+
$$dataType = undefined;
|
|
112
|
+
$$getElementBrowseName;
|
|
113
|
+
$$extensionObjectArray;
|
|
114
|
+
$$indexPropertyName;
|
|
115
|
+
// --------------
|
|
111
116
|
nodeClass = node_opcua_data_model_1.NodeClass.Variable;
|
|
112
117
|
dataType;
|
|
113
118
|
_basicDataType;
|
|
@@ -138,7 +143,10 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
138
143
|
// this could happen in faulty external nodeset and has been seen once
|
|
139
144
|
// in an nano server
|
|
140
145
|
warningLog(super.typeDefinitionObj.toString());
|
|
141
|
-
|
|
146
|
+
const baseVariableType = this.addressSpace.findVariableType("BaseVariableType");
|
|
147
|
+
if (!baseVariableType)
|
|
148
|
+
throw new Error("Cannot find BaseVariableType in address space");
|
|
149
|
+
return baseVariableType;
|
|
142
150
|
}
|
|
143
151
|
return super.typeDefinitionObj;
|
|
144
152
|
}
|
|
@@ -148,8 +156,8 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
148
156
|
constructor(options) {
|
|
149
157
|
super(options);
|
|
150
158
|
(0, node_opcua_variant_1.verifyRankAndDimensions)(options);
|
|
151
|
-
this.valueRank = options.valueRank;
|
|
152
|
-
this.arrayDimensions = options.arrayDimensions;
|
|
159
|
+
this.valueRank = options.valueRank ?? -1;
|
|
160
|
+
this.arrayDimensions = options.arrayDimensions ?? null;
|
|
153
161
|
this.dataType = this.resolveNodeId(options.dataType); // DataType (NodeId)
|
|
154
162
|
this.accessLevel = adjust_accessLevel(options.accessLevel);
|
|
155
163
|
this.userAccessLevel = adjust_userAccessLevel(options.userAccessLevel, this.accessLevel);
|
|
@@ -189,7 +197,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
189
197
|
}
|
|
190
198
|
return this.checkAccessLevelPrivate(context, accessLevel);
|
|
191
199
|
}
|
|
192
|
-
isReadable(
|
|
200
|
+
isReadable(_context) {
|
|
193
201
|
return (this.accessLevel & node_opcua_data_model_1.AccessLevelFlag.CurrentRead) === node_opcua_data_model_1.AccessLevelFlag.CurrentRead;
|
|
194
202
|
}
|
|
195
203
|
isUserReadable(context) {
|
|
@@ -201,7 +209,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
201
209
|
}
|
|
202
210
|
return this.checkAccessLevelPrivate(context, node_opcua_data_model_1.AccessLevelFlag.CurrentRead);
|
|
203
211
|
}
|
|
204
|
-
isWritable(
|
|
212
|
+
isWritable(_context) {
|
|
205
213
|
return (this.accessLevel & node_opcua_data_model_1.AccessLevelFlag.CurrentWrite) === node_opcua_data_model_1.AccessLevelFlag.CurrentWrite;
|
|
206
214
|
}
|
|
207
215
|
isUserWritable(context) {
|
|
@@ -277,7 +285,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
277
285
|
if (this._timestamped_get_func) {
|
|
278
286
|
if (this._timestamped_get_func.length === 0) {
|
|
279
287
|
const dataValueOrPromise = this._timestamped_get_func();
|
|
280
|
-
if (!Object.
|
|
288
|
+
if (!Object.hasOwn(dataValueOrPromise.constructor.prototype, "then")) {
|
|
281
289
|
if (dataValueOrPromise !== this.$dataValue) {
|
|
282
290
|
// we may have a problem here if we use a getter that returns a dataValue that is a ExtensionObject
|
|
283
291
|
if (dataValueOrPromise.value?.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
@@ -331,7 +339,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
331
339
|
return false;
|
|
332
340
|
const dataTypeNode = this.addressSpace.findDataType(this.dataType);
|
|
333
341
|
if (!dataTypeNode) {
|
|
334
|
-
throw new Error(
|
|
342
|
+
throw new Error(` Cannot find DataType ${this.dataType.toString()} in standard address Space`);
|
|
335
343
|
}
|
|
336
344
|
const structureNode = this.addressSpace.findDataType("Structure");
|
|
337
345
|
if (!structureNode) {
|
|
@@ -408,17 +416,17 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
408
416
|
writeEnumValue(value) {
|
|
409
417
|
const enumInfo = this._getEnumerationInfo();
|
|
410
418
|
if (typeof value === "string") {
|
|
411
|
-
if (!Object.
|
|
419
|
+
if (!Object.hasOwn(enumInfo.nameIndex, value)) {
|
|
412
420
|
const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
|
|
413
|
-
throw new Error(
|
|
421
|
+
throw new Error(`UAVariable#writeEnumValue: cannot find value ${value} in [${possibleValues}]`);
|
|
414
422
|
}
|
|
415
423
|
const valueIndex = enumInfo.nameIndex[value].value;
|
|
416
424
|
value = valueIndex;
|
|
417
425
|
}
|
|
418
|
-
if (isFinite(value)) {
|
|
426
|
+
if (Number.isFinite(value)) {
|
|
419
427
|
const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
|
|
420
428
|
if (!enumInfo.valueIndex[value]) {
|
|
421
|
-
throw new Error(
|
|
429
|
+
throw new Error(`UAVariable#writeEnumValue : value out of range ${value} in [${possibleValues}]`);
|
|
422
430
|
}
|
|
423
431
|
this.setValueFromSource({
|
|
424
432
|
dataType: node_opcua_variant_1.DataType.Int32,
|
|
@@ -434,7 +442,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
434
442
|
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
435
443
|
const options = {};
|
|
436
444
|
if (attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
|
|
437
|
-
if (indexRange
|
|
445
|
+
if (indexRange?.isDefined()) {
|
|
438
446
|
options.statusCode = node_opcua_status_code_1.StatusCodes.BadIndexRangeNoData;
|
|
439
447
|
return new node_opcua_data_value_1.DataValue(options);
|
|
440
448
|
}
|
|
@@ -475,7 +483,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
475
483
|
verifyVariantCompatibility(variant) {
|
|
476
484
|
try {
|
|
477
485
|
// c8 ignore next
|
|
478
|
-
if (Object.
|
|
486
|
+
if (Object.hasOwn(variant, "value")) {
|
|
479
487
|
if (variant.dataType === null || variant.dataType === undefined) {
|
|
480
488
|
throw new Error("Variant must provide a valid dataType : variant = " +
|
|
481
489
|
variant.toString() +
|
|
@@ -635,30 +643,30 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
635
643
|
indexRange = node_opcua_numeric_range_1.NumericRange.coerce(indexRange);
|
|
636
644
|
// test write permission
|
|
637
645
|
if (!this.isWritable(context)) {
|
|
638
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
|
|
646
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
|
|
639
647
|
}
|
|
640
648
|
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Write)) {
|
|
641
649
|
return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadUserAccessDenied });
|
|
642
650
|
}
|
|
643
651
|
if (!this.isUserWritable(context)) {
|
|
644
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadWriteNotSupported);
|
|
652
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadWriteNotSupported);
|
|
645
653
|
}
|
|
646
654
|
// adjust special case
|
|
647
655
|
const variant = adjustVariant2.call(this, dataValue.value);
|
|
648
656
|
const statusCode = this.checkVariantCompatibility(variant);
|
|
649
657
|
if (statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
650
|
-
return callback(null, statusCode);
|
|
658
|
+
return callback?.(null, statusCode);
|
|
651
659
|
}
|
|
652
660
|
// adjust dataValue.statusCode based on InstrumentRange and EngineeringUnits
|
|
653
661
|
const statusCode2 = this.adjustDataValueStatusCode(dataValue);
|
|
654
662
|
if (statusCode2.isNotGood()) {
|
|
655
|
-
return callback(null, statusCode2);
|
|
663
|
+
return callback?.(null, statusCode2);
|
|
656
664
|
}
|
|
657
665
|
const write_func = this._timestamped_set_func || default_func;
|
|
658
666
|
if (!write_func) {
|
|
659
|
-
warningLog(
|
|
667
|
+
warningLog(` warning ${this.nodeId.toString()} ${this.browseName.toString()} has no setter. \n`);
|
|
660
668
|
warningLog("Please make sure to bind the variable or to pass a valid value: new Variant({}) during construction time");
|
|
661
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
|
|
669
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
|
|
662
670
|
}
|
|
663
671
|
(0, node_opcua_assert_1.assert)(write_func);
|
|
664
672
|
write_func.call(this, dataValue, (err, statusCode1) => {
|
|
@@ -666,7 +674,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
666
674
|
dataValue && this.verifyVariantCompatibility(dataValue.value);
|
|
667
675
|
if (indexRange && !indexRange.isEmpty()) {
|
|
668
676
|
if (!indexRange.isValid()) {
|
|
669
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadIndexRangeInvalid);
|
|
677
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadIndexRangeInvalid);
|
|
670
678
|
}
|
|
671
679
|
const newArrayOrMatrix = dataValue.value.value;
|
|
672
680
|
if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Array) {
|
|
@@ -678,7 +686,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
678
686
|
const destArr = this.$dataValue.value.value;
|
|
679
687
|
const result = indexRange.set_values(destArr, newArrayOrMatrix);
|
|
680
688
|
if (result.statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
681
|
-
return callback(null, result.statusCode);
|
|
689
|
+
return callback?.(null, result.statusCode);
|
|
682
690
|
}
|
|
683
691
|
dataValue.value.value = result.array;
|
|
684
692
|
// scrap original array so we detect range
|
|
@@ -688,7 +696,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
688
696
|
const dimensions = this.$dataValue.value.dimensions;
|
|
689
697
|
if (this.$dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Matrix || !dimensions) {
|
|
690
698
|
// not a matrix !
|
|
691
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
699
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
692
700
|
}
|
|
693
701
|
const matrix = this.$dataValue.value.value;
|
|
694
702
|
const result = indexRange.set_values_matrix({
|
|
@@ -696,7 +704,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
696
704
|
dimensions
|
|
697
705
|
}, newArrayOrMatrix);
|
|
698
706
|
if (result.statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
699
|
-
return callback(null, result.statusCode);
|
|
707
|
+
return callback?.(null, result.statusCode);
|
|
700
708
|
}
|
|
701
709
|
dataValue.value.dimensions = this.$dataValue.value.dimensions;
|
|
702
710
|
dataValue.value.value = result.matrix;
|
|
@@ -704,20 +712,20 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
704
712
|
this.$dataValue.value.value = null;
|
|
705
713
|
}
|
|
706
714
|
else {
|
|
707
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
715
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
708
716
|
}
|
|
709
717
|
}
|
|
710
718
|
try {
|
|
711
719
|
this._internal_set_dataValue(dataValue, indexRange);
|
|
712
720
|
}
|
|
713
721
|
catch (err) {
|
|
714
|
-
if (
|
|
722
|
+
if (node_util_1.types.isNativeError(err)) {
|
|
715
723
|
warningLog(err.message);
|
|
716
724
|
}
|
|
717
|
-
return callback(null, node_opcua_status_code_1.StatusCodes.BadInternalError);
|
|
725
|
+
return callback?.(null, node_opcua_status_code_1.StatusCodes.BadInternalError);
|
|
718
726
|
}
|
|
719
727
|
}
|
|
720
|
-
callback(err || null, statusCode1);
|
|
728
|
+
callback?.(err || null, statusCode1);
|
|
721
729
|
});
|
|
722
730
|
}
|
|
723
731
|
writeAttribute(context, writeValueOptions, callback) {
|
|
@@ -733,7 +741,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
733
741
|
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
734
742
|
(0, node_opcua_assert_1.assert)(writeValue instanceof node_opcua_service_write_1.WriteValue);
|
|
735
743
|
(0, node_opcua_assert_1.assert)(writeValue.value instanceof node_opcua_data_value_1.DataValue);
|
|
736
|
-
(0, node_opcua_assert_1.assert)(writeValue.value
|
|
744
|
+
(0, node_opcua_assert_1.assert)(writeValue.value?.value instanceof node_opcua_variant_1.Variant);
|
|
737
745
|
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
738
746
|
// Spec 1.0.2 Part 4 page 58
|
|
739
747
|
// If the SourceTimestamp or the ServerTimestamp is specified, the Server shall
|
|
@@ -744,7 +752,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
744
752
|
this.writeValue(context, writeValue.value, writeValue.indexRange, callback);
|
|
745
753
|
break;
|
|
746
754
|
case node_opcua_data_model_1.AttributeIds.Historizing:
|
|
747
|
-
if (writeValue.value
|
|
755
|
+
if (writeValue.value?.value.dataType !== node_opcua_variant_1.DataType.Boolean) {
|
|
748
756
|
return callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
749
757
|
}
|
|
750
758
|
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.WriteHistorizing)) {
|
|
@@ -759,7 +767,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
759
767
|
}
|
|
760
768
|
// check if user is allowed to do that !
|
|
761
769
|
// TODO
|
|
762
|
-
this.historizing = !!writeValue.value
|
|
770
|
+
this.historizing = !!writeValue.value?.value.value; // yes ! indeed !
|
|
763
771
|
return callback(null, node_opcua_status_code_1.StatusCodes.Good);
|
|
764
772
|
default:
|
|
765
773
|
super.writeAttribute(context, writeValue, callback);
|
|
@@ -780,7 +788,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
780
788
|
try {
|
|
781
789
|
this.verifyVariantCompatibility(value);
|
|
782
790
|
}
|
|
783
|
-
catch (
|
|
791
|
+
catch (_err) {
|
|
784
792
|
return node_opcua_status_code_1.StatusCodes.BadTypeMismatch;
|
|
785
793
|
}
|
|
786
794
|
return node_opcua_status_code_1.StatusCodes.Good;
|
|
@@ -937,7 +945,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
937
945
|
}
|
|
938
946
|
// post conditions
|
|
939
947
|
(0, node_opcua_assert_1.assert)(typeof this._timestamped_set_func === "function");
|
|
940
|
-
(0, node_opcua_assert_1.assert)(this._timestamped_set_func
|
|
948
|
+
(0, node_opcua_assert_1.assert)(this._timestamped_set_func?.length === 2, "expecting 2 parameters");
|
|
941
949
|
}
|
|
942
950
|
readValueAsync(context, callback) {
|
|
943
951
|
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
@@ -949,7 +957,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
949
957
|
return;
|
|
950
958
|
}
|
|
951
959
|
if (this.isDisposed()) {
|
|
952
|
-
return callback(null, new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdUnknown }));
|
|
960
|
+
return callback?.(null, new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdUnknown }));
|
|
953
961
|
}
|
|
954
962
|
const readImmediate = (innerCallback) => {
|
|
955
963
|
(0, node_opcua_assert_1.assert)(this.$dataValue instanceof node_opcua_data_value_1.DataValue);
|
|
@@ -983,7 +991,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
983
991
|
// now call all pending callbacks
|
|
984
992
|
const callbacks = this.__waiting_callbacks || [];
|
|
985
993
|
this.__waiting_callbacks = [];
|
|
986
|
-
const
|
|
994
|
+
const _n = callbacks.length;
|
|
987
995
|
for (const callback1 of callbacks) {
|
|
988
996
|
callback1.call(this, err, dataValue);
|
|
989
997
|
}
|
|
@@ -995,7 +1003,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
995
1003
|
// c8 ignore next
|
|
996
1004
|
if (doDebug) {
|
|
997
1005
|
debugLog(chalk_1.default.red("func readValueAsync has failed "));
|
|
998
|
-
if (
|
|
1006
|
+
if (node_util_1.types.isNativeError(err)) {
|
|
999
1007
|
debugLog(" stack", err.stack);
|
|
1000
1008
|
}
|
|
1001
1009
|
}
|
|
@@ -1021,7 +1029,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1021
1029
|
userAccessLevel: this.userAccessLevel,
|
|
1022
1030
|
valueRank: this.valueRank
|
|
1023
1031
|
};
|
|
1024
|
-
const newVariable = (0, base_node_private_1._clone)(this, UAVariableImpl, options, optionalFilter || node_opcua_address_space_base_1.defaultCloneFilter, extraInfo || (0, node_opcua_address_space_base_1.makeDefaultCloneExtraInfo)(this));
|
|
1032
|
+
const newVariable = (0, base_node_private_1._clone)(this, (UAVariableImpl), options, optionalFilter || node_opcua_address_space_base_1.defaultCloneFilter, extraInfo || (0, node_opcua_address_space_base_1.makeDefaultCloneExtraInfo)(this));
|
|
1025
1033
|
newVariable.bindVariable();
|
|
1026
1034
|
(0, node_opcua_assert_1.assert)(typeof newVariable._timestamped_set_func === "function");
|
|
1027
1035
|
(0, node_opcua_assert_1.assert)(newVariable.dataType === this.dataType);
|
|
@@ -1053,7 +1061,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1053
1061
|
const dt = addressSpace.findNode(this.dataType);
|
|
1054
1062
|
// c8 ignore next
|
|
1055
1063
|
if (!dt) {
|
|
1056
|
-
throw new Error(
|
|
1064
|
+
throw new Error(`getDataTypeNode: cannot find dataType ${this.dataType.toString()}`);
|
|
1057
1065
|
}
|
|
1058
1066
|
return dt;
|
|
1059
1067
|
}
|
|
@@ -1080,14 +1088,14 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1080
1088
|
const Constructor = addressSpace.getExtensionObjectConstructor(this.dataType);
|
|
1081
1089
|
if (this.valueRank === -1) {
|
|
1082
1090
|
/** Scalar */
|
|
1083
|
-
if (extObj
|
|
1091
|
+
if (Array.isArray(extObj)) {
|
|
1084
1092
|
return false;
|
|
1085
1093
|
}
|
|
1086
1094
|
return checkExtensionObjectIsCorrectScalar.call(this, extObj);
|
|
1087
1095
|
}
|
|
1088
1096
|
else if (this.valueRank >= 1) {
|
|
1089
1097
|
/** array */
|
|
1090
|
-
if (!(extObj
|
|
1098
|
+
if (!Array.isArray(extObj)) {
|
|
1091
1099
|
// let's coerce this scalar into an 1-element array if it is a valid extension object
|
|
1092
1100
|
if (checkExtensionObjectIsCorrectScalar.call(this, extObj)) {
|
|
1093
1101
|
warningLog(`warning: checkExtensionObjectIsCorrect : expecting a array but got a scalar (value rank of '${this.browseName.toString()}' is 1)\nautomatic conversion from scalar to array with 1 element is taking place.`);
|
|
@@ -1110,7 +1118,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1110
1118
|
}
|
|
1111
1119
|
function checkExtensionObjectIsCorrectScalar(extObj) {
|
|
1112
1120
|
// c8 ignore next
|
|
1113
|
-
if (!
|
|
1121
|
+
if (!extObj?.constructor) {
|
|
1114
1122
|
errorLog(extObj);
|
|
1115
1123
|
throw new Error("expecting an valid extension object");
|
|
1116
1124
|
}
|
|
@@ -1133,7 +1141,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1133
1141
|
function checkExtensionObjectIsCorrectArray(extObjArray) {
|
|
1134
1142
|
// c8 ignore next
|
|
1135
1143
|
for (const extObj of extObjArray) {
|
|
1136
|
-
if (!
|
|
1144
|
+
if (!extObj?.constructor) {
|
|
1137
1145
|
errorLog(extObj);
|
|
1138
1146
|
throw new Error("expecting an valid extension object");
|
|
1139
1147
|
}
|
|
@@ -1190,13 +1198,13 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1190
1198
|
optionalExtensionObject = [optionalExtensionObject];
|
|
1191
1199
|
}
|
|
1192
1200
|
if (optionalExtensionObject) {
|
|
1193
|
-
if (optionalExtensionObject
|
|
1201
|
+
if (Array.isArray(optionalExtensionObject)) {
|
|
1194
1202
|
(0, node_opcua_assert_1.assert)(this.valueRank >= 1, "bindExtensionObject: expecting an Array of Matrix variable here");
|
|
1195
1203
|
return (0, ua_variable_impl_ext_obj_1._bindExtensionObjectArrayOrMatrix)(this, optionalExtensionObject, options);
|
|
1196
1204
|
}
|
|
1197
1205
|
else {
|
|
1198
1206
|
if (this.valueRank !== -1 && this.valueRank !== 0) {
|
|
1199
|
-
throw new Error(
|
|
1207
|
+
throw new Error(`bindExtensionObject: expecting an Scalar variable here but got value rank ${this.valueRank}`);
|
|
1200
1208
|
}
|
|
1201
1209
|
return (0, ua_variable_impl_ext_obj_1._bindExtensionObject)(this, optionalExtensionObject, options);
|
|
1202
1210
|
}
|
|
@@ -1229,21 +1237,98 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1229
1237
|
base_node_private_1.UAVariable_toString.call(this, options);
|
|
1230
1238
|
return options.toString();
|
|
1231
1239
|
}
|
|
1240
|
+
toJSON() {
|
|
1241
|
+
let value;
|
|
1242
|
+
let statusCode;
|
|
1243
|
+
try {
|
|
1244
|
+
const dv = this.$dataValue;
|
|
1245
|
+
if (dv) {
|
|
1246
|
+
statusCode = dv.statusCode?.toString();
|
|
1247
|
+
if (dv.value && !(dv.value.value instanceof node_opcua_extension_object_1.OpaqueStructure)) {
|
|
1248
|
+
value = dv.value.value;
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
catch {
|
|
1253
|
+
// ignore — value access may fail for bound variables
|
|
1254
|
+
}
|
|
1255
|
+
return {
|
|
1256
|
+
...super.toJSON(),
|
|
1257
|
+
typeDefinition: this.typeDefinitionObj?.browseName.toString(),
|
|
1258
|
+
dataType: this.dataType?.toString(),
|
|
1259
|
+
valueRank: this.valueRank,
|
|
1260
|
+
arrayDimensions: this.arrayDimensions,
|
|
1261
|
+
accessLevel: node_opcua_data_model_1.AccessLevelFlag[this.accessLevel],
|
|
1262
|
+
statusCode,
|
|
1263
|
+
value
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
[Symbol.for("nodejs.util.inspect.custom")](depth, inspectOptions) {
|
|
1267
|
+
const c = inspectOptions?.colors === false ? plainChalk : chalk_1.default;
|
|
1268
|
+
const typeName = this.typeDefinitionObj?.browseName.toString() ?? "?";
|
|
1269
|
+
const displayName = this.displayName.length ? this.displayName.map((d) => d.text).join(" | ") : "";
|
|
1270
|
+
if (depth !== null && depth <= 0) {
|
|
1271
|
+
return `${c.cyan("UAVariable<")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}${c.cyan(">")}`;
|
|
1272
|
+
}
|
|
1273
|
+
const dt = this.dataType?.toString() ?? "?";
|
|
1274
|
+
let valueStr = "";
|
|
1275
|
+
let statusStr = "";
|
|
1276
|
+
try {
|
|
1277
|
+
const dv = this.$dataValue;
|
|
1278
|
+
if (dv) {
|
|
1279
|
+
if (dv.statusCode)
|
|
1280
|
+
statusStr = dv.statusCode.toString();
|
|
1281
|
+
if (dv.value &&
|
|
1282
|
+
dv.value.value !== undefined &&
|
|
1283
|
+
dv.value.value !== null &&
|
|
1284
|
+
!(dv.value.value instanceof node_opcua_extension_object_1.OpaqueStructure)) {
|
|
1285
|
+
const v = dv.value.value;
|
|
1286
|
+
valueStr = typeof v === "object" ? Object.prototype.toString.call(v) : String(v);
|
|
1287
|
+
if (valueStr.length > 80)
|
|
1288
|
+
valueStr = `${valueStr.slice(0, 77)}...`;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
catch {
|
|
1293
|
+
// ignore
|
|
1294
|
+
}
|
|
1295
|
+
const lines = [
|
|
1296
|
+
`${c.cyan("UAVariable ")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}`,
|
|
1297
|
+
c.yellow(" typeDefinition : ") + typeName,
|
|
1298
|
+
c.yellow(" displayName : ") + displayName,
|
|
1299
|
+
c.yellow(" dataType : ") + dt,
|
|
1300
|
+
c.yellow(" valueRank : ") + (0, base_node_private_1.valueRankToString)(this.valueRank),
|
|
1301
|
+
c.yellow(" accessLevel : ") + node_opcua_data_model_1.AccessLevelFlag[this.accessLevel]
|
|
1302
|
+
];
|
|
1303
|
+
if (this.arrayDimensions?.length) {
|
|
1304
|
+
lines.push(c.yellow(" arrayDimensions: ") + JSON.stringify(this.arrayDimensions));
|
|
1305
|
+
}
|
|
1306
|
+
if (valueStr) {
|
|
1307
|
+
lines.push(c.yellow(" value : ") + valueStr);
|
|
1308
|
+
}
|
|
1309
|
+
if (statusStr && statusStr !== "Good (0x00000000)") {
|
|
1310
|
+
lines.push(c.yellow(" statusCode : ") + statusStr);
|
|
1311
|
+
}
|
|
1312
|
+
if (this.description?.text) {
|
|
1313
|
+
lines.push(c.yellow(" description : ") + this.description.text);
|
|
1314
|
+
}
|
|
1315
|
+
return lines.join("\n");
|
|
1316
|
+
}
|
|
1232
1317
|
historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback) {
|
|
1233
1318
|
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
1234
1319
|
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
1235
1320
|
if (typeof this._historyRead !== "function") {
|
|
1236
|
-
return callback(null, new node_opcua_types_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable }));
|
|
1321
|
+
return callback?.(null, new node_opcua_types_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable }));
|
|
1237
1322
|
}
|
|
1238
1323
|
this._historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback);
|
|
1239
1324
|
}
|
|
1240
|
-
_historyReadRaw(
|
|
1325
|
+
_historyReadRaw(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
|
|
1241
1326
|
throw new Error("");
|
|
1242
1327
|
}
|
|
1243
|
-
_historyReadRawModify(
|
|
1328
|
+
_historyReadRawModify(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
|
|
1244
1329
|
throw new Error("");
|
|
1245
1330
|
}
|
|
1246
|
-
_historyRead(context,
|
|
1331
|
+
_historyRead(context, _historyReadDetails, _indexRange, _dataEncoding, _continuationData, callback) {
|
|
1247
1332
|
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.ReadHistory)) {
|
|
1248
1333
|
const result = new node_opcua_types_1.HistoryReadResult({
|
|
1249
1334
|
statusCode: node_opcua_status_code_1.StatusCodes.BadUserAccessDenied
|
|
@@ -1261,20 +1346,20 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1261
1346
|
});
|
|
1262
1347
|
callback(null, result);
|
|
1263
1348
|
}
|
|
1264
|
-
_historyPush(
|
|
1349
|
+
_historyPush(_newDataValue) {
|
|
1265
1350
|
throw new Error("");
|
|
1266
1351
|
}
|
|
1267
|
-
_historyReadRawAsync(
|
|
1352
|
+
_historyReadRawAsync(_historyReadRawModifiedDetails, _maxNumberToExtract, _isReversed, _reverseDataValue, _callback) {
|
|
1268
1353
|
throw new Error("");
|
|
1269
1354
|
}
|
|
1270
|
-
_historyReadModify(
|
|
1355
|
+
_historyReadModify(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
|
|
1271
1356
|
throw new Error("");
|
|
1272
1357
|
}
|
|
1273
|
-
_update_startOfOnlineArchive(
|
|
1358
|
+
_update_startOfOnlineArchive(_newDate) {
|
|
1274
1359
|
// please install
|
|
1275
1360
|
throw new Error("");
|
|
1276
1361
|
}
|
|
1277
|
-
_update_startOfArchive(
|
|
1362
|
+
_update_startOfArchive(_newDate) {
|
|
1278
1363
|
throw new Error("");
|
|
1279
1364
|
}
|
|
1280
1365
|
_validate_DataType(variantDataType) {
|
|
@@ -1311,7 +1396,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1311
1396
|
// c8 ignore next
|
|
1312
1397
|
if (!this.checkExtensionObjectIsCorrect(dataValue.value.value)) {
|
|
1313
1398
|
warningLog(dataValue.toString());
|
|
1314
|
-
throw new Error(
|
|
1399
|
+
throw new Error(`Invalid Extension Object on nodeId =${this.nodeId.toString()}`);
|
|
1315
1400
|
}
|
|
1316
1401
|
}
|
|
1317
1402
|
this.verifyVariantCompatibility(dataValue.value);
|
|
@@ -1381,7 +1466,7 @@ class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
|
1381
1466
|
_conditionRefresh(_cache) {
|
|
1382
1467
|
apply_condition_refresh_1.apply_condition_refresh.call(this, _cache);
|
|
1383
1468
|
}
|
|
1384
|
-
handle_semantic_changed() {
|
|
1469
|
+
handle_semantic_changed(_dataValue) {
|
|
1385
1470
|
this.semantic_version = this.semantic_version + 1;
|
|
1386
1471
|
this.emit("semantic_changed");
|
|
1387
1472
|
}
|
|
@@ -1510,7 +1595,7 @@ function check_valid_array(dataType, array) {
|
|
|
1510
1595
|
function unsetFlag(flags, mask) {
|
|
1511
1596
|
return flags & ~mask;
|
|
1512
1597
|
}
|
|
1513
|
-
function
|
|
1598
|
+
function _setFlag(flags, mask) {
|
|
1514
1599
|
return flags | mask;
|
|
1515
1600
|
}
|
|
1516
1601
|
function _calculateEffectiveUserAccessLevelFromPermission(node, context, userAccessLevel) {
|
|
@@ -1542,7 +1627,7 @@ function _calculateEffectiveUserAccessLevelFromPermission(node, context, userAcc
|
|
|
1542
1627
|
}
|
|
1543
1628
|
function adjustVariant2(variant) {
|
|
1544
1629
|
// convert Variant( Scalar|ByteString) => Variant(Array|ByteArray)
|
|
1545
|
-
const
|
|
1630
|
+
const _addressSpace = this.addressSpace;
|
|
1546
1631
|
const basicType = this.getBasicDataType();
|
|
1547
1632
|
variant = (0, node_opcua_variant_1.adjustVariant)(variant, this.valueRank, basicType);
|
|
1548
1633
|
return variant;
|
|
@@ -1602,13 +1687,15 @@ function _Variable_bind_with_async_refresh(options) {
|
|
|
1602
1687
|
(0, node_opcua_assert_1.assert)(!options.timestamped_get, "a getter shall not be specified when refreshFunc is set");
|
|
1603
1688
|
(0, node_opcua_assert_1.assert)(!this.refreshFunc);
|
|
1604
1689
|
this.refreshFunc = options.refreshFunc;
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1690
|
+
/*
|
|
1691
|
+
// TO DO : REVISIT THIS ASSUMPTION
|
|
1692
|
+
if (false && this.minimumSamplingInterval === 0) {
|
|
1693
|
+
// when a getter /timestamped_getter or async_getter is provided
|
|
1694
|
+
// samplingInterval cannot be 0, as the item value must be scanned to be updated.
|
|
1695
|
+
this.minimumSamplingInterval = _default_minimumSamplingInterval; // MonitoredItem.minimumSamplingInterval;
|
|
1696
|
+
debugLog(`adapting minimumSamplingInterval on ${this.browseName.toString()} to ${this.minimumSamplingInterval}`);
|
|
1697
|
+
}
|
|
1698
|
+
*/
|
|
1612
1699
|
}
|
|
1613
1700
|
// variation 2
|
|
1614
1701
|
function _Variable_bind_with_timestamped_get(options) {
|
|
@@ -1652,7 +1739,7 @@ function _Variable_bind_with_timestamped_get(options) {
|
|
|
1652
1739
|
function _Variable_bind_with_simple_get(options) {
|
|
1653
1740
|
(0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
|
|
1654
1741
|
(0, node_opcua_assert_1.assert)(typeof options.get === "function", "should specify get function");
|
|
1655
|
-
(0, node_opcua_assert_1.assert)(options.get
|
|
1742
|
+
(0, node_opcua_assert_1.assert)(options.get?.length === 0, "get function should not have arguments");
|
|
1656
1743
|
(0, node_opcua_assert_1.assert)(!options.timestamped_get, "should not specify a timestamped_get function when get is specified");
|
|
1657
1744
|
(0, node_opcua_assert_1.assert)(!this._timestamped_get_func);
|
|
1658
1745
|
(0, node_opcua_assert_1.assert)(!this._get_func);
|
|
@@ -1668,9 +1755,7 @@ function _Variable_bind_with_simple_get(options) {
|
|
|
1668
1755
|
return new node_opcua_data_value_1.DataValue({ statusCode: value });
|
|
1669
1756
|
}
|
|
1670
1757
|
else {
|
|
1671
|
-
if (!this.$dataValue ||
|
|
1672
|
-
!this.$dataValue.statusCode.isGoodish() ||
|
|
1673
|
-
!(0, node_opcua_variant_1.sameVariant)(this.$dataValue.value, value)) {
|
|
1758
|
+
if (!this.$dataValue?.statusCode.isGoodish() || !(0, node_opcua_variant_1.sameVariant)(this.$dataValue.value, value)) {
|
|
1674
1759
|
// rebuilding artificially timestamps with current clock as they are not provided
|
|
1675
1760
|
// by the underlying getter function
|
|
1676
1761
|
const { timestamp: sourceTimestamp, picoseconds: sourcePicoseconds } = (0, node_opcua_date_time_1.getCurrentClock)();
|
|
@@ -1704,7 +1789,7 @@ function _Variable_bind_with_simple_set(options) {
|
|
|
1704
1789
|
errorLog(chalk_1.default.yellow("StatusCode.Good is assumed"));
|
|
1705
1790
|
return callback(err, node_opcua_status_code_1.StatusCodes.Good, timestamped_value);
|
|
1706
1791
|
}
|
|
1707
|
-
if (statusCode
|
|
1792
|
+
if (statusCode?.isNotGood()) {
|
|
1708
1793
|
// record the value but still record the statusCode !
|
|
1709
1794
|
timestamped_value.statusCode = statusCode;
|
|
1710
1795
|
}
|
|
@@ -1770,7 +1855,7 @@ function bind_getter(options) {
|
|
|
1770
1855
|
_Variable_bind_with_async_refresh.call(this, { refreshFunc: options.refreshFunc });
|
|
1771
1856
|
}
|
|
1772
1857
|
else {
|
|
1773
|
-
(0, node_opcua_assert_1.assert)(!Object.
|
|
1858
|
+
(0, node_opcua_assert_1.assert)(!Object.hasOwn(options, "set"), "getter is missing : a getter must be provided if a setter is provided");
|
|
1774
1859
|
// xx bind_variant.call(this,options);
|
|
1775
1860
|
if (options.dataType !== undefined) {
|
|
1776
1861
|
// if (options.dataType !== DataType.ExtensionObject) {
|
|
@@ -1780,6 +1865,15 @@ function bind_getter(options) {
|
|
|
1780
1865
|
}
|
|
1781
1866
|
}
|
|
1782
1867
|
class UAVariableImplT extends UAVariableImpl {
|
|
1868
|
+
readValue(context, indexRange, dataEncoding) {
|
|
1869
|
+
return super.readValue(context, indexRange, dataEncoding);
|
|
1870
|
+
}
|
|
1871
|
+
readValueAsync(context, callback) {
|
|
1872
|
+
return super.readValueAsync(context, callback);
|
|
1873
|
+
}
|
|
1874
|
+
writeValue(context, dataValue, indexRangeOrCallback, callback) {
|
|
1875
|
+
return super.writeValue(context, dataValue, indexRangeOrCallback, callback);
|
|
1876
|
+
}
|
|
1783
1877
|
}
|
|
1784
1878
|
exports.UAVariableImplT = UAVariableImplT;
|
|
1785
1879
|
function changeUAVariableDataType(uaVariable, newDataType, valueLike) {
|
|
@@ -1788,7 +1882,7 @@ function changeUAVariableDataType(uaVariable, newDataType, valueLike) {
|
|
|
1788
1882
|
const newDataTypeNode = addressSpace.findNode(newDataType);
|
|
1789
1883
|
// c8 ignore next
|
|
1790
1884
|
if (!newDataTypeNode || !(newDataTypeNode instanceof ua_data_type_impl_1.UADataTypeImpl)) {
|
|
1791
|
-
throw new Error(
|
|
1885
|
+
throw new Error(`Cannot find newDataTypeNode ${newDataType.toString()}`);
|
|
1792
1886
|
}
|
|
1793
1887
|
const newBaseDataType = newDataTypeNode.basicDataType;
|
|
1794
1888
|
// c8 ignore next
|