node-opcua-address-space 2.170.1 → 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.js +4 -1
- 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.js +1 -1
- 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 +7 -8
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -1
- package/dist/src/address_space.js +4 -4
- 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 +76 -47
- 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 +4 -6
- 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.js +1 -2
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/check_value_rank_compatibility.js +10 -6
- 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.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 +7 -5
- package/dist/src/ua_object_impl.js +13 -11
- 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 +4 -5
- 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 +43 -45
- package/dist/src/ua_variable_impl.js +99 -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 +1 -1
- package/distHelpers/get_address_space_fixture.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 +10 -7
- 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 +26 -16
- package/src/_mandatory_child_or_requested_optional_filter.ts +16 -15
- package/src/address_space.ts +23 -31
- 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 +106 -82
- 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 +63 -44
- package/src/base_node_private.ts +12 -4
- package/src/check_value_rank_compatibility.ts +18 -14
- 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 +53 -53
- 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 +38 -33
- package/src/ua_object_type_impl.ts +22 -22
- package/src/ua_reference_type_impl.ts +19 -19
- package/src/ua_variable_impl.ts +240 -220
- 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/ua_variable_impl.ts
CHANGED
|
@@ -2,99 +2,94 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @module node-opcua-address-space
|
|
4
4
|
*/
|
|
5
|
-
import { types } from "util";
|
|
5
|
+
import { types } from "node:util";
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
-
|
|
7
|
+
import type {
|
|
8
|
+
BindVariableOptions,
|
|
9
|
+
CloneFilter,
|
|
10
|
+
CloneOptions,
|
|
11
|
+
ISessionContext,
|
|
12
|
+
IVariableHistorian,
|
|
13
|
+
ListenerSignature,
|
|
14
|
+
TimestampGetFunc,
|
|
15
|
+
TimestampSetFunc,
|
|
16
|
+
UADataType,
|
|
17
|
+
UAVariable,
|
|
18
|
+
UAVariableEvents,
|
|
19
|
+
UAVariableType
|
|
20
|
+
} from "node-opcua-address-space-base";
|
|
8
21
|
import {
|
|
9
|
-
BindExtensionObjectOptions,
|
|
10
|
-
CloneExtraInfo,
|
|
11
|
-
ContinuationData,
|
|
12
|
-
makeDefaultCloneExtraInfo,
|
|
22
|
+
type BindExtensionObjectOptions,
|
|
23
|
+
type CloneExtraInfo,
|
|
24
|
+
type ContinuationData,
|
|
13
25
|
defaultCloneFilter,
|
|
14
|
-
GetFunc,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
type GetFunc,
|
|
27
|
+
makeDefaultCloneExtraInfo,
|
|
28
|
+
type SetFunc,
|
|
29
|
+
type VariableDataValueGetterSync,
|
|
30
|
+
type VariableDataValueSetterWithCallback
|
|
18
31
|
} from "node-opcua-address-space-base";
|
|
19
32
|
import { assert } from "node-opcua-assert";
|
|
20
33
|
import {
|
|
21
|
-
isValidDataEncoding,
|
|
22
|
-
convertAccessLevelFlagToByte,
|
|
23
|
-
QualifiedNameLike,
|
|
24
|
-
NodeClass,
|
|
25
34
|
AccessLevelFlag,
|
|
26
|
-
makeAccessLevelFlag,
|
|
27
35
|
AttributeIds,
|
|
36
|
+
convertAccessLevelFlagToByte,
|
|
28
37
|
isDataEncoding,
|
|
29
|
-
|
|
38
|
+
isValidDataEncoding,
|
|
39
|
+
makeAccessLevelFlag,
|
|
40
|
+
NodeClass,
|
|
41
|
+
type QualifiedName,
|
|
42
|
+
type QualifiedNameLike
|
|
30
43
|
} from "node-opcua-data-model";
|
|
31
|
-
import {
|
|
32
|
-
import { coerceClock, getCurrentClock, PreciseClock } from "node-opcua-date-time";
|
|
44
|
+
import { DataValue, type DataValueLike, type DataValueT, extractRange, sameDataValue } from "node-opcua-data-value";
|
|
45
|
+
import { coerceClock, getCurrentClock, type PreciseClock } from "node-opcua-date-time";
|
|
33
46
|
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
34
47
|
import { ExtensionObject, OpaqueStructure } from "node-opcua-extension-object";
|
|
35
|
-
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
48
|
+
import { NodeId, type NodeIdLike } from "node-opcua-nodeid";
|
|
49
|
+
import type { UAHistoricalDataConfiguration } from "node-opcua-nodeset-ua";
|
|
36
50
|
import { NumericRange } from "node-opcua-numeric-range";
|
|
37
51
|
import { WriteValue } from "node-opcua-service-write";
|
|
38
|
-
import {
|
|
52
|
+
import type { StatusCodeCallback } from "node-opcua-status-code";
|
|
53
|
+
import { type CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
39
54
|
import {
|
|
40
|
-
HistoryReadDetails,
|
|
55
|
+
type HistoryReadDetails,
|
|
41
56
|
HistoryReadResult,
|
|
42
57
|
PermissionType,
|
|
43
|
-
ReadAtTimeDetails,
|
|
44
|
-
ReadEventDetails,
|
|
45
|
-
ReadProcessedDetails,
|
|
46
|
-
ReadRawModifiedDetails,
|
|
47
|
-
WriteValueOptions
|
|
58
|
+
type ReadAtTimeDetails,
|
|
59
|
+
type ReadEventDetails,
|
|
60
|
+
type ReadProcessedDetails,
|
|
61
|
+
type ReadRawModifiedDetails,
|
|
62
|
+
type WriteValueOptions
|
|
48
63
|
} from "node-opcua-types";
|
|
49
|
-
import { isNullOrUndefined } from "node-opcua-utils";
|
|
50
64
|
import {
|
|
51
|
-
|
|
52
|
-
VariantLike,
|
|
65
|
+
adjustVariant,
|
|
53
66
|
DataType,
|
|
54
67
|
sameVariant,
|
|
68
|
+
Variant,
|
|
55
69
|
VariantArrayType,
|
|
56
|
-
|
|
70
|
+
type VariantLike,
|
|
57
71
|
verifyRankAndDimensions
|
|
58
72
|
} from "node-opcua-variant";
|
|
59
|
-
import { StatusCodeCallback } from "node-opcua-status-code";
|
|
60
|
-
import {
|
|
61
|
-
BindVariableOptions,
|
|
62
|
-
IVariableHistorian,
|
|
63
|
-
TimestampGetFunc,
|
|
64
|
-
TimestampSetFunc,
|
|
65
|
-
UADataType,
|
|
66
|
-
UAVariable,
|
|
67
|
-
UAVariableType,
|
|
68
|
-
CloneOptions,
|
|
69
|
-
CloneFilter,
|
|
70
|
-
ISessionContext,
|
|
71
|
-
BaseNode,
|
|
72
|
-
UAVariableT
|
|
73
|
-
} from "node-opcua-address-space-base";
|
|
74
|
-
import { UAHistoricalDataConfiguration } from "node-opcua-nodeset-ua";
|
|
75
|
-
|
|
76
|
-
import { SessionContext } from "../source/session_context";
|
|
77
73
|
import { convertToCallbackFunction1 } from "../source/helpers/multiform_func";
|
|
78
|
-
import {
|
|
74
|
+
import { SessionContext } from "../source/session_context";
|
|
75
|
+
import { apply_condition_refresh, type ConditionRefreshCache } from "./apply_condition_refresh";
|
|
76
|
+
import { BaseNodeImpl, type InternalBaseNodeOptions } from "./base_node_impl";
|
|
79
77
|
import { _clone, ToStringBuilder, UAVariable_toString, valueRankToString } from "./base_node_private";
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
78
|
+
import { adjustDataValueStatusCode } from "./data_access/adjust_datavalue_status_code";
|
|
79
|
+
import { _getBasicDataType } from "./get_basic_datatype";
|
|
80
|
+
import { type EnumerationInfo, type IEnumItem, UADataTypeImpl } from "./ua_data_type_impl";
|
|
82
81
|
import {
|
|
82
|
+
_bindExtensionObject,
|
|
83
|
+
_bindExtensionObjectArrayOrMatrix,
|
|
84
|
+
_installExtensionObjectBindingOnProperties,
|
|
83
85
|
extractPartialData,
|
|
84
86
|
incrementElement,
|
|
85
87
|
propagateTouchValueDownward,
|
|
86
88
|
propagateTouchValueDownwardArray,
|
|
87
89
|
propagateTouchValueUpward,
|
|
88
|
-
setExtensionObjectPartialValue
|
|
89
|
-
_bindExtensionObject,
|
|
90
|
-
_bindExtensionObjectArrayOrMatrix,
|
|
91
|
-
_installExtensionObjectBindingOnProperties,
|
|
92
|
-
_touchValue
|
|
90
|
+
setExtensionObjectPartialValue
|
|
93
91
|
} from "./ua_variable_impl_ext_obj";
|
|
94
|
-
import { adjustDataValueStatusCode } from "./data_access/adjust_datavalue_status_code";
|
|
95
|
-
import { _getBasicDataType } from "./get_basic_datatype";
|
|
96
92
|
import { validateDataTypeCorrectness } from "./validate_data_type_correctness";
|
|
97
|
-
import { DataTypeIds } from "node-opcua-constants";
|
|
98
93
|
|
|
99
94
|
const debugLog = make_debugLog(__filename);
|
|
100
95
|
const warningLog = make_warningLog(__filename);
|
|
@@ -103,16 +98,15 @@ const errorLog = make_errorLog(__filename);
|
|
|
103
98
|
|
|
104
99
|
const plainChalk = new Proxy(chalk, { get: () => (s: string) => s }) as typeof chalk;
|
|
105
100
|
|
|
106
|
-
export function adjust_accessLevel(accessLevel: string | number | null): AccessLevelFlag {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return accessLevel;
|
|
101
|
+
export function adjust_accessLevel(accessLevel: string | number | AccessLevelFlag | null | undefined): AccessLevelFlag {
|
|
102
|
+
const flag = makeAccessLevelFlag(accessLevel ?? "CurrentRead | CurrentWrite");
|
|
103
|
+
assert(Number.isFinite(flag));
|
|
104
|
+
return flag;
|
|
111
105
|
}
|
|
112
106
|
|
|
113
107
|
export function adjust_userAccessLevel(
|
|
114
|
-
userAccessLevel: string | number | null | undefined,
|
|
115
|
-
accessLevel: string | number | null
|
|
108
|
+
userAccessLevel: string | number | AccessLevelFlag | null | undefined,
|
|
109
|
+
accessLevel: string | number | AccessLevelFlag | null
|
|
116
110
|
): AccessLevelFlag | undefined {
|
|
117
111
|
if (userAccessLevel === undefined) {
|
|
118
112
|
return undefined;
|
|
@@ -123,21 +117,20 @@ export function adjust_userAccessLevel(
|
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
function adjust_samplingInterval(minimumSamplingInterval: number): number {
|
|
126
|
-
assert(isFinite(minimumSamplingInterval));
|
|
120
|
+
assert(Number.isFinite(minimumSamplingInterval));
|
|
127
121
|
if (minimumSamplingInterval < 0) {
|
|
128
122
|
return -1; // only -1 is a valid negative value for samplingInterval and means "unspecified"
|
|
129
123
|
}
|
|
130
124
|
return minimumSamplingInterval;
|
|
131
125
|
}
|
|
132
126
|
|
|
133
|
-
function is_Variant(v:
|
|
127
|
+
function is_Variant(v: unknown): boolean {
|
|
134
128
|
return v instanceof Variant;
|
|
135
129
|
}
|
|
136
130
|
|
|
137
|
-
function is_StatusCode(v:
|
|
138
|
-
return (
|
|
139
|
-
v &&
|
|
140
|
-
v.constructor &&
|
|
131
|
+
function is_StatusCode(v: unknown): boolean {
|
|
132
|
+
return !!(
|
|
133
|
+
v?.constructor &&
|
|
141
134
|
(v instanceof StatusCode ||
|
|
142
135
|
v.constructor.name === "ConstantStatusCode" ||
|
|
143
136
|
v.constructor.name === "StatusCode" ||
|
|
@@ -145,7 +138,7 @@ function is_StatusCode(v: any): boolean {
|
|
|
145
138
|
);
|
|
146
139
|
}
|
|
147
140
|
|
|
148
|
-
function is_Variant_or_StatusCode(v:
|
|
141
|
+
function is_Variant_or_StatusCode(v: unknown): boolean {
|
|
149
142
|
if (is_Variant(v)) {
|
|
150
143
|
// /@@assert(v.isValid());
|
|
151
144
|
}
|
|
@@ -157,7 +150,7 @@ function default_func(this: UAVariable, dataValue1: DataValue, callback1: Callba
|
|
|
157
150
|
}
|
|
158
151
|
|
|
159
152
|
interface UAVariableOptions extends InternalBaseNodeOptions {
|
|
160
|
-
value?:
|
|
153
|
+
value?: unknown;
|
|
161
154
|
dataType: NodeId | string;
|
|
162
155
|
/**
|
|
163
156
|
* This attribute indicates whether the Value attribute of the Variable is an array and how many dimensions the array has.
|
|
@@ -172,10 +165,10 @@ interface UAVariableOptions extends InternalBaseNodeOptions {
|
|
|
172
165
|
*/
|
|
173
166
|
valueRank?: number;
|
|
174
167
|
arrayDimensions?: null | number[];
|
|
175
|
-
accessLevel?:
|
|
176
|
-
userAccessLevel?:
|
|
168
|
+
accessLevel?: keyof typeof AccessLevelFlag | AccessLevelFlag | null;
|
|
169
|
+
userAccessLevel?: keyof typeof AccessLevelFlag | AccessLevelFlag | null;
|
|
177
170
|
minimumSamplingInterval?: number; // default -1
|
|
178
|
-
historizing?:
|
|
171
|
+
historizing?: boolean;
|
|
179
172
|
}
|
|
180
173
|
|
|
181
174
|
/**
|
|
@@ -204,7 +197,19 @@ interface UAVariableOptions extends InternalBaseNodeOptions {
|
|
|
204
197
|
* indicates if the history of the Variable is available via the OPC UA server.
|
|
205
198
|
*
|
|
206
199
|
*/
|
|
207
|
-
export class UAVariableImpl extends
|
|
200
|
+
export class UAVariableImpl<T extends UAVariableEvents & ListenerSignature<T> = UAVariableEvents>
|
|
201
|
+
extends BaseNodeImpl<T>
|
|
202
|
+
implements UAVariable<T>, UAVariableImplExtArray
|
|
203
|
+
{
|
|
204
|
+
|
|
205
|
+
// -------------- UAvaraibleImplExArray
|
|
206
|
+
$$variableType?: UAVariableType;
|
|
207
|
+
$$dataType?: UADataType = undefined;
|
|
208
|
+
$$getElementBrowseName?: (extObject: ExtensionObject, index: number | number[]) => QualifiedName;
|
|
209
|
+
$$extensionObjectArray?: ExtensionObject[];
|
|
210
|
+
$$indexPropertyName?: string;
|
|
211
|
+
// --------------
|
|
212
|
+
|
|
208
213
|
public readonly nodeClass = NodeClass.Variable;
|
|
209
214
|
|
|
210
215
|
public dataType: NodeId;
|
|
@@ -241,7 +246,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
241
246
|
// this could happen in faulty external nodeset and has been seen once
|
|
242
247
|
// in an nano server
|
|
243
248
|
warningLog(super.typeDefinitionObj.toString());
|
|
244
|
-
const baseVariableType= this.addressSpace.findVariableType("BaseVariableType");
|
|
249
|
+
const baseVariableType = this.addressSpace.findVariableType("BaseVariableType");
|
|
245
250
|
if (!baseVariableType) throw new Error("Cannot find BaseVariableType in address space");
|
|
246
251
|
return baseVariableType;
|
|
247
252
|
}
|
|
@@ -254,8 +259,8 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
254
259
|
super(options);
|
|
255
260
|
|
|
256
261
|
verifyRankAndDimensions(options);
|
|
257
|
-
this.valueRank = options.valueRank
|
|
258
|
-
this.arrayDimensions = options.arrayDimensions
|
|
262
|
+
this.valueRank = options.valueRank ?? -1;
|
|
263
|
+
this.arrayDimensions = options.arrayDimensions ?? null;
|
|
259
264
|
|
|
260
265
|
this.dataType = this.resolveNodeId(options.dataType); // DataType (NodeId)
|
|
261
266
|
|
|
@@ -308,7 +313,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
308
313
|
return this.checkAccessLevelPrivate(context, accessLevel);
|
|
309
314
|
}
|
|
310
315
|
|
|
311
|
-
public isReadable(
|
|
316
|
+
public isReadable(_context: ISessionContext): boolean {
|
|
312
317
|
return (this.accessLevel & AccessLevelFlag.CurrentRead) === AccessLevelFlag.CurrentRead;
|
|
313
318
|
}
|
|
314
319
|
|
|
@@ -322,7 +327,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
322
327
|
return this.checkAccessLevelPrivate(context, AccessLevelFlag.CurrentRead);
|
|
323
328
|
}
|
|
324
329
|
|
|
325
|
-
public isWritable(
|
|
330
|
+
public isWritable(_context: ISessionContext): boolean {
|
|
326
331
|
return (this.accessLevel & AccessLevelFlag.CurrentWrite) === AccessLevelFlag.CurrentWrite;
|
|
327
332
|
}
|
|
328
333
|
|
|
@@ -408,7 +413,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
408
413
|
if (this._timestamped_get_func) {
|
|
409
414
|
if (this._timestamped_get_func.length === 0) {
|
|
410
415
|
const dataValueOrPromise = (this._timestamped_get_func as VariableDataValueGetterSync)();
|
|
411
|
-
if (!Object.
|
|
416
|
+
if (!Object.hasOwn(dataValueOrPromise.constructor.prototype, "then")) {
|
|
412
417
|
if (dataValueOrPromise !== this.$dataValue) {
|
|
413
418
|
// we may have a problem here if we use a getter that returns a dataValue that is a ExtensionObject
|
|
414
419
|
if (dataValueOrPromise.value?.dataType === DataType.ExtensionObject) {
|
|
@@ -450,10 +455,10 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
450
455
|
) {
|
|
451
456
|
debugLog(
|
|
452
457
|
chalk.red(" Warning: UAVariable#readValue ") +
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
458
|
+
chalk.cyan(this.browseName.toString()) +
|
|
459
|
+
" (" +
|
|
460
|
+
chalk.yellow(this.nodeId.toString()) +
|
|
461
|
+
") exists but dataValue has not been defined"
|
|
457
462
|
);
|
|
458
463
|
}
|
|
459
464
|
return dataValue;
|
|
@@ -472,9 +477,9 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
472
477
|
if (this.dataType.isEmpty()) return false;
|
|
473
478
|
const dataTypeNode = this.addressSpace.findDataType(this.dataType) as UADataType;
|
|
474
479
|
if (!dataTypeNode) {
|
|
475
|
-
throw new Error(
|
|
480
|
+
throw new Error(` Cannot find DataType ${this.dataType.toString()} in standard address Space`);
|
|
476
481
|
}
|
|
477
|
-
const structureNode = this.addressSpace.findDataType("Structure")
|
|
482
|
+
const structureNode = this.addressSpace.findDataType("Structure");
|
|
478
483
|
if (!structureNode) {
|
|
479
484
|
throw new Error(" Cannot find 'Structure' DataType in standard address Space");
|
|
480
485
|
}
|
|
@@ -484,7 +489,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
484
489
|
public _getEnumerationInfo(): EnumerationInfo {
|
|
485
490
|
// DataType must be one of Enumeration
|
|
486
491
|
assert(this.isEnumeration(), "Variable is not an enumeration");
|
|
487
|
-
const dataTypeNode = this.addressSpace.findDataType(this.dataType)
|
|
492
|
+
const dataTypeNode = this.addressSpace.findDataType(this.dataType) as UADataTypeImpl;
|
|
488
493
|
return dataTypeNode._getEnumerationInfo();
|
|
489
494
|
}
|
|
490
495
|
|
|
@@ -566,18 +571,18 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
566
571
|
const enumInfo = this._getEnumerationInfo();
|
|
567
572
|
|
|
568
573
|
if (typeof value === "string") {
|
|
569
|
-
if (!Object.
|
|
574
|
+
if (!Object.hasOwn(enumInfo.nameIndex, value)) {
|
|
570
575
|
const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
|
|
571
|
-
throw new Error(
|
|
576
|
+
throw new Error(`UAVariable#writeEnumValue: cannot find value ${value} in [${possibleValues}]`);
|
|
572
577
|
}
|
|
573
578
|
const valueIndex = enumInfo.nameIndex[value].value;
|
|
574
579
|
value = valueIndex;
|
|
575
580
|
}
|
|
576
|
-
if (isFinite(value)) {
|
|
581
|
+
if (Number.isFinite(value)) {
|
|
577
582
|
const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
|
|
578
583
|
|
|
579
584
|
if (!enumInfo.valueIndex[value]) {
|
|
580
|
-
throw new Error(
|
|
585
|
+
throw new Error(`UAVariable#writeEnumValue : value out of range ${value} in [${possibleValues}]`);
|
|
581
586
|
}
|
|
582
587
|
this.setValueFromSource({
|
|
583
588
|
dataType: DataType.Int32,
|
|
@@ -600,7 +605,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
600
605
|
const options: DataValueLike = {};
|
|
601
606
|
|
|
602
607
|
if (attributeId !== AttributeIds.Value) {
|
|
603
|
-
if (indexRange
|
|
608
|
+
if (indexRange?.isDefined()) {
|
|
604
609
|
options.statusCode = StatusCodes.BadIndexRangeNoData;
|
|
605
610
|
return new DataValue(options);
|
|
606
611
|
}
|
|
@@ -651,13 +656,13 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
651
656
|
public verifyVariantCompatibility(variant: Variant): void {
|
|
652
657
|
try {
|
|
653
658
|
// c8 ignore next
|
|
654
|
-
if (Object.
|
|
659
|
+
if (Object.hasOwn(variant, "value")) {
|
|
655
660
|
if (variant.dataType === null || variant.dataType === undefined) {
|
|
656
661
|
throw new Error(
|
|
657
662
|
"Variant must provide a valid dataType : variant = " +
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
663
|
+
variant.toString() +
|
|
664
|
+
" this.dataType= " +
|
|
665
|
+
this.dataType.toString()
|
|
661
666
|
);
|
|
662
667
|
}
|
|
663
668
|
if (
|
|
@@ -666,9 +671,9 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
666
671
|
) {
|
|
667
672
|
throw new Error(
|
|
668
673
|
"Variant must provide a valid Boolean : variant = " +
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
674
|
+
variant.toString() +
|
|
675
|
+
" this.dataType= " +
|
|
676
|
+
this.dataType.toString()
|
|
672
677
|
);
|
|
673
678
|
}
|
|
674
679
|
if (
|
|
@@ -679,9 +684,9 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
679
684
|
) {
|
|
680
685
|
throw new Error(
|
|
681
686
|
"Variant must provide a valid LocalizedText : variant = " +
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
687
|
+
variant.toString() +
|
|
688
|
+
" this.dataType= " +
|
|
689
|
+
this.dataType.toString()
|
|
685
690
|
);
|
|
686
691
|
}
|
|
687
692
|
}
|
|
@@ -840,14 +845,14 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
840
845
|
|
|
841
846
|
// test write permission
|
|
842
847
|
if (!this.isWritable(context)) {
|
|
843
|
-
return callback
|
|
848
|
+
return callback?.(null, StatusCodes.BadNotWritable);
|
|
844
849
|
}
|
|
845
850
|
if (!this.checkPermissionPrivate(context, PermissionType.Write)) {
|
|
846
851
|
return new DataValue({ statusCode: StatusCodes.BadUserAccessDenied });
|
|
847
852
|
}
|
|
848
853
|
|
|
849
854
|
if (!this.isUserWritable(context)) {
|
|
850
|
-
return callback
|
|
855
|
+
return callback?.(null, StatusCodes.BadWriteNotSupported);
|
|
851
856
|
}
|
|
852
857
|
|
|
853
858
|
// adjust special case
|
|
@@ -855,21 +860,21 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
855
860
|
|
|
856
861
|
const statusCode = this.checkVariantCompatibility(variant);
|
|
857
862
|
if (statusCode.isNot(StatusCodes.Good)) {
|
|
858
|
-
return callback
|
|
863
|
+
return callback?.(null, statusCode);
|
|
859
864
|
}
|
|
860
865
|
|
|
861
866
|
// adjust dataValue.statusCode based on InstrumentRange and EngineeringUnits
|
|
862
867
|
const statusCode2 = this.adjustDataValueStatusCode(dataValue);
|
|
863
868
|
if (statusCode2.isNotGood()) {
|
|
864
|
-
return callback
|
|
869
|
+
return callback?.(null, statusCode2);
|
|
865
870
|
}
|
|
866
871
|
|
|
867
872
|
const write_func = this._timestamped_set_func || default_func;
|
|
868
873
|
|
|
869
874
|
if (!write_func) {
|
|
870
|
-
warningLog(
|
|
875
|
+
warningLog(` warning ${this.nodeId.toString()} ${this.browseName.toString()} has no setter. \n`);
|
|
871
876
|
warningLog("Please make sure to bind the variable or to pass a valid value: new Variant({}) during construction time");
|
|
872
|
-
return callback
|
|
877
|
+
return callback?.(null, StatusCodes.BadNotWritable);
|
|
873
878
|
}
|
|
874
879
|
assert(write_func);
|
|
875
880
|
|
|
@@ -879,7 +884,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
879
884
|
|
|
880
885
|
if (indexRange && !indexRange.isEmpty()) {
|
|
881
886
|
if (!indexRange.isValid()) {
|
|
882
|
-
return callback
|
|
887
|
+
return callback?.(null, StatusCodes.BadIndexRangeInvalid);
|
|
883
888
|
}
|
|
884
889
|
|
|
885
890
|
const newArrayOrMatrix = dataValue.value.value;
|
|
@@ -894,7 +899,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
894
899
|
const result = indexRange.set_values(destArr, newArrayOrMatrix);
|
|
895
900
|
|
|
896
901
|
if (result.statusCode.isNot(StatusCodes.Good)) {
|
|
897
|
-
return callback
|
|
902
|
+
return callback?.(null, result.statusCode);
|
|
898
903
|
}
|
|
899
904
|
dataValue.value.value = result.array;
|
|
900
905
|
|
|
@@ -904,7 +909,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
904
909
|
const dimensions = this.$dataValue.value.dimensions;
|
|
905
910
|
if (this.$dataValue.value.arrayType !== VariantArrayType.Matrix || !dimensions) {
|
|
906
911
|
// not a matrix !
|
|
907
|
-
return callback
|
|
912
|
+
return callback?.(null, StatusCodes.BadTypeMismatch);
|
|
908
913
|
}
|
|
909
914
|
const matrix = this.$dataValue.value.value;
|
|
910
915
|
const result = indexRange.set_values_matrix(
|
|
@@ -915,7 +920,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
915
920
|
newArrayOrMatrix
|
|
916
921
|
);
|
|
917
922
|
if (result.statusCode.isNot(StatusCodes.Good)) {
|
|
918
|
-
return callback
|
|
923
|
+
return callback?.(null, result.statusCode);
|
|
919
924
|
}
|
|
920
925
|
dataValue.value.dimensions = this.$dataValue.value.dimensions;
|
|
921
926
|
dataValue.value.value = result.matrix;
|
|
@@ -923,7 +928,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
923
928
|
// scrap original array so we detect range
|
|
924
929
|
this.$dataValue.value.value = null;
|
|
925
930
|
} else {
|
|
926
|
-
return callback
|
|
931
|
+
return callback?.(null, StatusCodes.BadTypeMismatch);
|
|
927
932
|
}
|
|
928
933
|
}
|
|
929
934
|
try {
|
|
@@ -932,10 +937,10 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
932
937
|
if (types.isNativeError(err)) {
|
|
933
938
|
warningLog(err.message);
|
|
934
939
|
}
|
|
935
|
-
return callback
|
|
940
|
+
return callback?.(null, StatusCodes.BadInternalError);
|
|
936
941
|
}
|
|
937
942
|
}
|
|
938
|
-
callback
|
|
943
|
+
callback?.(err || null, statusCode1);
|
|
939
944
|
});
|
|
940
945
|
}
|
|
941
946
|
|
|
@@ -962,7 +967,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
962
967
|
assert(context instanceof SessionContext);
|
|
963
968
|
assert(writeValue instanceof WriteValue);
|
|
964
969
|
assert(writeValue.value instanceof DataValue);
|
|
965
|
-
assert(writeValue.value
|
|
970
|
+
assert(writeValue.value?.value instanceof Variant);
|
|
966
971
|
assert(typeof callback === "function");
|
|
967
972
|
|
|
968
973
|
// Spec 1.0.2 Part 4 page 58
|
|
@@ -976,7 +981,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
976
981
|
this.writeValue(context, writeValue.value!, writeValue.indexRange!, callback);
|
|
977
982
|
break;
|
|
978
983
|
case AttributeIds.Historizing:
|
|
979
|
-
if (writeValue.value
|
|
984
|
+
if (writeValue.value?.value.dataType !== DataType.Boolean) {
|
|
980
985
|
return callback(null, StatusCodes.BadTypeMismatch);
|
|
981
986
|
}
|
|
982
987
|
if (!this.checkPermissionPrivate(context, PermissionType.WriteHistorizing)) {
|
|
@@ -993,7 +998,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
993
998
|
}
|
|
994
999
|
// check if user is allowed to do that !
|
|
995
1000
|
// TODO
|
|
996
|
-
this.historizing = !!writeValue.value
|
|
1001
|
+
this.historizing = !!writeValue.value?.value.value; // yes ! indeed !
|
|
997
1002
|
return callback(null, StatusCodes.Good);
|
|
998
1003
|
|
|
999
1004
|
default:
|
|
@@ -1015,7 +1020,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1015
1020
|
}
|
|
1016
1021
|
try {
|
|
1017
1022
|
this.verifyVariantCompatibility(value);
|
|
1018
|
-
} catch (
|
|
1023
|
+
} catch (_err) {
|
|
1019
1024
|
return StatusCodes.BadTypeMismatch;
|
|
1020
1025
|
}
|
|
1021
1026
|
return StatusCodes.Good;
|
|
@@ -1179,7 +1184,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1179
1184
|
}
|
|
1180
1185
|
// post conditions
|
|
1181
1186
|
assert(typeof this._timestamped_set_func === "function");
|
|
1182
|
-
assert(this._timestamped_set_func
|
|
1187
|
+
assert(this._timestamped_set_func?.length === 2, "expecting 2 parameters");
|
|
1183
1188
|
}
|
|
1184
1189
|
|
|
1185
1190
|
/**
|
|
@@ -1201,7 +1206,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1201
1206
|
}
|
|
1202
1207
|
|
|
1203
1208
|
if (this.isDisposed()) {
|
|
1204
|
-
return callback
|
|
1209
|
+
return callback?.(null, new DataValue({ statusCode: StatusCodes.BadNodeIdUnknown }));
|
|
1205
1210
|
}
|
|
1206
1211
|
|
|
1207
1212
|
const readImmediate = (innerCallback: (err: Error | null, dataValue: DataValue) => void) => {
|
|
@@ -1236,7 +1241,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1236
1241
|
// now call all pending callbacks
|
|
1237
1242
|
const callbacks = this.__waiting_callbacks || [];
|
|
1238
1243
|
this.__waiting_callbacks = [];
|
|
1239
|
-
const
|
|
1244
|
+
const _n = callbacks.length;
|
|
1240
1245
|
for (const callback1 of callbacks) {
|
|
1241
1246
|
callback1.call(this, err, dataValue);
|
|
1242
1247
|
}
|
|
@@ -1281,11 +1286,11 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1281
1286
|
|
|
1282
1287
|
const newVariable = _clone(
|
|
1283
1288
|
this,
|
|
1284
|
-
UAVariableImpl
|
|
1289
|
+
UAVariableImpl<T>,
|
|
1285
1290
|
options,
|
|
1286
1291
|
optionalFilter || defaultCloneFilter,
|
|
1287
1292
|
extraInfo || makeDefaultCloneExtraInfo(this)
|
|
1288
|
-
) as UAVariableImpl
|
|
1293
|
+
) as UAVariableImpl<T>;
|
|
1289
1294
|
|
|
1290
1295
|
newVariable.bindVariable();
|
|
1291
1296
|
|
|
@@ -1321,7 +1326,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1321
1326
|
const dt = addressSpace.findNode(this.dataType);
|
|
1322
1327
|
// c8 ignore next
|
|
1323
1328
|
if (!dt) {
|
|
1324
|
-
throw new Error(
|
|
1329
|
+
throw new Error(`getDataTypeNode: cannot find dataType ${this.dataType.toString()}`);
|
|
1325
1330
|
}
|
|
1326
1331
|
return dt as UADataType;
|
|
1327
1332
|
}
|
|
@@ -1336,7 +1341,6 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1336
1341
|
}
|
|
1337
1342
|
const addressSpace = this.addressSpace;
|
|
1338
1343
|
if (!addressSpace) {
|
|
1339
|
-
|
|
1340
1344
|
return true;
|
|
1341
1345
|
}
|
|
1342
1346
|
const dataType = addressSpace.findDataType(this.dataType);
|
|
@@ -1352,13 +1356,13 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1352
1356
|
|
|
1353
1357
|
if (this.valueRank === -1) {
|
|
1354
1358
|
/** Scalar */
|
|
1355
|
-
if (extObj
|
|
1359
|
+
if (Array.isArray(extObj)) {
|
|
1356
1360
|
return false;
|
|
1357
1361
|
}
|
|
1358
1362
|
return checkExtensionObjectIsCorrectScalar.call(this, extObj);
|
|
1359
1363
|
} else if (this.valueRank >= 1) {
|
|
1360
1364
|
/** array */
|
|
1361
|
-
if (!(extObj
|
|
1365
|
+
if (!Array.isArray(extObj)) {
|
|
1362
1366
|
// let's coerce this scalar into an 1-element array if it is a valid extension object
|
|
1363
1367
|
if (checkExtensionObjectIsCorrectScalar.call(this, extObj)) {
|
|
1364
1368
|
warningLog(
|
|
@@ -1381,16 +1385,13 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1381
1385
|
`checkExtensionObjectIsCorrect: Not Implemented case, please contact sterfive : this.valueRank =${this.valueRank}`
|
|
1382
1386
|
);
|
|
1383
1387
|
}
|
|
1384
|
-
function checkExtensionObjectIsCorrectScalar(
|
|
1385
|
-
this: UAVariableImpl,
|
|
1386
|
-
extObj: ExtensionObject | null
|
|
1387
|
-
): boolean {
|
|
1388
|
+
function checkExtensionObjectIsCorrectScalar(this: UAVariableImpl, extObj: ExtensionObject | null): boolean {
|
|
1388
1389
|
// c8 ignore next
|
|
1389
|
-
if (!
|
|
1390
|
+
if (!extObj?.constructor) {
|
|
1390
1391
|
errorLog(extObj);
|
|
1391
1392
|
throw new Error("expecting an valid extension object");
|
|
1392
1393
|
}
|
|
1393
|
-
|
|
1394
|
+
|
|
1394
1395
|
if (extObj.constructor.name === Constructor.name) {
|
|
1395
1396
|
return true;
|
|
1396
1397
|
}
|
|
@@ -1412,7 +1413,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1412
1413
|
function checkExtensionObjectIsCorrectArray(this: UAVariableImpl, extObjArray: ExtensionObject[]): boolean {
|
|
1413
1414
|
// c8 ignore next
|
|
1414
1415
|
for (const extObj of extObjArray) {
|
|
1415
|
-
if (!
|
|
1416
|
+
if (!extObj?.constructor) {
|
|
1416
1417
|
errorLog(extObj);
|
|
1417
1418
|
throw new Error("expecting an valid extension object");
|
|
1418
1419
|
}
|
|
@@ -1486,12 +1487,12 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1486
1487
|
}
|
|
1487
1488
|
|
|
1488
1489
|
if (optionalExtensionObject) {
|
|
1489
|
-
if (optionalExtensionObject
|
|
1490
|
+
if (Array.isArray(optionalExtensionObject)) {
|
|
1490
1491
|
assert(this.valueRank >= 1, "bindExtensionObject: expecting an Array of Matrix variable here");
|
|
1491
1492
|
return _bindExtensionObjectArrayOrMatrix(this, optionalExtensionObject, options);
|
|
1492
1493
|
} else {
|
|
1493
1494
|
if (this.valueRank !== -1 && this.valueRank !== 0) {
|
|
1494
|
-
throw new Error(
|
|
1495
|
+
throw new Error(`bindExtensionObject: expecting an Scalar variable here but got value rank ${this.valueRank}`);
|
|
1495
1496
|
}
|
|
1496
1497
|
return _bindExtensionObject(this, optionalExtensionObject, options) as ExtensionObject;
|
|
1497
1498
|
}
|
|
@@ -1566,7 +1567,12 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1566
1567
|
const dv = this.$dataValue;
|
|
1567
1568
|
if (dv) {
|
|
1568
1569
|
if (dv.statusCode) statusStr = dv.statusCode.toString();
|
|
1569
|
-
if (
|
|
1570
|
+
if (
|
|
1571
|
+
dv.value &&
|
|
1572
|
+
dv.value.value !== undefined &&
|
|
1573
|
+
dv.value.value !== null &&
|
|
1574
|
+
!(dv.value.value instanceof OpaqueStructure)
|
|
1575
|
+
) {
|
|
1570
1576
|
const v = dv.value.value;
|
|
1571
1577
|
valueStr = typeof v === "object" ? Object.prototype.toString.call(v) : String(v);
|
|
1572
1578
|
if (valueStr.length > 80) valueStr = `${valueStr.slice(0, 77)}...`;
|
|
@@ -1598,7 +1604,6 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1598
1604
|
return lines.join("\n");
|
|
1599
1605
|
}
|
|
1600
1606
|
|
|
1601
|
-
|
|
1602
1607
|
// ---------------------------------------------------------------------------------------------------
|
|
1603
1608
|
// History
|
|
1604
1609
|
// ---------------------------------------------------------------------------------------------------
|
|
@@ -1645,45 +1650,45 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1645
1650
|
assert(context instanceof SessionContext);
|
|
1646
1651
|
assert(typeof callback === "function");
|
|
1647
1652
|
if (typeof this._historyRead !== "function") {
|
|
1648
|
-
return callback
|
|
1653
|
+
return callback?.(null, new HistoryReadResult({ statusCode: StatusCodes.BadNotReadable }));
|
|
1649
1654
|
}
|
|
1650
1655
|
|
|
1651
1656
|
this._historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback!);
|
|
1652
1657
|
}
|
|
1653
1658
|
|
|
1654
1659
|
public _historyReadRaw(
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1660
|
+
_context: ISessionContext,
|
|
1661
|
+
_historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
1662
|
+
_indexRange: NumericRange | null,
|
|
1663
|
+
_dataEncoding: QualifiedNameLike | null,
|
|
1664
|
+
_continuationData: ContinuationData,
|
|
1665
|
+
_callback: CallbackT<HistoryReadResult>
|
|
1661
1666
|
): void {
|
|
1662
1667
|
throw new Error("");
|
|
1663
1668
|
}
|
|
1664
1669
|
|
|
1665
1670
|
public _historyReadRawModify(
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1671
|
+
_context: ISessionContext,
|
|
1672
|
+
_historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
1673
|
+
_indexRange: NumericRange | null,
|
|
1674
|
+
_dataEncoding: QualifiedNameLike | null,
|
|
1675
|
+
_continuationData: ContinuationData,
|
|
1676
|
+
_callback?: CallbackT<HistoryReadResult>
|
|
1672
1677
|
): any {
|
|
1673
1678
|
throw new Error("");
|
|
1674
1679
|
}
|
|
1675
1680
|
|
|
1676
1681
|
public _historyRead(
|
|
1677
1682
|
context: ISessionContext,
|
|
1678
|
-
|
|
1683
|
+
_historyReadDetails:
|
|
1679
1684
|
| HistoryReadDetails
|
|
1680
1685
|
| ReadRawModifiedDetails
|
|
1681
1686
|
| ReadEventDetails
|
|
1682
1687
|
| ReadProcessedDetails
|
|
1683
1688
|
| ReadAtTimeDetails,
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1689
|
+
_indexRange: NumericRange | null,
|
|
1690
|
+
_dataEncoding: QualifiedNameLike | null,
|
|
1691
|
+
_continuationData: ContinuationData,
|
|
1687
1692
|
callback: CallbackT<HistoryReadResult>
|
|
1688
1693
|
): void {
|
|
1689
1694
|
if (!this.checkPermissionPrivate(context, PermissionType.ReadHistory)) {
|
|
@@ -1704,37 +1709,37 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1704
1709
|
callback(null, result);
|
|
1705
1710
|
}
|
|
1706
1711
|
|
|
1707
|
-
public _historyPush(
|
|
1712
|
+
public _historyPush(_newDataValue: DataValue): any {
|
|
1708
1713
|
throw new Error("");
|
|
1709
1714
|
}
|
|
1710
1715
|
|
|
1711
1716
|
public _historyReadRawAsync(
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
+
_historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
1718
|
+
_maxNumberToExtract: number,
|
|
1719
|
+
_isReversed: boolean,
|
|
1720
|
+
_reverseDataValue: boolean,
|
|
1721
|
+
_callback: CallbackT<DataValue[]>
|
|
1717
1722
|
): any {
|
|
1718
1723
|
throw new Error("");
|
|
1719
1724
|
}
|
|
1720
1725
|
|
|
1721
1726
|
public _historyReadModify(
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1727
|
+
_context: ISessionContext,
|
|
1728
|
+
_historyReadRawModifiedDetails: ReadRawModifiedDetails,
|
|
1729
|
+
_indexRange: NumericRange | null,
|
|
1730
|
+
_dataEncoding: QualifiedNameLike | null,
|
|
1731
|
+
_continuationData: ContinuationData,
|
|
1732
|
+
_callback: CallbackT<HistoryReadResult>
|
|
1728
1733
|
): any {
|
|
1729
1734
|
throw new Error("");
|
|
1730
1735
|
}
|
|
1731
1736
|
|
|
1732
|
-
public _update_startOfOnlineArchive(
|
|
1737
|
+
public _update_startOfOnlineArchive(_newDate: Date): void {
|
|
1733
1738
|
// please install
|
|
1734
1739
|
throw new Error("");
|
|
1735
1740
|
}
|
|
1736
1741
|
|
|
1737
|
-
public _update_startOfArchive(
|
|
1742
|
+
public _update_startOfArchive(_newDate: Date): void {
|
|
1738
1743
|
throw new Error("");
|
|
1739
1744
|
}
|
|
1740
1745
|
|
|
@@ -1770,7 +1775,8 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1770
1775
|
const nbElements = dataValue.value.dimensions.reduce((acc, x) => acc * x, 1);
|
|
1771
1776
|
if (dataValue.value.value.length !== 0 && dataValue.value.value.length !== nbElements) {
|
|
1772
1777
|
throw new Error(
|
|
1773
|
-
`Internal Error: matrix dimension doesn't match the number of element in the array : ${dataValue.toString()} "\n expecting ${nbElements} elements but got ${
|
|
1778
|
+
`Internal Error: matrix dimension doesn't match the number of element in the array : ${dataValue.toString()} "\n expecting ${nbElements} elements but got ${
|
|
1779
|
+
dataValue.value.value.length
|
|
1774
1780
|
}`
|
|
1775
1781
|
);
|
|
1776
1782
|
}
|
|
@@ -1781,7 +1787,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1781
1787
|
// c8 ignore next
|
|
1782
1788
|
if (!this.checkExtensionObjectIsCorrect(dataValue.value.value)) {
|
|
1783
1789
|
warningLog(dataValue.toString());
|
|
1784
|
-
throw new Error(
|
|
1790
|
+
throw new Error(`Invalid Extension Object on nodeId =${this.nodeId.toString()}`);
|
|
1785
1791
|
}
|
|
1786
1792
|
}
|
|
1787
1793
|
|
|
@@ -1848,7 +1854,7 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1848
1854
|
propagateTouchValueDownward(this, preciseClock, cache);
|
|
1849
1855
|
}
|
|
1850
1856
|
} else {
|
|
1851
|
-
this.emit("value_changed", this.$dataValue.clone(), indexRange);
|
|
1857
|
+
(this as UAVariable).emit("value_changed", this.$dataValue.clone(), indexRange);
|
|
1852
1858
|
}
|
|
1853
1859
|
}
|
|
1854
1860
|
}
|
|
@@ -1857,9 +1863,9 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1857
1863
|
apply_condition_refresh.call(this, _cache);
|
|
1858
1864
|
}
|
|
1859
1865
|
|
|
1860
|
-
public handle_semantic_changed(): void {
|
|
1866
|
+
public handle_semantic_changed(_dataValue: DataValue): void {
|
|
1861
1867
|
this.semantic_version = this.semantic_version + 1;
|
|
1862
|
-
this.emit("semantic_changed");
|
|
1868
|
+
(this as UAVariable).emit("semantic_changed");
|
|
1863
1869
|
}
|
|
1864
1870
|
|
|
1865
1871
|
private _readDataType(): DataValue {
|
|
@@ -1949,9 +1955,11 @@ export class UAVariableImpl extends BaseNodeImpl implements UAVariable {
|
|
|
1949
1955
|
}
|
|
1950
1956
|
}
|
|
1951
1957
|
|
|
1958
|
+
|
|
1959
|
+
import type { IStructuredTypeSchema } from "node-opcua-factory";
|
|
1952
1960
|
// tslint:disable:no-var-requires
|
|
1953
1961
|
import { withCallback } from "thenify-ex";
|
|
1954
|
-
|
|
1962
|
+
|
|
1955
1963
|
UAVariableImpl.prototype.asyncRefresh = withCallback(UAVariableImpl.prototype.asyncRefresh);
|
|
1956
1964
|
UAVariableImpl.prototype.writeValue = withCallback(UAVariableImpl.prototype.writeValue);
|
|
1957
1965
|
UAVariableImpl.prototype.writeAttribute = withCallback(UAVariableImpl.prototype.writeAttribute);
|
|
@@ -1960,12 +1968,14 @@ UAVariableImpl.prototype.readValueAsync = withCallback(UAVariableImpl.prototype.
|
|
|
1960
1968
|
|
|
1961
1969
|
export interface UAVariableImplExtArray {
|
|
1962
1970
|
$$variableType?: UAVariableType;
|
|
1963
|
-
$$dataType
|
|
1964
|
-
$$getElementBrowseName
|
|
1965
|
-
$$extensionObjectArray
|
|
1966
|
-
$$indexPropertyName
|
|
1971
|
+
$$dataType?: UADataType;
|
|
1972
|
+
$$getElementBrowseName?: (extObject: ExtensionObject, index: number | number[]) => QualifiedName;
|
|
1973
|
+
$$extensionObjectArray?: ExtensionObject[];
|
|
1974
|
+
$$indexPropertyName?: string;
|
|
1967
1975
|
}
|
|
1968
|
-
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
|
|
1969
1979
|
function check_valid_array(dataType: DataType, array: any): boolean {
|
|
1970
1980
|
if (Array.isArray(array)) {
|
|
1971
1981
|
return true;
|
|
@@ -2008,7 +2018,7 @@ function check_valid_array(dataType: DataType, array: any): boolean {
|
|
|
2008
2018
|
function unsetFlag(flags: number, mask: number): number {
|
|
2009
2019
|
return flags & ~mask;
|
|
2010
2020
|
}
|
|
2011
|
-
function
|
|
2021
|
+
function _setFlag(flags: number, mask: number): number {
|
|
2012
2022
|
return flags | mask;
|
|
2013
2023
|
}
|
|
2014
2024
|
|
|
@@ -2048,7 +2058,7 @@ function _calculateEffectiveUserAccessLevelFromPermission(
|
|
|
2048
2058
|
|
|
2049
2059
|
function adjustVariant2(this: UAVariableImpl, variant: Variant): Variant {
|
|
2050
2060
|
// convert Variant( Scalar|ByteString) => Variant(Array|ByteArray)
|
|
2051
|
-
const
|
|
2061
|
+
const _addressSpace = this.addressSpace;
|
|
2052
2062
|
const basicType = this.getBasicDataType();
|
|
2053
2063
|
variant = adjustVariant(variant, this.valueRank, basicType);
|
|
2054
2064
|
return variant;
|
|
@@ -2127,14 +2137,15 @@ function _Variable_bind_with_async_refresh(
|
|
|
2127
2137
|
assert(!this.refreshFunc);
|
|
2128
2138
|
|
|
2129
2139
|
this.refreshFunc = options.refreshFunc;
|
|
2130
|
-
|
|
2140
|
+
/*
|
|
2131
2141
|
// TO DO : REVISIT THIS ASSUMPTION
|
|
2132
2142
|
if (false && this.minimumSamplingInterval === 0) {
|
|
2133
2143
|
// when a getter /timestamped_getter or async_getter is provided
|
|
2134
2144
|
// samplingInterval cannot be 0, as the item value must be scanned to be updated.
|
|
2135
2145
|
this.minimumSamplingInterval = _default_minimumSamplingInterval; // MonitoredItem.minimumSamplingInterval;
|
|
2136
|
-
debugLog(
|
|
2146
|
+
debugLog(`adapting minimumSamplingInterval on ${this.browseName.toString()} to ${this.minimumSamplingInterval}`);
|
|
2137
2147
|
}
|
|
2148
|
+
*/
|
|
2138
2149
|
}
|
|
2139
2150
|
|
|
2140
2151
|
// variation 2
|
|
@@ -2152,7 +2163,7 @@ function _Variable_bind_with_timestamped_get(
|
|
|
2152
2163
|
assert(!this._timestamped_get_func);
|
|
2153
2164
|
|
|
2154
2165
|
const async_refresh_func = (callback: (err: Error | null, dataValue?: DataValue) => void) => {
|
|
2155
|
-
Promise.resolve((this._timestamped_get_func
|
|
2166
|
+
Promise.resolve((this._timestamped_get_func as VariableDataValueGetterSync).call(this))
|
|
2156
2167
|
.then((dataValue) => callback(null, dataValue))
|
|
2157
2168
|
.catch((err) => {
|
|
2158
2169
|
errorLog("asyncRefresh error: Variable is ", this.nodeId.toString(), this.browseName.toString());
|
|
@@ -2172,7 +2183,7 @@ function _Variable_bind_with_timestamped_get(
|
|
|
2172
2183
|
errorLog(
|
|
2173
2184
|
chalk.red(" Bind variable error: "),
|
|
2174
2185
|
" the timestamped_get function must return a DataValue or a Promise<DataValue>" +
|
|
2175
|
-
|
|
2186
|
+
"\n value_check.constructor.name ",
|
|
2176
2187
|
dataValue_verify ? dataValue_verify.constructor.name : "null"
|
|
2177
2188
|
);
|
|
2178
2189
|
|
|
@@ -2191,7 +2202,7 @@ function _Variable_bind_with_timestamped_get(
|
|
|
2191
2202
|
function _Variable_bind_with_simple_get(this: UAVariableImpl, options: GetterOptions) {
|
|
2192
2203
|
assert(this instanceof UAVariableImpl);
|
|
2193
2204
|
assert(typeof options.get === "function", "should specify get function");
|
|
2194
|
-
assert(options.get
|
|
2205
|
+
assert(options.get?.length === 0, "get function should not have arguments");
|
|
2195
2206
|
assert(!options.timestamped_get, "should not specify a timestamped_get function when get is specified");
|
|
2196
2207
|
assert(!this._timestamped_get_func);
|
|
2197
2208
|
assert(!this._get_func);
|
|
@@ -2215,11 +2226,7 @@ function _Variable_bind_with_simple_get(this: UAVariableImpl, options: GetterOpt
|
|
|
2215
2226
|
if (is_StatusCode(value)) {
|
|
2216
2227
|
return new DataValue({ statusCode: value as StatusCode });
|
|
2217
2228
|
} else {
|
|
2218
|
-
if (
|
|
2219
|
-
!this.$dataValue ||
|
|
2220
|
-
!this.$dataValue.statusCode.isGoodish() ||
|
|
2221
|
-
!sameVariant(this.$dataValue.value, value as Variant)
|
|
2222
|
-
) {
|
|
2229
|
+
if (!this.$dataValue?.statusCode.isGoodish() || !sameVariant(this.$dataValue.value, value as Variant)) {
|
|
2223
2230
|
// rebuilding artificially timestamps with current clock as they are not provided
|
|
2224
2231
|
// by the underlying getter function
|
|
2225
2232
|
const { timestamp: sourceTimestamp, picoseconds: sourcePicoseconds } = getCurrentClock();
|
|
@@ -2267,7 +2274,7 @@ function _Variable_bind_with_simple_set(this: UAVariableImpl, options: SimpleSet
|
|
|
2267
2274
|
errorLog(chalk.yellow("StatusCode.Good is assumed"));
|
|
2268
2275
|
return callback(err, StatusCodes.Good, timestamped_value);
|
|
2269
2276
|
}
|
|
2270
|
-
if (statusCode
|
|
2277
|
+
if (statusCode?.isNotGood()) {
|
|
2271
2278
|
// record the value but still record the statusCode !
|
|
2272
2279
|
timestamped_value.statusCode = statusCode;
|
|
2273
2280
|
}
|
|
@@ -2351,10 +2358,7 @@ function bind_getter(this: UAVariableImpl, options: GetterOptions) {
|
|
|
2351
2358
|
}
|
|
2352
2359
|
_Variable_bind_with_async_refresh.call(this, { refreshFunc: options.refreshFunc! });
|
|
2353
2360
|
} else {
|
|
2354
|
-
assert(
|
|
2355
|
-
!Object.prototype.hasOwnProperty.call(options, "set"),
|
|
2356
|
-
"getter is missing : a getter must be provided if a setter is provided"
|
|
2357
|
-
);
|
|
2361
|
+
assert(!Object.hasOwn(options, "set"), "getter is missing : a getter must be provided if a setter is provided");
|
|
2358
2362
|
// xx bind_variant.call(this,options);
|
|
2359
2363
|
if (options.dataType !== undefined) {
|
|
2360
2364
|
// if (options.dataType !== DataType.ExtensionObject) {
|
|
@@ -2364,34 +2368,50 @@ function bind_getter(this: UAVariableImpl, options: GetterOptions) {
|
|
|
2364
2368
|
}
|
|
2365
2369
|
}
|
|
2366
2370
|
|
|
2367
|
-
export
|
|
2368
|
-
|
|
2369
|
-
once(): any;
|
|
2370
|
-
readValueAsync(context: ISessionContext | null): Promise<DataValueT<T, DT>>;
|
|
2371
|
-
readValueAsync(context: ISessionContext | null, callback: CallbackT<DataValueT<T, DT>>): void;
|
|
2372
|
-
|
|
2373
|
-
readValue(
|
|
2371
|
+
export class UAVariableImplT<T, DT extends DataType> extends UAVariableImpl {
|
|
2372
|
+
public readValue(
|
|
2374
2373
|
context?: ISessionContext | null,
|
|
2375
2374
|
indexRange?: NumericRange,
|
|
2376
2375
|
dataEncoding?: QualifiedNameLike | null
|
|
2377
|
-
): DataValueT<T, DT
|
|
2376
|
+
): DataValueT<T, DT> {
|
|
2377
|
+
return super.readValue(context, indexRange, dataEncoding) as DataValueT<T, DT>;
|
|
2378
|
+
}
|
|
2378
2379
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2380
|
+
public readValueAsync(context: ISessionContext | null): Promise<DataValueT<T, DT>>;
|
|
2381
|
+
public readValueAsync(context: ISessionContext | null, callback: CallbackT<DataValueT<T, DT>>): void;
|
|
2382
|
+
public readValueAsync(
|
|
2383
|
+
context: ISessionContext | null,
|
|
2384
|
+
callback?: CallbackT<DataValueT<T, DT>>
|
|
2385
|
+
): Promise<DataValueT<T, DT>> | undefined {
|
|
2386
|
+
return super.readValueAsync(context, callback as CallbackT<DataValue>) as Promise<DataValueT<T, DT>> | undefined;
|
|
2387
|
+
}
|
|
2384
2388
|
|
|
2385
|
-
writeValue(
|
|
2389
|
+
public writeValue(
|
|
2386
2390
|
context: ISessionContext,
|
|
2387
2391
|
dataValue: DataValueT<T, DT>,
|
|
2388
2392
|
indexRange: NumericRange | null,
|
|
2389
2393
|
callback: StatusCodeCallback
|
|
2390
2394
|
): void;
|
|
2391
|
-
writeValue(context: ISessionContext, dataValue: DataValueT<T, DT>, callback: StatusCodeCallback): void;
|
|
2392
|
-
writeValue(
|
|
2395
|
+
public writeValue(context: ISessionContext, dataValue: DataValueT<T, DT>, callback: StatusCodeCallback): void;
|
|
2396
|
+
public writeValue(
|
|
2397
|
+
context: ISessionContext,
|
|
2398
|
+
dataValue: DataValueT<T, DT>,
|
|
2399
|
+
indexRange?: NumericRange | null
|
|
2400
|
+
): Promise<StatusCode>;
|
|
2401
|
+
public writeValue(
|
|
2402
|
+
context: ISessionContext,
|
|
2403
|
+
dataValue: DataValueT<T, DT>,
|
|
2404
|
+
indexRangeOrCallback?: NumericRange | null | StatusCodeCallback,
|
|
2405
|
+
callback?: StatusCodeCallback
|
|
2406
|
+
): Promise<StatusCode> | undefined {
|
|
2407
|
+
return (super.writeValue as (...args: unknown[]) => Promise<StatusCode> | undefined)(
|
|
2408
|
+
context,
|
|
2409
|
+
dataValue,
|
|
2410
|
+
indexRangeOrCallback,
|
|
2411
|
+
callback
|
|
2412
|
+
);
|
|
2413
|
+
}
|
|
2393
2414
|
}
|
|
2394
|
-
export class UAVariableImplT<T, DT extends DataType> extends UAVariableImpl { }
|
|
2395
2415
|
|
|
2396
2416
|
function changeUAVariableDataType(uaVariable: UAVariableImpl, newDataType: NodeIdLike, valueLike?: VariantLike) {
|
|
2397
2417
|
let value: Variant | null = valueLike ? (valueLike instanceof Variant ? valueLike : new Variant(valueLike)) : null;
|
|
@@ -2400,7 +2420,7 @@ function changeUAVariableDataType(uaVariable: UAVariableImpl, newDataType: NodeI
|
|
|
2400
2420
|
const newDataTypeNode = addressSpace.findNode(newDataType) as UADataType;
|
|
2401
2421
|
// c8 ignore next
|
|
2402
2422
|
if (!newDataTypeNode || !(newDataTypeNode instanceof UADataTypeImpl)) {
|
|
2403
|
-
throw new Error(
|
|
2423
|
+
throw new Error(`Cannot find newDataTypeNode ${newDataType.toString()}`);
|
|
2404
2424
|
}
|
|
2405
2425
|
|
|
2406
2426
|
const newBaseDataType: DataType = newDataTypeNode.basicDataType;
|