node-opcua-address-space 2.180.0 → 2.181.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/api/address_space_public.ts +63 -0
- package/api/address_space_ts.ts +129 -0
- package/api/continuation_points/continuation_point_manager.ts +271 -0
- package/api/helpers/argument_list.ts +310 -0
- package/api/helpers/call_helpers.ts +100 -0
- package/api/helpers/coerce_enum_value.ts +33 -0
- package/api/helpers/dump_tools.ts +90 -0
- package/api/helpers/ensure_secure_access.ts +78 -0
- package/api/helpers/multiform_func.ts +78 -0
- package/api/helpers/resolve_opaque_on_address_space.ts +26 -0
- package/api/index.ts +210 -0
- package/api/interfaces/alarms_and_conditions/condition_info_i.ts +60 -0
- package/api/interfaces/alarms_and_conditions/condition_snapshot.ts +236 -0
- package/api/interfaces/alarms_and_conditions/deviation_stuff.ts +16 -0
- package/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +8 -0
- package/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +6 -0
- package/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +6 -0
- package/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +13 -0
- package/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +6 -0
- package/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +6 -0
- package/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +21 -0
- package/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +28 -0
- package/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +72 -0
- package/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +36 -0
- package/api/interfaces/alarms_and_conditions/ua_condition_ex.ts +55 -0
- package/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +17 -0
- package/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +21 -0
- package/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +21 -0
- package/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +26 -0
- package/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +29 -0
- package/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +25 -0
- package/api/interfaces/data_access/ua_multistate_discrete_ex.ts +57 -0
- package/api/interfaces/data_access/ua_multistate_value_discrete_ex.ts +31 -0
- package/api/interfaces/data_access/ua_two_state_discrete_ex.ts +15 -0
- package/api/interfaces/nodeset_loader_options.ts +58 -0
- package/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +20 -0
- package/api/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
- package/api/interfaces/state_machine/ua_program_state_machine_type.ts +14 -0
- package/api/interfaces/state_machine/ua_shelved_state_machine_ex.ts +35 -0
- package/api/interfaces/state_machine/ua_state_machine_type.ts +288 -0
- package/api/loader/decode_xml_extension_object.ts +80 -0
- package/api/loader/ensure_datatype_extracted.ts +122 -0
- package/api/loader/generateAddressSpaceRaw.ts +470 -0
- package/api/loader/load_nodeset2.ts +278 -0
- package/api/loader/make_xml_extension_object_parser.ts +518 -0
- package/api/loader/namespace_post_step.ts +68 -0
- package/api/loader/nodeset_image.ts +451 -0
- package/api/loader/nodeset_image_codec.ts +576 -0
- package/api/loader/nodeset_image_store.ts +78 -0
- package/api/loader/nodeset_record.ts +141 -0
- package/api/loader/nodeset_record_applier.ts +889 -0
- package/api/loader/nodeset_source.ts +367 -0
- package/api/loader/nodeset_source_helpers.ts +50 -0
- package/api/loader/nodeset_to_image.ts +29 -0
- package/api/loader/nodeset_xml_producer.ts +383 -0
- package/api/loader/parsers/extension_object_parser.ts +374 -0
- package/api/loader/parsers/variant_parser.ts +363 -0
- package/api/loader/register_node_promoter.ts +6 -0
- package/api/namespace.ts +25 -0
- package/api/namespace_alarm_and_condition.ts +78 -0
- package/api/namespace_data_access.ts +92 -0
- package/api/namespace_machine_state.ts +20 -0
- package/api/pseudo_session.ts +415 -0
- package/api/session_context.ts +729 -0
- package/api/ua_interface.ts +38 -0
- package/api/ua_two_state_variable_ex.ts +36 -0
- package/bin/opcua-nodeset-image.js +192 -0
- package/dist/api/address_space_public.d.ts +57 -0
- package/dist/api/address_space_public.js +19 -0
- package/dist/api/address_space_public.js.map +1 -0
- package/dist/api/address_space_ts.d.ts +79 -0
- package/dist/api/address_space_ts.js +13 -0
- package/dist/api/address_space_ts.js.map +1 -0
- package/dist/api/continuation_points/continuation_point_manager.js +230 -0
- package/dist/api/continuation_points/continuation_point_manager.js.map +1 -0
- package/dist/api/helpers/adjust_browse_direction.js.map +1 -0
- package/dist/api/helpers/argument_list.js +263 -0
- package/dist/api/helpers/argument_list.js.map +1 -0
- package/dist/api/helpers/call_helpers.js +80 -0
- package/dist/api/helpers/call_helpers.js.map +1 -0
- package/dist/api/helpers/coerce_enum_value.d.ts +6 -0
- package/dist/api/helpers/coerce_enum_value.js.map +1 -0
- package/dist/api/helpers/dump_tools.js +81 -0
- package/dist/api/helpers/dump_tools.js.map +1 -0
- package/dist/api/helpers/ensure_secure_access.d.ts +19 -0
- package/dist/api/helpers/ensure_secure_access.js +67 -0
- package/dist/api/helpers/ensure_secure_access.js.map +1 -0
- package/dist/api/helpers/make_optionals_map.js.map +1 -0
- package/dist/api/helpers/multiform_func.js +75 -0
- package/dist/api/helpers/multiform_func.js.map +1 -0
- package/dist/api/helpers/resolve_opaque_on_address_space.js +25 -0
- package/dist/api/helpers/resolve_opaque_on_address_space.js.map +1 -0
- package/dist/api/index.d.ts +113 -0
- package/dist/api/index.js +234 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.d.ts +54 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js +28 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.d.ts +151 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.d.ts +12 -0
- package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/install_setpoint_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +7 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +4 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +4 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +10 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +4 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +4 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +20 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +21 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +56 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +19 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +44 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +4 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +5 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +19 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +25 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +8 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +10 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +1 -0
- package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.d.ts +44 -0
- package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
- package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +22 -0
- package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
- package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.d.ts +13 -0
- package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
- package/dist/api/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
- package/dist/api/interfaces/extension_object_constructor.js.map +1 -0
- package/dist/api/interfaces/i_condition_variable_type_setter_options.js.map +1 -0
- package/dist/api/interfaces/i_set_state_options.js.map +1 -0
- package/dist/api/interfaces/nodeset_loader_options.d.ts +56 -0
- package/dist/api/interfaces/nodeset_loader_options.js.map +1 -0
- package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
- package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
- package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
- package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
- package/dist/api/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
- package/dist/api/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
- package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +29 -0
- package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +1 -0
- package/dist/api/interfaces/state_machine/ua_state_machine_type.d.ts +236 -0
- package/dist/api/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
- package/dist/api/interfaces/state_machine/ua_transition_ex.js.map +1 -0
- package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
- package/dist/api/loader/decode_xml_extension_object.d.ts +6 -0
- package/dist/api/loader/decode_xml_extension_object.js +69 -0
- package/dist/api/loader/decode_xml_extension_object.js.map +1 -0
- package/dist/api/loader/ensure_datatype_extracted.js +88 -0
- package/dist/api/loader/ensure_datatype_extracted.js.map +1 -0
- package/dist/api/loader/generateAddressSpaceRaw.d.ts +64 -0
- package/dist/api/loader/generateAddressSpaceRaw.js +379 -0
- package/dist/api/loader/generateAddressSpaceRaw.js.map +1 -0
- package/dist/api/loader/load_nodeset2.d.ts +38 -0
- package/dist/api/loader/load_nodeset2.js +245 -0
- package/dist/api/loader/load_nodeset2.js.map +1 -0
- package/dist/api/loader/make_semver_compatible.js.map +1 -0
- package/dist/api/loader/make_xml_extension_object_parser.js +417 -0
- package/dist/api/loader/make_xml_extension_object_parser.js.map +1 -0
- package/dist/api/loader/namespace_post_step.js +57 -0
- package/dist/api/loader/namespace_post_step.js.map +1 -0
- package/dist/api/loader/nodeset_image.d.ts +94 -0
- package/dist/api/loader/nodeset_image.js +406 -0
- package/dist/api/loader/nodeset_image.js.map +1 -0
- package/dist/api/loader/nodeset_image_codec.d.ts +104 -0
- package/dist/api/loader/nodeset_image_codec.js +489 -0
- package/dist/api/loader/nodeset_image_codec.js.map +1 -0
- package/dist/api/loader/nodeset_image_store.d.ts +27 -0
- package/dist/api/loader/nodeset_image_store.js +72 -0
- package/dist/api/loader/nodeset_image_store.js.map +1 -0
- package/dist/api/loader/nodeset_record.d.ts +125 -0
- package/dist/api/loader/nodeset_record.js +26 -0
- package/dist/api/loader/nodeset_record.js.map +1 -0
- package/dist/api/loader/nodeset_record_applier.d.ts +106 -0
- package/dist/api/loader/nodeset_record_applier.js +731 -0
- package/dist/api/loader/nodeset_record_applier.js.map +1 -0
- package/dist/api/loader/nodeset_source.d.ts +124 -0
- package/dist/api/loader/nodeset_source.js +307 -0
- package/dist/api/loader/nodeset_source.js.map +1 -0
- package/dist/api/loader/nodeset_source_helpers.d.ts +27 -0
- package/dist/api/loader/nodeset_source_helpers.js +30 -0
- package/dist/api/loader/nodeset_source_helpers.js.map +1 -0
- package/dist/api/loader/nodeset_to_image.d.ts +13 -0
- package/dist/api/loader/nodeset_to_image.js +30 -0
- package/dist/api/loader/nodeset_to_image.js.map +1 -0
- package/dist/api/loader/nodeset_xml_producer.d.ts +16 -0
- package/dist/api/loader/nodeset_xml_producer.js +349 -0
- package/dist/api/loader/nodeset_xml_producer.js.map +1 -0
- package/dist/api/loader/parsers/extension_object_parser.js +274 -0
- package/dist/api/loader/parsers/extension_object_parser.js.map +1 -0
- package/dist/api/loader/parsers/localized_text_parser.js.map +1 -0
- package/dist/api/loader/parsers/nodeid_parser.js.map +1 -0
- package/dist/api/loader/parsers/qualified_name_parser.js.map +1 -0
- package/dist/api/loader/parsers/variant_parser.d.ts +42 -0
- package/dist/api/loader/parsers/variant_parser.js +294 -0
- package/dist/api/loader/parsers/variant_parser.js.map +1 -0
- package/dist/api/loader/register_node_promoter.d.ts +2 -0
- package/dist/api/loader/register_node_promoter.js +9 -0
- package/dist/api/loader/register_node_promoter.js.map +1 -0
- package/dist/api/namespace.d.ts +18 -0
- package/dist/api/namespace.js.map +1 -0
- package/dist/api/namespace_alarm_and_condition.d.ts +33 -0
- package/dist/api/namespace_alarm_and_condition.js.map +1 -0
- package/dist/api/namespace_data_access.d.ts +67 -0
- package/dist/api/namespace_data_access.js.map +1 -0
- package/dist/api/namespace_machine_state.d.ts +8 -0
- package/dist/api/namespace_machine_state.js.map +1 -0
- package/dist/api/pseudo_session.d.ts +74 -0
- package/dist/api/pseudo_session.js +308 -0
- package/dist/api/pseudo_session.js.map +1 -0
- package/dist/api/session_context.d.ts +242 -0
- package/dist/api/session_context.js.map +1 -0
- package/dist/api/set_namespace_meta_data.js.map +1 -0
- package/dist/api/ua_addin.js.map +1 -0
- package/dist/api/ua_interface.js +25 -0
- package/dist/api/ua_interface.js.map +1 -0
- package/dist/api/ua_root_folder.js.map +1 -0
- package/dist/api/ua_two_state_variable_ex.d.ts +24 -0
- package/dist/api/ua_two_state_variable_ex.js.map +1 -0
- package/dist/api/xml_writer.js.map +1 -0
- package/dist/impl/_instantiate_helpers.js +99 -0
- package/dist/impl/_instantiate_helpers.js.map +1 -0
- package/dist/impl/_mandatory_child_or_requested_optional_filter.js +82 -0
- package/dist/impl/_mandatory_child_or_requested_optional_filter.js.map +1 -0
- package/dist/impl/address_space.d.ts +379 -0
- package/dist/impl/address_space.js +1383 -0
- package/dist/impl/address_space.js.map +1 -0
- package/dist/impl/address_space_change_event_tools.d.ts +6 -0
- package/dist/impl/address_space_change_event_tools.js.map +1 -0
- package/dist/impl/address_space_private.d.ts +48 -0
- package/dist/impl/address_space_private.js.map +1 -0
- package/dist/impl/alarms_and_conditions/condition.js.map +1 -0
- package/dist/impl/alarms_and_conditions/condition_info_impl.d.ts +19 -0
- package/dist/impl/alarms_and_conditions/condition_info_impl.js +39 -0
- package/dist/impl/alarms_and_conditions/condition_info_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.d.ts +271 -0
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js +700 -0
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.d.ts +12 -0
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js +66 -0
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
- package/dist/impl/alarms_and_conditions/index.d.ts +16 -0
- package/dist/impl/alarms_and_conditions/index.js +33 -0
- package/dist/impl/alarms_and_conditions/index.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +54 -0
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.d.ts +105 -0
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js +428 -0
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.d.ts +36 -0
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.js +32 -0
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +47 -0
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +204 -0
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_condition_impl.d.ts +152 -0
- package/dist/impl/alarms_and_conditions/ua_condition_impl.js +1016 -0
- package/dist/impl/alarms_and_conditions/ua_condition_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +22 -0
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js +41 -0
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +30 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +54 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +12 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +13 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +28 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +86 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.d.ts +49 -0
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js +207 -0
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +54 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +38 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +172 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +44 -0
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js +164 -0
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +18 -0
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
- package/dist/impl/apply_condition_refresh.d.ts +4 -0
- package/dist/impl/apply_condition_refresh.js +29 -0
- package/dist/impl/apply_condition_refresh.js.map +1 -0
- package/dist/impl/base_node_impl.d.ts +347 -0
- package/dist/impl/base_node_impl.js +1768 -0
- package/dist/impl/base_node_impl.js.map +1 -0
- package/dist/impl/base_node_private.d.ts +138 -0
- package/dist/impl/base_node_private.js +1028 -0
- package/dist/impl/base_node_private.js.map +1 -0
- package/dist/impl/check_value_rank_compatibility.js.map +1 -0
- package/dist/impl/child_accessors.d.ts +43 -0
- package/dist/impl/child_accessors.js +222 -0
- package/dist/impl/child_accessors.js.map +1 -0
- package/dist/impl/data_access/add_dataItem_stuff.js.map +1 -0
- package/dist/impl/data_access/adjust_datavalue_status_code.d.ts +7 -0
- package/dist/impl/data_access/adjust_datavalue_status_code.js.map +1 -0
- package/dist/impl/data_access/ua_multistate_discrete_impl.d.ts +38 -0
- package/dist/impl/data_access/ua_multistate_discrete_impl.js +143 -0
- package/dist/impl/data_access/ua_multistate_discrete_impl.js.map +1 -0
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.d.ts +61 -0
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.js +303 -0
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.js.map +1 -0
- package/dist/impl/data_access/ua_two_state_discrete_impl.d.ts +30 -0
- package/dist/impl/data_access/ua_two_state_discrete_impl.js +164 -0
- package/dist/impl/data_access/ua_two_state_discrete_impl.js.map +1 -0
- package/dist/impl/event_data.d.ts +27 -0
- package/dist/impl/event_data.js +73 -0
- package/dist/impl/event_data.js.map +1 -0
- package/dist/impl/event_layout.d.ts +40 -0
- package/dist/impl/event_layout.js +103 -0
- package/dist/impl/event_layout.js.map +1 -0
- package/dist/impl/extension_object_array_node.d.ts +41 -0
- package/dist/impl/extension_object_array_node.js +274 -0
- package/dist/impl/extension_object_array_node.js.map +1 -0
- package/dist/impl/get_basic_datatype.js.map +1 -0
- package/dist/impl/handle_hierarchy_parent.d.ts +33 -0
- package/dist/impl/handle_hierarchy_parent.js +103 -0
- package/dist/impl/handle_hierarchy_parent.js.map +1 -0
- package/dist/impl/historical_access/address_space_historical_data_node.d.ts +21 -0
- package/dist/impl/historical_access/address_space_historical_data_node.js +658 -0
- package/dist/impl/historical_access/address_space_historical_data_node.js.map +1 -0
- package/dist/impl/historizer_factory.d.ts +18 -0
- package/dist/impl/historizer_factory.js +16 -0
- package/dist/impl/historizer_factory.js.map +1 -0
- package/dist/impl/idx_iterator.js.map +1 -0
- package/dist/impl/namespace_impl.d.ts +469 -0
- package/dist/impl/namespace_impl.js +1845 -0
- package/dist/impl/namespace_impl.js.map +1 -0
- package/dist/impl/namespace_private.d.ts +25 -0
- package/dist/impl/namespace_private.js.map +1 -0
- package/dist/impl/nodeid_manager.js +249 -0
- package/dist/impl/nodeid_manager.js.map +1 -0
- package/dist/impl/nodeset_tools/adjust_namespace_array.js.map +1 -0
- package/dist/impl/nodeset_tools/construct_namespace_dependency.d.ts +37 -0
- package/dist/impl/nodeset_tools/construct_namespace_dependency.js +352 -0
- package/dist/impl/nodeset_tools/construct_namespace_dependency.js.map +1 -0
- package/dist/impl/nodeset_tools/dump_to_bsd.d.ts +10 -0
- package/dist/impl/nodeset_tools/dump_to_bsd.js +176 -0
- package/dist/impl/nodeset_tools/dump_to_bsd.js.map +1 -0
- package/dist/impl/nodeset_tools/nodeset_to_records.d.ts +67 -0
- package/dist/impl/nodeset_tools/nodeset_to_records.js +773 -0
- package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -0
- package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +28 -0
- package/dist/impl/nodeset_tools/nodeset_to_xml.js +1132 -0
- package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -0
- package/dist/impl/private_namespace.d.ts +5 -0
- package/dist/impl/private_namespace.js.map +1 -0
- package/dist/impl/reference_impl.d.ts +82 -0
- package/dist/impl/reference_impl.js +207 -0
- package/dist/impl/reference_impl.js.map +1 -0
- package/dist/impl/reference_type_version.d.ts +22 -0
- package/dist/impl/reference_type_version.js +22 -0
- package/dist/impl/reference_type_version.js.map +1 -0
- package/dist/impl/role_permissions.js.map +1 -0
- package/dist/impl/state_machine/finite_state_machine.d.ts +81 -0
- package/dist/impl/state_machine/finite_state_machine.js +573 -0
- package/dist/impl/state_machine/finite_state_machine.js.map +1 -0
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.d.ts +64 -0
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.js +249 -0
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
- package/dist/impl/state_machine/ua_two_state_variable.d.ts +55 -0
- package/dist/impl/state_machine/ua_two_state_variable.js +323 -0
- package/dist/impl/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/impl/tool_isSubtypeOf.d.ts +18 -0
- package/dist/impl/tool_isSubtypeOf.js +138 -0
- package/dist/impl/tool_isSubtypeOf.js.map +1 -0
- package/dist/impl/ua_condition_type.js.map +1 -0
- package/dist/impl/ua_data_type_impl.d.ts +87 -0
- package/dist/impl/ua_data_type_impl.js +391 -0
- package/dist/impl/ua_data_type_impl.js.map +1 -0
- package/dist/impl/ua_method_impl.d.ts +48 -0
- package/dist/impl/ua_method_impl.js +281 -0
- package/dist/impl/ua_method_impl.js.map +1 -0
- package/dist/impl/ua_object_impl.d.ts +38 -0
- package/dist/impl/ua_object_impl.js +214 -0
- package/dist/impl/ua_object_impl.js.map +1 -0
- package/dist/impl/ua_object_type_impl.d.ts +55 -0
- package/dist/impl/ua_object_type_impl.js +131 -0
- package/dist/impl/ua_object_type_impl.js.map +1 -0
- package/dist/impl/ua_reference_type_impl.d.ts +42 -0
- package/dist/impl/ua_reference_type_impl.js +157 -0
- package/dist/impl/ua_reference_type_impl.js.map +1 -0
- package/dist/impl/ua_variable_impl.d.ts +391 -0
- package/dist/impl/ua_variable_impl.js +2001 -0
- package/dist/impl/ua_variable_impl.js.map +1 -0
- package/dist/impl/ua_variable_impl_ext_obj.d.ts +23 -0
- package/dist/impl/ua_variable_impl_ext_obj.js +753 -0
- package/dist/impl/ua_variable_impl_ext_obj.js.map +1 -0
- package/dist/impl/ua_variable_type_impl.d.ts +79 -0
- package/dist/impl/ua_variable_type_impl.js +279 -0
- package/dist/impl/ua_variable_type_impl.js.map +1 -0
- package/dist/impl/ua_view_impl.d.ts +18 -0
- package/dist/impl/ua_view_impl.js +45 -0
- package/dist/impl/ua_view_impl.js.map +1 -0
- package/dist/impl/validate_data_type_correctness.d.ts +6 -0
- package/dist/impl/validate_data_type_correctness.js +123 -0
- package/dist/impl/validate_data_type_correctness.js.map +1 -0
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distHelpers/address_space_digest.d.ts +4 -0
- package/distHelpers/address_space_digest.js +9 -0
- package/distHelpers/address_space_digest.js.map +1 -0
- package/distHelpers/alarms_and_conditions_demo.d.ts +1 -1
- package/distHelpers/assertHasMatchingReference.d.ts +1 -1
- package/distHelpers/boiler_system.d.ts +1 -1
- package/distHelpers/boiler_system.js +3 -3
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -1
- package/distHelpers/get_address_space_fixture.js +38 -22
- package/distHelpers/get_address_space_fixture.js.map +1 -1
- package/distHelpers/get_mini_address_space.d.ts +1 -1
- package/distHelpers/get_mini_address_space.js +7 -7
- package/distHelpers/get_mini_address_space.js.map +1 -1
- package/distHelpers/index.d.ts +9 -9
- package/distHelpers/index.js +9 -9
- package/distHelpers/index.js.map +1 -1
- package/distHelpers/mock_session.d.ts +1 -1
- package/distHelpers/mock_session.js +2 -2
- package/distHelpers/mock_session.js.map +1 -1
- package/distNodeJS/address_space_digest.d.ts +13 -0
- package/distNodeJS/address_space_digest.js +31 -0
- package/distNodeJS/address_space_digest.js.map +1 -0
- package/distNodeJS/generate_address_space.d.ts +35 -2
- package/distNodeJS/generate_address_space.js +201 -7
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/distNodeJS/index.d.ts +3 -1
- package/distNodeJS/index.js +3 -1
- package/distNodeJS/index.js.map +1 -1
- package/distNodeJS/nodeset_image_file_store.d.ts +29 -0
- package/distNodeJS/nodeset_image_file_store.js +120 -0
- package/distNodeJS/nodeset_image_file_store.js.map +1 -0
- package/impl/_instantiate_helpers.ts +197 -0
- package/impl/_mandatory_child_or_requested_optional_filter.ts +100 -0
- package/impl/address_space.ts +1572 -0
- package/impl/address_space_change_event_tools.ts +177 -0
- package/impl/address_space_private.ts +100 -0
- package/impl/alarms_and_conditions/condition_info_impl.ts +45 -0
- package/impl/alarms_and_conditions/condition_snapshot_impl.ts +793 -0
- package/impl/alarms_and_conditions/deviation_alarm_helper.ts +73 -0
- package/impl/alarms_and_conditions/index.ts +16 -0
- package/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +351 -0
- package/impl/alarms_and_conditions/ua_alarm_condition_impl.ts +515 -0
- package/impl/alarms_and_conditions/ua_base_event_impl.ts +61 -0
- package/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +246 -0
- package/impl/alarms_and_conditions/ua_condition_impl.ts +1286 -0
- package/impl/alarms_and_conditions/ua_discrete_alarm_impl.ts +60 -0
- package/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +95 -0
- package/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +21 -0
- package/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +112 -0
- package/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +25 -0
- package/impl/alarms_and_conditions/ua_limit_alarm_impl.ts +265 -0
- package/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +94 -0
- package/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +232 -0
- package/impl/alarms_and_conditions/ua_off_normal_alarm_impl.ts +216 -0
- package/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +26 -0
- package/impl/apply_condition_refresh.ts +56 -0
- package/impl/base_node_impl.ts +2165 -0
- package/impl/base_node_private.ts +1420 -0
- package/impl/child_accessors.ts +239 -0
- package/impl/data_access/adjust_datavalue_status_code.ts +36 -0
- package/impl/data_access/ua_multistate_discrete_impl.ts +198 -0
- package/impl/data_access/ua_multistate_value_discrete_impl.ts +384 -0
- package/impl/data_access/ua_two_state_discrete_impl.ts +195 -0
- package/impl/event_data.ts +80 -0
- package/impl/event_layout.ts +141 -0
- package/impl/extension_object_array_node.ts +343 -0
- package/impl/handle_hierarchy_parent.ts +133 -0
- package/impl/historical_access/address_space_historical_data_node.ts +849 -0
- package/impl/historizer_factory.ts +17 -0
- package/impl/namespace_impl.ts +2323 -0
- package/impl/namespace_private.ts +68 -0
- package/impl/nodeid_manager.ts +293 -0
- package/impl/nodeset_tools/construct_namespace_dependency.ts +381 -0
- package/impl/nodeset_tools/dump_to_bsd.ts +210 -0
- package/impl/nodeset_tools/nodeset_to_records.ts +846 -0
- package/impl/nodeset_tools/nodeset_to_xml.ts +1326 -0
- package/impl/private_namespace.ts +21 -0
- package/impl/reference_impl.ts +244 -0
- package/impl/reference_type_version.ts +19 -0
- package/impl/state_machine/finite_state_machine.ts +676 -0
- package/impl/state_machine/ua_shelving_state_machine_ex.ts +356 -0
- package/impl/state_machine/ua_two_state_variable.ts +421 -0
- package/impl/tool_isSubtypeOf.ts +168 -0
- package/impl/ua_data_type_impl.ts +486 -0
- package/impl/ua_method_impl.ts +364 -0
- package/impl/ua_object_impl.ts +278 -0
- package/impl/ua_object_type_impl.ts +179 -0
- package/impl/ua_reference_type_impl.ts +179 -0
- package/impl/ua_variable_impl.ts +2559 -0
- package/impl/ua_variable_impl_ext_obj.ts +904 -0
- package/impl/ua_variable_type_impl.ts +390 -0
- package/impl/ua_view_impl.ts +53 -0
- package/impl/validate_data_type_correctness.ts +142 -0
- package/package.json +49 -44
- package/source_nodejs/address_space_digest.ts +35 -0
- package/source_nodejs/generate_address_space.ts +181 -8
- package/source_nodejs/index.ts +3 -1
- package/source_nodejs/nodeset_image_file_store.ts +127 -0
- package/dist/source/address_space_ts.d.ts +0 -128
- package/dist/source/address_space_ts.js +0 -23
- package/dist/source/address_space_ts.js.map +0 -1
- package/dist/source/continuation_points/continuation_point_manager.js +0 -230
- package/dist/source/continuation_points/continuation_point_manager.js.map +0 -1
- package/dist/source/helpers/adjust_browse_direction.js.map +0 -1
- package/dist/source/helpers/argument_list.js +0 -263
- package/dist/source/helpers/argument_list.js.map +0 -1
- package/dist/source/helpers/call_helpers.js +0 -80
- package/dist/source/helpers/call_helpers.js.map +0 -1
- package/dist/source/helpers/coerce_enum_value.d.ts +0 -6
- package/dist/source/helpers/coerce_enum_value.js.map +0 -1
- package/dist/source/helpers/dump_tools.js +0 -81
- package/dist/source/helpers/dump_tools.js.map +0 -1
- package/dist/source/helpers/ensure_secure_access.d.ts +0 -9
- package/dist/source/helpers/ensure_secure_access.js +0 -58
- package/dist/source/helpers/ensure_secure_access.js.map +0 -1
- package/dist/source/helpers/make_optionals_map.js.map +0 -1
- package/dist/source/helpers/multiform_func.js +0 -75
- package/dist/source/helpers/multiform_func.js.map +0 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js +0 -25
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +0 -1
- package/dist/source/index.d.ts +0 -66
- package/dist/source/index.js +0 -97
- package/dist/source/index.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +0 -21
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +0 -150
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +0 -12
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +0 -10
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +0 -20
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +0 -21
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +0 -33
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +0 -19
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +0 -44
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +0 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +0 -19
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +0 -25
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +0 -8
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +0 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +0 -44
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +0 -22
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +0 -13
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +0 -1
- package/dist/source/interfaces/extension_object_constructor.js.map +0 -1
- package/dist/source/interfaces/i_condition_variable_type_setter_options.js.map +0 -1
- package/dist/source/interfaces/i_set_state_options.js.map +0 -1
- package/dist/source/interfaces/nodeset_loader_options.d.ts +0 -37
- package/dist/source/interfaces/nodeset_loader_options.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +0 -12
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +0 -49
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +0 -11
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +0 -29
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +0 -236
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +0 -1
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +0 -1
- package/dist/source/loader/decode_xml_extension_object.d.ts +0 -6
- package/dist/source/loader/decode_xml_extension_object.js +0 -69
- package/dist/source/loader/decode_xml_extension_object.js.map +0 -1
- package/dist/source/loader/ensure_datatype_extracted.js +0 -88
- package/dist/source/loader/ensure_datatype_extracted.js.map +0 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +0 -29
- package/dist/source/loader/generateAddressSpaceRaw.js +0 -188
- package/dist/source/loader/generateAddressSpaceRaw.js.map +0 -1
- package/dist/source/loader/load_nodeset2.d.ts +0 -15
- package/dist/source/loader/load_nodeset2.js +0 -1047
- package/dist/source/loader/load_nodeset2.js.map +0 -1
- package/dist/source/loader/make_semver_compatible.js.map +0 -1
- package/dist/source/loader/make_xml_extension_object_parser.js +0 -422
- package/dist/source/loader/make_xml_extension_object_parser.js.map +0 -1
- package/dist/source/loader/namespace_post_step.js +0 -57
- package/dist/source/loader/namespace_post_step.js.map +0 -1
- package/dist/source/loader/parsers/extension_object_parser.js +0 -274
- package/dist/source/loader/parsers/extension_object_parser.js.map +0 -1
- package/dist/source/loader/parsers/localized_text_parser.js.map +0 -1
- package/dist/source/loader/parsers/nodeid_parser.js.map +0 -1
- package/dist/source/loader/parsers/qualified_name_parser.js.map +0 -1
- package/dist/source/loader/parsers/variant_parser.d.ts +0 -35
- package/dist/source/loader/parsers/variant_parser.js +0 -331
- package/dist/source/loader/parsers/variant_parser.js.map +0 -1
- package/dist/source/loader/register_node_promoter.d.ts +0 -2
- package/dist/source/loader/register_node_promoter.js +0 -9
- package/dist/source/loader/register_node_promoter.js.map +0 -1
- package/dist/source/namespace.d.ts +0 -6
- package/dist/source/namespace.js.map +0 -1
- package/dist/source/namespace_alarm_and_condition.d.ts +0 -33
- package/dist/source/namespace_alarm_and_condition.js.map +0 -1
- package/dist/source/namespace_data_access.d.ts +0 -67
- package/dist/source/namespace_data_access.js.map +0 -1
- package/dist/source/namespace_machine_state.d.ts +0 -8
- package/dist/source/namespace_machine_state.js.map +0 -1
- package/dist/source/pseudo_session.d.ts +0 -74
- package/dist/source/pseudo_session.js +0 -308
- package/dist/source/pseudo_session.js.map +0 -1
- package/dist/source/session_context.d.ts +0 -241
- package/dist/source/session_context.js.map +0 -1
- package/dist/source/set_namespace_meta_data.js.map +0 -1
- package/dist/source/ua_addin.js.map +0 -1
- package/dist/source/ua_interface.js +0 -25
- package/dist/source/ua_interface.js.map +0 -1
- package/dist/source/ua_root_folder.js.map +0 -1
- package/dist/source/ua_two_state_variable_ex.d.ts +0 -24
- package/dist/source/ua_two_state_variable_ex.js.map +0 -1
- package/dist/source/xml_writer.js.map +0 -1
- package/dist/src/_instantiate_helpers.js +0 -99
- package/dist/src/_instantiate_helpers.js.map +0 -1
- package/dist/src/_mandatory_child_or_requested_optional_filter.js +0 -82
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +0 -1
- package/dist/src/address_space.d.ts +0 -369
- package/dist/src/address_space.js +0 -1416
- package/dist/src/address_space.js.map +0 -1
- package/dist/src/address_space_change_event_tools.d.ts +0 -6
- package/dist/src/address_space_change_event_tools.js.map +0 -1
- package/dist/src/address_space_private.d.ts +0 -45
- package/dist/src/address_space_private.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +0 -18
- package/dist/src/alarms_and_conditions/condition_info_impl.js +0 -38
- package/dist/src/alarms_and_conditions/condition_info_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +0 -269
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +0 -699
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +0 -12
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +0 -66
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +0 -1
- package/dist/src/alarms_and_conditions/index.d.ts +0 -16
- package/dist/src/alarms_and_conditions/index.js +0 -33
- package/dist/src/alarms_and_conditions/index.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +0 -42
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +0 -243
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +0 -80
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +0 -415
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +0 -18
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +0 -33
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +0 -44
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +0 -203
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +0 -104
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +0 -1017
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +0 -19
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +0 -39
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +0 -25
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +0 -55
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +0 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +0 -12
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +0 -23
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +0 -87
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +0 -10
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +0 -8
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +0 -26
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +0 -208
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +0 -23
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +0 -55
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +0 -27
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -173
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +0 -43
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +0 -168
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +0 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +0 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +0 -1
- package/dist/src/apply_condition_refresh.d.ts +0 -4
- package/dist/src/apply_condition_refresh.js +0 -27
- package/dist/src/apply_condition_refresh.js.map +0 -1
- package/dist/src/base_node_impl.d.ts +0 -287
- package/dist/src/base_node_impl.js +0 -1538
- package/dist/src/base_node_impl.js.map +0 -1
- package/dist/src/base_node_private.d.ts +0 -87
- package/dist/src/base_node_private.js +0 -925
- package/dist/src/base_node_private.js.map +0 -1
- package/dist/src/check_value_rank_compatibility.js.map +0 -1
- package/dist/src/data_access/add_dataItem_stuff.js.map +0 -1
- package/dist/src/data_access/adjust_datavalue_status_code.d.ts +0 -7
- package/dist/src/data_access/adjust_datavalue_status_code.js.map +0 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +0 -35
- package/dist/src/data_access/ua_multistate_discrete_impl.js +0 -142
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +0 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +0 -51
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +0 -302
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +0 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +0 -20
- package/dist/src/data_access/ua_two_state_discrete_impl.js +0 -163
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +0 -1
- package/dist/src/event_data.d.ts +0 -18
- package/dist/src/event_data.js +0 -70
- package/dist/src/event_data.js.map +0 -1
- package/dist/src/extension_object_array_node.d.ts +0 -34
- package/dist/src/extension_object_array_node.js +0 -262
- package/dist/src/extension_object_array_node.js.map +0 -1
- package/dist/src/get_basic_datatype.js.map +0 -1
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +0 -21
- package/dist/src/historical_access/address_space_historical_data_node.js +0 -654
- package/dist/src/historical_access/address_space_historical_data_node.js.map +0 -1
- package/dist/src/idx_iterator.js.map +0 -1
- package/dist/src/index_current.d.ts +0 -50
- package/dist/src/index_current.js +0 -82
- package/dist/src/index_current.js.map +0 -1
- package/dist/src/namespace_impl.d.ts +0 -450
- package/dist/src/namespace_impl.js +0 -1876
- package/dist/src/namespace_impl.js.map +0 -1
- package/dist/src/namespace_private.d.ts +0 -31
- package/dist/src/namespace_private.js.map +0 -1
- package/dist/src/nodeid_manager.js +0 -249
- package/dist/src/nodeid_manager.js.map +0 -1
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +0 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +0 -33
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +0 -347
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +0 -1
- package/dist/src/nodeset_tools/dump_to_bsd.d.ts +0 -2
- package/dist/src/nodeset_tools/dump_to_bsd.js +0 -164
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +0 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +0 -12
- package/dist/src/nodeset_tools/nodeset_to_xml.js +0 -1381
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +0 -1
- package/dist/src/private_namespace.d.ts +0 -5
- package/dist/src/private_namespace.js.map +0 -1
- package/dist/src/reference_impl.d.ts +0 -43
- package/dist/src/reference_impl.js +0 -152
- package/dist/src/reference_impl.js.map +0 -1
- package/dist/src/role_permissions.js.map +0 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +0 -70
- package/dist/src/state_machine/finite_state_machine.js +0 -574
- package/dist/src/state_machine/finite_state_machine.js.map +0 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +0 -39
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +0 -249
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +0 -1
- package/dist/src/state_machine/ua_two_state_variable.d.ts +0 -55
- package/dist/src/state_machine/ua_two_state_variable.js +0 -323
- package/dist/src/state_machine/ua_two_state_variable.js.map +0 -1
- package/dist/src/tool_isSubtypeOf.d.ts +0 -18
- package/dist/src/tool_isSubtypeOf.js +0 -130
- package/dist/src/tool_isSubtypeOf.js.map +0 -1
- package/dist/src/ua_condition_type.js.map +0 -1
- package/dist/src/ua_data_type_impl.d.ts +0 -87
- package/dist/src/ua_data_type_impl.js +0 -393
- package/dist/src/ua_data_type_impl.js.map +0 -1
- package/dist/src/ua_method_impl.d.ts +0 -48
- package/dist/src/ua_method_impl.js +0 -280
- package/dist/src/ua_method_impl.js.map +0 -1
- package/dist/src/ua_object_impl.d.ts +0 -38
- package/dist/src/ua_object_impl.js +0 -214
- package/dist/src/ua_object_impl.js.map +0 -1
- package/dist/src/ua_object_type_impl.d.ts +0 -55
- package/dist/src/ua_object_type_impl.js +0 -131
- package/dist/src/ua_object_type_impl.js.map +0 -1
- package/dist/src/ua_reference_type_impl.d.ts +0 -42
- package/dist/src/ua_reference_type_impl.js +0 -146
- package/dist/src/ua_reference_type_impl.js.map +0 -1
- package/dist/src/ua_variable_impl.d.ts +0 -379
- package/dist/src/ua_variable_impl.js +0 -1940
- package/dist/src/ua_variable_impl.js.map +0 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +0 -23
- package/dist/src/ua_variable_impl_ext_obj.js +0 -752
- package/dist/src/ua_variable_impl_ext_obj.js.map +0 -1
- package/dist/src/ua_variable_type_impl.d.ts +0 -79
- package/dist/src/ua_variable_type_impl.js +0 -276
- package/dist/src/ua_variable_type_impl.js.map +0 -1
- package/dist/src/ua_view_impl.d.ts +0 -18
- package/dist/src/ua_view_impl.js +0 -45
- package/dist/src/ua_view_impl.js.map +0 -1
- package/dist/src/validate_data_type_correctness.d.ts +0 -6
- package/dist/src/validate_data_type_correctness.js +0 -106
- package/dist/src/validate_data_type_correctness.js.map +0 -1
- package/source/address_space_ts.ts +0 -220
- package/source/continuation_points/continuation_point_manager.ts +0 -271
- package/source/helpers/argument_list.ts +0 -310
- package/source/helpers/call_helpers.ts +0 -100
- package/source/helpers/coerce_enum_value.ts +0 -33
- package/source/helpers/dump_tools.ts +0 -90
- package/source/helpers/ensure_secure_access.ts +0 -57
- package/source/helpers/multiform_func.ts +0 -78
- package/source/helpers/resolve_opaque_on_address_space.ts +0 -26
- package/source/index.ts +0 -72
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +0 -24
- package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +0 -235
- package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +0 -16
- package/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +0 -8
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +0 -6
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +0 -6
- package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +0 -13
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +0 -6
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +0 -6
- package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +0 -21
- package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +0 -28
- package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +0 -43
- package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +0 -36
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +0 -55
- package/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +0 -17
- package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +0 -21
- package/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +0 -21
- package/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +0 -26
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +0 -29
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +0 -25
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +0 -57
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +0 -31
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +0 -15
- package/source/interfaces/nodeset_loader_options.ts +0 -38
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +0 -20
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +0 -50
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +0 -14
- package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +0 -35
- package/source/interfaces/state_machine/ua_state_machine_type.ts +0 -288
- package/source/loader/decode_xml_extension_object.ts +0 -80
- package/source/loader/ensure_datatype_extracted.ts +0 -122
- package/source/loader/generateAddressSpaceRaw.ts +0 -219
- package/source/loader/load_nodeset2.ts +0 -1275
- package/source/loader/make_xml_extension_object_parser.ts +0 -524
- package/source/loader/namespace_post_step.ts +0 -68
- package/source/loader/parsers/extension_object_parser.ts +0 -374
- package/source/loader/parsers/variant_parser.ts +0 -433
- package/source/loader/register_node_promoter.ts +0 -6
- package/source/namespace.ts +0 -7
- package/source/namespace_alarm_and_condition.ts +0 -78
- package/source/namespace_data_access.ts +0 -92
- package/source/namespace_machine_state.ts +0 -20
- package/source/pseudo_session.ts +0 -415
- package/source/session_context.ts +0 -725
- package/source/ua_interface.ts +0 -38
- package/source/ua_two_state_variable_ex.ts +0 -36
- package/src/_instantiate_helpers.ts +0 -197
- package/src/_mandatory_child_or_requested_optional_filter.ts +0 -100
- package/src/address_space.ts +0 -1631
- package/src/address_space_change_event_tools.ts +0 -177
- package/src/address_space_private.ts +0 -96
- package/src/alarms_and_conditions/condition_info_impl.ts +0 -44
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +0 -792
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +0 -73
- package/src/alarms_and_conditions/index.ts +0 -16
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +0 -331
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +0 -479
- package/src/alarms_and_conditions/ua_base_event_impl.ts +0 -42
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +0 -244
- package/src/alarms_and_conditions/ua_condition_impl.ts +0 -1261
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +0 -57
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +0 -94
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +0 -20
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +0 -109
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +0 -25
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +0 -244
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +0 -88
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +0 -223
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +0 -218
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +0 -26
- package/src/apply_condition_refresh.ts +0 -29
- package/src/base_node_impl.ts +0 -1907
- package/src/base_node_private.ts +0 -1287
- package/src/data_access/adjust_datavalue_status_code.ts +0 -36
- package/src/data_access/ua_multistate_discrete_impl.ts +0 -189
- package/src/data_access/ua_multistate_value_discrete_impl.ts +0 -369
- package/src/data_access/ua_two_state_discrete_impl.ts +0 -184
- package/src/event_data.ts +0 -83
- package/src/extension_object_array_node.ts +0 -331
- package/src/historical_access/address_space_historical_data_node.ts +0 -842
- package/src/index_current.ts +0 -51
- package/src/namespace_impl.ts +0 -2380
- package/src/namespace_private.ts +0 -77
- package/src/nodeid_manager.ts +0 -293
- package/src/nodeset_tools/construct_namespace_dependency.ts +0 -375
- package/src/nodeset_tools/dump_to_bsd.ts +0 -201
- package/src/nodeset_tools/nodeset_to_xml.ts +0 -1652
- package/src/private_namespace.ts +0 -21
- package/src/reference_impl.ts +0 -171
- package/src/state_machine/finite_state_machine.ts +0 -668
- package/src/state_machine/ua_shelving_state_machine_ex.ts +0 -330
- package/src/state_machine/ua_two_state_variable.ts +0 -421
- package/src/tool_isSubtypeOf.ts +0 -160
- package/src/ua_data_type_impl.ts +0 -483
- package/src/ua_method_impl.ts +0 -362
- package/src/ua_object_impl.ts +0 -278
- package/src/ua_object_type_impl.ts +0 -179
- package/src/ua_reference_type_impl.ts +0 -170
- package/src/ua_variable_impl.ts +0 -2489
- package/src/ua_variable_impl_ext_obj.ts +0 -903
- package/src/ua_variable_type_impl.ts +0 -385
- package/src/ua_view_impl.ts +0 -53
- package/src/validate_data_type_correctness.ts +0 -124
- /package/{source → api}/helpers/adjust_browse_direction.ts +0 -0
- /package/{source → api}/helpers/make_optionals_map.ts +0 -0
- /package/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.ts +0 -0
- /package/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.ts +0 -0
- /package/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.ts +0 -0
- /package/{source → api}/interfaces/data_access/ua_y_array_item_ex.ts +0 -0
- /package/{source → api}/interfaces/extension_object_constructor.ts +0 -0
- /package/{source → api}/interfaces/i_condition_variable_type_setter_options.ts +0 -0
- /package/{source → api}/interfaces/i_set_state_options.ts +0 -0
- /package/{source → api}/interfaces/state_machine/ua_transition_ex.ts +0 -0
- /package/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.ts +0 -0
- /package/{source → api}/loader/make_semver_compatible.ts +0 -0
- /package/{source → api}/loader/parsers/localized_text_parser.ts +0 -0
- /package/{source → api}/loader/parsers/nodeid_parser.ts +0 -0
- /package/{source → api}/loader/parsers/qualified_name_parser.ts +0 -0
- /package/{source → api}/set_namespace_meta_data.ts +0 -0
- /package/{source → api}/ua_addin.ts +0 -0
- /package/{source → api}/ua_root_folder.ts +0 -0
- /package/{source → api}/xml_writer.ts +0 -0
- /package/dist/{source → api}/continuation_points/continuation_point_manager.d.ts +0 -0
- /package/dist/{source → api}/helpers/adjust_browse_direction.d.ts +0 -0
- /package/dist/{source → api}/helpers/adjust_browse_direction.js +0 -0
- /package/dist/{source → api}/helpers/argument_list.d.ts +0 -0
- /package/dist/{source → api}/helpers/call_helpers.d.ts +0 -0
- /package/dist/{source → api}/helpers/coerce_enum_value.js +0 -0
- /package/dist/{source → api}/helpers/dump_tools.d.ts +0 -0
- /package/dist/{source → api}/helpers/make_optionals_map.d.ts +0 -0
- /package/dist/{source → api}/helpers/make_optionals_map.js +0 -0
- /package/dist/{source → api}/helpers/multiform_func.d.ts +0 -0
- /package/dist/{source → api}/helpers/resolve_opaque_on_address_space.d.ts +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/condition_snapshot.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/deviation_stuff.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/install_setpoint_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_condition_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_base_event_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_condition_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +0 -0
- /package/dist/{source → api}/interfaces/data_access/ua_multistate_discrete_ex.js +0 -0
- /package/dist/{source → api}/interfaces/data_access/ua_multistate_value_discrete_ex.js +0 -0
- /package/dist/{source → api}/interfaces/data_access/ua_two_state_discrete_ex.js +0 -0
- /package/dist/{source → api}/interfaces/data_access/ua_y_array_item_ex.d.ts +0 -0
- /package/dist/{source → api}/interfaces/data_access/ua_y_array_item_ex.js +0 -0
- /package/dist/{source → api}/interfaces/extension_object_constructor.d.ts +0 -0
- /package/dist/{source → api}/interfaces/extension_object_constructor.js +0 -0
- /package/dist/{source → api}/interfaces/i_condition_variable_type_setter_options.d.ts +0 -0
- /package/dist/{source → api}/interfaces/i_condition_variable_type_setter_options.js +0 -0
- /package/dist/{source → api}/interfaces/i_set_state_options.d.ts +0 -0
- /package/dist/{source → api}/interfaces/i_set_state_options.js +0 -0
- /package/dist/{source → api}/interfaces/nodeset_loader_options.js +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_finite_state_machine_type.js +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_program_state_machine_type.js +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_shelved_state_machine_ex.js +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_state_machine_type.js +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_transition_ex.d.ts +0 -0
- /package/dist/{source → api}/interfaces/state_machine/ua_transition_ex.js +0 -0
- /package/dist/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +0 -0
- /package/dist/{source → api}/interfaces/ua_subscription_diagnostics_variable_ex.js +0 -0
- /package/dist/{source → api}/loader/ensure_datatype_extracted.d.ts +0 -0
- /package/dist/{source → api}/loader/make_semver_compatible.d.ts +0 -0
- /package/dist/{source → api}/loader/make_semver_compatible.js +0 -0
- /package/dist/{source → api}/loader/make_xml_extension_object_parser.d.ts +0 -0
- /package/dist/{source → api}/loader/namespace_post_step.d.ts +0 -0
- /package/dist/{source → api}/loader/parsers/extension_object_parser.d.ts +0 -0
- /package/dist/{source → api}/loader/parsers/localized_text_parser.d.ts +0 -0
- /package/dist/{source → api}/loader/parsers/localized_text_parser.js +0 -0
- /package/dist/{source → api}/loader/parsers/nodeid_parser.d.ts +0 -0
- /package/dist/{source → api}/loader/parsers/nodeid_parser.js +0 -0
- /package/dist/{source → api}/loader/parsers/qualified_name_parser.d.ts +0 -0
- /package/dist/{source → api}/loader/parsers/qualified_name_parser.js +0 -0
- /package/dist/{source → api}/namespace.js +0 -0
- /package/dist/{source → api}/namespace_alarm_and_condition.js +0 -0
- /package/dist/{source → api}/namespace_data_access.js +0 -0
- /package/dist/{source → api}/namespace_machine_state.js +0 -0
- /package/dist/{source → api}/session_context.js +0 -0
- /package/dist/{source → api}/set_namespace_meta_data.d.ts +0 -0
- /package/dist/{source → api}/set_namespace_meta_data.js +0 -0
- /package/dist/{source → api}/ua_addin.d.ts +0 -0
- /package/dist/{source → api}/ua_addin.js +0 -0
- /package/dist/{source → api}/ua_interface.d.ts +0 -0
- /package/dist/{source → api}/ua_root_folder.d.ts +0 -0
- /package/dist/{source → api}/ua_root_folder.js +0 -0
- /package/dist/{source → api}/ua_two_state_variable_ex.js +0 -0
- /package/dist/{source → api}/xml_writer.d.ts +0 -0
- /package/dist/{source → api}/xml_writer.js +0 -0
- /package/dist/{src → impl}/_instantiate_helpers.d.ts +0 -0
- /package/dist/{src → impl}/_mandatory_child_or_requested_optional_filter.d.ts +0 -0
- /package/dist/{src → impl}/address_space_change_event_tools.js +0 -0
- /package/dist/{src → impl}/address_space_private.js +0 -0
- /package/dist/{src → impl}/alarms_and_conditions/condition.d.ts +0 -0
- /package/dist/{src → impl}/alarms_and_conditions/condition.js +0 -0
- /package/dist/{src → impl}/check_value_rank_compatibility.d.ts +0 -0
- /package/dist/{src → impl}/check_value_rank_compatibility.js +0 -0
- /package/dist/{src → impl}/data_access/add_dataItem_stuff.d.ts +0 -0
- /package/dist/{src → impl}/data_access/add_dataItem_stuff.js +0 -0
- /package/dist/{src → impl}/data_access/adjust_datavalue_status_code.js +0 -0
- /package/dist/{src → impl}/get_basic_datatype.d.ts +0 -0
- /package/dist/{src → impl}/get_basic_datatype.js +0 -0
- /package/dist/{src → impl}/idx_iterator.d.ts +0 -0
- /package/dist/{src → impl}/idx_iterator.js +0 -0
- /package/dist/{src → impl}/namespace_private.js +0 -0
- /package/dist/{src → impl}/nodeid_manager.d.ts +0 -0
- /package/dist/{src → impl}/nodeset_tools/adjust_namespace_array.d.ts +0 -0
- /package/dist/{src → impl}/nodeset_tools/adjust_namespace_array.js +0 -0
- /package/dist/{src → impl}/private_namespace.js +0 -0
- /package/dist/{src → impl}/role_permissions.d.ts +0 -0
- /package/dist/{src → impl}/role_permissions.js +0 -0
- /package/dist/{src → impl}/ua_condition_type.d.ts +0 -0
- /package/dist/{src → impl}/ua_condition_type.js +0 -0
- /package/{src → impl}/alarms_and_conditions/condition.ts +0 -0
- /package/{src → impl}/check_value_rank_compatibility.ts +0 -0
- /package/{src → impl}/data_access/add_dataItem_stuff.ts +0 -0
- /package/{src → impl}/get_basic_datatype.ts +0 -0
- /package/{src → impl}/idx_iterator.ts +0 -0
- /package/{src → impl}/nodeset_tools/adjust_namespace_array.ts +0 -0
- /package/{src → impl}/role_permissions.ts +0 -0
- /package/{src → impl}/ua_condition_type.ts +0 -0
|
@@ -0,0 +1,2323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import type {
|
|
7
|
+
AddBaseNodeOptions,
|
|
8
|
+
AddEnumerationTypeOptions,
|
|
9
|
+
AddMethodOptions,
|
|
10
|
+
AddObjectOptions,
|
|
11
|
+
AddObjectTypeOptions,
|
|
12
|
+
AddReferenceOpts,
|
|
13
|
+
AddReferenceTypeOptions,
|
|
14
|
+
AddVariableOptions,
|
|
15
|
+
AddVariableTypeOptions,
|
|
16
|
+
AddViewOptions,
|
|
17
|
+
AddYArrayItemOptions,
|
|
18
|
+
BaseNode,
|
|
19
|
+
BaseNodeEvents,
|
|
20
|
+
CreateDataTypeOptions,
|
|
21
|
+
CreateNodeOptions,
|
|
22
|
+
EnumerationItem,
|
|
23
|
+
RequiredModel,
|
|
24
|
+
UADataType,
|
|
25
|
+
UAEventType,
|
|
26
|
+
UAMethod,
|
|
27
|
+
UAObject,
|
|
28
|
+
UAObjectType,
|
|
29
|
+
UAReference,
|
|
30
|
+
UAReferenceType,
|
|
31
|
+
UAVariable,
|
|
32
|
+
UAVariableType,
|
|
33
|
+
UAView
|
|
34
|
+
} from "node-opcua-address-space-base";
|
|
35
|
+
import { assert } from "node-opcua-assert";
|
|
36
|
+
import { coerceInt64 } from "node-opcua-basic-types";
|
|
37
|
+
import { AxisScaleEnumeration } from "node-opcua-data-access";
|
|
38
|
+
import {
|
|
39
|
+
AccessRestrictionsFlag,
|
|
40
|
+
BrowseDirection,
|
|
41
|
+
coerceLocalizedText,
|
|
42
|
+
coerceQualifiedName,
|
|
43
|
+
NodeClass,
|
|
44
|
+
QualifiedName,
|
|
45
|
+
type QualifiedNameLike
|
|
46
|
+
} from "node-opcua-data-model";
|
|
47
|
+
import { dumpIf, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
48
|
+
import { coerceNodeId, NodeId, type NodeIdLike, NodeIdType, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
49
|
+
import type { UAAnalogItem, UADataItem, UAInitialState, UAState } from "node-opcua-nodeset-ua";
|
|
50
|
+
import { StatusCodes } from "node-opcua-status-code";
|
|
51
|
+
import {
|
|
52
|
+
Argument,
|
|
53
|
+
type ArgumentOptions,
|
|
54
|
+
AxisInformation,
|
|
55
|
+
EnumDefinition,
|
|
56
|
+
EnumField,
|
|
57
|
+
EnumValueType,
|
|
58
|
+
EUInformation,
|
|
59
|
+
Range,
|
|
60
|
+
type RolePermissionType,
|
|
61
|
+
type RolePermissionTypeOptions
|
|
62
|
+
} from "node-opcua-types";
|
|
63
|
+
import { isNullOrUndefined } from "node-opcua-utils";
|
|
64
|
+
import { DataType, Variant, VariantArrayType, type VariantOptions, verifyRankAndDimensions } from "node-opcua-variant";
|
|
65
|
+
import type {
|
|
66
|
+
AddMultiStateDiscreteOptions,
|
|
67
|
+
AddMultiStateValueDiscreteOptions,
|
|
68
|
+
AddTwoStateDiscreteOptions,
|
|
69
|
+
AddTwoStateVariableOptions
|
|
70
|
+
} from "../api/address_space_ts.js";
|
|
71
|
+
import type {
|
|
72
|
+
InstantiateAlarmConditionOptions,
|
|
73
|
+
InstantiateLimitAlarmOptions,
|
|
74
|
+
InstantiateOffNormalAlarmOptions,
|
|
75
|
+
UATwoStateDiscreteEx,
|
|
76
|
+
UAYArrayItemEx
|
|
77
|
+
} from "../api/index.js";
|
|
78
|
+
import type { InstantiateConditionOptions } from "../api/interfaces/alarms_and_conditions/instantiate_condition_options.js";
|
|
79
|
+
import type { InstantiateExclusiveDeviationAlarmOptions } from "../api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js";
|
|
80
|
+
import type { InstantiateNonExclusiveDeviationAlarmOptions } from "../api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js";
|
|
81
|
+
import type { InstantiateNonExclusiveLimitAlarmOptions } from "../api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js";
|
|
82
|
+
import type { UAAlarmConditionEx } from "../api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js";
|
|
83
|
+
import type { UAConditionEx } from "../api/interfaces/alarms_and_conditions/ua_condition_ex.js";
|
|
84
|
+
import type { UADiscreteAlarmEx } from "../api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js";
|
|
85
|
+
import type { UAExclusiveDeviationAlarmEx } from "../api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js";
|
|
86
|
+
import type { UAExclusiveLimitAlarmEx } from "../api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js";
|
|
87
|
+
import type { UALimitAlarmEx } from "../api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js";
|
|
88
|
+
import type { UANonExclusiveDeviationAlarmEx } from "../api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js";
|
|
89
|
+
import type { UANonExclusiveLimitAlarmEx } from "../api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js";
|
|
90
|
+
import type { UAMultiStateDiscreteEx } from "../api/interfaces/data_access/ua_multistate_discrete_ex.js";
|
|
91
|
+
import type { UAMultiStateValueDiscreteEx } from "../api/interfaces/data_access/ua_multistate_value_discrete_ex.js";
|
|
92
|
+
import type { UAStateMachineEx } from "../api/interfaces/state_machine/ua_state_machine_type.js";
|
|
93
|
+
import type { UATransitionEx } from "../api/interfaces/state_machine/ua_transition_ex.js";
|
|
94
|
+
import type { NodesetRecord } from "../api/loader/nodeset_record.js";
|
|
95
|
+
import type { AddAnalogDataItemOptions, AddDataItemOptions } from "../api/namespace_data_access.js";
|
|
96
|
+
import type { UATwoStateVariableEx } from "../api/ua_two_state_variable_ex.js";
|
|
97
|
+
import { _handle_delete_node_model_change_event, _handle_model_change_event } from "./address_space_change_event_tools.js";
|
|
98
|
+
import type { AddressSpacePrivate } from "./address_space_private.js";
|
|
99
|
+
import {
|
|
100
|
+
type UAAcknowledgeableConditionImpl,
|
|
101
|
+
UAAcknowledgeableConditionImplBase,
|
|
102
|
+
UAAlarmConditionImplBase,
|
|
103
|
+
UAConditionImplBase,
|
|
104
|
+
UADiscreteAlarmImplBase
|
|
105
|
+
} from "./alarms_and_conditions/index.js";
|
|
106
|
+
import { UAExclusiveDeviationAlarmImplBase } from "./alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js";
|
|
107
|
+
import { UAExclusiveLimitAlarmImplBase } from "./alarms_and_conditions/ua_exclusive_limit_alarm_impl.js";
|
|
108
|
+
import { UALimitAlarmImplBase } from "./alarms_and_conditions/ua_limit_alarm_impl.js";
|
|
109
|
+
import { UANonExclusiveDeviationAlarmImplBase } from "./alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js";
|
|
110
|
+
import { UANonExclusiveLimitAlarmImplBase } from "./alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js";
|
|
111
|
+
import { type UAOffNormalAlarmEx, UAOffNormalAlarmImplBase } from "./alarms_and_conditions/ua_off_normal_alarm_impl.js";
|
|
112
|
+
import { BaseNodeImpl } from "./base_node_impl.js";
|
|
113
|
+
import { add_dataItem_stuff } from "./data_access/add_dataItem_stuff.js";
|
|
114
|
+
import { _addMultiStateDiscrete } from "./data_access/ua_multistate_discrete_impl.js";
|
|
115
|
+
import { _addMultiStateValueDiscrete } from "./data_access/ua_multistate_value_discrete_impl.js";
|
|
116
|
+
import { _addTwoStateDiscrete } from "./data_access/ua_two_state_discrete_impl.js";
|
|
117
|
+
import { _coerce_parent, _handle_hierarchy_parent } from "./handle_hierarchy_parent.js";
|
|
118
|
+
//
|
|
119
|
+
import { type NamespacePrivate, UANamespace_process_modelling_rule } from "./namespace_private.js";
|
|
120
|
+
import { type ConstructNodeIdOptions, NodeIdManager } from "./nodeid_manager.js";
|
|
121
|
+
import type { NamespaceToImageOptions, ToNodesetRecordsOptions } from "./nodeset_tools/nodeset_to_records.js";
|
|
122
|
+
import { coerceRolePermissions } from "./role_permissions.js";
|
|
123
|
+
import type { UAStateMachineImpl, UATransitionImpl } from "./state_machine/finite_state_machine.js";
|
|
124
|
+
// state machine
|
|
125
|
+
import { _addTwoStateVariable } from "./state_machine/ua_two_state_variable.js";
|
|
126
|
+
import { UADataTypeImpl } from "./ua_data_type_impl.js";
|
|
127
|
+
import { UAMethodImpl } from "./ua_method_impl.js";
|
|
128
|
+
import { UAObjectImpl } from "./ua_object_impl.js";
|
|
129
|
+
import { UAObjectTypeImpl } from "./ua_object_type_impl.js";
|
|
130
|
+
import { UAReferenceTypeImpl } from "./ua_reference_type_impl.js";
|
|
131
|
+
import { UAVariableImpl } from "./ua_variable_impl.js";
|
|
132
|
+
import { UAVariableTypeImpl } from "./ua_variable_type_impl.js";
|
|
133
|
+
import { UAViewImpl } from "./ua_view_impl.js";
|
|
134
|
+
|
|
135
|
+
function _makeHashKey(nodeId: NodeId): string | number {
|
|
136
|
+
switch (nodeId.identifierType) {
|
|
137
|
+
case NodeIdType.STRING:
|
|
138
|
+
case NodeIdType.GUID:
|
|
139
|
+
return nodeId.value as string;
|
|
140
|
+
case NodeIdType.NUMERIC:
|
|
141
|
+
return nodeId.value as number;
|
|
142
|
+
default:
|
|
143
|
+
// c8 ignore next
|
|
144
|
+
if (nodeId.identifierType !== NodeIdType.BYTESTRING) {
|
|
145
|
+
throw new Error("invalid nodeIdType");
|
|
146
|
+
}
|
|
147
|
+
return nodeId.value ? nodeId.value.toString() : "OPAQUE:0";
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const doDebug = false;
|
|
151
|
+
const errorLog = make_errorLog("AddressSpace");
|
|
152
|
+
const warningLog = make_warningLog("AddressSpace");
|
|
153
|
+
|
|
154
|
+
const regExp1 = /^(s|i|b|g)=/;
|
|
155
|
+
const regExpNamespaceDotBrowseName = /^[0-9]+:(.*)/;
|
|
156
|
+
|
|
157
|
+
export interface AddFolderOptions {
|
|
158
|
+
browseName: QualifiedNameLike;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
interface AddVariableOptions2 extends AddVariableOptions {
|
|
162
|
+
nodeClass?: NodeClass.Variable;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function detachNode(node: BaseNode) {
|
|
166
|
+
const addressSpace = node.addressSpace;
|
|
167
|
+
const nonHierarchicalReferences = node.findReferencesEx("NonHierarchicalReferences", BrowseDirection.Inverse);
|
|
168
|
+
for (const ref of nonHierarchicalReferences) {
|
|
169
|
+
assert(!ref.isForward);
|
|
170
|
+
ref.node?.removeReference({
|
|
171
|
+
isForward: !ref.isForward,
|
|
172
|
+
nodeId: node.nodeId,
|
|
173
|
+
referenceType: ref.referenceType
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const nonHierarchicalReferencesF = node.findReferencesEx("NonHierarchicalReferences", BrowseDirection.Forward);
|
|
177
|
+
for (const ref of nonHierarchicalReferencesF) {
|
|
178
|
+
if (!ref.node) {
|
|
179
|
+
// could be a special case of a frequently use target node such as ModellingRule_Mandatory that do not back trace
|
|
180
|
+
// their reference
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
assert(ref.isForward);
|
|
184
|
+
ref.node?.removeReference({
|
|
185
|
+
isForward: !ref.isForward,
|
|
186
|
+
nodeId: node.nodeId,
|
|
187
|
+
referenceType: ref.referenceType
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// remove reversed Hierarchical references
|
|
192
|
+
const hierarchicalReferences = node.findReferencesEx("HierarchicalReferences", BrowseDirection.Inverse);
|
|
193
|
+
for (const ref of hierarchicalReferences) {
|
|
194
|
+
assert(!ref.isForward);
|
|
195
|
+
const parent = addressSpace.findNode(ref.nodeId) as BaseNode;
|
|
196
|
+
parent.removeReference({
|
|
197
|
+
isForward: !ref.isForward,
|
|
198
|
+
nodeId: node.nodeId,
|
|
199
|
+
referenceType: ref.referenceType
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
(<BaseNodeImpl>node).unpropagate_back_references();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
interface NamespaceConstructorOptions {
|
|
206
|
+
addressSpace: AddressSpacePrivate;
|
|
207
|
+
index: number;
|
|
208
|
+
namespaceUri: string;
|
|
209
|
+
publicationDate: Date;
|
|
210
|
+
version: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function toNodeId(nodeId: NodeId | { nodeId: NodeId } | string | number | undefined): NodeId | undefined {
|
|
214
|
+
if (!nodeId) {
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
if (nodeId instanceof NodeId) {
|
|
218
|
+
return nodeId;
|
|
219
|
+
}
|
|
220
|
+
if (typeof nodeId === "string") {
|
|
221
|
+
return coerceNodeId(nodeId);
|
|
222
|
+
}
|
|
223
|
+
if (typeof nodeId === "number") {
|
|
224
|
+
return coerceNodeId(nodeId);
|
|
225
|
+
}
|
|
226
|
+
return nodeId.nodeId;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
* @constructor
|
|
232
|
+
* @params options {Object}
|
|
233
|
+
* @params options.namespaceUri {string}
|
|
234
|
+
* @params options.addressSpace {IAddressSpace}
|
|
235
|
+
* @params options.index {number}
|
|
236
|
+
* @params options.version="" {string}
|
|
237
|
+
* @params options.publicationDate="" {Date}
|
|
238
|
+
*
|
|
239
|
+
* @internal
|
|
240
|
+
*/
|
|
241
|
+
export class NamespaceImpl implements NamespacePrivate {
|
|
242
|
+
public static _handle_hierarchy_parent = _handle_hierarchy_parent;
|
|
243
|
+
public static isNonEmptyQualifiedName = isNonEmptyQualifiedName;
|
|
244
|
+
|
|
245
|
+
public readonly namespaceUri: string;
|
|
246
|
+
public addressSpace: AddressSpacePrivate;
|
|
247
|
+
public readonly index: number;
|
|
248
|
+
public emulateVersion103 = false;
|
|
249
|
+
|
|
250
|
+
public version = "0.0.0";
|
|
251
|
+
public publicationDate: Date = new Date(Date.UTC(1900, 0, 1));
|
|
252
|
+
|
|
253
|
+
public registerSymbolicNames = false;
|
|
254
|
+
|
|
255
|
+
private _requiredModels?: RequiredModel[];
|
|
256
|
+
private _objectTypeMap: Map<string, UAObjectType>;
|
|
257
|
+
private _variableTypeMap: Map<string, UAVariableType>;
|
|
258
|
+
private _referenceTypeMap: Map<string, UAReferenceType>;
|
|
259
|
+
private _dataTypeMap: Map<string, UADataType>;
|
|
260
|
+
private _referenceTypeMapInv: Map<string, UAReferenceType>;
|
|
261
|
+
private _nodeIdManager: NodeIdManager;
|
|
262
|
+
private _nodeid_index: Map<string | number | Buffer, BaseNode>;
|
|
263
|
+
private _aliases: Map<string, NodeId>;
|
|
264
|
+
private defaultAccessRestrictions?: AccessRestrictionsFlag;
|
|
265
|
+
private defaultRolePermissions?: RolePermissionType[];
|
|
266
|
+
|
|
267
|
+
constructor(options: NamespaceConstructorOptions) {
|
|
268
|
+
// c8 ignore next
|
|
269
|
+
if (!(typeof options.namespaceUri === "string")) {
|
|
270
|
+
throw new Error(`NamespaceImpl constructor: namespaceUri must exists and be a string : got ${options.namespaceUri}`);
|
|
271
|
+
}
|
|
272
|
+
// c8 ignore next
|
|
273
|
+
if (typeof options.index !== "number") {
|
|
274
|
+
throw new Error("NamespaceImpl constructor: index must be a number");
|
|
275
|
+
}
|
|
276
|
+
// c8 ignore next
|
|
277
|
+
if (!options.addressSpace) {
|
|
278
|
+
throw new Error("NamespaceImpl constructor: Must specify a valid address space");
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
this.namespaceUri = options.namespaceUri;
|
|
282
|
+
this.addressSpace = options.addressSpace;
|
|
283
|
+
|
|
284
|
+
this.index = options.index;
|
|
285
|
+
this._nodeid_index = new Map();
|
|
286
|
+
this._aliases = new Map();
|
|
287
|
+
this._objectTypeMap = new Map();
|
|
288
|
+
this._variableTypeMap = new Map();
|
|
289
|
+
this._referenceTypeMap = new Map();
|
|
290
|
+
this._referenceTypeMapInv = new Map();
|
|
291
|
+
this._dataTypeMap = new Map();
|
|
292
|
+
this._nodeIdManager = new NodeIdManager(this.index, this.addressSpace);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
public getDefaultNamespace(): NamespacePrivate {
|
|
296
|
+
return this.index === 0 ? this : this.addressSpace.getDefaultNamespace();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
public toJSON(): Record<string, string | number | undefined> {
|
|
300
|
+
return {
|
|
301
|
+
index: this.index,
|
|
302
|
+
namespaceUri: this.namespaceUri,
|
|
303
|
+
version: this.version
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
public toString(): string {
|
|
308
|
+
return `Namespace({ index: ${this.index}, namespaceUri: "${this.namespaceUri}" })`;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
public [Symbol.for("nodejs.util.inspect.custom")](): string {
|
|
312
|
+
return this.toString();
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
public dispose(): void {
|
|
316
|
+
for (const node of this.nodeIterator()) {
|
|
317
|
+
(<BaseNodeImpl>node).dispose();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
this._nodeid_index = new Map();
|
|
321
|
+
this._aliases = new Map();
|
|
322
|
+
|
|
323
|
+
this.addressSpace = {} as AddressSpacePrivate;
|
|
324
|
+
|
|
325
|
+
this._objectTypeMap = new Map();
|
|
326
|
+
this._variableTypeMap = new Map();
|
|
327
|
+
this._referenceTypeMap = new Map();
|
|
328
|
+
this._referenceTypeMapInv = new Map();
|
|
329
|
+
this._dataTypeMap = new Map();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
public nodeIterator(): IterableIterator<BaseNode> {
|
|
333
|
+
return this._nodeid_index.values();
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
public objectTypeIterator(): IterableIterator<UAObjectType> {
|
|
337
|
+
return this._objectTypeMap.values();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
public objectTypeCount(): number {
|
|
341
|
+
return this._objectTypeMap.size;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
public variableTypeIterator(): IterableIterator<UAVariableType> {
|
|
345
|
+
return this._variableTypeMap.values();
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
public variableTypeCount(): number {
|
|
349
|
+
return this._variableTypeMap.size;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
public dataTypeIterator(): IterableIterator<UADataType> {
|
|
353
|
+
return this._dataTypeMap.values();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
public dataTypeCount(): number {
|
|
357
|
+
return this._dataTypeMap.size;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
public referenceTypeIterator(): IterableIterator<UAReferenceType> {
|
|
361
|
+
return this._referenceTypeMap.values();
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
public referenceTypeCount(): number {
|
|
365
|
+
return this._referenceTypeMap.size;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
public aliasCount(): number {
|
|
369
|
+
return this._aliases.size;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// The underscore spellings these had before they were published. Callers reached them
|
|
373
|
+
// through a cast, so they cannot be removed without warning; they delegate and are
|
|
374
|
+
// deprecated.
|
|
375
|
+
|
|
376
|
+
/** @deprecated use `objectTypeIterator` */
|
|
377
|
+
public _objectTypeIterator(): IterableIterator<UAObjectType> {
|
|
378
|
+
return this.objectTypeIterator();
|
|
379
|
+
}
|
|
380
|
+
/** @deprecated use `objectTypeCount` */
|
|
381
|
+
public _objectTypeCount(): number {
|
|
382
|
+
return this.objectTypeCount();
|
|
383
|
+
}
|
|
384
|
+
/** @deprecated use `variableTypeIterator` */
|
|
385
|
+
public _variableTypeIterator(): IterableIterator<UAVariableType> {
|
|
386
|
+
return this.variableTypeIterator();
|
|
387
|
+
}
|
|
388
|
+
/** @deprecated use `variableTypeCount` */
|
|
389
|
+
public _variableTypeCount(): number {
|
|
390
|
+
return this.variableTypeCount();
|
|
391
|
+
}
|
|
392
|
+
/** @deprecated use `dataTypeIterator` */
|
|
393
|
+
public _dataTypeIterator(): IterableIterator<UADataType> {
|
|
394
|
+
return this.dataTypeIterator();
|
|
395
|
+
}
|
|
396
|
+
/** @deprecated use `dataTypeCount` */
|
|
397
|
+
public _dataTypeCount(): number {
|
|
398
|
+
return this.dataTypeCount();
|
|
399
|
+
}
|
|
400
|
+
/** @deprecated use `referenceTypeIterator` */
|
|
401
|
+
public _referenceTypeIterator(): IterableIterator<UAReferenceType> {
|
|
402
|
+
return this.referenceTypeIterator();
|
|
403
|
+
}
|
|
404
|
+
/** @deprecated use `referenceTypeCount` */
|
|
405
|
+
public _referenceTypeCount(): number {
|
|
406
|
+
return this.referenceTypeCount();
|
|
407
|
+
}
|
|
408
|
+
/** @deprecated use `aliasCount` */
|
|
409
|
+
public _aliasCount(): number {
|
|
410
|
+
return this.aliasCount();
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
public findNode2(nodeId: NodeId): BaseNode | null {
|
|
414
|
+
// this one is faster assuming you have a nodeId
|
|
415
|
+
assert(nodeId.namespace === this.index);
|
|
416
|
+
return this._nodeid_index.get(_makeHashKey(nodeId)) || null;
|
|
417
|
+
}
|
|
418
|
+
public findNode(nodeId: string | NodeId): BaseNode | null {
|
|
419
|
+
if (typeof nodeId === "string") {
|
|
420
|
+
if (nodeId.match(regExp1)) {
|
|
421
|
+
nodeId = `ns=${this.index};${nodeId}`;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
nodeId = resolveNodeId(nodeId);
|
|
425
|
+
return this.findNode2(nodeId);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
*
|
|
430
|
+
* @param objectTypeName {String}
|
|
431
|
+
* @return {UAObjectType|null}
|
|
432
|
+
*/
|
|
433
|
+
public findObjectType(objectTypeName: string): UAObjectType | null {
|
|
434
|
+
return this._objectTypeMap.get(objectTypeName) || null;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
*
|
|
439
|
+
* @param variableTypeName {String}
|
|
440
|
+
* @returns {UAVariableType|null}
|
|
441
|
+
*/
|
|
442
|
+
public findVariableType(variableTypeName: string): UAVariableType | null {
|
|
443
|
+
return this._variableTypeMap.get(variableTypeName) || null;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
*
|
|
447
|
+
* @param dataTypeName {String}
|
|
448
|
+
* @returns {UADataType|null}
|
|
449
|
+
*/
|
|
450
|
+
public findDataType(dataTypeName: string): UADataType | null {
|
|
451
|
+
return this._dataTypeMap.get(dataTypeName) || null;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
*
|
|
456
|
+
* @param referenceTypeName {String}
|
|
457
|
+
* @returns {ReferenceType|null}
|
|
458
|
+
*/
|
|
459
|
+
public findReferenceType(referenceTypeName: string): UAReferenceType | null {
|
|
460
|
+
return this._referenceTypeMap.get(referenceTypeName) || null;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* find a ReferenceType by its inverse name.
|
|
465
|
+
|
|
466
|
+
* @param inverseName {String} the inverse name of the ReferenceType to find
|
|
467
|
+
* @return {ReferenceType}
|
|
468
|
+
*/
|
|
469
|
+
public findReferenceTypeFromInverseName(inverseName: string): UAReferenceType | null {
|
|
470
|
+
assert(typeof inverseName === "string");
|
|
471
|
+
const node = this._referenceTypeMapInv.get(inverseName);
|
|
472
|
+
assert(!node || (node.nodeClass === NodeClass.ReferenceType && node.inverseName.text === inverseName));
|
|
473
|
+
return node ? node : null;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
*
|
|
478
|
+
|
|
479
|
+
* @param alias_name {String} the alias name
|
|
480
|
+
* @param nodeId {NodeId} NodeId must belong to this namespace
|
|
481
|
+
*/
|
|
482
|
+
public addAlias(alias_name: string, nodeId: NodeId): void {
|
|
483
|
+
assert(typeof alias_name === "string");
|
|
484
|
+
assert(nodeId instanceof NodeId);
|
|
485
|
+
assert(nodeId.namespace === this.index);
|
|
486
|
+
this._aliases.set(alias_name, nodeId);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
public resolveAlias(name: string): NodeId | null {
|
|
490
|
+
return this._aliases.get(name) || null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* add a new Object type to the address space
|
|
495
|
+
|
|
496
|
+
* @param options
|
|
497
|
+
* @param options.browseName {String} the object type name
|
|
498
|
+
* @param [options.displayName] {String|LocalizedText} the display name
|
|
499
|
+
* @param [options.subtypeOf="BaseObjectType"] {String|NodeId|BaseNode} the base class
|
|
500
|
+
* @param [options.nodeId] {String|NodeId} an optional nodeId for this objectType,
|
|
501
|
+
* if not provided a new nodeId will be created
|
|
502
|
+
* @param [options.isAbstract = false] {Boolean}
|
|
503
|
+
* @param [options.eventNotifier = 0] {Integer}
|
|
504
|
+
* @param [options.postInstantiateFunc = null] {Function}
|
|
505
|
+
*
|
|
506
|
+
*/
|
|
507
|
+
public addObjectType(options: AddObjectTypeOptions): UAObjectType {
|
|
508
|
+
assert(!Object.hasOwn(options, "dataType"), "an objectType should not have a dataType");
|
|
509
|
+
assert(!Object.hasOwn(options, "valueRank"), "an objectType should not have a valueRank");
|
|
510
|
+
assert(!Object.hasOwn(options, "arrayDimensions"), "an objectType should not have a arrayDimensions");
|
|
511
|
+
return this._addObjectOrVariableType(options, "BaseObjectType", NodeClass.ObjectType) as UAObjectType;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* add a new Variable type to the address space
|
|
516
|
+
|
|
517
|
+
* @param options
|
|
518
|
+
* @param options.browseName {String} the object type name
|
|
519
|
+
* @param [options.displayName] {String|LocalizedText} the display name
|
|
520
|
+
* @param [options.subtypeOf="BaseVariableType"] {String|NodeId|BaseNode} the base class
|
|
521
|
+
* @param [options.nodeId] {String|NodeId} an optional nodeId for this objectType,
|
|
522
|
+
* if not provided a new nodeId will be created
|
|
523
|
+
* @param [options.isAbstract = false] {Boolean}
|
|
524
|
+
* @param options.dataType {String|NodeId} the variable DataType
|
|
525
|
+
* @param [options.valueRank = -1]
|
|
526
|
+
* @param [options.arrayDimensions = null] { Array<Int>>
|
|
527
|
+
*
|
|
528
|
+
*/
|
|
529
|
+
public addVariableType(options: AddVariableTypeOptions): UAVariableType {
|
|
530
|
+
assert(!Object.hasOwn(options, "arrayDimension"), "Do you mean ArrayDimensions ?");
|
|
531
|
+
|
|
532
|
+
// dataType
|
|
533
|
+
options.dataType = options.dataType || "Int32";
|
|
534
|
+
options.dataType = this.addressSpace._coerce_DataType(options.dataType);
|
|
535
|
+
|
|
536
|
+
// valueRank/ arrayDimensions
|
|
537
|
+
verifyRankAndDimensions(options);
|
|
538
|
+
|
|
539
|
+
// arrayDimensions
|
|
540
|
+
const variableType = this._addObjectOrVariableType(options, "BaseVariableType", NodeClass.VariableType) as UAVariableType;
|
|
541
|
+
|
|
542
|
+
variableType.dataType = options.dataType;
|
|
543
|
+
variableType.valueRank = options.valueRank || 0;
|
|
544
|
+
variableType.arrayDimensions = options.arrayDimensions || [];
|
|
545
|
+
|
|
546
|
+
return variableType as UAVariableType;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* add a variable as a component of the parent node
|
|
551
|
+
*/
|
|
552
|
+
public addVariable(options: AddVariableOptions): UAVariable {
|
|
553
|
+
if (Object.hasOwn(options, "propertyOf") && options.propertyOf) {
|
|
554
|
+
assert(!options.typeDefinition || options.typeDefinition === "PropertyType");
|
|
555
|
+
options.typeDefinition = options.typeDefinition || "PropertyType";
|
|
556
|
+
} else {
|
|
557
|
+
assert(!options.typeDefinition || options.typeDefinition !== "PropertyType");
|
|
558
|
+
}
|
|
559
|
+
return this._addVariable(options as AddVariableOptions2);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
public addView(options: AddViewOptions): UAView {
|
|
563
|
+
assert(Object.hasOwn(options, "browseName"));
|
|
564
|
+
assert(Object.hasOwn(options, "organizedBy"));
|
|
565
|
+
const browseName = options.browseName;
|
|
566
|
+
assert(typeof browseName === "string");
|
|
567
|
+
|
|
568
|
+
const addressSpace = this.addressSpace;
|
|
569
|
+
const baseDataVariableTypeId = addressSpace.findVariableType("BaseDataVariableType")?.nodeId;
|
|
570
|
+
|
|
571
|
+
// ------------------------------------------ TypeDefinition
|
|
572
|
+
const _typeDefinition = options.typeDefinition || baseDataVariableTypeId;
|
|
573
|
+
options.references = options.references || [];
|
|
574
|
+
|
|
575
|
+
options.references.push({
|
|
576
|
+
isForward: true,
|
|
577
|
+
nodeId: toNodeId(_typeDefinition) || NodeId.nullNodeId,
|
|
578
|
+
referenceType: "HasTypeDefinition"
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
const createOptions = options as CreateNodeOptions;
|
|
582
|
+
assert(!createOptions.nodeClass);
|
|
583
|
+
createOptions.nodeClass = NodeClass.View;
|
|
584
|
+
|
|
585
|
+
const view = this.createNode(createOptions) as UAView;
|
|
586
|
+
assert(view.nodeId instanceof NodeId);
|
|
587
|
+
assert(view.nodeClass === NodeClass.View);
|
|
588
|
+
return view;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
public addObject(options1: AddObjectOptions): UAObject {
|
|
592
|
+
const options: CreateNodeOptions = options1 as CreateNodeOptions;
|
|
593
|
+
|
|
594
|
+
assert(!options.nodeClass || options.nodeClass === NodeClass.Object);
|
|
595
|
+
options.nodeClass = NodeClass.Object;
|
|
596
|
+
|
|
597
|
+
const typeDefinition = options.typeDefinition || "BaseObjectType";
|
|
598
|
+
options.references = options.references || [];
|
|
599
|
+
options.references.push({ referenceType: "HasTypeDefinition", isForward: true, nodeId: typeDefinition });
|
|
600
|
+
options.eventNotifier = +(options.eventNotifier || 0);
|
|
601
|
+
const obj = this.createNode(options) as UAObject;
|
|
602
|
+
assert(obj instanceof UAObjectImpl);
|
|
603
|
+
assert(obj.nodeClass === NodeClass.Object);
|
|
604
|
+
return obj;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
*
|
|
609
|
+
|
|
610
|
+
* @param parentFolder
|
|
611
|
+
* @param options {String|Object}
|
|
612
|
+
* @param options.browseName {String} the name of the folder
|
|
613
|
+
* @param [options.nodeId] {NodeId}. An optional nodeId for this object
|
|
614
|
+
*
|
|
615
|
+
* @return {BaseNode}
|
|
616
|
+
*/
|
|
617
|
+
public addFolder(parentFolder: UAObject, options: AddFolderOptions | string): UAObject {
|
|
618
|
+
if (typeof options === "string") {
|
|
619
|
+
options = { browseName: options };
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const addressSpace = this.addressSpace;
|
|
623
|
+
|
|
624
|
+
assert(!(options as CreateNodeOptions).typeDefinition, "addFolder does not expect typeDefinition to be defined ");
|
|
625
|
+
const typeDefinition = addressSpace._coerceTypeDefinition("FolderType");
|
|
626
|
+
parentFolder = addressSpace._coerceFolder(parentFolder) as UAObject;
|
|
627
|
+
(options as CreateNodeOptions).nodeClass = NodeClass.Object;
|
|
628
|
+
(options as CreateNodeOptions).references = [
|
|
629
|
+
{ referenceType: "HasTypeDefinition", isForward: true, nodeId: typeDefinition },
|
|
630
|
+
{ referenceType: "Organizes", isForward: false, nodeId: parentFolder.nodeId }
|
|
631
|
+
];
|
|
632
|
+
const node = this.createNode(options as CreateNodeOptions) as UAObject;
|
|
633
|
+
return node;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
|
|
638
|
+
* @param options
|
|
639
|
+
* @param options.isAbstract
|
|
640
|
+
* @param options.browseName
|
|
641
|
+
* @param options.inverseName
|
|
642
|
+
*/
|
|
643
|
+
public addReferenceType(options: AddReferenceTypeOptions): UAReferenceType {
|
|
644
|
+
const addressSpace = this.addressSpace;
|
|
645
|
+
|
|
646
|
+
const options1 = options as CreateNodeOptions;
|
|
647
|
+
options1.nodeClass = NodeClass.ReferenceType;
|
|
648
|
+
options1.references = options.references || [];
|
|
649
|
+
options1.nodeId = options.nodeId;
|
|
650
|
+
|
|
651
|
+
if (options.subtypeOf) {
|
|
652
|
+
const subtypeOfNodeId = addressSpace._coerceType(options.subtypeOf, "References", NodeClass.ReferenceType);
|
|
653
|
+
|
|
654
|
+
assert(subtypeOfNodeId);
|
|
655
|
+
|
|
656
|
+
options1.references.push({
|
|
657
|
+
isForward: false,
|
|
658
|
+
nodeId: subtypeOfNodeId,
|
|
659
|
+
referenceType: "HasSubtype"
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
const node = this.internalCreateNode(options1) as UAReferenceType;
|
|
663
|
+
|
|
664
|
+
node.propagate_back_references();
|
|
665
|
+
|
|
666
|
+
return node;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
*/
|
|
671
|
+
// returns the published type, not UAMultiStateDiscreteImpl: two generic signatures are
|
|
672
|
+
// compared with their parameters erased to constraints, so declaring the narrower one
|
|
673
|
+
// here makes this method fail to satisfy the very interface it implements
|
|
674
|
+
public addMultiStateDiscrete<T, DT extends DataType>(options: AddMultiStateDiscreteOptions): UAMultiStateDiscreteEx<T, DT> {
|
|
675
|
+
return _addMultiStateDiscrete<T, DT>(this, options);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
|
|
680
|
+
*/
|
|
681
|
+
public createDataType(options: CreateDataTypeOptions): UADataType {
|
|
682
|
+
assert(Object.hasOwn(options, "isAbstract"), "must provide isAbstract");
|
|
683
|
+
assert(!Object.hasOwn(options, "nodeClass"));
|
|
684
|
+
assert(Object.hasOwn(options, "browseName"), "must provide a browseName");
|
|
685
|
+
|
|
686
|
+
const options1 = options as unknown as { nodeClass: NodeClass; references: AddReferenceOpts[]; subtypeOf: UADataType };
|
|
687
|
+
options1.nodeClass = NodeClass.DataType;
|
|
688
|
+
options1.references = options.references || [];
|
|
689
|
+
|
|
690
|
+
if (options1.references.length === 0) {
|
|
691
|
+
if (!options1.subtypeOf) {
|
|
692
|
+
throw new Error("must provide a subtypeOf");
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
if (options1.subtypeOf) {
|
|
696
|
+
if (!(options1.subtypeOf instanceof UADataTypeImpl)) {
|
|
697
|
+
options1.subtypeOf = this.addressSpace.findDataType(options1.subtypeOf) as UADataType;
|
|
698
|
+
}
|
|
699
|
+
if (!options1.subtypeOf) {
|
|
700
|
+
throw new Error("cannot find subtypeOf ");
|
|
701
|
+
}
|
|
702
|
+
options1.references.push({
|
|
703
|
+
isForward: false,
|
|
704
|
+
nodeId: options1.subtypeOf.nodeId,
|
|
705
|
+
referenceType: "HasSubtype"
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
const node = this.internalCreateNode(options) as UADataType;
|
|
709
|
+
|
|
710
|
+
node.propagate_back_references();
|
|
711
|
+
|
|
712
|
+
return node;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
|
|
717
|
+
* @param options
|
|
718
|
+
* @param options.nodeClass
|
|
719
|
+
* @param [options.nodeVersion {String} = "0" ] install nodeVersion
|
|
720
|
+
* @param [options.modellingRule {String} = null]
|
|
721
|
+
* @internal
|
|
722
|
+
*/
|
|
723
|
+
public createNode(options: CreateNodeOptions): BaseNode {
|
|
724
|
+
let node: BaseNode = null as unknown as BaseNode;
|
|
725
|
+
|
|
726
|
+
const addressSpace = this.addressSpace;
|
|
727
|
+
addressSpace.modelChangeTransaction(() => {
|
|
728
|
+
assert(isNonEmptyQualifiedName(options.browseName));
|
|
729
|
+
// xx assert(Object.prototype.hasOwnProperty.call(options,"browseName") && options.browseName.length > 0);
|
|
730
|
+
|
|
731
|
+
assert(Object.hasOwn(options, "nodeClass"));
|
|
732
|
+
options.references = addressSpace.normalizeReferenceTypes(options.references);
|
|
733
|
+
|
|
734
|
+
const references = _copy_references(options.references);
|
|
735
|
+
|
|
736
|
+
_handle_hierarchy_parent(addressSpace, references, options);
|
|
737
|
+
|
|
738
|
+
_handle_event_hierarchy_parent(addressSpace, references, options);
|
|
739
|
+
|
|
740
|
+
UANamespace_process_modelling_rule(references, options.modellingRule);
|
|
741
|
+
|
|
742
|
+
options.references = references;
|
|
743
|
+
|
|
744
|
+
node = this.internalCreateNode(options);
|
|
745
|
+
assert(node.nodeId instanceof NodeId);
|
|
746
|
+
|
|
747
|
+
node.propagate_back_references();
|
|
748
|
+
|
|
749
|
+
node.install_extra_properties();
|
|
750
|
+
|
|
751
|
+
_create_node_version_if_needed(node, options);
|
|
752
|
+
|
|
753
|
+
_handle_model_change_event(node as BaseNodeImpl);
|
|
754
|
+
});
|
|
755
|
+
return node;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* remove the specified Node from the address space
|
|
760
|
+
*
|
|
761
|
+
|
|
762
|
+
* @param nodeOrNodeId
|
|
763
|
+
*
|
|
764
|
+
*
|
|
765
|
+
*/
|
|
766
|
+
public deleteNode(nodeOrNodeId: NodeId | BaseNode): void {
|
|
767
|
+
let node: BaseNodeImpl | null = null;
|
|
768
|
+
let nodeId: NodeId = new NodeId();
|
|
769
|
+
if (nodeOrNodeId instanceof NodeId) {
|
|
770
|
+
nodeId = nodeOrNodeId;
|
|
771
|
+
node = this.findNode(nodeId) as BaseNodeImpl;
|
|
772
|
+
// c8 ignore next
|
|
773
|
+
if (!node) {
|
|
774
|
+
throw new Error(` deleteNode : cannot find node with nodeId${nodeId.toString()}`);
|
|
775
|
+
}
|
|
776
|
+
} else if (nodeOrNodeId instanceof BaseNodeImpl) {
|
|
777
|
+
node = nodeOrNodeId;
|
|
778
|
+
nodeId = node.nodeId;
|
|
779
|
+
}
|
|
780
|
+
// c8 ignore next
|
|
781
|
+
if (nodeId.namespace !== this.index) {
|
|
782
|
+
throw new Error("this node doesn't belong to this namespace");
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
const addressSpace = this.addressSpace;
|
|
786
|
+
|
|
787
|
+
addressSpace.modelChangeTransaction(() => {
|
|
788
|
+
/* c8 ignore next */
|
|
789
|
+
if (!node) {
|
|
790
|
+
throw new Error("this node doesn't belong to this namespace");
|
|
791
|
+
}
|
|
792
|
+
// notify parent that node is being removed
|
|
793
|
+
const hierarchicalReferences = node.findReferencesEx("HierarchicalReferences", BrowseDirection.Inverse);
|
|
794
|
+
for (const ref of hierarchicalReferences) {
|
|
795
|
+
assert(!ref.isForward);
|
|
796
|
+
const parent = addressSpace.findNode(ref.nodeId) as BaseNodeImpl;
|
|
797
|
+
assert(parent);
|
|
798
|
+
parent._on_child_removed(node);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function deleteNodePointedByReference(ref: { nodeId: NodeId }) {
|
|
802
|
+
const o = addressSpace.findNode(ref.nodeId) as BaseNode;
|
|
803
|
+
addressSpace.deleteNode(o.nodeId);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// recursively delete all nodes below in the hierarchy of nodes
|
|
807
|
+
// TODO : a better idea would be to extract any references of type "HasChild"
|
|
808
|
+
const components = node.findReferencesEx("HasComponent", BrowseDirection.Forward);
|
|
809
|
+
const properties = node.findReferencesEx("HasProperty", BrowseDirection.Forward);
|
|
810
|
+
// TODO: shall we delete nodes pointed by "Organizes" links here ?
|
|
811
|
+
const subFolders = node.findReferencesEx("Organizes", BrowseDirection.Forward);
|
|
812
|
+
|
|
813
|
+
for (const r of components) {
|
|
814
|
+
deleteNodePointedByReference(r);
|
|
815
|
+
}
|
|
816
|
+
for (const r of properties) {
|
|
817
|
+
deleteNodePointedByReference(r);
|
|
818
|
+
}
|
|
819
|
+
for (const r of subFolders) {
|
|
820
|
+
deleteNodePointedByReference(r);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
_handle_delete_node_model_change_event(node);
|
|
824
|
+
|
|
825
|
+
detachNode(node);
|
|
826
|
+
|
|
827
|
+
// delete nodes from global index
|
|
828
|
+
const namespace = addressSpace.getNamespace(node.nodeId.namespace);
|
|
829
|
+
namespace._deleteNode(node);
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* @internal
|
|
835
|
+
*/
|
|
836
|
+
public getStandardsNodeIds(): { referenceTypeIds: { [key: string]: string }; objectTypeIds: { [key: string]: string } } {
|
|
837
|
+
const standardNodeIds = {
|
|
838
|
+
objectTypeIds: {} as { [key: string]: string },
|
|
839
|
+
referenceTypeIds: {} as { [key: string]: string }
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
for (const referenceType of this._referenceTypeMap.values()) {
|
|
843
|
+
standardNodeIds.referenceTypeIds[referenceType?.browseName?.name as string] = referenceType.nodeId.toString();
|
|
844
|
+
}
|
|
845
|
+
for (const objectType of this._objectTypeMap.values()) {
|
|
846
|
+
standardNodeIds.objectTypeIds[objectType?.browseName?.name as string] = objectType.nodeId.toString();
|
|
847
|
+
}
|
|
848
|
+
return standardNodeIds;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// - Events --------------------------------------------------------------------------------------
|
|
852
|
+
/**
|
|
853
|
+
* add a new event type to the address space
|
|
854
|
+
|
|
855
|
+
* @param options
|
|
856
|
+
* @param options.browseName {String} the eventType name
|
|
857
|
+
* @param [options.subtypeOf ="BaseEventType"]
|
|
858
|
+
* @param [options.isAbstract = true]
|
|
859
|
+
* @return {UAObjectType} : the object type
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
*
|
|
863
|
+
* var evtType = namespace.addEventType({
|
|
864
|
+
* browseName: "MyAuditEventType",
|
|
865
|
+
* subtypeOf: "AuditEventType"
|
|
866
|
+
* });
|
|
867
|
+
* var myConditionType = namespace.addEventType({
|
|
868
|
+
* browseName: "MyConditionType",
|
|
869
|
+
* subtypeOf: "ConditionType",
|
|
870
|
+
* isAbstract: false
|
|
871
|
+
* });
|
|
872
|
+
*
|
|
873
|
+
*/
|
|
874
|
+
public addEventType(options: AddObjectTypeOptions): UAObjectType {
|
|
875
|
+
options.subtypeOf = options.subtypeOf || "BaseEventType";
|
|
876
|
+
// are eventType always abstract ?? No => Condition can be instantiated!
|
|
877
|
+
// but, by default is abstract is true
|
|
878
|
+
options.isAbstract = Object.hasOwn(options, "isAbstract") ? !!options.isAbstract : true;
|
|
879
|
+
return this.addObjectType(options);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
// ---------------------------------------------------------------------------------------------------
|
|
883
|
+
/**
|
|
884
|
+
*
|
|
885
|
+
*/
|
|
886
|
+
public addDataItem<T, DT extends DataType>(options: AddDataItemOptions): UADataItem<T, DT> {
|
|
887
|
+
const addressSpace = this.addressSpace;
|
|
888
|
+
const dataType = options.dataType || "Number";
|
|
889
|
+
|
|
890
|
+
const dataItemType = addressSpace.findVariableType("DataItemType");
|
|
891
|
+
if (!dataItemType) {
|
|
892
|
+
throw new Error("Cannot find DataItemType");
|
|
893
|
+
}
|
|
894
|
+
const variable = this.addVariable({
|
|
895
|
+
...options,
|
|
896
|
+
dataType,
|
|
897
|
+
typeDefinition: dataItemType.nodeId
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
add_dataItem_stuff(variable, options);
|
|
901
|
+
|
|
902
|
+
variable.install_extra_properties();
|
|
903
|
+
return variable as UADataItem<T, DT>;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
*
|
|
908
|
+
|
|
909
|
+
*
|
|
910
|
+
* AnalogDataItem DataItems that represent continuously-variable physical quantities ( e.g., length, temperature),
|
|
911
|
+
* in contrast to the digital representation of data in discrete items
|
|
912
|
+
* NOTE Typical examples are the values provided by temperature sensors or pressure sensors. OPC UA defines a
|
|
913
|
+
* specific UAVariableType to identify an AnalogItem. Properties describe the possible ranges of AnalogItems.
|
|
914
|
+
*
|
|
915
|
+
*
|
|
916
|
+
* @example:
|
|
917
|
+
*
|
|
918
|
+
*
|
|
919
|
+
* namespace.add_analog_dataItem({
|
|
920
|
+
* componentOf: parentObject,
|
|
921
|
+
* browseName: "TemperatureSensor",
|
|
922
|
+
*
|
|
923
|
+
* definition: "(tempA -25) + tempB",
|
|
924
|
+
* valuePrecision: 0.5,
|
|
925
|
+
* //-
|
|
926
|
+
* instrumentRange: { low: 100 , high: 200}, // optional
|
|
927
|
+
* engineeringUnitsRange: { low: 100 , high: 200}, // mandatory
|
|
928
|
+
* engineeringUnits: standardUnits.degree_celsius,, // optional
|
|
929
|
+
*
|
|
930
|
+
* // access level
|
|
931
|
+
* accessLevel: 1
|
|
932
|
+
* minimumSamplingInterval: 10,
|
|
933
|
+
*
|
|
934
|
+
* });
|
|
935
|
+
*
|
|
936
|
+
|
|
937
|
+
* @return {UAVariable}
|
|
938
|
+
*/
|
|
939
|
+
public addAnalogDataItem<T, DT extends DataType>(options: AddAnalogDataItemOptions): UAAnalogItem<T, DT> {
|
|
940
|
+
const addressSpace = this.addressSpace;
|
|
941
|
+
|
|
942
|
+
assert(Object.hasOwn(options, "engineeringUnitsRange"), "expecting engineeringUnitsRange");
|
|
943
|
+
|
|
944
|
+
const dataType = options.dataType || "Number";
|
|
945
|
+
|
|
946
|
+
const analogItemType = addressSpace.findVariableType("AnalogItemType");
|
|
947
|
+
|
|
948
|
+
if (!analogItemType) {
|
|
949
|
+
throw new Error("expecting AnalogItemType to be defined , check nodeset xml file");
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
// options.typeDefinition may designate a subtype of AnalogItemType (e.g. a companion
|
|
953
|
+
// specification's own AnalogItemType-derived VariableType). In that case we must honor it
|
|
954
|
+
// so that the subtype's identity - and its own mandatory members - are preserved, instead of
|
|
955
|
+
// silently downgrading the variable to a plain AnalogItemType.
|
|
956
|
+
let requestedTypeDefinition = analogItemType;
|
|
957
|
+
if (options.typeDefinition) {
|
|
958
|
+
const t =
|
|
959
|
+
options.typeDefinition instanceof BaseNodeImpl
|
|
960
|
+
? (options.typeDefinition as unknown as UAVariableType)
|
|
961
|
+
: addressSpace.findVariableType(options.typeDefinition as NodeIdLike);
|
|
962
|
+
if (!t) {
|
|
963
|
+
throw new Error(`cannot find requested typeDefinition ${options.typeDefinition.toString()}`);
|
|
964
|
+
}
|
|
965
|
+
if (!t.isSubtypeOf(analogItemType)) {
|
|
966
|
+
throw new Error(`typeDefinition ${t.browseName.toString()} shall be a subtype of AnalogItemType`);
|
|
967
|
+
}
|
|
968
|
+
requestedTypeDefinition = t;
|
|
969
|
+
}
|
|
970
|
+
const isStrictSubtype = !sameNodeId(requestedTypeDefinition.nodeId, analogItemType.nodeId);
|
|
971
|
+
|
|
972
|
+
let variable: UAVariableImpl;
|
|
973
|
+
if (isStrictSubtype) {
|
|
974
|
+
// instantiate the requested subtype so that its own mandatory members
|
|
975
|
+
// (in addition to the AnalogItemType ones) get materialized.
|
|
976
|
+
const optionals: string[] = [];
|
|
977
|
+
if (Object.hasOwn(options, "instrumentRange")) {
|
|
978
|
+
optionals.push("InstrumentRange");
|
|
979
|
+
}
|
|
980
|
+
if (Object.hasOwn(options, "engineeringUnits")) {
|
|
981
|
+
optionals.push("EngineeringUnits");
|
|
982
|
+
}
|
|
983
|
+
variable = requestedTypeDefinition.instantiate({
|
|
984
|
+
browseName: options.browseName,
|
|
985
|
+
componentOf: options.componentOf,
|
|
986
|
+
dataType: addressSpace._coerce_DataType(dataType as NodeIdLike),
|
|
987
|
+
modellingRule: options.modellingRule,
|
|
988
|
+
nodeId: options.nodeId,
|
|
989
|
+
notifierOf: options.notifierOf,
|
|
990
|
+
eventSourceOf: options.eventSourceOf,
|
|
991
|
+
organizedBy: options.organizedBy,
|
|
992
|
+
optionals
|
|
993
|
+
}) as unknown as UAVariableImpl;
|
|
994
|
+
} else {
|
|
995
|
+
const clone_options = { ...options, dataType, typeDefinition: analogItemType.nodeId } as AddVariableOptions;
|
|
996
|
+
variable = this.addVariable(clone_options) as unknown as UAVariableImpl;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
add_dataItem_stuff(variable, options);
|
|
1000
|
+
|
|
1001
|
+
// mandatory (EURange in the specs)
|
|
1002
|
+
// OPC Unified Architecture, Part 8 6 Release 1.02
|
|
1003
|
+
// EURange defines the value range likely to be obtained in normal operation. It is intended for such
|
|
1004
|
+
// use as automatically scaling a bar graph display
|
|
1005
|
+
// Sensor or instrument failure or deactivation can result in a return ed item value which is actually
|
|
1006
|
+
// outside of this range. Client software must be prepared to deal with this possibility. Similarly a client
|
|
1007
|
+
// may attempt to write a value that is outside of this range back to the server. The exact behavior
|
|
1008
|
+
// (accept, reject, clamp, etc.) in this case is server - dependent. However , in general servers shall be
|
|
1009
|
+
// prepared to handle this.
|
|
1010
|
+
// Example: EURange ::= {-200.0,1400.0}
|
|
1011
|
+
|
|
1012
|
+
// when `variable` was instantiated from a strict AnalogItemType subtype (isStrictSubtype),
|
|
1013
|
+
// EURange/InstrumentRange/EngineeringUnits may already exist as cloned mandatory/optional
|
|
1014
|
+
// members of that subtype - reuse them instead of creating duplicate property nodes.
|
|
1015
|
+
const euRangeExisting = variable.getPropertyByName("EURange") as UAVariableImpl | null;
|
|
1016
|
+
const euRange =
|
|
1017
|
+
euRangeExisting ||
|
|
1018
|
+
(this.addVariable({
|
|
1019
|
+
browseName: { name: "EURange", namespaceIndex: 0 },
|
|
1020
|
+
dataType: "Range",
|
|
1021
|
+
minimumSamplingInterval: 0,
|
|
1022
|
+
modellingRule: options.modellingRule,
|
|
1023
|
+
propertyOf: variable,
|
|
1024
|
+
typeDefinition: "PropertyType",
|
|
1025
|
+
value: new Variant({
|
|
1026
|
+
dataType: DataType.ExtensionObject,
|
|
1027
|
+
value: new Range(options.engineeringUnitsRange)
|
|
1028
|
+
})
|
|
1029
|
+
}) as unknown as UAVariableImpl);
|
|
1030
|
+
if (euRangeExisting) {
|
|
1031
|
+
euRange.setValueFromSource(
|
|
1032
|
+
new Variant({ dataType: DataType.ExtensionObject, value: new Range(options.engineeringUnitsRange) }),
|
|
1033
|
+
StatusCodes.Good
|
|
1034
|
+
);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
assert(euRange.readValue().value.value instanceof Range);
|
|
1038
|
+
|
|
1039
|
+
const handler = variable.handle_semantic_changed.bind(variable);
|
|
1040
|
+
euRange.on("value_changed", handler);
|
|
1041
|
+
|
|
1042
|
+
if (Object.hasOwn(options, "instrumentRange")) {
|
|
1043
|
+
const instrumentRangeExisting = variable.getPropertyByName("InstrumentRange") as UAVariableImpl | null;
|
|
1044
|
+
const instrumentRange =
|
|
1045
|
+
instrumentRangeExisting ||
|
|
1046
|
+
this.addVariable({
|
|
1047
|
+
accessLevel: "CurrentRead | CurrentWrite",
|
|
1048
|
+
browseName: { name: "InstrumentRange", namespaceIndex: 0 },
|
|
1049
|
+
dataType: "Range",
|
|
1050
|
+
minimumSamplingInterval: 0,
|
|
1051
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
1052
|
+
propertyOf: variable,
|
|
1053
|
+
typeDefinition: "PropertyType",
|
|
1054
|
+
value: new Variant({
|
|
1055
|
+
dataType: DataType.ExtensionObject,
|
|
1056
|
+
value: new Range(options.instrumentRange)
|
|
1057
|
+
})
|
|
1058
|
+
});
|
|
1059
|
+
if (instrumentRangeExisting) {
|
|
1060
|
+
instrumentRange.setValueFromSource(
|
|
1061
|
+
new Variant({ dataType: DataType.ExtensionObject, value: new Range(options.instrumentRange) }),
|
|
1062
|
+
StatusCodes.Good
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
instrumentRange.on("value_changed", handler);
|
|
1067
|
+
}
|
|
1068
|
+
(variable as unknown as { acceptValueOutOfRange?: boolean }).acceptValueOutOfRange = options.acceptValueOutOfRange;
|
|
1069
|
+
|
|
1070
|
+
if (Object.hasOwn(options, "engineeringUnits")) {
|
|
1071
|
+
const engineeringUnits = new EUInformation(options.engineeringUnits);
|
|
1072
|
+
assert(engineeringUnits instanceof EUInformation, "expecting engineering units");
|
|
1073
|
+
|
|
1074
|
+
// EngineeringUnits specifies the units for the DataItem‟s value (e.g., degree, hertz, seconds). The
|
|
1075
|
+
// EUInformation type is specified in 5.6.3.
|
|
1076
|
+
|
|
1077
|
+
const euExisting = variable.getPropertyByName("EngineeringUnits") as UAVariableImpl | null;
|
|
1078
|
+
const eu =
|
|
1079
|
+
euExisting ||
|
|
1080
|
+
this.addVariable({
|
|
1081
|
+
accessLevel: "CurrentRead",
|
|
1082
|
+
browseName: { name: "EngineeringUnits", namespaceIndex: 0 },
|
|
1083
|
+
dataType: "EUInformation",
|
|
1084
|
+
minimumSamplingInterval: 0,
|
|
1085
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
1086
|
+
propertyOf: variable,
|
|
1087
|
+
typeDefinition: "PropertyType",
|
|
1088
|
+
value: new Variant({
|
|
1089
|
+
dataType: DataType.ExtensionObject,
|
|
1090
|
+
value: engineeringUnits
|
|
1091
|
+
})
|
|
1092
|
+
});
|
|
1093
|
+
if (euExisting) {
|
|
1094
|
+
eu.setValueFromSource(
|
|
1095
|
+
new Variant({ dataType: DataType.ExtensionObject, value: engineeringUnits }),
|
|
1096
|
+
StatusCodes.Good
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
eu.on("value_changed", handler);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
variable.install_extra_properties();
|
|
1104
|
+
|
|
1105
|
+
return variable as unknown as UAAnalogItem<T, DT>;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
*
|
|
1110
|
+
|
|
1111
|
+
* @param options {Object}
|
|
1112
|
+
* @param options.browseName {String}
|
|
1113
|
+
* @param [options.nodeId {NodeId}]
|
|
1114
|
+
* @param [options.value {UInt32} = 0 }
|
|
1115
|
+
* @param options.enumValues { EnumValueType[]| {Key,Value} }
|
|
1116
|
+
* @return {Object|UAVariable}
|
|
1117
|
+
*
|
|
1118
|
+
* @example
|
|
1119
|
+
*
|
|
1120
|
+
*
|
|
1121
|
+
* namespace.addMultiStateValueDiscrete({
|
|
1122
|
+
* componentOf:parentObj,
|
|
1123
|
+
* browseName: "myVar",
|
|
1124
|
+
* enumValues: {
|
|
1125
|
+
* "Red": 0xFF0000,
|
|
1126
|
+
* "Green": 0x00FF00,
|
|
1127
|
+
* "Blue": 0x0000FF
|
|
1128
|
+
* }
|
|
1129
|
+
* });
|
|
1130
|
+
* addMultiStateValueDiscrete(parentObj,{
|
|
1131
|
+
* browseName: "myVar",
|
|
1132
|
+
* enumValues: [
|
|
1133
|
+
* {
|
|
1134
|
+
* value: 0xFF0000,
|
|
1135
|
+
* displayName: "Red",
|
|
1136
|
+
* description: " The color Red"
|
|
1137
|
+
* },
|
|
1138
|
+
* {
|
|
1139
|
+
* value: 0x00FF000,
|
|
1140
|
+
* displayName: "Green",
|
|
1141
|
+
* description: " The color Green"
|
|
1142
|
+
* },
|
|
1143
|
+
* {
|
|
1144
|
+
* value: 0x0000FF,
|
|
1145
|
+
* displayName: "Blue",
|
|
1146
|
+
* description: " The color Blue"
|
|
1147
|
+
* }
|
|
1148
|
+
*
|
|
1149
|
+
* ]
|
|
1150
|
+
* });
|
|
1151
|
+
*/
|
|
1152
|
+
public addMultiStateValueDiscrete<T, DT extends DataType>(
|
|
1153
|
+
options: AddMultiStateValueDiscreteOptions
|
|
1154
|
+
): UAMultiStateValueDiscreteEx<T, DT> {
|
|
1155
|
+
return _addMultiStateValueDiscrete<T, DT>(this, options);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// -
|
|
1159
|
+
/**
|
|
1160
|
+
*
|
|
1161
|
+
|
|
1162
|
+
* @param options
|
|
1163
|
+
* @param options.componentOf {NodeId}
|
|
1164
|
+
* @param options.browseName {String}
|
|
1165
|
+
* @param options.title {String}
|
|
1166
|
+
* @param [options.instrumentRange]
|
|
1167
|
+
* @param [options.instrumentRange.low] {Double}
|
|
1168
|
+
* @param [options.instrumentRange.high] {Double}
|
|
1169
|
+
* @param options.engineeringUnitsRange.low {Double}
|
|
1170
|
+
* @param options.engineeringUnitsRange.high {Double}
|
|
1171
|
+
* @param options.engineeringUnits {String}
|
|
1172
|
+
* @param [options.nodeId = {NodeId}]
|
|
1173
|
+
* @param options.accessLevel
|
|
1174
|
+
* @param options.userAccessLevel
|
|
1175
|
+
* @param options.title {String}
|
|
1176
|
+
* @param options.axisScaleType {AxisScaleEnumeration}
|
|
1177
|
+
*
|
|
1178
|
+
* @param options.xAxisDefinition {AxisInformation}
|
|
1179
|
+
* @param options.xAxisDefinition.engineeringUnits EURange
|
|
1180
|
+
* @param options.xAxisDefinition.range
|
|
1181
|
+
* @param options.xAxisDefinition.range.low
|
|
1182
|
+
* @param options.xAxisDefinition.range.high
|
|
1183
|
+
* @param options.xAxisDefinition.title {LocalizedText}
|
|
1184
|
+
* @param options.xAxisDefinition.axisScaleType {AxisScaleEnumeration}
|
|
1185
|
+
* @param options.xAxisDefinition.axisSteps = <null> {Array<Double>}
|
|
1186
|
+
* @param options.value
|
|
1187
|
+
*/
|
|
1188
|
+
public addYArrayItem<DT extends DataType.Double | DataType.Float>(options: AddYArrayItemOptions): UAYArrayItemEx<DT> {
|
|
1189
|
+
assert(Object.hasOwn(options, "engineeringUnitsRange"), "expecting engineeringUnitsRange");
|
|
1190
|
+
assert(Object.hasOwn(options, "axisScaleType"), "expecting axisScaleType");
|
|
1191
|
+
assert(options.xAxisDefinition !== null && typeof options.xAxisDefinition === "object", "expecting a xAxisDefinition");
|
|
1192
|
+
|
|
1193
|
+
const addressSpace = this.addressSpace;
|
|
1194
|
+
|
|
1195
|
+
const YArrayItemType = addressSpace.findVariableType("YArrayItemType");
|
|
1196
|
+
if (!YArrayItemType) {
|
|
1197
|
+
throw new Error("expecting YArrayItemType to be defined , check nodeset xml file");
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
const dataType = toNodeId(options.dataType as unknown as NodeId) || toNodeId((options.value as Variant)?.dataType);
|
|
1201
|
+
const optionals = [];
|
|
1202
|
+
if (Object.hasOwn(options, "instrumentRange")) {
|
|
1203
|
+
optionals.push("InstrumentRange");
|
|
1204
|
+
}
|
|
1205
|
+
const variable = YArrayItemType.instantiate({
|
|
1206
|
+
browseName: options.browseName,
|
|
1207
|
+
componentOf: options.componentOf,
|
|
1208
|
+
dataType,
|
|
1209
|
+
optionals
|
|
1210
|
+
}) as UAYArrayItemEx<DataType.Float | DataType.Double>;
|
|
1211
|
+
|
|
1212
|
+
function coerceAxisScale(value: unknown) {
|
|
1213
|
+
const ret = AxisScaleEnumeration[value as keyof typeof AxisScaleEnumeration];
|
|
1214
|
+
assert(!isNullOrUndefined(ret));
|
|
1215
|
+
return ret;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
variable.setValueFromSource(options.value as Variant, StatusCodes.Good);
|
|
1219
|
+
|
|
1220
|
+
variable.euRange.setValueFromSource(
|
|
1221
|
+
new Variant({
|
|
1222
|
+
dataType: DataType.ExtensionObject,
|
|
1223
|
+
value: new Range(options.engineeringUnitsRange)
|
|
1224
|
+
})
|
|
1225
|
+
);
|
|
1226
|
+
|
|
1227
|
+
if (Object.hasOwn(options, "instrumentRange") && variable.instrumentRange) {
|
|
1228
|
+
variable.instrumentRange.setValueFromSource(
|
|
1229
|
+
new Variant({
|
|
1230
|
+
dataType: DataType.ExtensionObject,
|
|
1231
|
+
value: new Range(options.instrumentRange)
|
|
1232
|
+
})
|
|
1233
|
+
);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
variable.title.setValueFromSource(
|
|
1237
|
+
new Variant({
|
|
1238
|
+
dataType: DataType.LocalizedText,
|
|
1239
|
+
value: coerceLocalizedText(options.title || "")
|
|
1240
|
+
})
|
|
1241
|
+
);
|
|
1242
|
+
|
|
1243
|
+
// Linear/Log/Ln
|
|
1244
|
+
variable.axisScaleType.setValueFromSource(
|
|
1245
|
+
new Variant({
|
|
1246
|
+
dataType: DataType.Int32,
|
|
1247
|
+
value: coerceAxisScale(options.axisScaleType)
|
|
1248
|
+
})
|
|
1249
|
+
);
|
|
1250
|
+
|
|
1251
|
+
variable.xAxisDefinition.setValueFromSource(
|
|
1252
|
+
new Variant({
|
|
1253
|
+
dataType: DataType.ExtensionObject,
|
|
1254
|
+
value: new AxisInformation(options.xAxisDefinition)
|
|
1255
|
+
})
|
|
1256
|
+
);
|
|
1257
|
+
|
|
1258
|
+
return variable as unknown as UAYArrayItemEx<DT>;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
// - Methods ----------------------------------------------------------------------------------------------------
|
|
1262
|
+
/**
|
|
1263
|
+
|
|
1264
|
+
* @param parentObject {Object}
|
|
1265
|
+
* @param options {Object}
|
|
1266
|
+
* @param [options.nodeId=null] {NodeId} the object nodeid.
|
|
1267
|
+
* @param [options.browseName=""] {String} the object browse name.
|
|
1268
|
+
* @param [options.description=""] {String} the object description.
|
|
1269
|
+
* @param options.inputArguments {Array<Argument>}
|
|
1270
|
+
* @param options.outputArguments {Array<Argument>}
|
|
1271
|
+
* @return {Object}
|
|
1272
|
+
*/
|
|
1273
|
+
public addMethod(parentObject: UAObject, options: AddMethodOptions): UAMethod {
|
|
1274
|
+
const addressSpace = this.addressSpace;
|
|
1275
|
+
|
|
1276
|
+
assert(
|
|
1277
|
+
parentObject !== null && typeof parentObject === "object" && parentObject instanceof BaseNodeImpl,
|
|
1278
|
+
"expecting a valid parent object"
|
|
1279
|
+
);
|
|
1280
|
+
assert(Object.hasOwn(options, "browseName"));
|
|
1281
|
+
options.componentOf = parentObject;
|
|
1282
|
+
|
|
1283
|
+
const method = this._addMethod(options);
|
|
1284
|
+
|
|
1285
|
+
const propertyTypeId = addressSpace._coerce_VariableTypeIds("PropertyType");
|
|
1286
|
+
|
|
1287
|
+
const nodeId_ArgumentDataType = "Argument"; // makeNodeId(DataTypeIds.Argument);
|
|
1288
|
+
|
|
1289
|
+
if (options.inputArguments) {
|
|
1290
|
+
const _inputArgs = new Variant({
|
|
1291
|
+
arrayType: VariantArrayType.Array,
|
|
1292
|
+
dataType: DataType.ExtensionObject,
|
|
1293
|
+
value: options.inputArguments.map((opt: ArgumentOptions) => new Argument(opt))
|
|
1294
|
+
});
|
|
1295
|
+
|
|
1296
|
+
const inputArguments = this.addVariable({
|
|
1297
|
+
accessLevel: "CurrentRead",
|
|
1298
|
+
arrayDimensions: [_inputArgs.value.length],
|
|
1299
|
+
browseName: { name: "InputArguments", namespaceIndex: 0 },
|
|
1300
|
+
dataType: nodeId_ArgumentDataType,
|
|
1301
|
+
description:
|
|
1302
|
+
"the definition of the input argument of method " +
|
|
1303
|
+
parentObject.browseName.toString() +
|
|
1304
|
+
"." +
|
|
1305
|
+
method.browseName.toString(),
|
|
1306
|
+
minimumSamplingInterval: -1,
|
|
1307
|
+
modellingRule: "Mandatory",
|
|
1308
|
+
propertyOf: method,
|
|
1309
|
+
typeDefinition: "PropertyType",
|
|
1310
|
+
value: _inputArgs,
|
|
1311
|
+
valueRank: 1
|
|
1312
|
+
});
|
|
1313
|
+
inputArguments.setValueFromSource(_inputArgs);
|
|
1314
|
+
assert(inputArguments.typeDefinition.toString() === propertyTypeId.toString());
|
|
1315
|
+
assert(Array.isArray(inputArguments.arrayDimensions));
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
if (options.outputArguments) {
|
|
1319
|
+
const _outputArgs = new Variant({
|
|
1320
|
+
arrayType: VariantArrayType.Array,
|
|
1321
|
+
dataType: DataType.ExtensionObject,
|
|
1322
|
+
value: options.outputArguments.map((opts) => new Argument(opts))
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
const outputArguments = this.addVariable({
|
|
1326
|
+
accessLevel: "CurrentRead",
|
|
1327
|
+
arrayDimensions: [_outputArgs.value.length],
|
|
1328
|
+
browseName: { name: "OutputArguments", namespaceIndex: 0 },
|
|
1329
|
+
dataType: nodeId_ArgumentDataType,
|
|
1330
|
+
description:
|
|
1331
|
+
"the definition of the output arguments of method " +
|
|
1332
|
+
parentObject.browseName.toString() +
|
|
1333
|
+
"." +
|
|
1334
|
+
method.browseName.toString(),
|
|
1335
|
+
minimumSamplingInterval: -1,
|
|
1336
|
+
modellingRule: "Mandatory",
|
|
1337
|
+
propertyOf: method,
|
|
1338
|
+
typeDefinition: "PropertyType",
|
|
1339
|
+
value: _outputArgs,
|
|
1340
|
+
valueRank: 1
|
|
1341
|
+
});
|
|
1342
|
+
outputArguments.setValueFromSource(_outputArgs);
|
|
1343
|
+
|
|
1344
|
+
assert(outputArguments.typeDefinition.toString() === propertyTypeId.toString());
|
|
1345
|
+
assert(Array.isArray(outputArguments.arrayDimensions));
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// verifying post-conditions
|
|
1349
|
+
parentObject.install_extra_properties();
|
|
1350
|
+
|
|
1351
|
+
return method;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
// - Enumeration ------------------------------------------------------------------------------------------------
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
*
|
|
1358
|
+
|
|
1359
|
+
* @param options
|
|
1360
|
+
* @param options.browseName {String}
|
|
1361
|
+
* @param options.enumeration {Array}
|
|
1362
|
+
* @param options.enumeration[].displayName {String|LocalizedText}
|
|
1363
|
+
* @param options.enumeration[].value {Number}
|
|
1364
|
+
* @param options.enumeration[].description {String|LocalizedText|null}
|
|
1365
|
+
*/
|
|
1366
|
+
public addEnumerationType(options: AddEnumerationTypeOptions): UADataType {
|
|
1367
|
+
// Release 1.03 OPC Unified Architecture, Part 3 - page 34
|
|
1368
|
+
// Enumeration DataTypes are DataTypes that represent discrete sets of named values.
|
|
1369
|
+
// Enumerations are always encoded as Int32 on the wire as defined in Part 6. Enumeration
|
|
1370
|
+
// DataTypes inherit directly or indirectly from the DataType Enumeration defined in 8.14.
|
|
1371
|
+
// Enumerations have no encodings exposed in the IAddressSpace. To expose the human readable
|
|
1372
|
+
// representation of an enumerated value the DataType Node may have the EnumString
|
|
1373
|
+
// Property that contains an array of LocalizedText. The Integer representation of the enumeration
|
|
1374
|
+
// value points to a position within that array. EnumValues Property can be used instead of the
|
|
1375
|
+
// EnumStrings to support integer representation of enumerations that are not zero-based or have
|
|
1376
|
+
// gaps. It contains an array of a Structured DataType containing the integer representation as
|
|
1377
|
+
// well as the human-readable representation. An example of an enumeration DataType containing
|
|
1378
|
+
// a sparse list of Integers is NodeClass which is defined in 8.30.
|
|
1379
|
+
|
|
1380
|
+
// OPC Unified Architecture, Part 3 Release 1.03 page 35
|
|
1381
|
+
// Table 11 – DataType NodeClass
|
|
1382
|
+
// EnumStrings O LocalizedText[] The EnumStrings Property only applies for Enumeration DataTypes.
|
|
1383
|
+
// It shall not be applied for other DataTypes. If the EnumValues
|
|
1384
|
+
// Property is provided, the EnumStrings Property shall not be provided.
|
|
1385
|
+
// Each entry of the array of LocalizedText in this Property represents
|
|
1386
|
+
// the human-readable representation of an enumerated value. The
|
|
1387
|
+
// Integer representation of the enumeration value points to a position
|
|
1388
|
+
// of the array.
|
|
1389
|
+
// EnumValues O EnumValueType[] The EnumValues Property only applies for Enumeration DataTypes.
|
|
1390
|
+
// It shall not be applied for other DataTypes. If the EnumStrings
|
|
1391
|
+
// Property is provided, the EnumValues Property shall not be provided.
|
|
1392
|
+
// Using the EnumValues Property it is possible to represent.
|
|
1393
|
+
// Enumerations with integers that are not zero-based or have gaps
|
|
1394
|
+
// (e.g. 1, 2, 4, 8, 16).
|
|
1395
|
+
// Each entry of the array of EnumValueType in this Property
|
|
1396
|
+
// represents one enumeration value with its integer notation, human readable
|
|
1397
|
+
// representation and help information.
|
|
1398
|
+
// The Property EnumStrings contains human-readable representations of enumeration values and is
|
|
1399
|
+
// only applied to Enumeration DataTypes. Instead of the EnumStrings Property an Enumeration
|
|
1400
|
+
// DataType can also use the EnumValues Property to represent Enumerations with integer values that are not
|
|
1401
|
+
// zero-based or containing gaps. There are no additional Properties defined for DataTypes in this standard.
|
|
1402
|
+
// Additional parts of this series of standards may define additional Properties for DataTypes.
|
|
1403
|
+
|
|
1404
|
+
// 8.40 EnumValueType
|
|
1405
|
+
// This Structured DataType is used to represent a human-readable representation of an
|
|
1406
|
+
// Enumeration. Its elements are described inTable 27. When this type is used in an array representing
|
|
1407
|
+
// human-readable representations of an enumeration, each Value shall be unique in that array.
|
|
1408
|
+
// Table 27 – EnumValueType Definition
|
|
1409
|
+
// Name Type Description
|
|
1410
|
+
// EnumValueType structure
|
|
1411
|
+
// Value Int64 The Integer representation of an Enumeration.
|
|
1412
|
+
// DisplayName LocalizedText A human-readable representation of the Value of the Enumeration.
|
|
1413
|
+
// Description LocalizedText A localized description of the enumeration value. This field can
|
|
1414
|
+
// contain an empty string if no description is available.
|
|
1415
|
+
// Note that the EnumValueType has been defined with a Int64 Value to meet a variety of usages.
|
|
1416
|
+
// When it is used to define the string representation of an Enumeration DataType, the value range
|
|
1417
|
+
// is limited to Int32, because the Enumeration DataType is a subtype of Int32. Part 8 specifies
|
|
1418
|
+
// other usages where the actual value might be between 8 and 64 Bit.
|
|
1419
|
+
|
|
1420
|
+
assert(typeof options.browseName === "string");
|
|
1421
|
+
assert(Array.isArray(options.enumeration));
|
|
1422
|
+
|
|
1423
|
+
const addressSpace = this.addressSpace;
|
|
1424
|
+
const enumerationType = addressSpace.findDataType("Enumeration") as UADataType;
|
|
1425
|
+
assert(enumerationType.nodeId instanceof NodeId);
|
|
1426
|
+
assert(enumerationType instanceof UADataTypeImpl);
|
|
1427
|
+
const references = [{ referenceType: "HasSubtype", isForward: false, nodeId: enumerationType.nodeId }];
|
|
1428
|
+
const opts = {
|
|
1429
|
+
browseName: options.browseName,
|
|
1430
|
+
definition: undefined,
|
|
1431
|
+
description: coerceLocalizedText(options.description) || null,
|
|
1432
|
+
displayName: options.displayName || null,
|
|
1433
|
+
isAbstract: false,
|
|
1434
|
+
nodeClass: NodeClass.DataType,
|
|
1435
|
+
references
|
|
1436
|
+
};
|
|
1437
|
+
|
|
1438
|
+
const enumType = this.internalCreateNode(opts) as UADataType; // as UAEnumeration;
|
|
1439
|
+
|
|
1440
|
+
enumType.propagate_back_references();
|
|
1441
|
+
|
|
1442
|
+
if (typeof options.enumeration[0] === "string") {
|
|
1443
|
+
const enumeration = options.enumeration as string[];
|
|
1444
|
+
// enumeration is a array of string
|
|
1445
|
+
const definition = enumeration.map((str: string, _index: number) => coerceLocalizedText(str));
|
|
1446
|
+
|
|
1447
|
+
const value = new Variant({
|
|
1448
|
+
arrayType: VariantArrayType.Array,
|
|
1449
|
+
dataType: DataType.LocalizedText,
|
|
1450
|
+
value: definition
|
|
1451
|
+
});
|
|
1452
|
+
|
|
1453
|
+
const enumStrings = this.addVariable({
|
|
1454
|
+
browseName: { name: "EnumStrings", namespaceIndex: 0 },
|
|
1455
|
+
dataType: "LocalizedText",
|
|
1456
|
+
description: "",
|
|
1457
|
+
modellingRule: "Mandatory",
|
|
1458
|
+
propertyOf: enumType,
|
|
1459
|
+
value,
|
|
1460
|
+
valueRank: 1
|
|
1461
|
+
});
|
|
1462
|
+
assert(enumStrings.browseName.toString() === "EnumStrings");
|
|
1463
|
+
|
|
1464
|
+
// set $definition
|
|
1465
|
+
// EnumDefinition
|
|
1466
|
+
// This Structured DataType is used to provide the metadata for a custom Enumeration or
|
|
1467
|
+
// OptionSet DataType. It is derived from the DataType DataTypeDefinition.
|
|
1468
|
+
// Enum Field:
|
|
1469
|
+
// This Structured DataType is used to provide the metadata for a field of a custom Enumeration
|
|
1470
|
+
// or OptionSet DataType. It is derived from the DataType EnumValueType. If used for an
|
|
1471
|
+
// OptionSet, the corresponding Value in the base type contains the number of the bit associated
|
|
1472
|
+
// with the field. The EnumField is formally defined in Table 37.
|
|
1473
|
+
(enumType as unknown as { $fullDefinition?: EnumDefinition }).$fullDefinition = new EnumDefinition({
|
|
1474
|
+
fields: enumeration.map(
|
|
1475
|
+
(x: string, index: number) =>
|
|
1476
|
+
new EnumField({
|
|
1477
|
+
name: x,
|
|
1478
|
+
|
|
1479
|
+
description: coerceLocalizedText(x),
|
|
1480
|
+
value: coerceInt64(index)
|
|
1481
|
+
})
|
|
1482
|
+
)
|
|
1483
|
+
});
|
|
1484
|
+
} else {
|
|
1485
|
+
const enumeration = options.enumeration as EnumerationItem[];
|
|
1486
|
+
// construct the definition object
|
|
1487
|
+
const definition = enumeration.map((enumItem: EnumerationItem) => {
|
|
1488
|
+
return new EnumValueType({
|
|
1489
|
+
description: coerceLocalizedText(enumItem.description),
|
|
1490
|
+
displayName: coerceLocalizedText(enumItem.displayName),
|
|
1491
|
+
value: coerceInt64(enumItem.value)
|
|
1492
|
+
});
|
|
1493
|
+
});
|
|
1494
|
+
|
|
1495
|
+
const value = new Variant({
|
|
1496
|
+
arrayType: VariantArrayType.Array,
|
|
1497
|
+
dataType: DataType.ExtensionObject,
|
|
1498
|
+
value: definition
|
|
1499
|
+
});
|
|
1500
|
+
|
|
1501
|
+
const enumValues = this.addVariable({
|
|
1502
|
+
browseName: { name: "EnumValues", namespaceIndex: 0 },
|
|
1503
|
+
dataType: "EnumValueType",
|
|
1504
|
+
description: undefined,
|
|
1505
|
+
modellingRule: "Mandatory",
|
|
1506
|
+
propertyOf: enumType,
|
|
1507
|
+
value,
|
|
1508
|
+
valueRank: 1
|
|
1509
|
+
});
|
|
1510
|
+
assert(enumValues.browseName.toString() === "EnumValues");
|
|
1511
|
+
|
|
1512
|
+
(enumType as unknown as { $fullDefinition?: EnumDefinition }).$fullDefinition = new EnumDefinition({
|
|
1513
|
+
fields: enumeration.map(
|
|
1514
|
+
(x: EnumerationItem, _index: number) =>
|
|
1515
|
+
new EnumField({
|
|
1516
|
+
name: x.displayName.toString(),
|
|
1517
|
+
|
|
1518
|
+
description: x.description || "",
|
|
1519
|
+
value: coerceInt64(x.value)
|
|
1520
|
+
})
|
|
1521
|
+
)
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
// now create the string value property
|
|
1525
|
+
// <UAVariable NodeId="i=7612" BrowseName="EnumStrings"
|
|
1526
|
+
// ParentNodeId="i=852" DataType="LocalizedText" ValueRank="1">
|
|
1527
|
+
// <DisplayName>EnumStrings</DisplayName>
|
|
1528
|
+
// <References>
|
|
1529
|
+
// <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
|
|
1530
|
+
// <Reference ReferenceType="HasModellingRule">i=78</Reference>
|
|
1531
|
+
// <Reference ReferenceType="HasProperty" IsForward="false">i=852</Reference>
|
|
1532
|
+
// </References>
|
|
1533
|
+
// <Value>
|
|
1534
|
+
// <ListOfLocalizedText xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd">
|
|
1535
|
+
// <LocalizedText><Locale></Locale><Text>Running</Text></LocalizedText>
|
|
1536
|
+
// <LocalizedText><Locale></Locale><Text>Failed</Text>
|
|
1537
|
+
// </ListOfLocalizedText>
|
|
1538
|
+
// </Value>
|
|
1539
|
+
// </UAVariable>
|
|
1540
|
+
|
|
1541
|
+
return enumType;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
// -------------------------------------------------------------------------
|
|
1545
|
+
// State and Transition
|
|
1546
|
+
// -------------------------------------------------------------------------
|
|
1547
|
+
public toNodeset2XML(): string {
|
|
1548
|
+
return "<toNodeset2XML>has not be installed</toNodeset2XML>!";
|
|
1549
|
+
}
|
|
1550
|
+
// installed by impl/nodeset_tools/nodeset_to_records.ts
|
|
1551
|
+
public toNodesetRecords(_options?: ToNodesetRecordsOptions): Iterable<NodesetRecord> {
|
|
1552
|
+
throw new Error("toNodesetRecords has not been installed");
|
|
1553
|
+
}
|
|
1554
|
+
public toNodesetImage(_options?: NamespaceToImageOptions): Promise<Uint8Array> {
|
|
1555
|
+
throw new Error("toNodesetImage has not been installed");
|
|
1556
|
+
}
|
|
1557
|
+
public setRequiredModels(requiredModels: RequiredModel[]): void {
|
|
1558
|
+
this._requiredModels = requiredModels;
|
|
1559
|
+
}
|
|
1560
|
+
public getRequiredModels(): RequiredModel[] | undefined {
|
|
1561
|
+
return this._requiredModels;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
// -------------------------------------------------------------------------
|
|
1565
|
+
// State and Transition
|
|
1566
|
+
// -------------------------------------------------------------------------
|
|
1567
|
+
/**
|
|
1568
|
+
*/
|
|
1569
|
+
public addState(
|
|
1570
|
+
component: UAStateMachineEx,
|
|
1571
|
+
stateName: QualifiedNameLike,
|
|
1572
|
+
stateNumber: number,
|
|
1573
|
+
isInitialState: boolean
|
|
1574
|
+
): UAState | UAInitialState {
|
|
1575
|
+
const addressSpace = this.addressSpace;
|
|
1576
|
+
|
|
1577
|
+
isInitialState = !!isInitialState;
|
|
1578
|
+
|
|
1579
|
+
const _component = component as UAStateMachineImpl;
|
|
1580
|
+
|
|
1581
|
+
assert(_component.nodeClass === NodeClass.Object || _component.nodeClass === NodeClass.ObjectType);
|
|
1582
|
+
|
|
1583
|
+
const initialStateType = addressSpace.findObjectType("InitialStateType");
|
|
1584
|
+
const stateType = addressSpace.findObjectType("StateType");
|
|
1585
|
+
|
|
1586
|
+
if (!initialStateType) {
|
|
1587
|
+
throw new Error("Cannot find InitialStateType");
|
|
1588
|
+
}
|
|
1589
|
+
if (!stateType) {
|
|
1590
|
+
throw new Error("Cannot find StateType");
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
let state: UAState | UAInitialState;
|
|
1594
|
+
if (isInitialState) {
|
|
1595
|
+
state = initialStateType.instantiate({
|
|
1596
|
+
browseName: stateName,
|
|
1597
|
+
componentOf: _component
|
|
1598
|
+
}) as UAInitialState;
|
|
1599
|
+
} else {
|
|
1600
|
+
state = stateType.instantiate({
|
|
1601
|
+
browseName: stateName,
|
|
1602
|
+
componentOf: _component
|
|
1603
|
+
}) as UAState;
|
|
1604
|
+
}
|
|
1605
|
+
// ensure state number is unique
|
|
1606
|
+
state.stateNumber.setValueFromSource({
|
|
1607
|
+
dataType: DataType.UInt32,
|
|
1608
|
+
value: stateNumber
|
|
1609
|
+
});
|
|
1610
|
+
return state;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
*/
|
|
1615
|
+
public addTransition(
|
|
1616
|
+
component: UAStateMachineEx,
|
|
1617
|
+
fromState: string,
|
|
1618
|
+
toState: string,
|
|
1619
|
+
transitionNumber: number,
|
|
1620
|
+
browseName?: QualifiedNameLike
|
|
1621
|
+
): UATransitionEx {
|
|
1622
|
+
const addressSpace = this.addressSpace;
|
|
1623
|
+
|
|
1624
|
+
const _component = component as UAStateMachineImpl;
|
|
1625
|
+
|
|
1626
|
+
assert(_component.nodeClass === NodeClass.Object || _component.nodeClass === NodeClass.ObjectType);
|
|
1627
|
+
assert(typeof fromState === "string");
|
|
1628
|
+
assert(typeof toState === "string");
|
|
1629
|
+
assert(Number.isFinite(transitionNumber));
|
|
1630
|
+
|
|
1631
|
+
const fromStateNode = _component.getComponentByName(fromState);
|
|
1632
|
+
|
|
1633
|
+
// c8 ignore next
|
|
1634
|
+
if (!fromStateNode) {
|
|
1635
|
+
throw new Error(`Cannot find state with name ${fromState}`);
|
|
1636
|
+
}
|
|
1637
|
+
assert(fromStateNode.browseName.name?.toString() === fromState);
|
|
1638
|
+
|
|
1639
|
+
const toStateNode = _component.getComponentByName(toState);
|
|
1640
|
+
|
|
1641
|
+
// c8 ignore next
|
|
1642
|
+
if (!toStateNode) {
|
|
1643
|
+
throw new Error(`Cannot find state with name ${toState}`);
|
|
1644
|
+
}
|
|
1645
|
+
assert(toStateNode.browseName.name?.toString() === toState);
|
|
1646
|
+
|
|
1647
|
+
const transitionType = addressSpace.findObjectType("TransitionType");
|
|
1648
|
+
if (!transitionType) {
|
|
1649
|
+
throw new Error("Cannot find TransitionType");
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
browseName = browseName || `${fromState}To${toState}`; // "Transition";
|
|
1653
|
+
|
|
1654
|
+
const transition = transitionType.instantiate({
|
|
1655
|
+
browseName,
|
|
1656
|
+
componentOf: _component
|
|
1657
|
+
}) as UATransitionImpl;
|
|
1658
|
+
|
|
1659
|
+
transition.addReference({
|
|
1660
|
+
isForward: true,
|
|
1661
|
+
nodeId: toStateNode.nodeId,
|
|
1662
|
+
referenceType: "ToState"
|
|
1663
|
+
});
|
|
1664
|
+
transition.addReference({
|
|
1665
|
+
isForward: true,
|
|
1666
|
+
nodeId: fromStateNode.nodeId,
|
|
1667
|
+
referenceType: "FromState"
|
|
1668
|
+
});
|
|
1669
|
+
|
|
1670
|
+
transition.transitionNumber.setValueFromSource({
|
|
1671
|
+
dataType: DataType.UInt32,
|
|
1672
|
+
value: transitionNumber
|
|
1673
|
+
});
|
|
1674
|
+
|
|
1675
|
+
return transition;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
/**
|
|
1679
|
+
|
|
1680
|
+
*
|
|
1681
|
+
* @return {UATwoStateVariable}
|
|
1682
|
+
*/
|
|
1683
|
+
public addTwoStateVariable(options: AddTwoStateVariableOptions): UATwoStateVariableEx {
|
|
1684
|
+
return _addTwoStateVariable(this, options);
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
|
|
1689
|
+
*
|
|
1690
|
+
* Add a TwoStateDiscrete Variable
|
|
1691
|
+
* @return {UATwoStateDiscrete}
|
|
1692
|
+
*/
|
|
1693
|
+
public addTwoStateDiscrete(options: AddTwoStateDiscreteOptions): UATwoStateDiscreteEx {
|
|
1694
|
+
return _addTwoStateDiscrete(this, options);
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
// --- Alarms & Conditions -------------------------------------------------
|
|
1698
|
+
public instantiateCondition(
|
|
1699
|
+
conditionTypeId: UAEventType | NodeId | string,
|
|
1700
|
+
options: InstantiateConditionOptions,
|
|
1701
|
+
data: Record<string, VariantOptions>
|
|
1702
|
+
): UAConditionEx {
|
|
1703
|
+
return UAConditionImplBase.instantiate(this, conditionTypeId, options, data);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
public instantiateAcknowledgeableCondition(
|
|
1707
|
+
conditionTypeId: UAEventType | NodeId | string,
|
|
1708
|
+
options: InstantiateAlarmConditionOptions,
|
|
1709
|
+
data?: Record<string, VariantOptions>
|
|
1710
|
+
): UAAcknowledgeableConditionImpl {
|
|
1711
|
+
return UAAcknowledgeableConditionImplBase.instantiate(this, conditionTypeId, options, data);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
public instantiateAlarmCondition(
|
|
1715
|
+
alarmConditionTypeId: UAEventType | NodeId | string,
|
|
1716
|
+
options: InstantiateAlarmConditionOptions,
|
|
1717
|
+
data?: Record<string, VariantOptions>
|
|
1718
|
+
): UAAlarmConditionEx {
|
|
1719
|
+
return UAAlarmConditionImplBase.instantiate(this, alarmConditionTypeId, options, data);
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
public instantiateLimitAlarm(
|
|
1723
|
+
limitAlarmTypeId: UAEventType | NodeId | string,
|
|
1724
|
+
options: InstantiateLimitAlarmOptions,
|
|
1725
|
+
data?: Record<string, VariantOptions>
|
|
1726
|
+
): UALimitAlarmEx {
|
|
1727
|
+
return UALimitAlarmImplBase.instantiate(this, limitAlarmTypeId, options, data);
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
public instantiateExclusiveLimitAlarm(
|
|
1731
|
+
exclusiveLimitAlarmTypeId: UAEventType | NodeId | string,
|
|
1732
|
+
options: InstantiateLimitAlarmOptions,
|
|
1733
|
+
data?: Record<string, VariantOptions>
|
|
1734
|
+
): UAExclusiveLimitAlarmEx {
|
|
1735
|
+
return UAExclusiveLimitAlarmImplBase.instantiate(this, exclusiveLimitAlarmTypeId, options, data);
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
public instantiateExclusiveDeviationAlarm(
|
|
1739
|
+
options: InstantiateExclusiveDeviationAlarmOptions,
|
|
1740
|
+
data?: Record<string, VariantOptions>
|
|
1741
|
+
): UAExclusiveDeviationAlarmEx {
|
|
1742
|
+
return UAExclusiveDeviationAlarmImplBase.instantiate(this, "ExclusiveDeviationAlarmType", options, data);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
public instantiateNonExclusiveLimitAlarm(
|
|
1746
|
+
nonExclusiveLimitAlarmTypeId: UAEventType | NodeId | string,
|
|
1747
|
+
options: InstantiateNonExclusiveLimitAlarmOptions,
|
|
1748
|
+
data?: Record<string, VariantOptions>
|
|
1749
|
+
): UANonExclusiveLimitAlarmEx {
|
|
1750
|
+
return UANonExclusiveLimitAlarmImplBase.instantiate(this, nonExclusiveLimitAlarmTypeId, options, data);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
public instantiateNonExclusiveDeviationAlarm(
|
|
1754
|
+
options: InstantiateNonExclusiveDeviationAlarmOptions,
|
|
1755
|
+
data?: Record<string, VariantOptions>
|
|
1756
|
+
): UANonExclusiveDeviationAlarmEx {
|
|
1757
|
+
return UANonExclusiveDeviationAlarmImplBase.instantiate(this, "NonExclusiveDeviationAlarmType", options, data);
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
public instantiateDiscreteAlarm(
|
|
1761
|
+
discreteAlarmType: UAEventType | NodeId | string,
|
|
1762
|
+
options: InstantiateAlarmConditionOptions,
|
|
1763
|
+
data?: Record<string, VariantOptions>
|
|
1764
|
+
): UADiscreteAlarmEx {
|
|
1765
|
+
return UADiscreteAlarmImplBase.instantiate(this, discreteAlarmType, options, data);
|
|
1766
|
+
}
|
|
1767
|
+
public instantiateOffNormalAlarm(
|
|
1768
|
+
options: InstantiateOffNormalAlarmOptions,
|
|
1769
|
+
data?: Record<string, VariantOptions>
|
|
1770
|
+
): UAOffNormalAlarmEx {
|
|
1771
|
+
return UAOffNormalAlarmImplBase.instantiate(this, "OffNormalAlarmType", options, data);
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
// default roles and permissions
|
|
1775
|
+
public setDefaultRolePermissions(rolePermissions: RolePermissionTypeOptions[] | null): void {
|
|
1776
|
+
this.defaultRolePermissions = rolePermissions ? coerceRolePermissions(rolePermissions) : undefined;
|
|
1777
|
+
}
|
|
1778
|
+
public getDefaultRolePermissions(): RolePermissionType[] | null {
|
|
1779
|
+
return this.defaultRolePermissions || null;
|
|
1780
|
+
}
|
|
1781
|
+
public setDefaultAccessRestrictions(accessRestrictions: AccessRestrictionsFlag): void {
|
|
1782
|
+
this.defaultAccessRestrictions = accessRestrictions;
|
|
1783
|
+
}
|
|
1784
|
+
public getDefaultAccessRestrictions(): AccessRestrictionsFlag {
|
|
1785
|
+
return this.defaultAccessRestrictions || AccessRestrictionsFlag.None;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
// --- internal stuff
|
|
1789
|
+
public constructNodeId(options: ConstructNodeIdOptions): NodeId {
|
|
1790
|
+
return this._nodeIdManager.constructNodeId({
|
|
1791
|
+
registerSymbolicNames: this.registerSymbolicNames,
|
|
1792
|
+
...options
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
public _register(node: BaseNode): void {
|
|
1797
|
+
assert(node instanceof BaseNodeImpl, "Expecting a instance of BaseNode in _register");
|
|
1798
|
+
assert(node.nodeId instanceof NodeId, "Expecting a NodeId");
|
|
1799
|
+
// c8 ignore next
|
|
1800
|
+
if (node.nodeId.namespace !== this.index) {
|
|
1801
|
+
throw new Error(
|
|
1802
|
+
"node must belong to this namespace : " +
|
|
1803
|
+
node.nodeId.toString() +
|
|
1804
|
+
" " +
|
|
1805
|
+
" node.browseName = " +
|
|
1806
|
+
node.browseName.toString() +
|
|
1807
|
+
" this.index = " +
|
|
1808
|
+
this.index
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
assert(node.nodeId.namespace === this.index, "node must belongs to this namespace");
|
|
1812
|
+
assert(Object.hasOwn(node, "browseName"), "Node must have a browseName");
|
|
1813
|
+
|
|
1814
|
+
const hashKey = _makeHashKey(node.nodeId);
|
|
1815
|
+
|
|
1816
|
+
// c8 ignore next
|
|
1817
|
+
if (this._nodeid_index.has(hashKey)) {
|
|
1818
|
+
const existingNode = this.findNode(node.nodeId);
|
|
1819
|
+
throw new Error(
|
|
1820
|
+
"node " +
|
|
1821
|
+
node.browseName.toString() +
|
|
1822
|
+
" nodeId = " +
|
|
1823
|
+
node.nodeId.displayText() +
|
|
1824
|
+
" already registered " +
|
|
1825
|
+
node.nodeId.toString() +
|
|
1826
|
+
"\n" +
|
|
1827
|
+
" in namespace " +
|
|
1828
|
+
this.namespaceUri +
|
|
1829
|
+
" index = " +
|
|
1830
|
+
this.index +
|
|
1831
|
+
"\n" +
|
|
1832
|
+
"existing node = " +
|
|
1833
|
+
existingNode?.toString() +
|
|
1834
|
+
"this parent : " +
|
|
1835
|
+
node.parentNodeId?.toString()
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
this._nodeid_index.set(hashKey, node);
|
|
1840
|
+
|
|
1841
|
+
switch (node.nodeClass) {
|
|
1842
|
+
case NodeClass.ObjectType:
|
|
1843
|
+
this._registerObjectType(node as UAObjectType);
|
|
1844
|
+
break;
|
|
1845
|
+
case NodeClass.VariableType:
|
|
1846
|
+
this._registerVariableType(node as UAVariableType);
|
|
1847
|
+
break;
|
|
1848
|
+
case NodeClass.ReferenceType:
|
|
1849
|
+
this._registerReferenceType(node as UAReferenceType);
|
|
1850
|
+
break;
|
|
1851
|
+
case NodeClass.DataType:
|
|
1852
|
+
this._registerDataType(node as UADataType);
|
|
1853
|
+
break;
|
|
1854
|
+
case NodeClass.Object:
|
|
1855
|
+
case NodeClass.Variable:
|
|
1856
|
+
case NodeClass.Method:
|
|
1857
|
+
case NodeClass.View:
|
|
1858
|
+
break;
|
|
1859
|
+
default:
|
|
1860
|
+
errorLog("Invalid class Name", node.nodeClass);
|
|
1861
|
+
throw new Error("Invalid class name specified");
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
|
|
1867
|
+
* @internal
|
|
1868
|
+
*/
|
|
1869
|
+
public internalCreateNode(options: CreateNodeOptions): BaseNode {
|
|
1870
|
+
assert(options.nodeClass !== undefined, " options.nodeClass must be specified");
|
|
1871
|
+
assert(options.browseName, "options.browseName must be specified");
|
|
1872
|
+
// xx assert(options.browseName instanceof QualifiedName
|
|
1873
|
+
// ? (options.browseName.namespaceIndex === this.index): true,
|
|
1874
|
+
// "Expecting browseName to have the same namespaceIndex as the namespace");
|
|
1875
|
+
|
|
1876
|
+
options.description = coerceLocalizedText(options.description) || "";
|
|
1877
|
+
|
|
1878
|
+
// browseName adjustment
|
|
1879
|
+
if (typeof options.browseName === "string") {
|
|
1880
|
+
const match = options.browseName.match(regExpNamespaceDotBrowseName);
|
|
1881
|
+
if (match) {
|
|
1882
|
+
const correctedName = match[1];
|
|
1883
|
+
// the application is using an old scheme
|
|
1884
|
+
warningLog(
|
|
1885
|
+
chalk.green(
|
|
1886
|
+
"Warning : since node-opcua 0.4.2 " + "namespace index should not be prepended to the browse name anymore"
|
|
1887
|
+
)
|
|
1888
|
+
);
|
|
1889
|
+
warningLog(" ", options.browseName, " will be replaced with ", correctedName);
|
|
1890
|
+
warningLog(" Please update your code");
|
|
1891
|
+
|
|
1892
|
+
const indexVerify = parseInt(match[0], 10);
|
|
1893
|
+
if (indexVerify !== this.index) {
|
|
1894
|
+
errorLog(
|
|
1895
|
+
chalk.red.bold(
|
|
1896
|
+
"Error: namespace index used at the front of the browseName " +
|
|
1897
|
+
indexVerify +
|
|
1898
|
+
" do not match the index of the current namespace (" +
|
|
1899
|
+
this.index +
|
|
1900
|
+
")"
|
|
1901
|
+
)
|
|
1902
|
+
);
|
|
1903
|
+
errorLog(
|
|
1904
|
+
" Please fix your code so that the created node is inserted in the correct namespace," +
|
|
1905
|
+
" please refer to the NodeOPCUA documentation"
|
|
1906
|
+
);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
options.browseName = new QualifiedName({ name: options.browseName, namespaceIndex: this.index });
|
|
1911
|
+
} else if (!(options.browseName instanceof QualifiedName)) {
|
|
1912
|
+
options.browseName = new QualifiedName(options.browseName);
|
|
1913
|
+
}
|
|
1914
|
+
assert(options.browseName instanceof QualifiedName, "Expecting options.browseName to be instanceof QualifiedName ");
|
|
1915
|
+
|
|
1916
|
+
// ------------- set display name
|
|
1917
|
+
if (!options.displayName) {
|
|
1918
|
+
assert(typeof options.browseName.name === "string");
|
|
1919
|
+
options.displayName = coerceLocalizedText(options.browseName.name || "");
|
|
1920
|
+
}
|
|
1921
|
+
if (!options.nodeClass || options.nodeClass === undefined) {
|
|
1922
|
+
throw new Error("nodeclass must be specified");
|
|
1923
|
+
}
|
|
1924
|
+
// --- nodeId adjustment
|
|
1925
|
+
options.nodeId = this.constructNodeId(options as ConstructNodeIdOptions);
|
|
1926
|
+
dumpIf(!options.nodeId, options); // missing node Id
|
|
1927
|
+
assert(options.nodeId instanceof NodeId);
|
|
1928
|
+
|
|
1929
|
+
// assert(options.browseName.namespaceIndex === this.index,"Expecting browseName to have
|
|
1930
|
+
// the same namespaceIndex as the namespace");
|
|
1931
|
+
|
|
1932
|
+
const Constructor = _constructors_map[NodeClass[options.nodeClass] as keyof typeof _constructors_map];
|
|
1933
|
+
|
|
1934
|
+
if (!Constructor) {
|
|
1935
|
+
throw new Error(` missing constructor for NodeClass ${NodeClass[options.nodeClass]}`);
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
options.addressSpace = this.addressSpace as AddressSpacePrivate;
|
|
1939
|
+
|
|
1940
|
+
const node = new Constructor(options);
|
|
1941
|
+
this._register(node);
|
|
1942
|
+
|
|
1943
|
+
// object shall now be registered
|
|
1944
|
+
// c8 ignore next
|
|
1945
|
+
if (doDebug) {
|
|
1946
|
+
assert(this.findNode(node.nodeId) !== null && typeof this.findNode(node.nodeId) === "object");
|
|
1947
|
+
}
|
|
1948
|
+
return node;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
public _deleteNode(node: BaseNode): void {
|
|
1952
|
+
assert(node instanceof BaseNodeImpl);
|
|
1953
|
+
|
|
1954
|
+
const hashKey = _makeHashKey(node.nodeId);
|
|
1955
|
+
// c8 ignore next
|
|
1956
|
+
if (!this._nodeid_index.has(hashKey)) {
|
|
1957
|
+
throw new Error(`deleteNode : nodeId ${node.nodeId.displayText()} is not registered ${node.nodeId.toString()}`);
|
|
1958
|
+
}
|
|
1959
|
+
switch (node.nodeClass) {
|
|
1960
|
+
case NodeClass.ObjectType:
|
|
1961
|
+
this._unregisterObjectType(node as UAObjectType);
|
|
1962
|
+
break;
|
|
1963
|
+
case NodeClass.VariableType:
|
|
1964
|
+
this._unregisterVariableType(node as UAVariableType);
|
|
1965
|
+
break;
|
|
1966
|
+
case NodeClass.Object:
|
|
1967
|
+
case NodeClass.Variable:
|
|
1968
|
+
case NodeClass.Method:
|
|
1969
|
+
case NodeClass.View:
|
|
1970
|
+
break;
|
|
1971
|
+
default:
|
|
1972
|
+
warningLog("Invalid class Name", node.nodeClass);
|
|
1973
|
+
throw new Error("Invalid class name specified");
|
|
1974
|
+
}
|
|
1975
|
+
const deleted = this._nodeid_index.delete(hashKey);
|
|
1976
|
+
assert(deleted);
|
|
1977
|
+
(<BaseNodeImpl>node).dispose();
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
// --- Private stuff
|
|
1981
|
+
|
|
1982
|
+
private _addObjectOrVariableType<_T>(
|
|
1983
|
+
options1: AddBaseNodeOptions,
|
|
1984
|
+
topMostBaseType: string,
|
|
1985
|
+
nodeClass: NodeClass.ObjectType | NodeClass.VariableType
|
|
1986
|
+
) {
|
|
1987
|
+
const addressSpace = this.addressSpace;
|
|
1988
|
+
|
|
1989
|
+
assert(typeof topMostBaseType === "string");
|
|
1990
|
+
assert(nodeClass === NodeClass.ObjectType || nodeClass === NodeClass.VariableType);
|
|
1991
|
+
|
|
1992
|
+
const options = options1 as CreateNodeOptions;
|
|
1993
|
+
assert(!options.nodeClass);
|
|
1994
|
+
assert(options.browseName);
|
|
1995
|
+
assert(typeof options.browseName === "string");
|
|
1996
|
+
if (Object.hasOwn(options, "references")) {
|
|
1997
|
+
throw new Error("options.references should not be provided, use options.subtypeOf instead");
|
|
1998
|
+
}
|
|
1999
|
+
const references: UAReference[] = [];
|
|
2000
|
+
|
|
2001
|
+
function process_subtypeOf_options(this: NamespaceImpl, options2: CreateNodeOptions, references1: AddReferenceOpts[]) {
|
|
2002
|
+
// check common misspelling mistake
|
|
2003
|
+
assert(
|
|
2004
|
+
!(options2 as unknown as Record<string, unknown>).subTypeOf,
|
|
2005
|
+
"misspell error : it should be 'subtypeOf' instead"
|
|
2006
|
+
);
|
|
2007
|
+
if (Object.hasOwn(options2, "hasTypeDefinition")) {
|
|
2008
|
+
throw new Error("hasTypeDefinition option is invalid. Do you mean typeDefinition instead ?");
|
|
2009
|
+
}
|
|
2010
|
+
assert(!options2.typeDefinition, " do you mean subtypeOf ?");
|
|
2011
|
+
|
|
2012
|
+
// subtypeOf is optional: _coerceType defaults to topMostBaseType when it's falsy.
|
|
2013
|
+
const subtypeOfNodeId = addressSpace._coerceType(
|
|
2014
|
+
options2.subtypeOf as unknown as string | NodeId | BaseNode,
|
|
2015
|
+
topMostBaseType,
|
|
2016
|
+
nodeClass
|
|
2017
|
+
);
|
|
2018
|
+
|
|
2019
|
+
assert(subtypeOfNodeId);
|
|
2020
|
+
references1.push({
|
|
2021
|
+
isForward: false,
|
|
2022
|
+
nodeId: subtypeOfNodeId,
|
|
2023
|
+
referenceType: "HasSubtype"
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
process_subtypeOf_options.call(this, options, references);
|
|
2028
|
+
|
|
2029
|
+
const objectType = this.internalCreateNode({
|
|
2030
|
+
browseName: options.browseName,
|
|
2031
|
+
displayName: options.displayName,
|
|
2032
|
+
description: options.description,
|
|
2033
|
+
eventNotifier: +(options.eventNotifier || 0),
|
|
2034
|
+
isAbstract: !!options.isAbstract,
|
|
2035
|
+
nodeClass,
|
|
2036
|
+
nodeId: options.nodeId,
|
|
2037
|
+
references
|
|
2038
|
+
});
|
|
2039
|
+
|
|
2040
|
+
objectType.propagate_back_references();
|
|
2041
|
+
|
|
2042
|
+
objectType.install_extra_properties();
|
|
2043
|
+
|
|
2044
|
+
if (options.postInstantiateFunc) {
|
|
2045
|
+
(<BaseNodeImpl>objectType).installPostInstallFunc(options.postInstantiateFunc);
|
|
2046
|
+
}
|
|
2047
|
+
return objectType;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
// private _adjust_options(options: any) {
|
|
2051
|
+
// const ns = this.addressSpace.getNamespaceIndex(this.namespaceUri);
|
|
2052
|
+
// if (!options.nodeId) {
|
|
2053
|
+
// const id = this._getNextAvailableId();
|
|
2054
|
+
// options.nodeId = new NodeId(NodeId.NodeIdType.NUMERIC, id, ns);
|
|
2055
|
+
// }
|
|
2056
|
+
// options.nodeId = NodeId.coerce(options.nodeId);
|
|
2057
|
+
// if (typeof options.browseName === "string") {
|
|
2058
|
+
// options.browseName = new QualifiedName({
|
|
2059
|
+
// name: options.browseName,
|
|
2060
|
+
// namespaceIndex: ns
|
|
2061
|
+
// });
|
|
2062
|
+
// }
|
|
2063
|
+
// return options;
|
|
2064
|
+
// }
|
|
2065
|
+
|
|
2066
|
+
private _registerObjectType(node: UAObjectType) {
|
|
2067
|
+
assert(this.index === node.nodeId.namespace);
|
|
2068
|
+
const key = node.browseName.name || "";
|
|
2069
|
+
if (this._objectTypeMap.has(key)) {
|
|
2070
|
+
throw new Error(` UAObjectType already declared ${node.browseName.toString()} ${node.nodeId.toString()}`);
|
|
2071
|
+
}
|
|
2072
|
+
this._objectTypeMap.set(key, node);
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
private _registerVariableType(node: UAVariableType) {
|
|
2076
|
+
assert(this.index === node.nodeId.namespace);
|
|
2077
|
+
const key = node.browseName.name || "";
|
|
2078
|
+
assert(!this._variableTypeMap.has(key), " UAVariableType already declared");
|
|
2079
|
+
this._variableTypeMap.set(key, node);
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
private _registerReferenceType(node: UAReferenceType) {
|
|
2083
|
+
assert(this.index === node.nodeId.namespace);
|
|
2084
|
+
assert(node.browseName instanceof QualifiedName);
|
|
2085
|
+
const key: string = node.browseName.name || "";
|
|
2086
|
+
this._referenceTypeMap.set(key, node);
|
|
2087
|
+
this._referenceTypeMapInv.set(node.inverseName.text || "", node);
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
private _registerDataType(node: UADataType) {
|
|
2091
|
+
assert(this.index === node.nodeId.namespace);
|
|
2092
|
+
const key = node.browseName.name || "";
|
|
2093
|
+
assert(node.browseName instanceof QualifiedName);
|
|
2094
|
+
assert(!this._dataTypeMap.has(key), " DataType already declared");
|
|
2095
|
+
this._dataTypeMap.set(key, node);
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
private _unregisterObjectType(node: UAObjectType): void {
|
|
2099
|
+
const key = node.browseName.name || "";
|
|
2100
|
+
this._objectTypeMap.delete(key);
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
private _unregisterVariableType(node: UAVariableType): void {
|
|
2104
|
+
const key = node.browseName.name || "";
|
|
2105
|
+
this._variableTypeMap.delete(key);
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* @private
|
|
2110
|
+
*/
|
|
2111
|
+
private _addVariable(options: AddVariableOptions2): UAVariable {
|
|
2112
|
+
const addressSpace = this.addressSpace;
|
|
2113
|
+
|
|
2114
|
+
const baseDataVariableType = addressSpace.findVariableType("BaseDataVariableType");
|
|
2115
|
+
if (!baseDataVariableType) {
|
|
2116
|
+
throw new Error("cannot find BaseDataVariableType");
|
|
2117
|
+
}
|
|
2118
|
+
const baseDataVariableTypeId = baseDataVariableType.nodeId;
|
|
2119
|
+
|
|
2120
|
+
assert(Object.hasOwn(options, "browseName"), "options.browseName must be provided");
|
|
2121
|
+
assert(Object.hasOwn(options, "dataType"), "options.dataType must be provided");
|
|
2122
|
+
|
|
2123
|
+
options.historizing = !!options.historizing;
|
|
2124
|
+
|
|
2125
|
+
// c8 ignore next
|
|
2126
|
+
if (Object.hasOwn(options, "hasTypeDefinition")) {
|
|
2127
|
+
throw new Error("hasTypeDefinition option is invalid. Do you mean typeDefinition instead ?");
|
|
2128
|
+
}
|
|
2129
|
+
// ------------------------------------------ TypeDefinition
|
|
2130
|
+
let typeDefinition = options.typeDefinition || baseDataVariableTypeId;
|
|
2131
|
+
if (typeDefinition instanceof BaseNodeImpl) {
|
|
2132
|
+
// c8 ignore next
|
|
2133
|
+
if (typeDefinition.nodeClass !== NodeClass.VariableType) {
|
|
2134
|
+
const message = `invalid typeDefinition expecting a VariableType got ${NodeClass[typeDefinition.nodeClass]}`;
|
|
2135
|
+
errorLog(message);
|
|
2136
|
+
throw new Error(message);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
typeDefinition = addressSpace._coerce_VariableTypeIds(typeDefinition);
|
|
2140
|
+
assert(typeDefinition instanceof NodeId);
|
|
2141
|
+
|
|
2142
|
+
// ------------------------------------------ DataType
|
|
2143
|
+
options.dataType = addressSpace._coerce_DataType(options.dataType || DataType.Null);
|
|
2144
|
+
|
|
2145
|
+
options.valueRank = isNullOrUndefined(options.valueRank)
|
|
2146
|
+
? options.arrayDimensions
|
|
2147
|
+
? options.arrayDimensions.length
|
|
2148
|
+
: -1
|
|
2149
|
+
: options.valueRank;
|
|
2150
|
+
assert(typeof options.valueRank === "number" && Number.isFinite(options.valueRank));
|
|
2151
|
+
|
|
2152
|
+
options.arrayDimensions = options.arrayDimensions || null;
|
|
2153
|
+
assert(options.arrayDimensions === null || Array.isArray(options.arrayDimensions));
|
|
2154
|
+
|
|
2155
|
+
// -----------------------------------------------------
|
|
2156
|
+
const hasGetter = (options: AddVariableOptions2) => {
|
|
2157
|
+
return typeof options.value?.get === "function" || typeof options.value?.timestamped_get === "function";
|
|
2158
|
+
};
|
|
2159
|
+
|
|
2160
|
+
// c8 ignore next
|
|
2161
|
+
if (options.minimumSamplingInterval === undefined && hasGetter(options)) {
|
|
2162
|
+
// a getter has been specified and no options.minimumSamplingInterval has been specified
|
|
2163
|
+
warningLog(
|
|
2164
|
+
"[NODE-OPCUA-W30",
|
|
2165
|
+
"namespace#addVariable a getter has been specified and minimumSamplingInterval is missing.\nMinimumSamplingInterval has been adjusted to 1000 ms\nvariable = " +
|
|
2166
|
+
options?.browseName?.toString()
|
|
2167
|
+
);
|
|
2168
|
+
options.minimumSamplingInterval = 1000;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
options.minimumSamplingInterval = options.minimumSamplingInterval !== undefined ? +options.minimumSamplingInterval : 0;
|
|
2172
|
+
|
|
2173
|
+
// c8 ignore next
|
|
2174
|
+
if (options.minimumSamplingInterval === 0 && hasGetter(options)) {
|
|
2175
|
+
warningLog(
|
|
2176
|
+
"[NODE-OPCUA-W31",
|
|
2177
|
+
"namespace#addVariable a getter has been specified and minimumSamplingInterval is 0.\nThis may conduct to an unpredictable behavior.\nPlease specify a non zero minimum sampling interval"
|
|
2178
|
+
);
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
let references = options.references || ([] as AddReferenceOpts[]);
|
|
2182
|
+
|
|
2183
|
+
references = ([] as AddReferenceOpts[]).concat(references, [
|
|
2184
|
+
{
|
|
2185
|
+
isForward: true,
|
|
2186
|
+
nodeId: typeDefinition,
|
|
2187
|
+
referenceType: "HasTypeDefinition"
|
|
2188
|
+
}
|
|
2189
|
+
]);
|
|
2190
|
+
|
|
2191
|
+
assert(!options.nodeClass || options.nodeClass === NodeClass.Variable);
|
|
2192
|
+
options.nodeClass = NodeClass.Variable;
|
|
2193
|
+
|
|
2194
|
+
options.references = references;
|
|
2195
|
+
|
|
2196
|
+
const variable = this.createNode(options as CreateNodeOptions) as UAVariable;
|
|
2197
|
+
return variable;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
/**
|
|
2201
|
+
* @private
|
|
2202
|
+
*/
|
|
2203
|
+
private _addMethod(options: AddMethodOptions & { eventNotifier?: number }): UAMethod {
|
|
2204
|
+
const addressSpace = this.addressSpace;
|
|
2205
|
+
|
|
2206
|
+
assert(isNonEmptyQualifiedName(options.browseName));
|
|
2207
|
+
|
|
2208
|
+
const references: UAReference[] = [];
|
|
2209
|
+
assert(isNonEmptyQualifiedName(options.browseName));
|
|
2210
|
+
|
|
2211
|
+
_handle_hierarchy_parent(addressSpace, references, options);
|
|
2212
|
+
|
|
2213
|
+
UANamespace_process_modelling_rule(references, options.modellingRule);
|
|
2214
|
+
|
|
2215
|
+
const method = this.internalCreateNode({
|
|
2216
|
+
browseName: options.browseName,
|
|
2217
|
+
description: options.description || "",
|
|
2218
|
+
displayName: options.displayName,
|
|
2219
|
+
eventNotifier: +(options.eventNotifier || 0),
|
|
2220
|
+
isAbstract: false,
|
|
2221
|
+
nodeClass: NodeClass.Method,
|
|
2222
|
+
nodeId: options.nodeId,
|
|
2223
|
+
references,
|
|
2224
|
+
rolePermissions: options.rolePermissions
|
|
2225
|
+
}) as UAMethod;
|
|
2226
|
+
assert(method.nodeId !== null);
|
|
2227
|
+
method.propagate_back_references();
|
|
2228
|
+
assert(!method.typeDefinition);
|
|
2229
|
+
|
|
2230
|
+
return method;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
// each concrete constructor below takes a different, incompatible options type (UADataTypeOptions,
|
|
2235
|
+
// UAVariableOptions, ...) — the map is only ever indexed by nodeClass and invoked with the matching
|
|
2236
|
+
// options shape by the caller, so a wider `new (options: any) => ...` signature is required here.
|
|
2237
|
+
// biome-ignore lint/suspicious/noExplicitAny: see comment above
|
|
2238
|
+
const _constructors_map: Record<keyof Omit<typeof NodeClass, "Unspecified">, new (options: any) => BaseNodeImpl<BaseNodeEvents>> = {
|
|
2239
|
+
DataType: UADataTypeImpl,
|
|
2240
|
+
Method: UAMethodImpl,
|
|
2241
|
+
Object: UAObjectImpl,
|
|
2242
|
+
ObjectType: UAObjectTypeImpl,
|
|
2243
|
+
ReferenceType: UAReferenceTypeImpl,
|
|
2244
|
+
Variable: UAVariableImpl,
|
|
2245
|
+
VariableType: UAVariableTypeImpl,
|
|
2246
|
+
View: UAViewImpl
|
|
2247
|
+
};
|
|
2248
|
+
|
|
2249
|
+
function _handle_event_hierarchy_parent(
|
|
2250
|
+
addressSpace: AddressSpacePrivate,
|
|
2251
|
+
references: AddReferenceOpts[],
|
|
2252
|
+
options: CreateNodeOptions
|
|
2253
|
+
) {
|
|
2254
|
+
options.eventSourceOf = _coerce_parent(addressSpace, options.eventSourceOf, addressSpace._coerceNode);
|
|
2255
|
+
options.notifierOf = _coerce_parent(addressSpace, options.notifierOf, addressSpace._coerceNode);
|
|
2256
|
+
if (options.eventSourceOf) {
|
|
2257
|
+
assert(!options.notifierOf, "notifierOf shall not be provided with eventSourceOf ");
|
|
2258
|
+
references.push({
|
|
2259
|
+
isForward: false,
|
|
2260
|
+
nodeId: options.eventSourceOf.nodeId,
|
|
2261
|
+
referenceType: "HasEventSource"
|
|
2262
|
+
});
|
|
2263
|
+
|
|
2264
|
+
options.eventNotifier = options.eventNotifier || 1;
|
|
2265
|
+
} else if (options.notifierOf) {
|
|
2266
|
+
assert(!options.eventSourceOf, "eventSourceOf shall not be provided with notifierOf ");
|
|
2267
|
+
references.push({
|
|
2268
|
+
isForward: false,
|
|
2269
|
+
nodeId: options.notifierOf.nodeId,
|
|
2270
|
+
referenceType: "HasNotifier"
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
function _copy_reference(reference: UAReference | AddReferenceOpts): AddReferenceOpts {
|
|
2275
|
+
assert(Object.hasOwn(reference, "referenceType"));
|
|
2276
|
+
assert(Object.hasOwn(reference, "isForward"));
|
|
2277
|
+
assert(Object.hasOwn(reference, "nodeId"));
|
|
2278
|
+
assert(reference.nodeId instanceof NodeId);
|
|
2279
|
+
return {
|
|
2280
|
+
isForward: reference.isForward,
|
|
2281
|
+
nodeId: reference.nodeId,
|
|
2282
|
+
referenceType: reference.referenceType
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
function _copy_references(references?: UAReference[] | AddReferenceOpts[] | null): AddReferenceOpts[] {
|
|
2287
|
+
references = references || [];
|
|
2288
|
+
return references.map(_copy_reference);
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
export function isNonEmptyQualifiedName(browseName: QualifiedNameLike): boolean {
|
|
2292
|
+
if (!browseName) {
|
|
2293
|
+
return false;
|
|
2294
|
+
}
|
|
2295
|
+
if (typeof browseName === "string") {
|
|
2296
|
+
return browseName.length >= 0;
|
|
2297
|
+
}
|
|
2298
|
+
if (!(browseName instanceof QualifiedName)) {
|
|
2299
|
+
browseName = new QualifiedName(browseName);
|
|
2300
|
+
}
|
|
2301
|
+
assert(browseName instanceof QualifiedName);
|
|
2302
|
+
return (browseName.name?.length || 0) > 0;
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
function _create_node_version_if_needed(node: BaseNode, options: { nodeVersion?: string }) {
|
|
2306
|
+
assert(options);
|
|
2307
|
+
if (typeof options.nodeVersion === "string") {
|
|
2308
|
+
assert(node.nodeClass === NodeClass.Variable || node.nodeClass === NodeClass.Object);
|
|
2309
|
+
// c8 ignore next
|
|
2310
|
+
if (node.getNodeVersion()) {
|
|
2311
|
+
return; // already exists
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
const namespace = node.namespace;
|
|
2315
|
+
const nodeVersion = namespace.addVariable({
|
|
2316
|
+
browseName: coerceQualifiedName({ name: "NodeVersion", namespaceIndex: 0 }),
|
|
2317
|
+
dataType: DataType.String,
|
|
2318
|
+
propertyOf: node
|
|
2319
|
+
});
|
|
2320
|
+
const initialValue = typeof options.nodeVersion === "string" ? options.nodeVersion : "0";
|
|
2321
|
+
nodeVersion.setValueFromSource({ dataType: "String", value: initialValue });
|
|
2322
|
+
}
|
|
2323
|
+
}
|