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
|
@@ -1,1940 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UAVariableImplT = exports.UAVariableImpl = void 0;
|
|
7
|
-
exports.adjust_accessLevel = adjust_accessLevel;
|
|
8
|
-
exports.adjust_userAccessLevel = adjust_userAccessLevel;
|
|
9
|
-
/**
|
|
10
|
-
* @module node-opcua-address-space
|
|
11
|
-
*/
|
|
12
|
-
const node_util_1 = require("node:util");
|
|
13
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
14
|
-
const node_opcua_address_space_base_1 = require("node-opcua-address-space-base");
|
|
15
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
16
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
17
|
-
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
18
|
-
const node_opcua_date_time_1 = require("node-opcua-date-time");
|
|
19
|
-
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
20
|
-
const node_opcua_extension_object_1 = require("node-opcua-extension-object");
|
|
21
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
22
|
-
const node_opcua_numeric_range_1 = require("node-opcua-numeric-range");
|
|
23
|
-
const node_opcua_service_write_1 = require("node-opcua-service-write");
|
|
24
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
25
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
26
|
-
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
27
|
-
const multiform_func_1 = require("../source/helpers/multiform_func");
|
|
28
|
-
const session_context_1 = require("../source/session_context");
|
|
29
|
-
const apply_condition_refresh_1 = require("./apply_condition_refresh");
|
|
30
|
-
const base_node_impl_1 = require("./base_node_impl");
|
|
31
|
-
const base_node_private_1 = require("./base_node_private");
|
|
32
|
-
const adjust_datavalue_status_code_1 = require("./data_access/adjust_datavalue_status_code");
|
|
33
|
-
const get_basic_datatype_1 = require("./get_basic_datatype");
|
|
34
|
-
const ua_data_type_impl_1 = require("./ua_data_type_impl");
|
|
35
|
-
const ua_variable_impl_ext_obj_1 = require("./ua_variable_impl_ext_obj");
|
|
36
|
-
const validate_data_type_correctness_1 = require("./validate_data_type_correctness");
|
|
37
|
-
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
38
|
-
const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
|
|
39
|
-
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
|
|
40
|
-
const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
|
|
41
|
-
const plainChalk = new Proxy(chalk_1.default, { get: () => (s) => s });
|
|
42
|
-
function adjust_accessLevel(accessLevel) {
|
|
43
|
-
const flag = (0, node_opcua_data_model_1.makeAccessLevelFlag)(accessLevel ?? "CurrentRead | CurrentWrite");
|
|
44
|
-
(0, node_opcua_assert_1.assert)(Number.isFinite(flag));
|
|
45
|
-
return flag;
|
|
46
|
-
}
|
|
47
|
-
function adjust_userAccessLevel(userAccessLevel, accessLevel) {
|
|
48
|
-
if (userAccessLevel === undefined) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
userAccessLevel = adjust_accessLevel(userAccessLevel);
|
|
52
|
-
accessLevel = adjust_accessLevel(accessLevel);
|
|
53
|
-
return (0, node_opcua_data_model_1.makeAccessLevelFlag)(accessLevel & userAccessLevel);
|
|
54
|
-
}
|
|
55
|
-
function adjust_samplingInterval(minimumSamplingInterval) {
|
|
56
|
-
(0, node_opcua_assert_1.assert)(Number.isFinite(minimumSamplingInterval));
|
|
57
|
-
if (minimumSamplingInterval < 0) {
|
|
58
|
-
return -1; // only -1 is a valid negative value for samplingInterval and means "unspecified"
|
|
59
|
-
}
|
|
60
|
-
return minimumSamplingInterval;
|
|
61
|
-
}
|
|
62
|
-
function is_Variant(v) {
|
|
63
|
-
return v instanceof node_opcua_variant_1.Variant;
|
|
64
|
-
}
|
|
65
|
-
function is_StatusCode(v) {
|
|
66
|
-
return !!(v?.constructor &&
|
|
67
|
-
(v instanceof node_opcua_status_code_1.StatusCode ||
|
|
68
|
-
v.constructor.name === "ConstantStatusCode" ||
|
|
69
|
-
v.constructor.name === "StatusCode" ||
|
|
70
|
-
v.constructor.name === "ModifiableStatusCode"));
|
|
71
|
-
}
|
|
72
|
-
function is_Variant_or_StatusCode(v) {
|
|
73
|
-
if (is_Variant(v)) {
|
|
74
|
-
// /@@assert(v.isValid());
|
|
75
|
-
}
|
|
76
|
-
return is_Variant(v) || is_StatusCode(v);
|
|
77
|
-
}
|
|
78
|
-
function default_func(dataValue1, callback1) {
|
|
79
|
-
return _default_writable_timestamped_set_func.call(this, dataValue1, callback1);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A OPCUA Variable Node
|
|
83
|
-
*
|
|
84
|
-
* @class UAVariable
|
|
85
|
-
* @constructor
|
|
86
|
-
* @extends BaseNode
|
|
87
|
-
* The AccessLevel Attribute is used to indicate how the Value of a Variable can be accessed (read/write) and if it
|
|
88
|
-
* contains current and/or historic data. The AccessLevel does not take any user access rights into account,
|
|
89
|
-
* i.e. although the Variable is writable this may be restricted to a certain user / user group.
|
|
90
|
-
* The AccessLevel is an 8-bit unsigned integer with the structure defined in the following table:
|
|
91
|
-
*
|
|
92
|
-
* Field Bit Description
|
|
93
|
-
* CurrentRead 0 Indicates if the current value is readable
|
|
94
|
-
* (0 means not readable, 1 means readable).
|
|
95
|
-
* CurrentWrite 1 Indicates if the current value is writable
|
|
96
|
-
* (0 means not writable, 1 means writable).
|
|
97
|
-
* HistoryRead 2 Indicates if the history of the value is readable
|
|
98
|
-
* (0 means not readable, 1 means readable).
|
|
99
|
-
* HistoryWrite 3 Indicates if the history of the value is writable (0 means not writable, 1 means writable).
|
|
100
|
-
* SemanticChange 4 Indicates if the Variable used as Property generates SemanticChangeEvents (see 9.31).
|
|
101
|
-
* Reserved 5:7 Reserved for future use. Shall always be zero.
|
|
102
|
-
*
|
|
103
|
-
* The first two bits also indicate if a current value of this Variable is available and the second two bits
|
|
104
|
-
* indicates if the history of the Variable is available via the OPC UA server.
|
|
105
|
-
*
|
|
106
|
-
*/
|
|
107
|
-
class UAVariableImpl extends base_node_impl_1.BaseNodeImpl {
|
|
108
|
-
// -------------- UAvaraibleImplExArray
|
|
109
|
-
$$variableType;
|
|
110
|
-
$$dataType = undefined;
|
|
111
|
-
$$getElementBrowseName;
|
|
112
|
-
$$extensionObjectArray;
|
|
113
|
-
$$indexPropertyName;
|
|
114
|
-
// --------------
|
|
115
|
-
nodeClass = node_opcua_data_model_1.NodeClass.Variable;
|
|
116
|
-
dataType;
|
|
117
|
-
_basicDataType;
|
|
118
|
-
// narrowing this to ExtensionObject breaks declaration-merging in ua_two_state_variable.ts and elsewhere
|
|
119
|
-
// (concrete *T variants bind $extensionObject to a different, more specific shape) — see the matching
|
|
120
|
-
// comment on UAVariable.$extensionObject in node-opcua-address-space-base for the documented precedent.
|
|
121
|
-
// biome-ignore lint/suspicious/noExplicitAny: see comment above
|
|
122
|
-
$extensionObject;
|
|
123
|
-
$set_ExtensionObject;
|
|
124
|
-
$historicalDataConfiguration;
|
|
125
|
-
varHistorian;
|
|
126
|
-
/**
|
|
127
|
-
* @internal @private
|
|
128
|
-
*/
|
|
129
|
-
$dataValue;
|
|
130
|
-
accessLevel;
|
|
131
|
-
userAccessLevel;
|
|
132
|
-
valueRank;
|
|
133
|
-
minimumSamplingInterval;
|
|
134
|
-
historizing;
|
|
135
|
-
semantic_version;
|
|
136
|
-
arrayDimensions;
|
|
137
|
-
_timestamped_get_func;
|
|
138
|
-
_timestamped_set_func;
|
|
139
|
-
_get_func;
|
|
140
|
-
_set_func;
|
|
141
|
-
refreshFunc;
|
|
142
|
-
__waiting_callbacks;
|
|
143
|
-
get typeDefinitionObj() {
|
|
144
|
-
// c8 ignore next
|
|
145
|
-
if (super.typeDefinitionObj && super.typeDefinitionObj.nodeClass !== node_opcua_data_model_1.NodeClass.VariableType) {
|
|
146
|
-
// this could happen in faulty external nodeset and has been seen once
|
|
147
|
-
// in an nano server
|
|
148
|
-
warningLog(super.typeDefinitionObj.toString());
|
|
149
|
-
const baseVariableType = this.addressSpace.findVariableType("BaseVariableType");
|
|
150
|
-
if (!baseVariableType)
|
|
151
|
-
throw new Error("Cannot find BaseVariableType in address space");
|
|
152
|
-
return baseVariableType;
|
|
153
|
-
}
|
|
154
|
-
return super.typeDefinitionObj;
|
|
155
|
-
}
|
|
156
|
-
get typeDefinition() {
|
|
157
|
-
return super.typeDefinition;
|
|
158
|
-
}
|
|
159
|
-
constructor(options) {
|
|
160
|
-
super(options);
|
|
161
|
-
(0, node_opcua_variant_1.verifyRankAndDimensions)(options);
|
|
162
|
-
this.valueRank = options.valueRank ?? -1;
|
|
163
|
-
this.arrayDimensions = options.arrayDimensions ?? null;
|
|
164
|
-
this.dataType = this.resolveNodeId(options.dataType); // DataType (NodeId)
|
|
165
|
-
this.accessLevel = adjust_accessLevel(options.accessLevel);
|
|
166
|
-
this.userAccessLevel = adjust_userAccessLevel(options.userAccessLevel, this.accessLevel);
|
|
167
|
-
this.minimumSamplingInterval = adjust_samplingInterval(options.minimumSamplingInterval || 0);
|
|
168
|
-
this.historizing = !!options.historizing; // coerced to boolean"
|
|
169
|
-
this.$dataValue = new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.UncertainInitialValue, value: { dataType: node_opcua_variant_1.DataType.Null } });
|
|
170
|
-
if (options.value) {
|
|
171
|
-
this.bindVariable(options.value);
|
|
172
|
-
}
|
|
173
|
-
this.setMaxListeners(5000);
|
|
174
|
-
this.semantic_version = 0;
|
|
175
|
-
}
|
|
176
|
-
checkAccessLevelPrivate(_context, accessLevel) {
|
|
177
|
-
if (this.userAccessLevel === undefined) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
return (this.userAccessLevel & accessLevel) === accessLevel;
|
|
181
|
-
}
|
|
182
|
-
checkPermissionPrivate(context, permission) {
|
|
183
|
-
if (!context)
|
|
184
|
-
return true;
|
|
185
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
186
|
-
if (context.checkPermission) {
|
|
187
|
-
if (!(context.checkPermission instanceof Function)) {
|
|
188
|
-
errorLog("context checkPermission is not a function");
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
if (!context.checkPermission(this, permission)) {
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
checkPermissionAndAccessLevelPrivate(context, permission, accessLevel) {
|
|
198
|
-
if (!this.checkPermissionPrivate(context, permission)) {
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
return this.checkAccessLevelPrivate(context, accessLevel);
|
|
202
|
-
}
|
|
203
|
-
isReadable(_context) {
|
|
204
|
-
return (this.accessLevel & node_opcua_data_model_1.AccessLevelFlag.CurrentRead) === node_opcua_data_model_1.AccessLevelFlag.CurrentRead;
|
|
205
|
-
}
|
|
206
|
-
isUserReadable(context) {
|
|
207
|
-
if (!this.isReadable(context)) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Read)) {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
return this.checkAccessLevelPrivate(context, node_opcua_data_model_1.AccessLevelFlag.CurrentRead);
|
|
214
|
-
}
|
|
215
|
-
isWritable(_context) {
|
|
216
|
-
return (this.accessLevel & node_opcua_data_model_1.AccessLevelFlag.CurrentWrite) === node_opcua_data_model_1.AccessLevelFlag.CurrentWrite;
|
|
217
|
-
}
|
|
218
|
-
isUserWritable(context) {
|
|
219
|
-
if (!this.isWritable(context)) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.CurrentWrite);
|
|
223
|
-
}
|
|
224
|
-
canUserReadHistory(context) {
|
|
225
|
-
return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.ReadHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryRead);
|
|
226
|
-
}
|
|
227
|
-
canUserWriteHistorizingAttribute(context) {
|
|
228
|
-
if (context && !context.checkPermission(this, node_opcua_types_1.PermissionType.WriteHistorizing)) {
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
return true;
|
|
232
|
-
}
|
|
233
|
-
canUserInsertHistory(context) {
|
|
234
|
-
return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.InsertHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite);
|
|
235
|
-
}
|
|
236
|
-
canUserModifyHistory(context) {
|
|
237
|
-
return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.ModifyHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite);
|
|
238
|
-
}
|
|
239
|
-
canUserDeleteHistory(context) {
|
|
240
|
-
return this.checkPermissionAndAccessLevelPrivate(context, node_opcua_types_1.PermissionType.DeleteHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite);
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* from OPC.UA.Spec 1.02 part 4
|
|
246
|
-
* 5.10.2.4 StatusCodes
|
|
247
|
-
* Table 51 defines values for the operation level statusCode contained in the DataValue structure of
|
|
248
|
-
* each values element. Common StatusCodes are defined in Table 166.
|
|
249
|
-
*
|
|
250
|
-
* Table 51 Read Operation Level Result Codes
|
|
251
|
-
*
|
|
252
|
-
* | Symbolic Id | Description
|
|
253
|
-
* |-----------------------------|---------------------------------------------------------------------------------------------|
|
|
254
|
-
* |BadNodeIdInvalid | The syntax of the node id is not valid.|
|
|
255
|
-
* |BadNodeIdUnknown |The node id refers to a node that does not exist in the server address space.|
|
|
256
|
-
* |BadAttributeIdInvalid | BadAttributeIdInvalid The attribute is not supported for the specified node.|
|
|
257
|
-
* |BadIndexRangeInvalid | The syntax of the index range parameter is invalid.|
|
|
258
|
-
* |BadIndexRangeNoData | No data exists within the range of indexes specified.|
|
|
259
|
-
* |BadDataEncodingInvalid | The data encoding is invalid.|
|
|
260
|
-
* | | This result is used if no dataEncoding can be applied because an Attribute other|
|
|
261
|
-
* | | than Value was requested or the DataType of the Value Attribute is not a subtype|
|
|
262
|
-
* | | of the Structure DataType.|
|
|
263
|
-
* |BadDataEncodingUnsupported | The server does not support the requested data encoding for the node. |
|
|
264
|
-
* | | This result is used if a dataEncoding can be applied but the passed data encoding |
|
|
265
|
-
* | | is not known to the Server. |
|
|
266
|
-
* |BadNotReadable | The access level does not allow reading or subscribing to the Node.|
|
|
267
|
-
* |BadUserAccessDenied | User does not have permission to perform the requested operation. (table 165)|
|
|
268
|
-
*/
|
|
269
|
-
readValue(context, indexRange, dataEncoding) {
|
|
270
|
-
if (!context) {
|
|
271
|
-
context = session_context_1.SessionContext.defaultContext;
|
|
272
|
-
}
|
|
273
|
-
if (context.isAccessRestricted(this)) {
|
|
274
|
-
return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadSecurityModeInsufficient });
|
|
275
|
-
}
|
|
276
|
-
if (!this.isReadable(context)) {
|
|
277
|
-
return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable });
|
|
278
|
-
}
|
|
279
|
-
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Read)) {
|
|
280
|
-
return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadUserAccessDenied });
|
|
281
|
-
}
|
|
282
|
-
if (!this.isUserReadable(context)) {
|
|
283
|
-
return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable });
|
|
284
|
-
}
|
|
285
|
-
if (!(0, node_opcua_data_model_1.isValidDataEncoding)(dataEncoding)) {
|
|
286
|
-
return new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadDataEncodingInvalid });
|
|
287
|
-
}
|
|
288
|
-
if (this._timestamped_get_func) {
|
|
289
|
-
if (this._timestamped_get_func.length === 0) {
|
|
290
|
-
const dataValueOrPromise = this._timestamped_get_func();
|
|
291
|
-
if (!Object.hasOwn(dataValueOrPromise.constructor.prototype, "then")) {
|
|
292
|
-
if (dataValueOrPromise !== this.$dataValue) {
|
|
293
|
-
// we may have a problem here if we use a getter that returns a dataValue that is a ExtensionObject
|
|
294
|
-
if (dataValueOrPromise.value?.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
295
|
-
if (this.$extensionObject || this.$$extensionObjectArray) {
|
|
296
|
-
// we have an extension object already bound to this node
|
|
297
|
-
// the client is asking us to replace the object entirely by a new one
|
|
298
|
-
// const ext = dataValue.value.value;
|
|
299
|
-
this._internal_set_dataValue(dataValueOrPromise);
|
|
300
|
-
return dataValueOrPromise;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
// TO DO : is this necessary ? this may interfere with current use of $dataValue
|
|
304
|
-
this.$dataValue = dataValueOrPromise;
|
|
305
|
-
if (this.$dataValue.statusCode.isGoodish()) {
|
|
306
|
-
this.verifyVariantCompatibility(this.$dataValue.value);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
errorLog("[NODE-OPCUA-E28] Unsupported: _timestamped_get_func returns a Promise ! , when the uaVariable has an async getter. Fix your application code.");
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
let dataValue = this.$dataValue;
|
|
316
|
-
if (dataValue.statusCode.isGoodish()) {
|
|
317
|
-
// note : extractRange will clone the dataValue
|
|
318
|
-
dataValue = (0, node_opcua_data_value_1.extractRange)(dataValue, indexRange);
|
|
319
|
-
}
|
|
320
|
-
/* c8 ignore next */
|
|
321
|
-
if (dataValue.statusCode.equals(node_opcua_status_code_1.StatusCodes.BadWaitingForInitialData) ||
|
|
322
|
-
dataValue.statusCode.equals(node_opcua_status_code_1.StatusCodes.UncertainInitialValue)) {
|
|
323
|
-
// c8 ignore next
|
|
324
|
-
doDebug &&
|
|
325
|
-
debugLog(chalk_1.default.red(" Warning: UAVariable#readValue ") +
|
|
326
|
-
chalk_1.default.cyan(this.browseName.toString()) +
|
|
327
|
-
" (" +
|
|
328
|
-
chalk_1.default.yellow(this.nodeId.toString()) +
|
|
329
|
-
") exists but dataValue has not been defined");
|
|
330
|
-
}
|
|
331
|
-
return dataValue;
|
|
332
|
-
}
|
|
333
|
-
isEnumeration() {
|
|
334
|
-
return this.addressSpacePrivate.isEnumeration(this.dataType);
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* return true if the DataType is of type Extension object
|
|
338
|
-
* this is not taking into account the valueRank of the variable
|
|
339
|
-
*/
|
|
340
|
-
isExtensionObject() {
|
|
341
|
-
// DataType must be one of Structure
|
|
342
|
-
if (this.dataType.isEmpty())
|
|
343
|
-
return false;
|
|
344
|
-
const dataTypeNode = this.addressSpace.findDataType(this.dataType);
|
|
345
|
-
if (!dataTypeNode) {
|
|
346
|
-
throw new Error(` Cannot find DataType ${this.dataType.toString()} in standard address Space`);
|
|
347
|
-
}
|
|
348
|
-
const structureNode = this.addressSpace.findDataType("Structure");
|
|
349
|
-
if (!structureNode) {
|
|
350
|
-
throw new Error(" Cannot find 'Structure' DataType in standard address Space");
|
|
351
|
-
}
|
|
352
|
-
return dataTypeNode.isSubtypeOf(structureNode);
|
|
353
|
-
}
|
|
354
|
-
_getEnumerationInfo() {
|
|
355
|
-
// DataType must be one of Enumeration
|
|
356
|
-
(0, node_opcua_assert_1.assert)(this.isEnumeration(), "Variable is not an enumeration");
|
|
357
|
-
const dataTypeNode = this.addressSpace.findDataType(this.dataType);
|
|
358
|
-
return dataTypeNode._getEnumerationInfo();
|
|
359
|
-
}
|
|
360
|
-
asyncRefresh(oldestDate, callback) {
|
|
361
|
-
// asyncRefresh is always invoked with a callback at runtime: the public overload without
|
|
362
|
-
// a callback is only reachable through the withCallback() wrapper installed below, which
|
|
363
|
-
// synthesizes one before calling into this implementation.
|
|
364
|
-
const cb = callback;
|
|
365
|
-
if (this.$dataValue.statusCode.isGoodish()) {
|
|
366
|
-
this.verifyVariantCompatibility(this.$dataValue.value);
|
|
367
|
-
}
|
|
368
|
-
const lessOrEqual = (a, b) => {
|
|
369
|
-
return (a.timestamp.getTime() < b.timestamp.getTime() ||
|
|
370
|
-
(a.timestamp.getTime() === b.timestamp.getTime() && a.picoseconds <= b.picoseconds));
|
|
371
|
-
};
|
|
372
|
-
if (!this.refreshFunc) {
|
|
373
|
-
// no refresh func
|
|
374
|
-
const dataValue = this.readValue();
|
|
375
|
-
dataValue.serverTimestamp = oldestDate.timestamp;
|
|
376
|
-
dataValue.serverPicoseconds = oldestDate.picoseconds;
|
|
377
|
-
const serverClock = (0, node_opcua_date_time_1.coerceClock)(dataValue.serverTimestamp, dataValue.serverPicoseconds);
|
|
378
|
-
if (lessOrEqual(oldestDate, serverClock)) {
|
|
379
|
-
cb(null, dataValue);
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
// fake
|
|
384
|
-
cb(null, dataValue);
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
const c1 = this.$dataValue.serverTimestamp
|
|
389
|
-
? (0, node_opcua_date_time_1.coerceClock)(this.$dataValue.serverTimestamp, this.$dataValue.serverPicoseconds)
|
|
390
|
-
: null;
|
|
391
|
-
if (c1 && lessOrEqual(oldestDate, c1)) {
|
|
392
|
-
const dataValue = this.readValue().clone();
|
|
393
|
-
dataValue.serverTimestamp = oldestDate.timestamp;
|
|
394
|
-
dataValue.serverPicoseconds = oldestDate.picoseconds;
|
|
395
|
-
cb(null, dataValue);
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
try {
|
|
399
|
-
this.refreshFunc.call(this, (err, dataValue) => {
|
|
400
|
-
// c8 ignore next
|
|
401
|
-
if (err || !dataValue) {
|
|
402
|
-
errorLog("-------------- refresh call failed", this.browseName.toString(), this.nodeId.toString(), err?.message);
|
|
403
|
-
dataValue = { statusCode: node_opcua_status_code_1.StatusCodes.BadNoDataAvailable };
|
|
404
|
-
}
|
|
405
|
-
if (dataValue && dataValue !== this.$dataValue) {
|
|
406
|
-
this._internal_set_dataValue(coerceDataValue(dataValue), null);
|
|
407
|
-
}
|
|
408
|
-
cb(err, this.$dataValue);
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
catch (err) {
|
|
412
|
-
errorLog("-------------- refresh call failed 2", this.browseName.toString(), this.nodeId.toString());
|
|
413
|
-
errorLog(err);
|
|
414
|
-
const dataValue = new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadInternalError });
|
|
415
|
-
this._internal_set_dataValue(dataValue, null);
|
|
416
|
-
cb(err, this.$dataValue);
|
|
417
|
-
}
|
|
418
|
-
return undefined;
|
|
419
|
-
}
|
|
420
|
-
readEnumValue() {
|
|
421
|
-
const value = this.readValue().value.value;
|
|
422
|
-
const enumInfo = this._getEnumerationInfo();
|
|
423
|
-
const enumV = enumInfo.valueIndex[value];
|
|
424
|
-
return { value, name: enumV ? enumV.name : "?????" };
|
|
425
|
-
}
|
|
426
|
-
writeEnumValue(value) {
|
|
427
|
-
const enumInfo = this._getEnumerationInfo();
|
|
428
|
-
if (typeof value === "string") {
|
|
429
|
-
if (!Object.hasOwn(enumInfo.nameIndex, value)) {
|
|
430
|
-
const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
|
|
431
|
-
throw new Error(`UAVariable#writeEnumValue: cannot find value ${value} in [${possibleValues}]`);
|
|
432
|
-
}
|
|
433
|
-
const valueIndex = enumInfo.nameIndex[value].value;
|
|
434
|
-
value = valueIndex;
|
|
435
|
-
}
|
|
436
|
-
if (Number.isFinite(value)) {
|
|
437
|
-
const possibleValues = Object.keys(enumInfo.nameIndex).join(",");
|
|
438
|
-
if (!enumInfo.valueIndex[value]) {
|
|
439
|
-
throw new Error(`UAVariable#writeEnumValue : value out of range ${value} in [${possibleValues}]`);
|
|
440
|
-
}
|
|
441
|
-
this.setValueFromSource({
|
|
442
|
-
dataType: node_opcua_variant_1.DataType.Int32,
|
|
443
|
-
value
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
throw new Error("UAVariable#writeEnumValue: value type mismatch");
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
readAttribute(context, attributeId, indexRange, dataEncoding) {
|
|
451
|
-
context = context || session_context_1.SessionContext.defaultContext;
|
|
452
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
453
|
-
const options = {};
|
|
454
|
-
if (attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
|
|
455
|
-
if (indexRange?.isDefined()) {
|
|
456
|
-
options.statusCode = node_opcua_status_code_1.StatusCodes.BadIndexRangeNoData;
|
|
457
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
458
|
-
}
|
|
459
|
-
if ((0, node_opcua_data_model_1.isDataEncoding)(dataEncoding)) {
|
|
460
|
-
options.statusCode = node_opcua_status_code_1.StatusCodes.BadDataEncodingInvalid;
|
|
461
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
switch (attributeId) {
|
|
465
|
-
case node_opcua_data_model_1.AttributeIds.Value:
|
|
466
|
-
return this.readValue(context, indexRange, dataEncoding);
|
|
467
|
-
case node_opcua_data_model_1.AttributeIds.DataType:
|
|
468
|
-
return this._readDataType();
|
|
469
|
-
case node_opcua_data_model_1.AttributeIds.ValueRank:
|
|
470
|
-
return this._readValueRank();
|
|
471
|
-
case node_opcua_data_model_1.AttributeIds.ArrayDimensions:
|
|
472
|
-
return this._readArrayDimensions();
|
|
473
|
-
case node_opcua_data_model_1.AttributeIds.AccessLevel:
|
|
474
|
-
return this._readAccessLevel(context);
|
|
475
|
-
case node_opcua_data_model_1.AttributeIds.UserAccessLevel:
|
|
476
|
-
return this._readUserAccessLevel(context);
|
|
477
|
-
case node_opcua_data_model_1.AttributeIds.MinimumSamplingInterval:
|
|
478
|
-
return this._readMinimumSamplingInterval();
|
|
479
|
-
case node_opcua_data_model_1.AttributeIds.Historizing:
|
|
480
|
-
return this._readHistorizing();
|
|
481
|
-
case node_opcua_data_model_1.AttributeIds.AccessLevelEx:
|
|
482
|
-
return this._readAccessLevelEx(context);
|
|
483
|
-
default:
|
|
484
|
-
return base_node_impl_1.BaseNodeImpl.prototype.readAttribute.call(this, context, attributeId);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
getBasicDataType() {
|
|
488
|
-
return (0, get_basic_datatype_1._getBasicDataType)(this);
|
|
489
|
-
}
|
|
490
|
-
adjustVariant(variant) {
|
|
491
|
-
return (0, node_opcua_variant_1.adjustVariant)(variant, this.valueRank, this.getBasicDataType());
|
|
492
|
-
}
|
|
493
|
-
verifyVariantCompatibility(variant) {
|
|
494
|
-
try {
|
|
495
|
-
// c8 ignore next
|
|
496
|
-
if (Object.hasOwn(variant, "value")) {
|
|
497
|
-
if (variant.dataType === null || variant.dataType === undefined) {
|
|
498
|
-
throw new Error("Variant must provide a valid dataType : variant = " +
|
|
499
|
-
variant.toString() +
|
|
500
|
-
" this.dataType= " +
|
|
501
|
-
this.dataType.toString());
|
|
502
|
-
}
|
|
503
|
-
if (variant.dataType === node_opcua_variant_1.DataType.Boolean &&
|
|
504
|
-
(this.dataType.namespace !== 0 || this.dataType.value !== node_opcua_variant_1.DataType.Boolean)) {
|
|
505
|
-
throw new Error("Variant must provide a valid Boolean : variant = " +
|
|
506
|
-
variant.toString() +
|
|
507
|
-
" this.dataType= " +
|
|
508
|
-
this.dataType.toString());
|
|
509
|
-
}
|
|
510
|
-
if (this.dataType.namespace === 0 &&
|
|
511
|
-
this.dataType.value === node_opcua_variant_1.DataType.LocalizedText &&
|
|
512
|
-
variant.dataType !== node_opcua_variant_1.DataType.LocalizedText &&
|
|
513
|
-
variant.dataType !== node_opcua_variant_1.DataType.Null) {
|
|
514
|
-
throw new Error("Variant must provide a valid LocalizedText : variant = " +
|
|
515
|
-
variant.toString() +
|
|
516
|
-
" this.dataType= " +
|
|
517
|
-
this.dataType.toString());
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
const basicType = this.getBasicDataType();
|
|
521
|
-
if (basicType === node_opcua_variant_1.DataType.String && variant.dataType === node_opcua_variant_1.DataType.ByteString) {
|
|
522
|
-
return; // this is allowed
|
|
523
|
-
}
|
|
524
|
-
if (basicType === node_opcua_variant_1.DataType.ByteString && variant.dataType === node_opcua_variant_1.DataType.String) {
|
|
525
|
-
return; // this is allowed
|
|
526
|
-
}
|
|
527
|
-
if (basicType !== node_opcua_variant_1.DataType.Null &&
|
|
528
|
-
basicType !== node_opcua_variant_1.DataType.Variant &&
|
|
529
|
-
variant.dataType !== node_opcua_variant_1.DataType.Null &&
|
|
530
|
-
variant.dataType !== basicType) {
|
|
531
|
-
const message = "UAVariable.setValueFromSource " +
|
|
532
|
-
this.browseName.toString() +
|
|
533
|
-
" nodeId:" +
|
|
534
|
-
this.nodeId.toString() +
|
|
535
|
-
" dataType:" +
|
|
536
|
-
this.dataType.toString() +
|
|
537
|
-
":\n" +
|
|
538
|
-
"the provided variant must have the expected dataType!\n" +
|
|
539
|
-
" - the expected dataType is " +
|
|
540
|
-
chalk_1.default.cyan(node_opcua_variant_1.DataType[basicType]) +
|
|
541
|
-
"\n" +
|
|
542
|
-
" - the actual dataType is " +
|
|
543
|
-
chalk_1.default.magenta(node_opcua_variant_1.DataType[variant.dataType]) +
|
|
544
|
-
"\n" +
|
|
545
|
-
" - " +
|
|
546
|
-
variant.toString();
|
|
547
|
-
throw new Error(message);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
catch (err) {
|
|
551
|
-
errorLog("UAVariable ", err?.message, this.browseName.toString(), " nodeId=", this.nodeId.toString());
|
|
552
|
-
errorLog(err.message);
|
|
553
|
-
errorLog(err.stack);
|
|
554
|
-
throw err;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* setValueFromSource is used to let the device sets the variable values
|
|
559
|
-
* this method also records the current time as sourceTimestamp and serverTimestamp.
|
|
560
|
-
. *
|
|
561
|
-
* The method will raise an exception if the value is not compatible with the dataType and expected dimension
|
|
562
|
-
*
|
|
563
|
-
|
|
564
|
-
* @param variant {Variant}
|
|
565
|
-
* @param [statusCode {StatusCode} = StatusCodes.Good]
|
|
566
|
-
* @param [sourceTimestamp= Now]
|
|
567
|
-
*/
|
|
568
|
-
setValueFromSource(variant, statusCode, sourceTimestamp) {
|
|
569
|
-
try {
|
|
570
|
-
statusCode = statusCode || node_opcua_status_code_1.StatusCodes.Good;
|
|
571
|
-
const variant1 = node_opcua_variant_1.Variant.coerce(variant);
|
|
572
|
-
this.verifyVariantCompatibility(variant1);
|
|
573
|
-
const now = (0, node_opcua_date_time_1.coerceClock)(sourceTimestamp, 0);
|
|
574
|
-
const dataValue = new node_opcua_data_value_1.DataValue(null);
|
|
575
|
-
dataValue.serverPicoseconds = now.picoseconds;
|
|
576
|
-
dataValue.serverTimestamp = now.timestamp;
|
|
577
|
-
dataValue.sourcePicoseconds = now.picoseconds;
|
|
578
|
-
dataValue.sourceTimestamp = now.timestamp;
|
|
579
|
-
dataValue.statusCode = statusCode;
|
|
580
|
-
dataValue.value = variant1;
|
|
581
|
-
if (dataValue.value.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
582
|
-
// early, detailed diagnostics on a malformed extension object (the actual throw
|
|
583
|
-
// happens below in _internal_set_dataValue).
|
|
584
|
-
const valueIsCorrect = this.checkExtensionObjectIsCorrect(dataValue.value.value);
|
|
585
|
-
if (!valueIsCorrect) {
|
|
586
|
-
errorLog("setValueFromSource Invalid value !");
|
|
587
|
-
errorLog(this.toString());
|
|
588
|
-
errorLog(dataValue.toString());
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
// Route every value - scalar or ExtensionObject - through _internal_set_dataValue.
|
|
592
|
-
// This guarantees the change is consistently propagated to observers (historian,
|
|
593
|
-
// monitored items) and, when the node is a bound extension object (or a bound
|
|
594
|
-
// sub-structure child), cascaded through the proxy field setters by the overridden
|
|
595
|
-
// _inner_replace_dataValue. Previously ExtensionObject values were special-cased with a
|
|
596
|
-
// silent "this.$dataValue = dataValue" assignment that skipped notification for plain
|
|
597
|
-
// (unbound) extension object variables and threw on bound sub-structure children.
|
|
598
|
-
this._internal_set_dataValue(dataValue);
|
|
599
|
-
}
|
|
600
|
-
catch (err) {
|
|
601
|
-
errorLog("UAVariable#setValueFromString Error : ", this.browseName.toString(), this.nodeId.toString());
|
|
602
|
-
errorLog(err.message);
|
|
603
|
-
errorLog(this.parent?.toString());
|
|
604
|
-
throw err;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
adjustDataValueStatusCode(dataValue) {
|
|
608
|
-
const statusCode = (0, adjust_datavalue_status_code_1.adjustDataValueStatusCode)(this, dataValue, this.acceptValueOutOfRange || false);
|
|
609
|
-
return statusCode;
|
|
610
|
-
}
|
|
611
|
-
writeValue(context, dataValue, ...args) {
|
|
612
|
-
context = context || session_context_1.SessionContext.defaultContext;
|
|
613
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
614
|
-
if (!dataValue.sourceTimestamp) {
|
|
615
|
-
// source timestamp was not specified by the caller
|
|
616
|
-
// we will set the timestamp ourself with the current clock
|
|
617
|
-
if (context.currentTime) {
|
|
618
|
-
dataValue.sourceTimestamp = context.currentTime.timestamp;
|
|
619
|
-
dataValue.sourcePicoseconds = context.currentTime.picoseconds;
|
|
620
|
-
}
|
|
621
|
-
else {
|
|
622
|
-
const { timestamp, picoseconds } = (0, node_opcua_date_time_1.getCurrentClock)();
|
|
623
|
-
dataValue.sourceTimestamp = timestamp;
|
|
624
|
-
dataValue.sourcePicoseconds = picoseconds;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
if (context.currentTime && !dataValue.serverTimestamp) {
|
|
628
|
-
dataValue.serverTimestamp = context.currentTime.timestamp;
|
|
629
|
-
dataValue.serverPicoseconds = context.currentTime.picoseconds;
|
|
630
|
-
}
|
|
631
|
-
// adjust arguments if optional indexRange Parameter is not given
|
|
632
|
-
let indexRange = null;
|
|
633
|
-
let callback;
|
|
634
|
-
if (args.length === 1) {
|
|
635
|
-
indexRange = new node_opcua_numeric_range_1.NumericRange();
|
|
636
|
-
callback = args[0];
|
|
637
|
-
}
|
|
638
|
-
else if (args.length === 2) {
|
|
639
|
-
indexRange = args[0];
|
|
640
|
-
callback = args[1];
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
throw new Error("Invalid Number of args");
|
|
644
|
-
}
|
|
645
|
-
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
646
|
-
(0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue);
|
|
647
|
-
// index range could be string
|
|
648
|
-
indexRange = node_opcua_numeric_range_1.NumericRange.coerce(indexRange);
|
|
649
|
-
// test write permission
|
|
650
|
-
if (!this.isWritable(context)) {
|
|
651
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Write)) {
|
|
655
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
if (!this.isUserWritable(context)) {
|
|
659
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadWriteNotSupported);
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
// adjust special case
|
|
663
|
-
const variant = adjustVariant2.call(this, dataValue.value);
|
|
664
|
-
const statusCode = this.checkVariantCompatibility(variant);
|
|
665
|
-
if (statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
666
|
-
callback?.(null, statusCode);
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
// adjust dataValue.statusCode based on InstrumentRange and EngineeringUnits
|
|
670
|
-
const statusCode2 = this.adjustDataValueStatusCode(dataValue);
|
|
671
|
-
if (statusCode2.isNotGood()) {
|
|
672
|
-
callback?.(null, statusCode2);
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
const write_func = this._timestamped_set_func || default_func;
|
|
676
|
-
if (!write_func) {
|
|
677
|
-
warningLog(` warning ${this.nodeId.toString()} ${this.browseName.toString()} has no setter. \n`);
|
|
678
|
-
warningLog("Please make sure to bind the variable or to pass a valid value: new Variant({}) during construction time");
|
|
679
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadNotWritable);
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
(0, node_opcua_assert_1.assert)(write_func);
|
|
683
|
-
write_func.call(this, dataValue, (err, statusCode1) => {
|
|
684
|
-
if (!err) {
|
|
685
|
-
dataValue && this.verifyVariantCompatibility(dataValue.value);
|
|
686
|
-
if (indexRange && !indexRange.isEmpty()) {
|
|
687
|
-
if (!indexRange.isValid()) {
|
|
688
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadIndexRangeInvalid);
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
const newArrayOrMatrix = dataValue.value.value;
|
|
692
|
-
if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Array) {
|
|
693
|
-
if (this.$dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Array) {
|
|
694
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
// check that destination data is also an array
|
|
698
|
-
(0, node_opcua_assert_1.assert)(check_valid_array(this.$dataValue.value.dataType, this.$dataValue.value.value));
|
|
699
|
-
const destArr = this.$dataValue.value.value;
|
|
700
|
-
const result = indexRange.set_values(destArr, newArrayOrMatrix);
|
|
701
|
-
if (result.statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
702
|
-
callback?.(null, result.statusCode);
|
|
703
|
-
return;
|
|
704
|
-
}
|
|
705
|
-
dataValue.value.value = result.array;
|
|
706
|
-
// scrap original array so we detect range
|
|
707
|
-
this.$dataValue.value.value = null;
|
|
708
|
-
}
|
|
709
|
-
else if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Matrix) {
|
|
710
|
-
const dimensions = this.$dataValue.value.dimensions;
|
|
711
|
-
if (this.$dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Matrix || !dimensions) {
|
|
712
|
-
// not a matrix !
|
|
713
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
const matrix = this.$dataValue.value.value;
|
|
717
|
-
const result = indexRange.set_values_matrix({
|
|
718
|
-
matrix,
|
|
719
|
-
dimensions
|
|
720
|
-
}, newArrayOrMatrix);
|
|
721
|
-
if (result.statusCode.isNot(node_opcua_status_code_1.StatusCodes.Good)) {
|
|
722
|
-
callback?.(null, result.statusCode);
|
|
723
|
-
return;
|
|
724
|
-
}
|
|
725
|
-
dataValue.value.dimensions = this.$dataValue.value.dimensions;
|
|
726
|
-
dataValue.value.value = result.matrix;
|
|
727
|
-
// scrap original array so we detect range
|
|
728
|
-
this.$dataValue.value.value = null;
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
try {
|
|
736
|
-
this._internal_set_dataValue(dataValue, indexRange);
|
|
737
|
-
}
|
|
738
|
-
catch (err) {
|
|
739
|
-
if (node_util_1.types.isNativeError(err)) {
|
|
740
|
-
warningLog(err.message);
|
|
741
|
-
}
|
|
742
|
-
callback?.(null, node_opcua_status_code_1.StatusCodes.BadInternalError);
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
callback?.(err || null, statusCode1);
|
|
747
|
-
});
|
|
748
|
-
return undefined;
|
|
749
|
-
}
|
|
750
|
-
writeAttribute(context, writeValueOptions, callback) {
|
|
751
|
-
// c8 ignore next
|
|
752
|
-
if (!callback) {
|
|
753
|
-
throw new Error("Internal error");
|
|
754
|
-
}
|
|
755
|
-
if (!this.canUserWriteAttribute(context, writeValueOptions.attributeId)) {
|
|
756
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
|
|
757
|
-
return;
|
|
758
|
-
}
|
|
759
|
-
const writeValue = writeValueOptions instanceof node_opcua_service_write_1.WriteValue ? writeValueOptions : new node_opcua_service_write_1.WriteValue(writeValueOptions);
|
|
760
|
-
context = context || session_context_1.SessionContext.defaultContext;
|
|
761
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
762
|
-
(0, node_opcua_assert_1.assert)(writeValue instanceof node_opcua_service_write_1.WriteValue);
|
|
763
|
-
(0, node_opcua_assert_1.assert)(writeValue.value instanceof node_opcua_data_value_1.DataValue);
|
|
764
|
-
(0, node_opcua_assert_1.assert)(writeValue.value?.value instanceof node_opcua_variant_1.Variant);
|
|
765
|
-
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
766
|
-
// Spec 1.0.2 Part 4 page 58
|
|
767
|
-
// If the SourceTimestamp or the ServerTimestamp is specified, the Server shall
|
|
768
|
-
// use these values.
|
|
769
|
-
// xx _apply_default_timestamps(writeValue.value);
|
|
770
|
-
switch (writeValue.attributeId) {
|
|
771
|
-
case node_opcua_data_model_1.AttributeIds.Value:
|
|
772
|
-
this.writeValue(context, writeValue.value, writeValue.indexRange, callback);
|
|
773
|
-
break;
|
|
774
|
-
case node_opcua_data_model_1.AttributeIds.Historizing:
|
|
775
|
-
if (writeValue.value?.value.dataType !== node_opcua_variant_1.DataType.Boolean) {
|
|
776
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadTypeMismatch);
|
|
777
|
-
break;
|
|
778
|
-
}
|
|
779
|
-
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.WriteHistorizing)) {
|
|
780
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
|
|
781
|
-
break;
|
|
782
|
-
}
|
|
783
|
-
if (!this.canUserWriteHistorizingAttribute(context)) {
|
|
784
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadHistoryOperationUnsupported);
|
|
785
|
-
break;
|
|
786
|
-
}
|
|
787
|
-
// if the variable has no historizing in place reject
|
|
788
|
-
if (!this.getChildByName("HA Configuration")) {
|
|
789
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadNotSupported);
|
|
790
|
-
break;
|
|
791
|
-
}
|
|
792
|
-
// check if user is allowed to do that !
|
|
793
|
-
// TODO
|
|
794
|
-
this.historizing = !!writeValue.value?.value.value; // yes ! indeed !
|
|
795
|
-
callback(null, node_opcua_status_code_1.StatusCodes.Good);
|
|
796
|
-
break;
|
|
797
|
-
default:
|
|
798
|
-
super.writeAttribute(context, writeValue, callback);
|
|
799
|
-
break;
|
|
800
|
-
}
|
|
801
|
-
return undefined;
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
|
|
805
|
-
* note:
|
|
806
|
-
* this method is overridden in address-space-data-access
|
|
807
|
-
* @return {StatusCode}
|
|
808
|
-
*/
|
|
809
|
-
checkVariantCompatibility(value) {
|
|
810
|
-
// test dataType
|
|
811
|
-
if (!this._validate_DataType(value.dataType)) {
|
|
812
|
-
return node_opcua_status_code_1.StatusCodes.BadTypeMismatch;
|
|
813
|
-
}
|
|
814
|
-
try {
|
|
815
|
-
this.verifyVariantCompatibility(value);
|
|
816
|
-
}
|
|
817
|
-
catch (_err) {
|
|
818
|
-
return node_opcua_status_code_1.StatusCodes.BadTypeMismatch;
|
|
819
|
-
}
|
|
820
|
-
return node_opcua_status_code_1.StatusCodes.Good;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* touch the source timestamp of a Variable and cascade up the change
|
|
824
|
-
* to the parent variable if any.
|
|
825
|
-
*/
|
|
826
|
-
touchValue(optionalNow) {
|
|
827
|
-
const now = optionalNow || (0, node_opcua_date_time_1.getCurrentClock)();
|
|
828
|
-
(0, ua_variable_impl_ext_obj_1.propagateTouchValueUpward)(this, now);
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* bind a variable with a get and set functions.
|
|
832
|
-
*
|
|
833
|
-
* properties:
|
|
834
|
-
* - value: a Variant or a status code
|
|
835
|
-
* - sourceTimestamp
|
|
836
|
-
* - sourcePicoseconds
|
|
837
|
-
* @param [options.timestamped_set]
|
|
838
|
-
* @param [options.refreshFunc] the variable asynchronous getter function.
|
|
839
|
-
* @param [overwrite {Boolean} = false] set overwrite to true to overwrite existing binding
|
|
840
|
-
* @return void
|
|
841
|
-
*
|
|
842
|
-
*
|
|
843
|
-
* ### Providing read access to the underlying value
|
|
844
|
-
*
|
|
845
|
-
* #### Variation 1
|
|
846
|
-
*
|
|
847
|
-
* In this variation, the user provides a function that returns a Variant with the current value.
|
|
848
|
-
*
|
|
849
|
-
* The sourceTimestamp will be set automatically.
|
|
850
|
-
*
|
|
851
|
-
* The get function is called synchronously.
|
|
852
|
-
*
|
|
853
|
-
* @example
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
* ```javascript
|
|
857
|
-
* ...
|
|
858
|
-
* var options = {
|
|
859
|
-
* get : () => {
|
|
860
|
-
* return new Variant({...});
|
|
861
|
-
* },
|
|
862
|
-
* set : function(variant) {
|
|
863
|
-
* // store the variant somewhere
|
|
864
|
-
* return StatusCodes.Good;
|
|
865
|
-
* }
|
|
866
|
-
* };
|
|
867
|
-
* ...
|
|
868
|
-
* engine.bindVariable(nodeId,options):
|
|
869
|
-
* ...
|
|
870
|
-
* ```
|
|
871
|
-
*
|
|
872
|
-
*
|
|
873
|
-
* #### Variation 2:
|
|
874
|
-
*
|
|
875
|
-
* This variation can be used when the user wants to specify a specific '''sourceTimestamp''' associated
|
|
876
|
-
* with the current value of the UAVariable.
|
|
877
|
-
*
|
|
878
|
-
* The provided ```timestamped_get``` function should return an object with three properties:
|
|
879
|
-
* * value: containing the variant value or a error StatusCode,
|
|
880
|
-
* * sourceTimestamp
|
|
881
|
-
* * sourcePicoseconds
|
|
882
|
-
*
|
|
883
|
-
* ```javascript
|
|
884
|
-
* ...
|
|
885
|
-
* var myDataValue = new DataValue({
|
|
886
|
-
* value: {dataType: DataType.Double , value: 10.0},
|
|
887
|
-
* sourceTimestamp : new Date(),
|
|
888
|
-
* sourcePicoseconds: 0
|
|
889
|
-
* });
|
|
890
|
-
* ...
|
|
891
|
-
* var options = {
|
|
892
|
-
* timestamped_get : () => { return myDataValue; }
|
|
893
|
-
* };
|
|
894
|
-
* ...
|
|
895
|
-
* engine.bindVariable(nodeId,options):
|
|
896
|
-
* ...
|
|
897
|
-
* // record a new value
|
|
898
|
-
* myDataValue.value.value = 5.0;
|
|
899
|
-
* myDataValue.sourceTimestamp = new Date();
|
|
900
|
-
* ...
|
|
901
|
-
* ```
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
* #### Variation 3:
|
|
905
|
-
*
|
|
906
|
-
* This variation can be used when the value associated with the variables requires a asynchronous function call to be
|
|
907
|
-
* extracted. In this case, the user should provide an async method ```refreshFunc```.
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
* The ```refreshFunc``` shall do whatever is necessary to fetch the most up to date version of the variable value, and
|
|
911
|
-
* call the ```callback``` function when the data is ready.
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
* The ```callback``` function follow the standard callback function signature:
|
|
915
|
-
* * the first argument shall be **null** or **Error**, depending of the outcome of the fetch operation,
|
|
916
|
-
* * the second argument shall be a DataValue with the new UAVariable Value, a StatusCode, and time stamps.
|
|
917
|
-
*
|
|
918
|
-
*
|
|
919
|
-
* Optionally, it is possible to pass a sourceTimestamp and a sourcePicoseconds value as a third and fourth arguments
|
|
920
|
-
* of the callback. When sourceTimestamp and sourcePicoseconds are missing, the system will set their default value
|
|
921
|
-
* to the current time..
|
|
922
|
-
*
|
|
923
|
-
*
|
|
924
|
-
* ```javascript
|
|
925
|
-
* ...
|
|
926
|
-
* var options = {
|
|
927
|
-
* refreshFunc : function(callback) {
|
|
928
|
-
* ... do_some_async_stuff_to_get_the_new_variable_value
|
|
929
|
-
* var dataValue = new DataValue({
|
|
930
|
-
* value: new Variant({...}),
|
|
931
|
-
* statusCode: StatusCodes.Good,
|
|
932
|
-
* sourceTimestamp: new Date()
|
|
933
|
-
* });
|
|
934
|
-
* callback(null,dataValue);
|
|
935
|
-
* }
|
|
936
|
-
* };
|
|
937
|
-
* ...
|
|
938
|
-
* variable.bindVariable(nodeId,options):
|
|
939
|
-
* ...
|
|
940
|
-
* ```
|
|
941
|
-
*
|
|
942
|
-
* ### Providing write access to the underlying value
|
|
943
|
-
*
|
|
944
|
-
* #### Variation1 - provide a simple synchronous set function
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
* #### Notes
|
|
948
|
-
* to do : explain return StatusCodes.GoodCompletesAsynchronously;
|
|
949
|
-
*
|
|
950
|
-
*/
|
|
951
|
-
bindVariable(options, overwrite) {
|
|
952
|
-
if (overwrite) {
|
|
953
|
-
this._timestamped_set_func = null;
|
|
954
|
-
this._timestamped_get_func = null;
|
|
955
|
-
this._get_func = null;
|
|
956
|
-
this._set_func = null;
|
|
957
|
-
this.refreshFunc = undefined;
|
|
958
|
-
this._historyRead = UAVariableImpl.prototype._historyRead;
|
|
959
|
-
}
|
|
960
|
-
options = options || {};
|
|
961
|
-
(0, node_opcua_assert_1.assert)(typeof this._timestamped_set_func !== "function", "UAVariable already bound");
|
|
962
|
-
(0, node_opcua_assert_1.assert)(typeof this._timestamped_get_func !== "function", "UAVariable already bound");
|
|
963
|
-
bind_getter.call(this, options);
|
|
964
|
-
bind_setter.call(this, options);
|
|
965
|
-
const _historyRead = options.historyRead;
|
|
966
|
-
if (_historyRead) {
|
|
967
|
-
(0, node_opcua_assert_1.assert)(typeof this._historyRead !== "function" || this._historyRead === UAVariableImpl.prototype._historyRead);
|
|
968
|
-
(0, node_opcua_assert_1.assert)(typeof _historyRead === "function");
|
|
969
|
-
this._historyRead = _historyRead;
|
|
970
|
-
(0, node_opcua_assert_1.assert)(this._historyRead.length === 6);
|
|
971
|
-
}
|
|
972
|
-
// post conditions
|
|
973
|
-
(0, node_opcua_assert_1.assert)(typeof this._timestamped_set_func === "function");
|
|
974
|
-
(0, node_opcua_assert_1.assert)(this._timestamped_set_func?.length === 2, "expecting 2 parameters");
|
|
975
|
-
}
|
|
976
|
-
readValueAsync(context, callback) {
|
|
977
|
-
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
978
|
-
context = context || session_context_1.SessionContext.defaultContext;
|
|
979
|
-
this.__waiting_callbacks = this.__waiting_callbacks || [];
|
|
980
|
-
this.__waiting_callbacks.push(callback);
|
|
981
|
-
const _readValueAsync_in_progress = this.__waiting_callbacks.length >= 2;
|
|
982
|
-
if (_readValueAsync_in_progress) {
|
|
983
|
-
return;
|
|
984
|
-
}
|
|
985
|
-
if (this.isDisposed()) {
|
|
986
|
-
callback?.(null, new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNodeIdUnknown }));
|
|
987
|
-
return;
|
|
988
|
-
}
|
|
989
|
-
const readImmediate = (innerCallback) => {
|
|
990
|
-
(0, node_opcua_assert_1.assert)(this.$dataValue instanceof node_opcua_data_value_1.DataValue);
|
|
991
|
-
const dataValue = this.readValue(context);
|
|
992
|
-
innerCallback(null, dataValue);
|
|
993
|
-
};
|
|
994
|
-
let func;
|
|
995
|
-
const answerStatusOnly = (statusCode) => (innerCallback) => innerCallback(null, new node_opcua_data_value_1.DataValue({ statusCode }));
|
|
996
|
-
if (context.isAccessRestricted(this)) {
|
|
997
|
-
// same gate as readValue(): a variable bound with a simple get()
|
|
998
|
-
// also gets a refreshFunc, sending every read down the asyncRefresh
|
|
999
|
-
// branch below - which calls the getter directly and never passes
|
|
1000
|
-
// through readValue(). Without this check here, a node hardened
|
|
1001
|
-
// with AccessRestrictions(EncryptionRequired) answered its value
|
|
1002
|
-
// over an unencrypted channel.
|
|
1003
|
-
func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadSecurityModeInsufficient);
|
|
1004
|
-
}
|
|
1005
|
-
else if (!this.isReadable(context)) {
|
|
1006
|
-
func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadNotReadable);
|
|
1007
|
-
}
|
|
1008
|
-
else if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.Read)) {
|
|
1009
|
-
func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadUserAccessDenied);
|
|
1010
|
-
}
|
|
1011
|
-
else if (!this.isUserReadable(context)) {
|
|
1012
|
-
func = answerStatusOnly(node_opcua_status_code_1.StatusCodes.BadNotReadable);
|
|
1013
|
-
}
|
|
1014
|
-
else {
|
|
1015
|
-
const clock = (0, node_opcua_date_time_1.getCurrentClock)();
|
|
1016
|
-
func = typeof this.refreshFunc === "function" ? this.asyncRefresh.bind(this, clock) : readImmediate;
|
|
1017
|
-
}
|
|
1018
|
-
const satisfy_callbacks = (err, dataValue) => {
|
|
1019
|
-
// now call all pending callbacks
|
|
1020
|
-
const callbacks = this.__waiting_callbacks || [];
|
|
1021
|
-
this.__waiting_callbacks = [];
|
|
1022
|
-
const _n = callbacks.length;
|
|
1023
|
-
for (const callback1 of callbacks) {
|
|
1024
|
-
callback1.call(this, err, dataValue);
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
try {
|
|
1028
|
-
func.call(this, satisfy_callbacks);
|
|
1029
|
-
}
|
|
1030
|
-
catch (err) {
|
|
1031
|
-
// c8 ignore next
|
|
1032
|
-
if (doDebug) {
|
|
1033
|
-
debugLog(chalk_1.default.red("func readValueAsync has failed "));
|
|
1034
|
-
if (node_util_1.types.isNativeError(err)) {
|
|
1035
|
-
debugLog(" stack", err.stack);
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
satisfy_callbacks(err);
|
|
1039
|
-
}
|
|
1040
|
-
return undefined;
|
|
1041
|
-
}
|
|
1042
|
-
getWriteMask() {
|
|
1043
|
-
return super.getWriteMask();
|
|
1044
|
-
}
|
|
1045
|
-
getUserWriteMask() {
|
|
1046
|
-
return super.getUserWriteMask();
|
|
1047
|
-
}
|
|
1048
|
-
clone(options, optionalFilter, extraInfo) {
|
|
1049
|
-
options = {
|
|
1050
|
-
...options,
|
|
1051
|
-
// check this eventNotifier: this.eventNotifier,
|
|
1052
|
-
// check this symbolicName: this.symbolicName,
|
|
1053
|
-
accessLevel: this.accessLevel,
|
|
1054
|
-
arrayDimensions: this.arrayDimensions,
|
|
1055
|
-
dataType: this.dataType,
|
|
1056
|
-
historizing: this.historizing,
|
|
1057
|
-
minimumSamplingInterval: this.minimumSamplingInterval,
|
|
1058
|
-
userAccessLevel: this.userAccessLevel,
|
|
1059
|
-
valueRank: this.valueRank
|
|
1060
|
-
};
|
|
1061
|
-
const newVariable = (0, base_node_private_1._clone)(this, (UAVariableImpl), options, optionalFilter || node_opcua_address_space_base_1.defaultCloneFilter, extraInfo || (0, node_opcua_address_space_base_1.makeDefaultCloneExtraInfo)(this));
|
|
1062
|
-
newVariable.bindVariable();
|
|
1063
|
-
(0, node_opcua_assert_1.assert)(typeof newVariable._timestamped_set_func === "function");
|
|
1064
|
-
(0, node_opcua_assert_1.assert)(newVariable.dataType === this.dataType);
|
|
1065
|
-
newVariable.$dataValue = this.$dataValue.clone();
|
|
1066
|
-
// also bind extension object
|
|
1067
|
-
const v = newVariable.$dataValue.value;
|
|
1068
|
-
if (v.dataType === node_opcua_variant_1.DataType.ExtensionObject && v.value && v.arrayType === node_opcua_variant_1.VariantArrayType.Scalar) {
|
|
1069
|
-
try {
|
|
1070
|
-
newVariable.bindExtensionObject(newVariable.$dataValue.value.value);
|
|
1071
|
-
}
|
|
1072
|
-
catch (err) {
|
|
1073
|
-
errorLog("Error binding extension objects");
|
|
1074
|
-
errorLog(err.message);
|
|
1075
|
-
errorLog(this.toString());
|
|
1076
|
-
errorLog("---------------------------------------");
|
|
1077
|
-
errorLog(this.$dataValue.toString());
|
|
1078
|
-
errorLog("---------------------------------------");
|
|
1079
|
-
errorLog(newVariable.$dataValue.toString());
|
|
1080
|
-
throw err;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
return newVariable;
|
|
1084
|
-
}
|
|
1085
|
-
getDataTypeNode() {
|
|
1086
|
-
const addressSpace = this.addressSpace;
|
|
1087
|
-
if (this.dataType.isEmpty()) {
|
|
1088
|
-
this.dataType = this.resolveNodeId(node_opcua_variant_1.DataType.Variant);
|
|
1089
|
-
}
|
|
1090
|
-
const dt = addressSpace.findNode(this.dataType);
|
|
1091
|
-
// c8 ignore next
|
|
1092
|
-
if (!dt) {
|
|
1093
|
-
throw new Error(`getDataTypeNode: cannot find dataType ${this.dataType.toString()}`);
|
|
1094
|
-
}
|
|
1095
|
-
return dt;
|
|
1096
|
-
}
|
|
1097
|
-
get dataTypeObj() {
|
|
1098
|
-
return this.getDataTypeNode();
|
|
1099
|
-
}
|
|
1100
|
-
checkExtensionObjectIsCorrect(extObj) {
|
|
1101
|
-
if (!extObj) {
|
|
1102
|
-
return true;
|
|
1103
|
-
}
|
|
1104
|
-
const addressSpace = this.addressSpace;
|
|
1105
|
-
if (!addressSpace) {
|
|
1106
|
-
return true;
|
|
1107
|
-
}
|
|
1108
|
-
const dataType = addressSpace.findDataType(this.dataType);
|
|
1109
|
-
if (!dataType) {
|
|
1110
|
-
// may be we are in the process of loading a xml file and the corresponding dataType
|
|
1111
|
-
// has not yet been loaded !
|
|
1112
|
-
return true;
|
|
1113
|
-
}
|
|
1114
|
-
if (dataType.nodeId.namespace === 0 && dataType.nodeId.value === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
1115
|
-
return true;
|
|
1116
|
-
}
|
|
1117
|
-
const Constructor = addressSpace.getExtensionObjectConstructor(this.dataType);
|
|
1118
|
-
if (this.valueRank === -1) {
|
|
1119
|
-
/** Scalar */
|
|
1120
|
-
if (Array.isArray(extObj)) {
|
|
1121
|
-
return false;
|
|
1122
|
-
}
|
|
1123
|
-
return checkExtensionObjectIsCorrectScalar.call(this, extObj);
|
|
1124
|
-
}
|
|
1125
|
-
else if (this.valueRank >= 1) {
|
|
1126
|
-
/** array */
|
|
1127
|
-
if (!Array.isArray(extObj)) {
|
|
1128
|
-
// let's coerce this scalar into an 1-element array if it is a valid extension object
|
|
1129
|
-
if (checkExtensionObjectIsCorrectScalar.call(this, extObj)) {
|
|
1130
|
-
warningLog(`warning: checkExtensionObjectIsCorrect : expecting a array but got a scalar (value rank of '${this.browseName.toString()}' is 1)\nautomatic conversion from scalar to array with 1 element is taking place.`);
|
|
1131
|
-
extObj = [extObj];
|
|
1132
|
-
}
|
|
1133
|
-
else {
|
|
1134
|
-
return false;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
return checkExtensionObjectIsCorrectArray.call(this, extObj);
|
|
1138
|
-
}
|
|
1139
|
-
else if (this.valueRank === 0) {
|
|
1140
|
-
// Scalar or Array
|
|
1141
|
-
const isCorrectScalar = !Array.isArray(extObj) && checkExtensionObjectIsCorrectScalar.call(this, extObj);
|
|
1142
|
-
const isCorrectArray = Array.isArray(extObj) && checkExtensionObjectIsCorrectArray.call(this, extObj);
|
|
1143
|
-
return isCorrectArray || isCorrectScalar;
|
|
1144
|
-
}
|
|
1145
|
-
else {
|
|
1146
|
-
throw new Error(`checkExtensionObjectIsCorrect: Not Implemented case, please contact sterfive : this.valueRank =${this.valueRank}`);
|
|
1147
|
-
}
|
|
1148
|
-
function checkExtensionObjectIsCorrectScalar(extObj) {
|
|
1149
|
-
// c8 ignore next
|
|
1150
|
-
if (!extObj?.constructor) {
|
|
1151
|
-
errorLog(extObj);
|
|
1152
|
-
throw new Error("expecting an valid extension object");
|
|
1153
|
-
}
|
|
1154
|
-
if (extObj.constructor.name === Constructor.name) {
|
|
1155
|
-
return true;
|
|
1156
|
-
}
|
|
1157
|
-
if (extObj instanceof node_opcua_extension_object_1.OpaqueStructure) {
|
|
1158
|
-
throw new Error("An opaque structure is not expected here");
|
|
1159
|
-
}
|
|
1160
|
-
// let's verify that the constructor is a sub-class of Constructor
|
|
1161
|
-
let current = extObj.schema;
|
|
1162
|
-
while (current) {
|
|
1163
|
-
if (current.name === Constructor.name) {
|
|
1164
|
-
return true;
|
|
1165
|
-
}
|
|
1166
|
-
current = current.getBaseSchema();
|
|
1167
|
-
}
|
|
1168
|
-
return false;
|
|
1169
|
-
}
|
|
1170
|
-
function checkExtensionObjectIsCorrectArray(extObjArray) {
|
|
1171
|
-
// c8 ignore next
|
|
1172
|
-
for (const extObj of extObjArray) {
|
|
1173
|
-
if (!extObj?.constructor) {
|
|
1174
|
-
errorLog(extObj);
|
|
1175
|
-
throw new Error("expecting an valid extension object");
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
try {
|
|
1179
|
-
for (const e of extObjArray) {
|
|
1180
|
-
if (!e) {
|
|
1181
|
-
continue;
|
|
1182
|
-
}
|
|
1183
|
-
if (e.constructor.name !== Constructor.name) {
|
|
1184
|
-
// c8 ignore next
|
|
1185
|
-
doDebug && debugLog("extObj.constructor.name ", e.constructor.name, "expected", Constructor.name);
|
|
1186
|
-
return false;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
return true;
|
|
1190
|
-
}
|
|
1191
|
-
catch (err) {
|
|
1192
|
-
errorLog(err);
|
|
1193
|
-
return false;
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
changeDataType(newDataType, newValue) {
|
|
1198
|
-
changeUAVariableDataType(this, newDataType, newValue);
|
|
1199
|
-
}
|
|
1200
|
-
/**
|
|
1201
|
-
* @private
|
|
1202
|
-
* install UAVariable to exposed th
|
|
1203
|
-
*
|
|
1204
|
-
* precondition:
|
|
1205
|
-
*/
|
|
1206
|
-
installExtensionObjectVariables() {
|
|
1207
|
-
(0, ua_variable_impl_ext_obj_1._installExtensionObjectBindingOnProperties)(this, { createMissingProp: true });
|
|
1208
|
-
}
|
|
1209
|
-
/**
|
|
1210
|
-
|
|
1211
|
-
* @return {ExtensionObject}
|
|
1212
|
-
*/
|
|
1213
|
-
bindExtensionObjectScalar(optionalExtensionObject, options) {
|
|
1214
|
-
(0, node_opcua_assert_1.assert)(this.valueRank === -1, "expecting an Scalar variable here");
|
|
1215
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObject)(this, optionalExtensionObject, options);
|
|
1216
|
-
}
|
|
1217
|
-
bindExtensionObjectArray(optionalExtensionObject, options) {
|
|
1218
|
-
(0, node_opcua_assert_1.assert)(this.valueRank >= 1, "expecting an Array or a Matrix variable here");
|
|
1219
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObjectArrayOrMatrix)(this, optionalExtensionObject, options);
|
|
1220
|
-
}
|
|
1221
|
-
bindExtensionObject(optionalExtensionObject, options) {
|
|
1222
|
-
// coerce to ExtensionObject[] when this.valueRank === 1
|
|
1223
|
-
if (optionalExtensionObject &&
|
|
1224
|
-
this.valueRank === 1 &&
|
|
1225
|
-
!Array.isArray(optionalExtensionObject) &&
|
|
1226
|
-
optionalExtensionObject instanceof node_opcua_extension_object_1.ExtensionObject) {
|
|
1227
|
-
warningLog("bindExtensionObject: coerce to ExtensionObject[] when valueRank === 1 and value is a scalar extension object");
|
|
1228
|
-
optionalExtensionObject = [optionalExtensionObject];
|
|
1229
|
-
}
|
|
1230
|
-
if (optionalExtensionObject) {
|
|
1231
|
-
if (Array.isArray(optionalExtensionObject)) {
|
|
1232
|
-
(0, node_opcua_assert_1.assert)(this.valueRank >= 1, "bindExtensionObject: expecting an Array of Matrix variable here");
|
|
1233
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObjectArrayOrMatrix)(this, optionalExtensionObject, options);
|
|
1234
|
-
}
|
|
1235
|
-
else {
|
|
1236
|
-
if (this.valueRank !== -1 && this.valueRank !== 0) {
|
|
1237
|
-
throw new Error(`bindExtensionObject: expecting an Scalar variable here but got value rank ${this.valueRank}`);
|
|
1238
|
-
}
|
|
1239
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObject)(this, optionalExtensionObject, options);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
(0, node_opcua_assert_1.assert)(optionalExtensionObject === undefined || optionalExtensionObject === null);
|
|
1243
|
-
if (this.valueRank === -1) {
|
|
1244
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObject)(this, undefined, options);
|
|
1245
|
-
}
|
|
1246
|
-
else if (this.valueRank === 1) {
|
|
1247
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObjectArrayOrMatrix)(this, undefined, options);
|
|
1248
|
-
}
|
|
1249
|
-
else if (this.valueRank > 1) {
|
|
1250
|
-
return (0, ua_variable_impl_ext_obj_1._bindExtensionObjectArrayOrMatrix)(this, undefined, options);
|
|
1251
|
-
}
|
|
1252
|
-
// unsupported case ...
|
|
1253
|
-
return null;
|
|
1254
|
-
}
|
|
1255
|
-
updateExtensionObjectPartial(partialExtensionObject) {
|
|
1256
|
-
(0, ua_variable_impl_ext_obj_1.setExtensionObjectPartialValue)(this, partialExtensionObject);
|
|
1257
|
-
return this.$extensionObject;
|
|
1258
|
-
}
|
|
1259
|
-
incrementExtensionObjectPartial(path) {
|
|
1260
|
-
const extensionObject = this.readValue().value.value;
|
|
1261
|
-
const partialData = (0, ua_variable_impl_ext_obj_1.extractPartialData)(path, extensionObject);
|
|
1262
|
-
(0, ua_variable_impl_ext_obj_1.incrementElement)(path, partialData);
|
|
1263
|
-
(0, ua_variable_impl_ext_obj_1.setExtensionObjectPartialValue)(this, partialData);
|
|
1264
|
-
}
|
|
1265
|
-
toString() {
|
|
1266
|
-
const options = new base_node_private_1.ToStringBuilder();
|
|
1267
|
-
base_node_private_1.UAVariable_toString.call(this, options);
|
|
1268
|
-
return options.toString();
|
|
1269
|
-
}
|
|
1270
|
-
toJSON() {
|
|
1271
|
-
let value;
|
|
1272
|
-
let statusCode;
|
|
1273
|
-
try {
|
|
1274
|
-
const dv = this.$dataValue;
|
|
1275
|
-
if (dv) {
|
|
1276
|
-
statusCode = dv.statusCode?.toString();
|
|
1277
|
-
if (dv.value && !(dv.value.value instanceof node_opcua_extension_object_1.OpaqueStructure)) {
|
|
1278
|
-
value = dv.value.value;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
catch {
|
|
1283
|
-
// ignore — value access may fail for bound variables
|
|
1284
|
-
}
|
|
1285
|
-
return {
|
|
1286
|
-
...super.toJSON(),
|
|
1287
|
-
typeDefinition: this.typeDefinitionObj?.browseName.toString(),
|
|
1288
|
-
dataType: this.dataType?.toString(),
|
|
1289
|
-
valueRank: this.valueRank,
|
|
1290
|
-
arrayDimensions: this.arrayDimensions,
|
|
1291
|
-
accessLevel: node_opcua_data_model_1.AccessLevelFlag[this.accessLevel],
|
|
1292
|
-
statusCode,
|
|
1293
|
-
value
|
|
1294
|
-
};
|
|
1295
|
-
}
|
|
1296
|
-
[Symbol.for("nodejs.util.inspect.custom")](depth, inspectOptions) {
|
|
1297
|
-
const c = inspectOptions?.colors === false ? plainChalk : chalk_1.default;
|
|
1298
|
-
const typeName = this.typeDefinitionObj?.browseName.toString() ?? "?";
|
|
1299
|
-
const displayName = this.displayName.length ? this.displayName.map((d) => d.text).join(" | ") : "";
|
|
1300
|
-
if (depth !== null && depth <= 0) {
|
|
1301
|
-
return `${c.cyan("UAVariable<")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}${c.cyan(">")}`;
|
|
1302
|
-
}
|
|
1303
|
-
const dt = this.dataType?.toString() ?? "?";
|
|
1304
|
-
let valueStr = "";
|
|
1305
|
-
let statusStr = "";
|
|
1306
|
-
try {
|
|
1307
|
-
const dv = this.$dataValue;
|
|
1308
|
-
if (dv) {
|
|
1309
|
-
if (dv.statusCode)
|
|
1310
|
-
statusStr = dv.statusCode.toString();
|
|
1311
|
-
if (dv.value &&
|
|
1312
|
-
dv.value.value !== undefined &&
|
|
1313
|
-
dv.value.value !== null &&
|
|
1314
|
-
!(dv.value.value instanceof node_opcua_extension_object_1.OpaqueStructure)) {
|
|
1315
|
-
const v = dv.value.value;
|
|
1316
|
-
valueStr = typeof v === "object" ? Object.prototype.toString.call(v) : String(v);
|
|
1317
|
-
if (valueStr.length > 80)
|
|
1318
|
-
valueStr = `${valueStr.slice(0, 77)}...`;
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
catch {
|
|
1323
|
-
// ignore
|
|
1324
|
-
}
|
|
1325
|
-
const lines = [
|
|
1326
|
-
`${c.cyan("UAVariable ")}${c.green(this.browseName.toString())}${c.grey(` ${this.nodeId.toString()}`)}`,
|
|
1327
|
-
c.yellow(" typeDefinition : ") + typeName,
|
|
1328
|
-
c.yellow(" displayName : ") + displayName,
|
|
1329
|
-
c.yellow(" dataType : ") + dt,
|
|
1330
|
-
c.yellow(" valueRank : ") + (0, base_node_private_1.valueRankToString)(this.valueRank),
|
|
1331
|
-
c.yellow(" accessLevel : ") + node_opcua_data_model_1.AccessLevelFlag[this.accessLevel]
|
|
1332
|
-
];
|
|
1333
|
-
if (this.arrayDimensions?.length) {
|
|
1334
|
-
lines.push(c.yellow(" arrayDimensions: ") + JSON.stringify(this.arrayDimensions));
|
|
1335
|
-
}
|
|
1336
|
-
if (valueStr) {
|
|
1337
|
-
lines.push(c.yellow(" value : ") + valueStr);
|
|
1338
|
-
}
|
|
1339
|
-
if (statusStr && statusStr !== "Good (0x00000000)") {
|
|
1340
|
-
lines.push(c.yellow(" statusCode : ") + statusStr);
|
|
1341
|
-
}
|
|
1342
|
-
if (this.description?.text) {
|
|
1343
|
-
lines.push(c.yellow(" description : ") + this.description.text);
|
|
1344
|
-
}
|
|
1345
|
-
return lines.join("\n");
|
|
1346
|
-
}
|
|
1347
|
-
historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback) {
|
|
1348
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
1349
|
-
(0, node_opcua_assert_1.assert)(typeof callback === "function");
|
|
1350
|
-
if (typeof this._historyRead !== "function") {
|
|
1351
|
-
callback?.(null, new node_opcua_types_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadNotReadable }));
|
|
1352
|
-
return;
|
|
1353
|
-
}
|
|
1354
|
-
this._historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback);
|
|
1355
|
-
return undefined;
|
|
1356
|
-
}
|
|
1357
|
-
_historyReadRaw(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
|
|
1358
|
-
throw new Error("");
|
|
1359
|
-
}
|
|
1360
|
-
_historyReadRawModify(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
|
|
1361
|
-
throw new Error("");
|
|
1362
|
-
}
|
|
1363
|
-
_historyRead(context, _historyReadDetails, _indexRange, _dataEncoding, _continuationData, callback) {
|
|
1364
|
-
if (!this.checkPermissionPrivate(context, node_opcua_types_1.PermissionType.ReadHistory)) {
|
|
1365
|
-
const result = new node_opcua_types_1.HistoryReadResult({
|
|
1366
|
-
statusCode: node_opcua_status_code_1.StatusCodes.BadUserAccessDenied
|
|
1367
|
-
});
|
|
1368
|
-
callback(null, result);
|
|
1369
|
-
}
|
|
1370
|
-
if (!this.canUserReadHistory(context)) {
|
|
1371
|
-
const result = new node_opcua_types_1.HistoryReadResult({
|
|
1372
|
-
statusCode: node_opcua_status_code_1.StatusCodes.BadHistoryOperationUnsupported
|
|
1373
|
-
});
|
|
1374
|
-
callback(null, result);
|
|
1375
|
-
}
|
|
1376
|
-
const result = new node_opcua_types_1.HistoryReadResult({
|
|
1377
|
-
statusCode: node_opcua_status_code_1.StatusCodes.BadHistoryOperationUnsupported
|
|
1378
|
-
});
|
|
1379
|
-
callback(null, result);
|
|
1380
|
-
}
|
|
1381
|
-
_historyPush(_newDataValue) {
|
|
1382
|
-
throw new Error("");
|
|
1383
|
-
}
|
|
1384
|
-
_historyReadRawAsync(_historyReadRawModifiedDetails, _maxNumberToExtract, _isReversed, _reverseDataValue, _callback) {
|
|
1385
|
-
throw new Error("");
|
|
1386
|
-
}
|
|
1387
|
-
_historyReadModify(_context, _historyReadRawModifiedDetails, _indexRange, _dataEncoding, _continuationData, _callback) {
|
|
1388
|
-
throw new Error("");
|
|
1389
|
-
}
|
|
1390
|
-
_update_startOfOnlineArchive(_newDate) {
|
|
1391
|
-
// please install
|
|
1392
|
-
throw new Error("");
|
|
1393
|
-
}
|
|
1394
|
-
_update_startOfArchive(_newDate) {
|
|
1395
|
-
throw new Error("");
|
|
1396
|
-
}
|
|
1397
|
-
_validate_DataType(variantDataType) {
|
|
1398
|
-
return (0, validate_data_type_correctness_1.validateDataTypeCorrectness)(this.addressSpace, this.dataType, variantDataType, /* allow Nulls */ false, this.nodeId);
|
|
1399
|
-
}
|
|
1400
|
-
_internal_set_value(value) {
|
|
1401
|
-
if (value.dataType !== node_opcua_variant_1.DataType.Null) {
|
|
1402
|
-
this.verifyVariantCompatibility(value);
|
|
1403
|
-
}
|
|
1404
|
-
this.$dataValue.value = value;
|
|
1405
|
-
}
|
|
1406
|
-
_internal_set_dataValue(dataValue, indexRange) {
|
|
1407
|
-
(0, node_opcua_assert_1.assert)(dataValue, "expecting a dataValue");
|
|
1408
|
-
(0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue, "expecting dataValue to be a DataValue");
|
|
1409
|
-
(0, node_opcua_assert_1.assert)(dataValue !== this.$dataValue, "expecting dataValue to be different from previous DataValue instance");
|
|
1410
|
-
const addressSpace = this.addressSpace;
|
|
1411
|
-
// c8 ignore next
|
|
1412
|
-
if (!addressSpace) {
|
|
1413
|
-
warningLog("UAVariable#_internal_set_dataValue : no addressSpace ! may be node has already been deleted ?");
|
|
1414
|
-
return;
|
|
1415
|
-
}
|
|
1416
|
-
// c8 ignore next
|
|
1417
|
-
if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Matrix) {
|
|
1418
|
-
if (!dataValue.value.dimensions) {
|
|
1419
|
-
throw new Error("missing dimensions: a Matrix Variant needs a dimension");
|
|
1420
|
-
}
|
|
1421
|
-
const nbElements = dataValue.value.dimensions.reduce((acc, x) => acc * x, 1);
|
|
1422
|
-
if (dataValue.value.value.length !== 0 && dataValue.value.value.length !== nbElements) {
|
|
1423
|
-
throw new Error(`Internal Error: matrix dimension doesn't match the number of element in the array : ${dataValue.toString()} "\n expecting ${nbElements} elements but got ${dataValue.value.value.length}`);
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
// c8 ignore next
|
|
1427
|
-
if (dataValue.value.dataType === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
1428
|
-
// c8 ignore next
|
|
1429
|
-
if (!this.checkExtensionObjectIsCorrect(dataValue.value.value)) {
|
|
1430
|
-
warningLog(dataValue.toString());
|
|
1431
|
-
throw new Error(`Invalid Extension Object on nodeId =${this.nodeId.toString()}`);
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
this.verifyVariantCompatibility(dataValue.value);
|
|
1435
|
-
this._inner_replace_dataValue(dataValue, indexRange);
|
|
1436
|
-
}
|
|
1437
|
-
/**
|
|
1438
|
-
* @private
|
|
1439
|
-
*/
|
|
1440
|
-
_inner_replace_dataValue(dataValue, indexRange) {
|
|
1441
|
-
(0, node_opcua_assert_1.assert)(this.$dataValue.value instanceof node_opcua_variant_1.Variant);
|
|
1442
|
-
const old_dataValue = this.$dataValue.clone();
|
|
1443
|
-
if (this.$$extensionObjectArray && dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Scalar) {
|
|
1444
|
-
// we have a bounded array or matrix
|
|
1445
|
-
(0, node_opcua_assert_1.assert)(Array.isArray(dataValue.value.value));
|
|
1446
|
-
if (this.$$extensionObjectArray !== this.$dataValue.value.value) {
|
|
1447
|
-
throw new Error("internal error");
|
|
1448
|
-
}
|
|
1449
|
-
this.$$extensionObjectArray = dataValue.value.value;
|
|
1450
|
-
this.$dataValue.value.value = dataValue.value.value;
|
|
1451
|
-
this.$dataValue.statusCode = dataValue.statusCode || node_opcua_status_code_1.StatusCodes.Good;
|
|
1452
|
-
this.$dataValue.serverTimestamp = dataValue.serverTimestamp;
|
|
1453
|
-
this.$dataValue.serverPicoseconds = dataValue.serverPicoseconds;
|
|
1454
|
-
this.$dataValue.sourceTimestamp = dataValue.sourceTimestamp;
|
|
1455
|
-
this.$dataValue.sourcePicoseconds = dataValue.sourcePicoseconds;
|
|
1456
|
-
}
|
|
1457
|
-
else if (this._basicDataType === node_opcua_variant_1.DataType.ExtensionObject &&
|
|
1458
|
-
this.valueRank === -1 &&
|
|
1459
|
-
this.$set_ExtensionObject &&
|
|
1460
|
-
dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Scalar) {
|
|
1461
|
-
// the entire extension object is changed.
|
|
1462
|
-
this.$dataValue.statusCode = this.$dataValue.statusCode || node_opcua_status_code_1.StatusCodes.Good;
|
|
1463
|
-
const preciseClock = (0, node_opcua_date_time_1.coerceClock)(this.$dataValue.sourceTimestamp, this.$dataValue.sourcePicoseconds);
|
|
1464
|
-
this.$set_ExtensionObject(dataValue.value.value, preciseClock, new Set());
|
|
1465
|
-
}
|
|
1466
|
-
else {
|
|
1467
|
-
this.$dataValue = dataValue;
|
|
1468
|
-
this.$dataValue.statusCode = this.$dataValue.statusCode || node_opcua_status_code_1.StatusCodes.Good;
|
|
1469
|
-
}
|
|
1470
|
-
// repair missing timestamps
|
|
1471
|
-
const now = new Date();
|
|
1472
|
-
if (!dataValue.serverTimestamp) {
|
|
1473
|
-
this.$dataValue.serverTimestamp = old_dataValue.serverTimestamp || now;
|
|
1474
|
-
this.$dataValue.serverPicoseconds = old_dataValue.serverPicoseconds || 0;
|
|
1475
|
-
}
|
|
1476
|
-
if (!dataValue.sourceTimestamp) {
|
|
1477
|
-
this.$dataValue.sourceTimestamp = old_dataValue.sourceTimestamp || now;
|
|
1478
|
-
this.$dataValue.sourcePicoseconds = old_dataValue.sourcePicoseconds || 0;
|
|
1479
|
-
}
|
|
1480
|
-
if (!(0, node_opcua_data_value_1.sameDataValue)(old_dataValue, dataValue)) {
|
|
1481
|
-
if (this.getBasicDataType() === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
1482
|
-
const preciseClock = (0, node_opcua_date_time_1.coerceClock)(this.$dataValue.sourceTimestamp, this.$dataValue.sourcePicoseconds);
|
|
1483
|
-
const cache = new Set();
|
|
1484
|
-
if (this.$$extensionObjectArray) {
|
|
1485
|
-
this.touchValue(preciseClock);
|
|
1486
|
-
(0, ua_variable_impl_ext_obj_1.propagateTouchValueDownwardArray)(this, preciseClock, cache);
|
|
1487
|
-
}
|
|
1488
|
-
else {
|
|
1489
|
-
this.touchValue(preciseClock);
|
|
1490
|
-
(0, ua_variable_impl_ext_obj_1.propagateTouchValueDownward)(this, preciseClock, cache);
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
else {
|
|
1494
|
-
this.emit("value_changed", this.$dataValue.clone(), indexRange);
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
_conditionRefresh(_cache) {
|
|
1499
|
-
apply_condition_refresh_1.apply_condition_refresh.call(this, _cache);
|
|
1500
|
-
}
|
|
1501
|
-
handle_semantic_changed(_dataValue) {
|
|
1502
|
-
this.semantic_version = this.semantic_version + 1;
|
|
1503
|
-
this.emit("semantic_changed");
|
|
1504
|
-
}
|
|
1505
|
-
_readDataType() {
|
|
1506
|
-
(0, node_opcua_assert_1.assert)(this.dataType instanceof node_opcua_nodeid_1.NodeId);
|
|
1507
|
-
const options = {
|
|
1508
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1509
|
-
value: {
|
|
1510
|
-
dataType: node_opcua_variant_1.DataType.NodeId,
|
|
1511
|
-
value: this.dataType
|
|
1512
|
-
}
|
|
1513
|
-
};
|
|
1514
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1515
|
-
}
|
|
1516
|
-
_readValueRank() {
|
|
1517
|
-
(0, node_opcua_assert_1.assert)(typeof this.valueRank === "number");
|
|
1518
|
-
const options = {
|
|
1519
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1520
|
-
value: { dataType: node_opcua_variant_1.DataType.Int32, value: this.valueRank }
|
|
1521
|
-
};
|
|
1522
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1523
|
-
}
|
|
1524
|
-
_readArrayDimensions() {
|
|
1525
|
-
(0, node_opcua_assert_1.assert)(Array.isArray(this.arrayDimensions) || this.arrayDimensions === null);
|
|
1526
|
-
(0, node_opcua_assert_1.assert)(!this.arrayDimensions || this.valueRank > 0, "arrayDimension must be null if valueRank <0");
|
|
1527
|
-
const options = {
|
|
1528
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1529
|
-
value: { dataType: node_opcua_variant_1.DataType.UInt32, arrayType: node_opcua_variant_1.VariantArrayType.Array, value: this.arrayDimensions }
|
|
1530
|
-
};
|
|
1531
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1532
|
-
}
|
|
1533
|
-
_readAccessLevel(context) {
|
|
1534
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
1535
|
-
const options = {
|
|
1536
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1537
|
-
value: { dataType: node_opcua_variant_1.DataType.Byte, value: (0, node_opcua_data_model_1.convertAccessLevelFlagToByte)(this.accessLevel) }
|
|
1538
|
-
};
|
|
1539
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1540
|
-
}
|
|
1541
|
-
_readAccessLevelEx(context) {
|
|
1542
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
1543
|
-
const options = {
|
|
1544
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1545
|
-
// Extra flags are not supported yet. to do:
|
|
1546
|
-
value: { dataType: node_opcua_variant_1.DataType.UInt32, value: (0, node_opcua_data_model_1.convertAccessLevelFlagToByte)(this.accessLevel) }
|
|
1547
|
-
};
|
|
1548
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1549
|
-
}
|
|
1550
|
-
_readUserAccessLevel(context) {
|
|
1551
|
-
(0, node_opcua_assert_1.assert)(context instanceof session_context_1.SessionContext);
|
|
1552
|
-
const effectiveUserAccessLevel = _calculateEffectiveUserAccessLevelFromPermission(this, context, this.userAccessLevel);
|
|
1553
|
-
const options = {
|
|
1554
|
-
value: {
|
|
1555
|
-
dataType: node_opcua_variant_1.DataType.Byte,
|
|
1556
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1557
|
-
value: (0, node_opcua_data_model_1.convertAccessLevelFlagToByte)(effectiveUserAccessLevel)
|
|
1558
|
-
}
|
|
1559
|
-
};
|
|
1560
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1561
|
-
}
|
|
1562
|
-
_readMinimumSamplingInterval() {
|
|
1563
|
-
// expect a Duration => Double
|
|
1564
|
-
const options = {};
|
|
1565
|
-
if (this.minimumSamplingInterval === undefined) {
|
|
1566
|
-
options.statusCode = node_opcua_status_code_1.StatusCodes.BadAttributeIdInvalid;
|
|
1567
|
-
}
|
|
1568
|
-
else {
|
|
1569
|
-
options.value = { dataType: node_opcua_variant_1.DataType.Double, value: this.minimumSamplingInterval };
|
|
1570
|
-
options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
|
|
1571
|
-
}
|
|
1572
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1573
|
-
}
|
|
1574
|
-
_readHistorizing() {
|
|
1575
|
-
(0, node_opcua_assert_1.assert)(typeof this.historizing === "boolean");
|
|
1576
|
-
const options = {
|
|
1577
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good,
|
|
1578
|
-
value: { dataType: node_opcua_variant_1.DataType.Boolean, value: !!this.historizing }
|
|
1579
|
-
};
|
|
1580
|
-
return new node_opcua_data_value_1.DataValue(options);
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
exports.UAVariableImpl = UAVariableImpl;
|
|
1584
|
-
const thenify_ex_1 = require("thenify-ex");
|
|
1585
|
-
UAVariableImpl.prototype.asyncRefresh = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.asyncRefresh);
|
|
1586
|
-
UAVariableImpl.prototype.writeValue = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.writeValue);
|
|
1587
|
-
UAVariableImpl.prototype.writeAttribute = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.writeAttribute);
|
|
1588
|
-
UAVariableImpl.prototype.historyRead = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.historyRead);
|
|
1589
|
-
UAVariableImpl.prototype.readValueAsync = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.readValueAsync);
|
|
1590
|
-
function check_valid_array(dataType, array) {
|
|
1591
|
-
if (Array.isArray(array)) {
|
|
1592
|
-
return true;
|
|
1593
|
-
}
|
|
1594
|
-
switch (dataType) {
|
|
1595
|
-
case node_opcua_variant_1.DataType.Double:
|
|
1596
|
-
return array instanceof Float64Array;
|
|
1597
|
-
case node_opcua_variant_1.DataType.Float:
|
|
1598
|
-
return array instanceof Float32Array;
|
|
1599
|
-
case node_opcua_variant_1.DataType.Int32:
|
|
1600
|
-
return array instanceof Int32Array;
|
|
1601
|
-
case node_opcua_variant_1.DataType.Int16:
|
|
1602
|
-
return array instanceof Int16Array;
|
|
1603
|
-
case node_opcua_variant_1.DataType.SByte:
|
|
1604
|
-
return array instanceof Int8Array;
|
|
1605
|
-
case node_opcua_variant_1.DataType.UInt32:
|
|
1606
|
-
return array instanceof Uint32Array;
|
|
1607
|
-
case node_opcua_variant_1.DataType.UInt16:
|
|
1608
|
-
return array instanceof Uint16Array;
|
|
1609
|
-
case node_opcua_variant_1.DataType.Byte:
|
|
1610
|
-
return array instanceof Uint8Array || array instanceof Buffer;
|
|
1611
|
-
}
|
|
1612
|
-
return false;
|
|
1613
|
-
}
|
|
1614
|
-
// function _apply_default_timestamps(dataValue: DataValue): void {
|
|
1615
|
-
// const now = getCurrentClock();
|
|
1616
|
-
// assert(dataValue instanceof DataValue);
|
|
1617
|
-
// if (!dataValue.sourceTimestamp) {
|
|
1618
|
-
// dataValue.sourceTimestamp = now.timestamp;
|
|
1619
|
-
// dataValue.sourcePicoseconds = now.picoseconds;
|
|
1620
|
-
// }
|
|
1621
|
-
// if (!dataValue.serverTimestamp) {
|
|
1622
|
-
// dataValue.serverTimestamp = now.timestamp;
|
|
1623
|
-
// dataValue.serverPicoseconds = now.picoseconds;
|
|
1624
|
-
// }
|
|
1625
|
-
// }
|
|
1626
|
-
function unsetFlag(flags, mask) {
|
|
1627
|
-
return flags & ~mask;
|
|
1628
|
-
}
|
|
1629
|
-
function _setFlag(flags, mask) {
|
|
1630
|
-
return flags | mask;
|
|
1631
|
-
}
|
|
1632
|
-
function _calculateEffectiveUserAccessLevelFromPermission(node, context, userAccessLevel) {
|
|
1633
|
-
function __adjustFlag(permissionType, access, userAccessLevel1) {
|
|
1634
|
-
if ((node.accessLevel & access) === 0 || (userAccessLevel1 & access) === 0) {
|
|
1635
|
-
userAccessLevel1 = unsetFlag(userAccessLevel1, access);
|
|
1636
|
-
}
|
|
1637
|
-
else {
|
|
1638
|
-
if (!context.checkPermission(node, permissionType)) {
|
|
1639
|
-
userAccessLevel1 = unsetFlag(userAccessLevel1, access);
|
|
1640
|
-
}
|
|
1641
|
-
}
|
|
1642
|
-
return userAccessLevel1;
|
|
1643
|
-
}
|
|
1644
|
-
userAccessLevel = node.userAccessLevel === undefined ? node.accessLevel : node.userAccessLevel & node.accessLevel;
|
|
1645
|
-
if (context.checkPermission) {
|
|
1646
|
-
(0, node_opcua_assert_1.assert)(context.checkPermission instanceof Function);
|
|
1647
|
-
userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Read, node_opcua_data_model_1.AccessLevelFlag.CurrentRead, userAccessLevel);
|
|
1648
|
-
userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.CurrentWrite, userAccessLevel);
|
|
1649
|
-
userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.StatusWrite, userAccessLevel);
|
|
1650
|
-
userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.Write, node_opcua_data_model_1.AccessLevelFlag.TimestampWrite, userAccessLevel);
|
|
1651
|
-
userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.ReadHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryRead, userAccessLevel);
|
|
1652
|
-
userAccessLevel = __adjustFlag(node_opcua_types_1.PermissionType.DeleteHistory, node_opcua_data_model_1.AccessLevelFlag.HistoryWrite, userAccessLevel);
|
|
1653
|
-
return userAccessLevel;
|
|
1654
|
-
}
|
|
1655
|
-
else {
|
|
1656
|
-
return userAccessLevel;
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
function adjustVariant2(variant) {
|
|
1660
|
-
// convert Variant( Scalar|ByteString) => Variant(Array|ByteArray)
|
|
1661
|
-
const _addressSpace = this.addressSpace;
|
|
1662
|
-
const basicType = this.getBasicDataType();
|
|
1663
|
-
variant = (0, node_opcua_variant_1.adjustVariant)(variant, this.valueRank, basicType);
|
|
1664
|
-
return variant;
|
|
1665
|
-
}
|
|
1666
|
-
function _not_writable_timestamped_set_func(dataValue, callback) {
|
|
1667
|
-
(0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue);
|
|
1668
|
-
callback(null, node_opcua_status_code_1.StatusCodes.BadNotWritable, null);
|
|
1669
|
-
}
|
|
1670
|
-
function _default_writable_timestamped_set_func(dataValue, callback) {
|
|
1671
|
-
(0, node_opcua_assert_1.assert)(dataValue instanceof node_opcua_data_value_1.DataValue);
|
|
1672
|
-
callback(null, node_opcua_status_code_1.StatusCodes.Good, dataValue);
|
|
1673
|
-
}
|
|
1674
|
-
function turn_sync_to_async(f, numberOfArgs) {
|
|
1675
|
-
if (f.length <= numberOfArgs) {
|
|
1676
|
-
return function (data, callback) {
|
|
1677
|
-
new Promise((resolve, reject) => {
|
|
1678
|
-
try {
|
|
1679
|
-
// const ff1 = f as f1<T, D, R>;
|
|
1680
|
-
const ff2 = f;
|
|
1681
|
-
const r = ff2.call(this, data);
|
|
1682
|
-
if (r instanceof Promise) {
|
|
1683
|
-
r.then(resolve, reject);
|
|
1684
|
-
}
|
|
1685
|
-
else {
|
|
1686
|
-
resolve(r);
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
catch (err) {
|
|
1690
|
-
reject(err);
|
|
1691
|
-
}
|
|
1692
|
-
})
|
|
1693
|
-
.then((r) => {
|
|
1694
|
-
callback(null, r);
|
|
1695
|
-
})
|
|
1696
|
-
.catch((err) => {
|
|
1697
|
-
callback(err);
|
|
1698
|
-
});
|
|
1699
|
-
};
|
|
1700
|
-
}
|
|
1701
|
-
else {
|
|
1702
|
-
(0, node_opcua_assert_1.assert)(f.length === numberOfArgs + 1);
|
|
1703
|
-
return f;
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
const _default_minimumSamplingInterval = 1000;
|
|
1707
|
-
function coerceDataValue(dataValue) {
|
|
1708
|
-
if (dataValue instanceof node_opcua_data_value_1.DataValue) {
|
|
1709
|
-
return dataValue;
|
|
1710
|
-
}
|
|
1711
|
-
return new node_opcua_data_value_1.DataValue(dataValue);
|
|
1712
|
-
}
|
|
1713
|
-
// variation #3 :
|
|
1714
|
-
function _Variable_bind_with_async_refresh(options) {
|
|
1715
|
-
(0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
|
|
1716
|
-
(0, node_opcua_assert_1.assert)(typeof options.refreshFunc === "function");
|
|
1717
|
-
(0, node_opcua_assert_1.assert)(!options.get, "a getter shall not be specified when refreshFunc is set");
|
|
1718
|
-
(0, node_opcua_assert_1.assert)(!options.timestamped_get, "a getter shall not be specified when refreshFunc is set");
|
|
1719
|
-
(0, node_opcua_assert_1.assert)(!this.refreshFunc);
|
|
1720
|
-
this.refreshFunc = options.refreshFunc;
|
|
1721
|
-
/*
|
|
1722
|
-
// TO DO : REVISIT THIS ASSUMPTION
|
|
1723
|
-
if (false && this.minimumSamplingInterval === 0) {
|
|
1724
|
-
// when a getter /timestamped_getter or async_getter is provided
|
|
1725
|
-
// samplingInterval cannot be 0, as the item value must be scanned to be updated.
|
|
1726
|
-
this.minimumSamplingInterval = _default_minimumSamplingInterval; // MonitoredItem.minimumSamplingInterval;
|
|
1727
|
-
// c8 ignore next
|
|
1728
|
-
doDebug && debugLog(`adapting minimumSamplingInterval on ${this.browseName.toString()} to ${this.minimumSamplingInterval}`);
|
|
1729
|
-
}
|
|
1730
|
-
*/
|
|
1731
|
-
}
|
|
1732
|
-
// variation 2
|
|
1733
|
-
function _Variable_bind_with_timestamped_get(options) {
|
|
1734
|
-
/* jshint validthis: true */
|
|
1735
|
-
(0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
|
|
1736
|
-
(0, node_opcua_assert_1.assert)(typeof options.timestamped_get === "function");
|
|
1737
|
-
(0, node_opcua_assert_1.assert)(!options.get, "should not specify 'get' when 'timestamped_get' exists ");
|
|
1738
|
-
(0, node_opcua_assert_1.assert)(!this._timestamped_get_func);
|
|
1739
|
-
const async_refresh_func = (callback) => {
|
|
1740
|
-
Promise.resolve(this._timestamped_get_func.call(this))
|
|
1741
|
-
.then((dataValue) => callback(null, dataValue))
|
|
1742
|
-
.catch((err) => {
|
|
1743
|
-
errorLog("asyncRefresh error: Variable is ", this.nodeId.toString(), this.browseName.toString());
|
|
1744
|
-
callback(err);
|
|
1745
|
-
});
|
|
1746
|
-
};
|
|
1747
|
-
const pThis = this;
|
|
1748
|
-
if (options.timestamped_get.length === 0) {
|
|
1749
|
-
const timestamped_get = options.timestamped_get;
|
|
1750
|
-
// sync version | Promise version
|
|
1751
|
-
this._timestamped_get_func = timestamped_get;
|
|
1752
|
-
const dataValue_verify = timestamped_get.call(pThis);
|
|
1753
|
-
// dataValue_verify should be a DataValue or a Promise
|
|
1754
|
-
/* c8 ignore next */
|
|
1755
|
-
if (!(dataValue_verify instanceof node_opcua_data_value_1.DataValue) && typeof dataValue_verify.then !== "function") {
|
|
1756
|
-
errorLog(chalk_1.default.red(" Bind variable error: "), " the timestamped_get function must return a DataValue or a Promise<DataValue>" +
|
|
1757
|
-
"\n value_check.constructor.name ", dataValue_verify ? dataValue_verify.constructor.name : "null");
|
|
1758
|
-
throw new Error(" Bind variable error: " + " the timestamped_get function must return a DataValue");
|
|
1759
|
-
}
|
|
1760
|
-
_Variable_bind_with_async_refresh.call(this, { refreshFunc: async_refresh_func });
|
|
1761
|
-
}
|
|
1762
|
-
else if (options.timestamped_get.length === 1) {
|
|
1763
|
-
_Variable_bind_with_async_refresh.call(this, { refreshFunc: options.timestamped_get });
|
|
1764
|
-
}
|
|
1765
|
-
else {
|
|
1766
|
-
errorLog("timestamped_get has a invalid number of argument , should be 0 or 1 ");
|
|
1767
|
-
throw new Error("timestamped_get has a invalid number of argument , should be 0 or 1 ");
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
// variation 1
|
|
1771
|
-
function _Variable_bind_with_simple_get(options) {
|
|
1772
|
-
(0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
|
|
1773
|
-
(0, node_opcua_assert_1.assert)(typeof options.get === "function", "should specify get function");
|
|
1774
|
-
(0, node_opcua_assert_1.assert)(options.get?.length === 0, "get function should not have arguments");
|
|
1775
|
-
(0, node_opcua_assert_1.assert)(!options.timestamped_get, "should not specify a timestamped_get function when get is specified");
|
|
1776
|
-
(0, node_opcua_assert_1.assert)(!this._timestamped_get_func);
|
|
1777
|
-
(0, node_opcua_assert_1.assert)(!this._get_func);
|
|
1778
|
-
this._get_func = options.get;
|
|
1779
|
-
const timestamped_get_func_from__Variable_bind_with_simple_get = () => {
|
|
1780
|
-
const value = this._get_func();
|
|
1781
|
-
/* c8 ignore next */
|
|
1782
|
-
if (!is_Variant_or_StatusCode(value)) {
|
|
1783
|
-
errorLog(chalk_1.default.red(" Bind variable error: "), " : the getter must return a Variant or a StatusCode" + "\nvalue_check.constructor.name ", value ? value.constructor.name : "null");
|
|
1784
|
-
throw new Error(" bindVariable : the value getter function returns a invalid result ( expecting a Variant or a StatusCode !!!");
|
|
1785
|
-
}
|
|
1786
|
-
if (is_StatusCode(value)) {
|
|
1787
|
-
return new node_opcua_data_value_1.DataValue({ statusCode: value });
|
|
1788
|
-
}
|
|
1789
|
-
else {
|
|
1790
|
-
if (!this.$dataValue?.statusCode.isGoodish() || !(0, node_opcua_variant_1.sameVariant)(this.$dataValue.value, value)) {
|
|
1791
|
-
// rebuilding artificially timestamps with current clock as they are not provided
|
|
1792
|
-
// by the underlying getter function
|
|
1793
|
-
const { timestamp: sourceTimestamp, picoseconds: sourcePicoseconds } = (0, node_opcua_date_time_1.getCurrentClock)();
|
|
1794
|
-
const serverTimestamp = sourceTimestamp;
|
|
1795
|
-
const serverPicoseconds = sourcePicoseconds;
|
|
1796
|
-
this._inner_replace_dataValue(new node_opcua_data_value_1.DataValue({ value, sourceTimestamp, sourcePicoseconds, serverTimestamp, serverPicoseconds }));
|
|
1797
|
-
}
|
|
1798
|
-
return this.$dataValue;
|
|
1799
|
-
}
|
|
1800
|
-
};
|
|
1801
|
-
_Variable_bind_with_timestamped_get.call(this, {
|
|
1802
|
-
get: undefined,
|
|
1803
|
-
timestamped_get: timestamped_get_func_from__Variable_bind_with_simple_get
|
|
1804
|
-
});
|
|
1805
|
-
}
|
|
1806
|
-
function _Variable_bind_with_simple_set(options) {
|
|
1807
|
-
(0, node_opcua_assert_1.assert)(this instanceof UAVariableImpl);
|
|
1808
|
-
(0, node_opcua_assert_1.assert)(typeof options.set === "function", "should specify set function");
|
|
1809
|
-
(0, node_opcua_assert_1.assert)(!options.timestamped_set, "should not specify a timestamped_set function");
|
|
1810
|
-
(0, node_opcua_assert_1.assert)(!this._timestamped_set_func);
|
|
1811
|
-
(0, node_opcua_assert_1.assert)(!this._set_func);
|
|
1812
|
-
//
|
|
1813
|
-
const set_func = turn_sync_to_async(options.set, 1);
|
|
1814
|
-
this._set_func = set_func;
|
|
1815
|
-
(0, node_opcua_assert_1.assert)(set_func.length === 2, " set function must have 2 arguments ( variant, callback)");
|
|
1816
|
-
this._timestamped_set_func = (timestamped_value, callback) => {
|
|
1817
|
-
(0, node_opcua_assert_1.assert)(timestamped_value instanceof node_opcua_data_value_1.DataValue);
|
|
1818
|
-
set_func.call(this, timestamped_value.value, (err, statusCode) => {
|
|
1819
|
-
// c8 ignore next
|
|
1820
|
-
if (!err && !statusCode) {
|
|
1821
|
-
errorLog(chalk_1.default.red("UAVariable Binding Error _set_func must return a StatusCode, check the bindVariable parameters"));
|
|
1822
|
-
errorLog(chalk_1.default.yellow("StatusCode.Good is assumed"));
|
|
1823
|
-
return callback(err, node_opcua_status_code_1.StatusCodes.Good, timestamped_value);
|
|
1824
|
-
}
|
|
1825
|
-
if (statusCode?.isNotGood()) {
|
|
1826
|
-
// record the value but still record the statusCode !
|
|
1827
|
-
timestamped_value.statusCode = statusCode;
|
|
1828
|
-
}
|
|
1829
|
-
callback(err, statusCode ?? node_opcua_status_code_1.StatusCodes.BadInternalError, timestamped_value);
|
|
1830
|
-
});
|
|
1831
|
-
};
|
|
1832
|
-
}
|
|
1833
|
-
function _Variable_bind_with_timestamped_set(options) {
|
|
1834
|
-
(0, node_opcua_assert_1.assert)(options.timestamped_set.length === 2 || options.timestamped_set.length === 1, "timestamped_set must have 2 parameters timestamped_set: function(dataValue,callback){} or one paramater timestamped_set: function(dataValue): Promise<StatusCode>{}");
|
|
1835
|
-
(0, node_opcua_assert_1.assert)(!options.set, "should not specify set when timestamped_set_func exists ");
|
|
1836
|
-
this._timestamped_set_func = (0, multiform_func_1.convertToCallbackFunction1)(options.timestamped_set);
|
|
1837
|
-
}
|
|
1838
|
-
function bind_setter(options) {
|
|
1839
|
-
if (options.set && typeof options.set === "function") {
|
|
1840
|
-
// variation 1
|
|
1841
|
-
if (options.timestamped_set === undefined) {
|
|
1842
|
-
_Variable_bind_with_simple_set.call(this, options);
|
|
1843
|
-
}
|
|
1844
|
-
else {
|
|
1845
|
-
throw new Error("bind_setter : options should not specify both set and timestamped_set ");
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
else if (typeof options.timestamped_set === "function") {
|
|
1849
|
-
// variation 2
|
|
1850
|
-
(0, node_opcua_assert_1.assert)(typeof options.timestamped_get === "function", "timestamped_set must be used with timestamped_get ");
|
|
1851
|
-
_Variable_bind_with_timestamped_set.call(this, {
|
|
1852
|
-
set: undefined,
|
|
1853
|
-
timestamped_set: options.timestamped_set
|
|
1854
|
-
});
|
|
1855
|
-
}
|
|
1856
|
-
else if (typeof options.timestamped_get === "function") {
|
|
1857
|
-
// timestamped_get is specified but timestamped_set is not
|
|
1858
|
-
// => Value is read-only
|
|
1859
|
-
_Variable_bind_with_timestamped_set.call(this, {
|
|
1860
|
-
set: undefined,
|
|
1861
|
-
timestamped_set: _not_writable_timestamped_set_func
|
|
1862
|
-
});
|
|
1863
|
-
}
|
|
1864
|
-
else {
|
|
1865
|
-
_Variable_bind_with_timestamped_set.call(this, {
|
|
1866
|
-
set: undefined,
|
|
1867
|
-
timestamped_set: _default_writable_timestamped_set_func
|
|
1868
|
-
});
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1871
|
-
function bind_getter(options) {
|
|
1872
|
-
if (typeof options.get === "function") {
|
|
1873
|
-
// variation 1
|
|
1874
|
-
_Variable_bind_with_simple_get.call(this, options);
|
|
1875
|
-
}
|
|
1876
|
-
else if (typeof options.timestamped_get === "function") {
|
|
1877
|
-
// variation 2
|
|
1878
|
-
_Variable_bind_with_timestamped_get.call(this, {
|
|
1879
|
-
get: undefined,
|
|
1880
|
-
timestamped_get: options.timestamped_get
|
|
1881
|
-
});
|
|
1882
|
-
}
|
|
1883
|
-
else if (typeof options.refreshFunc === "function") {
|
|
1884
|
-
// variation 3
|
|
1885
|
-
if (options.get !== undefined || options.timestamped_get !== undefined) {
|
|
1886
|
-
throw new Error("bind_getter : options should not specify both get and timestamped_get ");
|
|
1887
|
-
}
|
|
1888
|
-
_Variable_bind_with_async_refresh.call(this, { refreshFunc: options.refreshFunc });
|
|
1889
|
-
}
|
|
1890
|
-
else {
|
|
1891
|
-
(0, node_opcua_assert_1.assert)(!Object.hasOwn(options, "set"), "getter is missing : a getter must be provided if a setter is provided");
|
|
1892
|
-
// xx bind_variant.call(this,options);
|
|
1893
|
-
if (options.dataType !== undefined) {
|
|
1894
|
-
// if (options.dataType !== DataType.ExtensionObject) {
|
|
1895
|
-
this.setValueFromSource(options);
|
|
1896
|
-
// }
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
class UAVariableImplT extends UAVariableImpl {
|
|
1901
|
-
readValue(context, indexRange, dataEncoding) {
|
|
1902
|
-
return super.readValue(context, indexRange, dataEncoding);
|
|
1903
|
-
}
|
|
1904
|
-
readValueAsync(context, callback) {
|
|
1905
|
-
return super.readValueAsync(context, callback);
|
|
1906
|
-
}
|
|
1907
|
-
writeValue(context, dataValue, indexRangeOrCallback, callback) {
|
|
1908
|
-
return super.writeValue(context, dataValue, indexRangeOrCallback, callback);
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
exports.UAVariableImplT = UAVariableImplT;
|
|
1912
|
-
function changeUAVariableDataType(uaVariable, newDataType, valueLike) {
|
|
1913
|
-
let value = valueLike ? (valueLike instanceof node_opcua_variant_1.Variant ? valueLike : new node_opcua_variant_1.Variant(valueLike)) : null;
|
|
1914
|
-
const addressSpace = uaVariable.addressSpace;
|
|
1915
|
-
const newDataTypeNode = addressSpace.findNode(newDataType);
|
|
1916
|
-
// c8 ignore next
|
|
1917
|
-
if (!newDataTypeNode || !(newDataTypeNode instanceof ua_data_type_impl_1.UADataTypeImpl)) {
|
|
1918
|
-
throw new Error(`Cannot find newDataTypeNode ${newDataType.toString()}`);
|
|
1919
|
-
}
|
|
1920
|
-
const newBaseDataType = newDataTypeNode.basicDataType;
|
|
1921
|
-
// c8 ignore next
|
|
1922
|
-
if (newBaseDataType === node_opcua_variant_1.DataType.Null) {
|
|
1923
|
-
throw new Error("newDataTypeNode must be a DataType");
|
|
1924
|
-
}
|
|
1925
|
-
if (!value) {
|
|
1926
|
-
value = uaVariable.readValue().value;
|
|
1927
|
-
value.dataType = newBaseDataType;
|
|
1928
|
-
}
|
|
1929
|
-
if (newBaseDataType !== value.dataType) {
|
|
1930
|
-
throw new Error("newDataTypeNode must be of the same base dataType as the value");
|
|
1931
|
-
}
|
|
1932
|
-
// change uaVariable.dataType
|
|
1933
|
-
uaVariable.dataType = newDataTypeNode.nodeId;
|
|
1934
|
-
uaVariable._basicDataType = null;
|
|
1935
|
-
uaVariable.$dataValue.value.dataType = newBaseDataType;
|
|
1936
|
-
uaVariable.$dataValue.value = value;
|
|
1937
|
-
// also change the value to ensure that we have a default value with the correct dataType
|
|
1938
|
-
uaVariable._internal_set_value(value);
|
|
1939
|
-
}
|
|
1940
|
-
//# sourceMappingURL=ua_variable_impl.js.map
|