node-opcua-address-space 2.183.1 → 2.184.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/helpers/adjust_browse_direction.ts +1 -1
- package/api/helpers/argument_list.ts +9 -9
- package/api/helpers/coerce_enum_value.ts +1 -0
- package/api/helpers/dump_tools.ts +1 -1
- package/api/index.ts +2 -1
- package/api/interfaces/data_access/ua_multistate_discrete_ex.ts +1 -1
- package/api/interfaces/nodeset_loader_options.ts +17 -0
- package/api/loader/decode_xml_extension_object.ts +1 -1
- package/api/loader/ensure_datatype_extracted.ts +73 -37
- package/api/loader/generateAddressSpaceRaw.ts +32 -22
- package/api/loader/load_nodeset2.ts +2 -2
- package/api/loader/namespace_post_step.ts +1 -1
- package/api/loader/narrow_instance_datatypes.ts +22 -9
- package/api/loader/nodeset_image_codec.ts +26 -12
- package/api/loader/nodeset_record_applier.ts +1 -1
- package/api/loader/nodeset_xml_producer.ts +8 -6
- package/api/loader/parsers/extension_object_parser.ts +3 -3
- package/api/pseudo_session.ts +1 -1
- package/bin/{nodeset_equivalence.js → nodeset_equivalence.cjs} +1 -1
- package/bin/{opcua-nodeset-image.js → opcua-nodeset-image.cjs} +1 -1
- package/bin/{opcua-nodeset-live.js → opcua-nodeset-live.cjs} +2 -2
- package/dist/api/address_space_public.d.ts +1 -0
- package/dist/api/address_space_public.d.ts.map +1 -0
- package/dist/api/address_space_public.js +2 -5
- package/dist/api/address_space_public.js.map +1 -1
- package/dist/api/address_space_ts.d.ts +1 -0
- package/dist/api/address_space_ts.d.ts.map +1 -0
- package/dist/api/address_space_ts.js +2 -5
- package/dist/api/address_space_ts.js.map +1 -1
- package/dist/api/continuation_points/continuation_point_manager.d.ts +1 -0
- package/dist/api/continuation_points/continuation_point_manager.d.ts.map +1 -0
- package/dist/api/continuation_points/continuation_point_manager.js +13 -17
- package/dist/api/continuation_points/continuation_point_manager.js.map +1 -1
- package/dist/api/helpers/adjust_browse_direction.d.ts +1 -0
- package/dist/api/helpers/adjust_browse_direction.d.ts.map +1 -0
- package/dist/api/helpers/adjust_browse_direction.js +2 -5
- package/dist/api/helpers/adjust_browse_direction.js.map +1 -1
- package/dist/api/helpers/argument_list.d.ts +1 -0
- package/dist/api/helpers/argument_list.d.ts.map +1 -0
- package/dist/api/helpers/argument_list.js +61 -69
- package/dist/api/helpers/argument_list.js.map +1 -1
- package/dist/api/helpers/call_helpers.d.ts +1 -0
- package/dist/api/helpers/call_helpers.d.ts.map +1 -0
- package/dist/api/helpers/call_helpers.js +25 -28
- package/dist/api/helpers/call_helpers.js.map +1 -1
- package/dist/api/helpers/coerce_enum_value.d.ts +1 -0
- package/dist/api/helpers/coerce_enum_value.d.ts.map +1 -0
- package/dist/api/helpers/coerce_enum_value.js +15 -17
- package/dist/api/helpers/coerce_enum_value.js.map +1 -1
- package/dist/api/helpers/dump_tools.d.ts +1 -0
- package/dist/api/helpers/dump_tools.d.ts.map +1 -0
- package/dist/api/helpers/dump_tools.js +19 -29
- package/dist/api/helpers/dump_tools.js.map +1 -1
- package/dist/api/helpers/ensure_secure_access.d.ts +1 -0
- package/dist/api/helpers/ensure_secure_access.d.ts.map +1 -0
- package/dist/api/helpers/ensure_secure_access.js +24 -28
- package/dist/api/helpers/ensure_secure_access.js.map +1 -1
- package/dist/api/helpers/make_optionals_map.d.ts +1 -0
- package/dist/api/helpers/make_optionals_map.d.ts.map +1 -0
- package/dist/api/helpers/make_optionals_map.js +1 -4
- package/dist/api/helpers/make_optionals_map.js.map +1 -1
- package/dist/api/helpers/multiform_func.d.ts +1 -0
- package/dist/api/helpers/multiform_func.d.ts.map +1 -0
- package/dist/api/helpers/multiform_func.js +4 -8
- package/dist/api/helpers/multiform_func.js.map +1 -1
- package/dist/api/helpers/resolve_opaque_on_address_space.d.ts +1 -0
- package/dist/api/helpers/resolve_opaque_on_address_space.d.ts.map +1 -0
- package/dist/api/helpers/resolve_opaque_on_address_space.js +10 -13
- package/dist/api/helpers/resolve_opaque_on_address_space.js.map +1 -1
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +93 -218
- package/dist/api/index.js.map +1 -1
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js +2 -5
- package/dist/api/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -1
- package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/condition_snapshot.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/deviation_stuff.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/install_setpoint_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/install_setpoint_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_condition_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/promote_to_alarm_options.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/promote_to_alarm_options.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/promote_to_alarm_options.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_base_event_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_condition_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +1 -2
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts.map +1 -0
- package/dist/api/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +1 -2
- package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.d.ts +2 -1
- package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.d.ts.map +1 -0
- package/dist/api/interfaces/data_access/ua_multistate_discrete_ex.js +1 -2
- package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +1 -0
- package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts.map +1 -0
- package/dist/api/interfaces/data_access/ua_multistate_value_discrete_ex.js +1 -2
- package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.d.ts +1 -0
- package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.d.ts.map +1 -0
- package/dist/api/interfaces/data_access/ua_two_state_discrete_ex.js +1 -2
- package/dist/api/interfaces/data_access/ua_y_array_item_ex.d.ts +1 -0
- package/dist/api/interfaces/data_access/ua_y_array_item_ex.d.ts.map +1 -0
- package/dist/api/interfaces/data_access/ua_y_array_item_ex.js +1 -2
- package/dist/api/interfaces/extension_object_constructor.d.ts +1 -0
- package/dist/api/interfaces/extension_object_constructor.d.ts.map +1 -0
- package/dist/api/interfaces/extension_object_constructor.js +1 -2
- package/dist/api/interfaces/i_condition_variable_type_setter_options.d.ts +1 -0
- package/dist/api/interfaces/i_condition_variable_type_setter_options.d.ts.map +1 -0
- package/dist/api/interfaces/i_condition_variable_type_setter_options.js +1 -2
- package/dist/api/interfaces/i_set_state_options.d.ts +1 -0
- package/dist/api/interfaces/i_set_state_options.d.ts.map +1 -0
- package/dist/api/interfaces/i_set_state_options.js +1 -2
- package/dist/api/interfaces/nodeset_loader_options.d.ts +18 -0
- package/dist/api/interfaces/nodeset_loader_options.d.ts.map +1 -0
- package/dist/api/interfaces/nodeset_loader_options.js +1 -2
- package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +1 -0
- package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts.map +1 -0
- package/dist/api/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +1 -2
- package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.d.ts +1 -0
- package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.d.ts.map +1 -0
- package/dist/api/interfaces/state_machine/ua_finite_state_machine_type.js +1 -2
- package/dist/api/interfaces/state_machine/ua_program_state_machine_type.d.ts +1 -0
- package/dist/api/interfaces/state_machine/ua_program_state_machine_type.d.ts.map +1 -0
- package/dist/api/interfaces/state_machine/ua_program_state_machine_type.js +1 -2
- package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +1 -0
- package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts.map +1 -0
- package/dist/api/interfaces/state_machine/ua_shelved_state_machine_ex.js +1 -2
- package/dist/api/interfaces/state_machine/ua_state_machine_type.d.ts +1 -0
- package/dist/api/interfaces/state_machine/ua_state_machine_type.d.ts.map +1 -0
- package/dist/api/interfaces/state_machine/ua_state_machine_type.js +1 -2
- package/dist/api/interfaces/state_machine/ua_state_machine_type.js.map +1 -1
- package/dist/api/interfaces/state_machine/ua_transition_ex.d.ts +1 -0
- package/dist/api/interfaces/state_machine/ua_transition_ex.d.ts.map +1 -0
- package/dist/api/interfaces/state_machine/ua_transition_ex.js +1 -2
- package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +1 -0
- package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.d.ts.map +1 -0
- package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.js +1 -2
- package/dist/api/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -1
- package/dist/api/loader/decode_xml_extension_object.d.ts +1 -0
- package/dist/api/loader/decode_xml_extension_object.d.ts.map +1 -0
- package/dist/api/loader/decode_xml_extension_object.js +13 -17
- package/dist/api/loader/decode_xml_extension_object.js.map +1 -1
- package/dist/api/loader/ensure_datatype_extracted.d.ts +1 -0
- package/dist/api/loader/ensure_datatype_extracted.d.ts.map +1 -0
- package/dist/api/loader/ensure_datatype_extracted.js +83 -52
- package/dist/api/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/api/loader/generateAddressSpaceRaw.d.ts +1 -0
- package/dist/api/loader/generateAddressSpaceRaw.d.ts.map +1 -0
- package/dist/api/loader/generateAddressSpaceRaw.js +76 -74
- package/dist/api/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/api/loader/load_nodeset2.d.ts +1 -0
- package/dist/api/loader/load_nodeset2.d.ts.map +1 -0
- package/dist/api/loader/load_nodeset2.js +44 -51
- package/dist/api/loader/load_nodeset2.js.map +1 -1
- package/dist/api/loader/make_semver_compatible.d.ts +1 -0
- package/dist/api/loader/make_semver_compatible.d.ts.map +1 -0
- package/dist/api/loader/make_semver_compatible.js +1 -4
- package/dist/api/loader/make_semver_compatible.js.map +1 -1
- package/dist/api/loader/make_xml_extension_object_parser.d.ts +1 -0
- package/dist/api/loader/make_xml_extension_object_parser.d.ts.map +1 -0
- package/dist/api/loader/make_xml_extension_object_parser.js +37 -40
- package/dist/api/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/api/loader/namespace_post_step.d.ts +1 -0
- package/dist/api/loader/namespace_post_step.d.ts.map +1 -0
- package/dist/api/loader/namespace_post_step.js +12 -17
- package/dist/api/loader/namespace_post_step.js.map +1 -1
- package/dist/api/loader/narrow_instance_datatypes.d.ts +1 -0
- package/dist/api/loader/narrow_instance_datatypes.d.ts.map +1 -0
- package/dist/api/loader/narrow_instance_datatypes.js +38 -28
- package/dist/api/loader/narrow_instance_datatypes.js.map +1 -1
- package/dist/api/loader/nodeset_builtin_formats.d.ts +1 -0
- package/dist/api/loader/nodeset_builtin_formats.d.ts.map +1 -0
- package/dist/api/loader/nodeset_builtin_formats.js +20 -25
- package/dist/api/loader/nodeset_builtin_formats.js.map +1 -1
- package/dist/api/loader/nodeset_format.d.ts +1 -0
- package/dist/api/loader/nodeset_format.d.ts.map +1 -0
- package/dist/api/loader/nodeset_format.js +4 -10
- package/dist/api/loader/nodeset_format.js.map +1 -1
- package/dist/api/loader/nodeset_image.d.ts +1 -0
- package/dist/api/loader/nodeset_image.d.ts.map +1 -0
- package/dist/api/loader/nodeset_image.js +38 -54
- package/dist/api/loader/nodeset_image.js.map +1 -1
- package/dist/api/loader/nodeset_image_codec.d.ts +1 -0
- package/dist/api/loader/nodeset_image_codec.d.ts.map +1 -0
- package/dist/api/loader/nodeset_image_codec.js +118 -116
- package/dist/api/loader/nodeset_image_codec.js.map +1 -1
- package/dist/api/loader/nodeset_image_store.d.ts +1 -0
- package/dist/api/loader/nodeset_image_store.d.ts.map +1 -0
- package/dist/api/loader/nodeset_image_store.js +5 -11
- package/dist/api/loader/nodeset_image_store.js.map +1 -1
- package/dist/api/loader/nodeset_record.d.ts +1 -0
- package/dist/api/loader/nodeset_record.d.ts.map +1 -0
- package/dist/api/loader/nodeset_record.js +3 -7
- package/dist/api/loader/nodeset_record.js.map +1 -1
- package/dist/api/loader/nodeset_record_applier.d.ts +1 -0
- package/dist/api/loader/nodeset_record_applier.d.ts.map +1 -0
- package/dist/api/loader/nodeset_record_applier.js +89 -97
- package/dist/api/loader/nodeset_record_applier.js.map +1 -1
- package/dist/api/loader/nodeset_records_to_xml.d.ts +1 -0
- package/dist/api/loader/nodeset_records_to_xml.d.ts.map +1 -0
- package/dist/api/loader/nodeset_records_to_xml.js +82 -88
- package/dist/api/loader/nodeset_records_to_xml.js.map +1 -1
- package/dist/api/loader/nodeset_source.d.ts +1 -0
- package/dist/api/loader/nodeset_source.d.ts.map +1 -0
- package/dist/api/loader/nodeset_source.js +14 -21
- package/dist/api/loader/nodeset_source.js.map +1 -1
- package/dist/api/loader/nodeset_source_helpers.d.ts +1 -0
- package/dist/api/loader/nodeset_source_helpers.d.ts.map +1 -0
- package/dist/api/loader/nodeset_source_helpers.js +2 -6
- package/dist/api/loader/nodeset_source_helpers.js.map +1 -1
- package/dist/api/loader/nodeset_to_image.d.ts +1 -0
- package/dist/api/loader/nodeset_to_image.d.ts.map +1 -0
- package/dist/api/loader/nodeset_to_image.js +12 -15
- package/dist/api/loader/nodeset_to_image.js.map +1 -1
- package/dist/api/loader/nodeset_xml_header.d.ts +1 -0
- package/dist/api/loader/nodeset_xml_header.d.ts.map +1 -0
- package/dist/api/loader/nodeset_xml_header.js +9 -14
- package/dist/api/loader/nodeset_xml_header.js.map +1 -1
- package/dist/api/loader/nodeset_xml_primitives.d.ts +1 -0
- package/dist/api/loader/nodeset_xml_primitives.d.ts.map +1 -0
- package/dist/api/loader/nodeset_xml_primitives.js +32 -53
- package/dist/api/loader/nodeset_xml_primitives.js.map +1 -1
- package/dist/api/loader/nodeset_xml_producer.d.ts +1 -0
- package/dist/api/loader/nodeset_xml_producer.d.ts.map +1 -0
- package/dist/api/loader/nodeset_xml_producer.js +49 -51
- package/dist/api/loader/nodeset_xml_producer.js.map +1 -1
- package/dist/api/loader/parsers/extension_object_parser.d.ts +1 -0
- package/dist/api/loader/parsers/extension_object_parser.d.ts.map +1 -0
- package/dist/api/loader/parsers/extension_object_parser.js +49 -57
- package/dist/api/loader/parsers/extension_object_parser.js.map +1 -1
- package/dist/api/loader/parsers/localized_text_parser.d.ts +1 -0
- package/dist/api/loader/parsers/localized_text_parser.d.ts.map +1 -0
- package/dist/api/loader/parsers/localized_text_parser.js +3 -6
- package/dist/api/loader/parsers/localized_text_parser.js.map +1 -1
- package/dist/api/loader/parsers/nodeid_parser.d.ts +1 -0
- package/dist/api/loader/parsers/nodeid_parser.d.ts.map +1 -0
- package/dist/api/loader/parsers/nodeid_parser.js +3 -7
- package/dist/api/loader/parsers/nodeid_parser.js.map +1 -1
- package/dist/api/loader/parsers/qualified_name_parser.d.ts +1 -0
- package/dist/api/loader/parsers/qualified_name_parser.d.ts.map +1 -0
- package/dist/api/loader/parsers/qualified_name_parser.js +5 -9
- package/dist/api/loader/parsers/qualified_name_parser.js.map +1 -1
- package/dist/api/loader/parsers/variant_parser.d.ts +1 -0
- package/dist/api/loader/parsers/variant_parser.d.ts.map +1 -0
- package/dist/api/loader/parsers/variant_parser.js +59 -63
- package/dist/api/loader/parsers/variant_parser.js.map +1 -1
- package/dist/api/loader/register_node_promoter.d.ts +1 -0
- package/dist/api/loader/register_node_promoter.d.ts.map +1 -0
- package/dist/api/loader/register_node_promoter.js +4 -7
- package/dist/api/loader/register_node_promoter.js.map +1 -1
- package/dist/api/namespace.d.ts +1 -0
- package/dist/api/namespace.d.ts.map +1 -0
- package/dist/api/namespace.js +1 -2
- package/dist/api/namespace_alarm_and_condition.d.ts +1 -0
- package/dist/api/namespace_alarm_and_condition.d.ts.map +1 -0
- package/dist/api/namespace_alarm_and_condition.js +1 -2
- package/dist/api/namespace_data_access.d.ts +1 -0
- package/dist/api/namespace_data_access.d.ts.map +1 -0
- package/dist/api/namespace_data_access.js +1 -2
- package/dist/api/namespace_machine_state.d.ts +1 -0
- package/dist/api/namespace_machine_state.d.ts.map +1 -0
- package/dist/api/namespace_machine_state.js +1 -2
- package/dist/api/namespace_of.d.ts +1 -0
- package/dist/api/namespace_of.d.ts.map +1 -0
- package/dist/api/namespace_of.js +1 -4
- package/dist/api/namespace_of.js.map +1 -1
- package/dist/api/pseudo_session.d.ts +1 -0
- package/dist/api/pseudo_session.d.ts.map +1 -0
- package/dist/api/pseudo_session.js +56 -62
- package/dist/api/pseudo_session.js.map +1 -1
- package/dist/api/session_context.d.ts +1 -0
- package/dist/api/session_context.d.ts.map +1 -0
- package/dist/api/session_context.js +60 -68
- package/dist/api/session_context.js.map +1 -1
- package/dist/api/set_namespace_meta_data.d.ts +1 -0
- package/dist/api/set_namespace_meta_data.d.ts.map +1 -0
- package/dist/api/set_namespace_meta_data.js +10 -13
- package/dist/api/set_namespace_meta_data.js.map +1 -1
- package/dist/api/ua_addin.d.ts +1 -0
- package/dist/api/ua_addin.d.ts.map +1 -0
- package/dist/api/ua_addin.js +9 -13
- package/dist/api/ua_addin.js.map +1 -1
- package/dist/api/ua_interface.d.ts +1 -0
- package/dist/api/ua_interface.d.ts.map +1 -0
- package/dist/api/ua_interface.js +5 -8
- package/dist/api/ua_interface.js.map +1 -1
- package/dist/api/ua_root_folder.d.ts +1 -0
- package/dist/api/ua_root_folder.d.ts.map +1 -0
- package/dist/api/ua_root_folder.js +1 -2
- package/dist/api/ua_two_state_variable_ex.d.ts +1 -0
- package/dist/api/ua_two_state_variable_ex.d.ts.map +1 -0
- package/dist/api/ua_two_state_variable_ex.js +1 -2
- package/dist/api/xml_writer.d.ts +1 -0
- package/dist/api/xml_writer.d.ts.map +1 -0
- package/dist/api/xml_writer.js +1 -2
- package/dist/impl/_instantiate_helpers.d.ts +1 -0
- package/dist/impl/_instantiate_helpers.d.ts.map +1 -0
- package/dist/impl/_instantiate_helpers.js +25 -31
- package/dist/impl/_instantiate_helpers.js.map +1 -1
- package/dist/impl/_mandatory_child_or_requested_optional_filter.d.ts +1 -0
- package/dist/impl/_mandatory_child_or_requested_optional_filter.d.ts.map +1 -0
- package/dist/impl/_mandatory_child_or_requested_optional_filter.js +16 -20
- package/dist/impl/_mandatory_child_or_requested_optional_filter.js.map +1 -1
- package/dist/impl/address_space.d.ts +40 -0
- package/dist/impl/address_space.d.ts.map +1 -0
- package/dist/impl/address_space.js +246 -189
- package/dist/impl/address_space.js.map +1 -1
- package/dist/impl/address_space_change_event_tools.d.ts +1 -0
- package/dist/impl/address_space_change_event_tools.d.ts.map +1 -0
- package/dist/impl/address_space_change_event_tools.js +31 -29
- package/dist/impl/address_space_change_event_tools.js.map +1 -1
- package/dist/impl/address_space_private.d.ts +2 -0
- package/dist/impl/address_space_private.d.ts.map +1 -0
- package/dist/impl/address_space_private.js +1 -2
- package/dist/impl/address_space_private.js.map +1 -1
- package/dist/impl/alarms_and_conditions/condition.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/condition.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/condition.js +1 -2
- package/dist/impl/alarms_and_conditions/condition.js.map +1 -1
- package/dist/impl/alarms_and_conditions/condition_info_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/condition_info_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/condition_info_impl.js +3 -7
- package/dist/impl/alarms_and_conditions/condition_info_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js +77 -81
- package/dist/impl/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js +14 -20
- package/dist/impl/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/impl/alarms_and_conditions/index.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/index.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/index.js +13 -29
- package/dist/impl/alarms_and_conditions/index.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +60 -65
- package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js +53 -59
- package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.js +12 -16
- package/dist/impl/alarms_and_conditions/ua_base_event_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +34 -39
- package/dist/impl/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_condition_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_condition_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_condition_impl.js +140 -148
- package/dist/impl/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js +6 -10
- package/dist/impl/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +18 -22
- package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +3 -7
- package/dist/impl/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +14 -18
- package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +2 -6
- package/dist/impl/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js +35 -39
- package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +17 -21
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +27 -31
- package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js +18 -22
- package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +1 -0
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts.map +1 -0
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +3 -7
- package/dist/impl/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -1
- package/dist/impl/apply_condition_refresh.d.ts +1 -0
- package/dist/impl/apply_condition_refresh.d.ts.map +1 -0
- package/dist/impl/apply_condition_refresh.js +1 -4
- package/dist/impl/apply_condition_refresh.js.map +1 -1
- package/dist/impl/base_node_impl.d.ts +1 -0
- package/dist/impl/base_node_impl.d.ts.map +1 -0
- package/dist/impl/base_node_impl.js +279 -292
- package/dist/impl/base_node_impl.js.map +1 -1
- package/dist/impl/base_node_private.d.ts +1 -0
- package/dist/impl/base_node_private.d.ts.map +1 -0
- package/dist/impl/base_node_private.js +168 -199
- package/dist/impl/base_node_private.js.map +1 -1
- package/dist/impl/bulk_load_clock.d.ts +35 -0
- package/dist/impl/bulk_load_clock.d.ts.map +1 -0
- package/dist/impl/bulk_load_clock.js +58 -0
- package/dist/impl/bulk_load_clock.js.map +1 -0
- package/dist/impl/check_value_rank_compatibility.d.ts +1 -0
- package/dist/impl/check_value_rank_compatibility.d.ts.map +1 -0
- package/dist/impl/check_value_rank_compatibility.js +1 -4
- package/dist/impl/check_value_rank_compatibility.js.map +1 -1
- package/dist/impl/child_accessors.d.ts +1 -0
- package/dist/impl/child_accessors.d.ts.map +1 -0
- package/dist/impl/child_accessors.js +10 -20
- package/dist/impl/child_accessors.js.map +1 -1
- package/dist/impl/data_access/add_dataItem_stuff.d.ts +1 -0
- package/dist/impl/data_access/add_dataItem_stuff.d.ts.map +1 -0
- package/dist/impl/data_access/add_dataItem_stuff.js +6 -9
- package/dist/impl/data_access/add_dataItem_stuff.js.map +1 -1
- package/dist/impl/data_access/adjust_datavalue_status_code.d.ts +1 -0
- package/dist/impl/data_access/adjust_datavalue_status_code.d.ts.map +1 -0
- package/dist/impl/data_access/adjust_datavalue_status_code.js +9 -12
- package/dist/impl/data_access/adjust_datavalue_status_code.js.map +1 -1
- package/dist/impl/data_access/semantics_changed.d.ts +12 -0
- package/dist/impl/data_access/semantics_changed.d.ts.map +1 -0
- package/dist/impl/data_access/semantics_changed.js +44 -10
- package/dist/impl/data_access/semantics_changed.js.map +1 -1
- package/dist/impl/data_access/ua_multistate_discrete_impl.d.ts +2 -1
- package/dist/impl/data_access/ua_multistate_discrete_impl.d.ts.map +1 -0
- package/dist/impl/data_access/ua_multistate_discrete_impl.js +35 -41
- package/dist/impl/data_access/ua_multistate_discrete_impl.js.map +1 -1
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.d.ts +1 -0
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.d.ts.map +1 -0
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.js +71 -78
- package/dist/impl/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
- package/dist/impl/data_access/ua_two_state_discrete_impl.d.ts +1 -0
- package/dist/impl/data_access/ua_two_state_discrete_impl.d.ts.map +1 -0
- package/dist/impl/data_access/ua_two_state_discrete_impl.js +27 -36
- package/dist/impl/data_access/ua_two_state_discrete_impl.js.map +1 -1
- package/dist/impl/event_data.d.ts +1 -0
- package/dist/impl/event_data.d.ts.map +1 -0
- package/dist/impl/event_data.js +15 -19
- package/dist/impl/event_data.js.map +1 -1
- package/dist/impl/event_layout.d.ts +1 -0
- package/dist/impl/event_layout.d.ts.map +1 -0
- package/dist/impl/event_layout.js +12 -16
- package/dist/impl/event_layout.js.map +1 -1
- package/dist/impl/extension_object_array_node.d.ts +1 -0
- package/dist/impl/extension_object_array_node.d.ts.map +1 -0
- package/dist/impl/extension_object_array_node.js +47 -53
- package/dist/impl/extension_object_array_node.js.map +1 -1
- package/dist/impl/get_basic_datatype.d.ts +1 -0
- package/dist/impl/get_basic_datatype.d.ts.map +1 -0
- package/dist/impl/get_basic_datatype.js +6 -10
- package/dist/impl/get_basic_datatype.js.map +1 -1
- package/dist/impl/handle_hierarchy_parent.d.ts +1 -0
- package/dist/impl/handle_hierarchy_parent.d.ts.map +1 -0
- package/dist/impl/handle_hierarchy_parent.js +26 -30
- package/dist/impl/handle_hierarchy_parent.js.map +1 -1
- package/dist/impl/historical_access/address_space_historical_data_node.d.ts +1 -0
- package/dist/impl/historical_access/address_space_historical_data_node.d.ts.map +1 -0
- package/dist/impl/historical_access/address_space_historical_data_node.js +76 -84
- package/dist/impl/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/impl/historical_access/read_processed_details_hook.d.ts +1 -0
- package/dist/impl/historical_access/read_processed_details_hook.d.ts.map +1 -0
- package/dist/impl/historical_access/read_processed_details_hook.js +1 -4
- package/dist/impl/historical_access/read_processed_details_hook.js.map +1 -1
- package/dist/impl/historizer_factory.d.ts +1 -0
- package/dist/impl/historizer_factory.d.ts.map +1 -0
- package/dist/impl/historizer_factory.js +1 -4
- package/dist/impl/historizer_factory.js.map +1 -1
- package/dist/impl/idx_iterator.d.ts +1 -0
- package/dist/impl/idx_iterator.d.ts.map +1 -0
- package/dist/impl/idx_iterator.js +1 -5
- package/dist/impl/idx_iterator.js.map +1 -1
- package/dist/impl/namespace_impl.d.ts +32 -0
- package/dist/impl/namespace_impl.d.ts.map +1 -0
- package/dist/impl/namespace_impl.js +418 -318
- package/dist/impl/namespace_impl.js.map +1 -1
- package/dist/impl/namespace_private.d.ts +3 -0
- package/dist/impl/namespace_private.d.ts.map +1 -0
- package/dist/impl/namespace_private.js +3 -6
- package/dist/impl/namespace_private.js.map +1 -1
- package/dist/impl/nodeid_manager.d.ts +11 -0
- package/dist/impl/nodeid_manager.d.ts.map +1 -0
- package/dist/impl/nodeid_manager.js +52 -44
- package/dist/impl/nodeid_manager.js.map +1 -1
- package/dist/impl/nodeset_tools/adjust_namespace_array.d.ts +1 -0
- package/dist/impl/nodeset_tools/adjust_namespace_array.d.ts.map +1 -0
- package/dist/impl/nodeset_tools/adjust_namespace_array.js +1 -4
- package/dist/impl/nodeset_tools/adjust_namespace_array.js.map +1 -1
- package/dist/impl/nodeset_tools/construct_namespace_dependency.d.ts +1 -0
- package/dist/impl/nodeset_tools/construct_namespace_dependency.d.ts.map +1 -0
- package/dist/impl/nodeset_tools/construct_namespace_dependency.js +28 -39
- package/dist/impl/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/impl/nodeset_tools/dump_to_bsd.d.ts +1 -0
- package/dist/impl/nodeset_tools/dump_to_bsd.d.ts.map +1 -0
- package/dist/impl/nodeset_tools/dump_to_bsd.js +14 -20
- package/dist/impl/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/impl/nodeset_tools/nodeset_to_records.d.ts +1 -0
- package/dist/impl/nodeset_tools/nodeset_to_records.d.ts.map +1 -0
- package/dist/impl/nodeset_tools/nodeset_to_records.js +125 -139
- package/dist/impl/nodeset_tools/nodeset_to_records.js.map +1 -1
- package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts +1 -0
- package/dist/impl/nodeset_tools/nodeset_to_xml.d.ts.map +1 -0
- package/dist/impl/nodeset_tools/nodeset_to_xml.js +190 -202
- package/dist/impl/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/impl/private_namespace.d.ts +1 -0
- package/dist/impl/private_namespace.d.ts.map +1 -0
- package/dist/impl/private_namespace.js +3 -8
- package/dist/impl/private_namespace.js.map +1 -1
- package/dist/impl/reference_impl.d.ts +1 -0
- package/dist/impl/reference_impl.d.ts.map +1 -0
- package/dist/impl/reference_impl.js +24 -37
- package/dist/impl/reference_impl.js.map +1 -1
- package/dist/impl/reference_type_version.d.ts +1 -0
- package/dist/impl/reference_type_version.d.ts.map +1 -0
- package/dist/impl/reference_type_version.js +2 -5
- package/dist/impl/reference_type_version.js.map +1 -1
- package/dist/impl/role_permissions.d.ts +1 -0
- package/dist/impl/role_permissions.d.ts.map +1 -0
- package/dist/impl/role_permissions.js +3 -6
- package/dist/impl/role_permissions.js.map +1 -1
- package/dist/impl/state_machine/finite_state_machine.d.ts +1 -0
- package/dist/impl/state_machine/finite_state_machine.d.ts.map +1 -0
- package/dist/impl/state_machine/finite_state_machine.js +123 -97
- package/dist/impl/state_machine/finite_state_machine.js.map +1 -1
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.d.ts +1 -0
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.d.ts.map +1 -0
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.js +57 -62
- package/dist/impl/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
- package/dist/impl/state_machine/ua_two_state_variable.d.ts +1 -0
- package/dist/impl/state_machine/ua_two_state_variable.d.ts.map +1 -0
- package/dist/impl/state_machine/ua_two_state_variable.js +56 -63
- package/dist/impl/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/impl/tool_isSubtypeOf.d.ts +1 -0
- package/dist/impl/tool_isSubtypeOf.d.ts.map +1 -0
- package/dist/impl/tool_isSubtypeOf.js +27 -34
- package/dist/impl/tool_isSubtypeOf.js.map +1 -1
- package/dist/impl/ua_condition_type.d.ts +1 -0
- package/dist/impl/ua_condition_type.d.ts.map +1 -0
- package/dist/impl/ua_condition_type.js +1 -2
- package/dist/impl/ua_data_type_impl.d.ts +1 -0
- package/dist/impl/ua_data_type_impl.d.ts.map +1 -0
- package/dist/impl/ua_data_type_impl.js +99 -83
- package/dist/impl/ua_data_type_impl.js.map +1 -1
- package/dist/impl/ua_method_impl.d.ts +3 -2
- package/dist/impl/ua_method_impl.d.ts.map +1 -0
- package/dist/impl/ua_method_impl.js +74 -78
- package/dist/impl/ua_method_impl.js.map +1 -1
- package/dist/impl/ua_object_impl.d.ts +1 -0
- package/dist/impl/ua_object_impl.d.ts.map +1 -0
- package/dist/impl/ua_object_impl.js +48 -51
- package/dist/impl/ua_object_impl.js.map +1 -1
- package/dist/impl/ua_object_type_impl.d.ts +1 -0
- package/dist/impl/ua_object_type_impl.d.ts.map +1 -0
- package/dist/impl/ua_object_type_impl.js +35 -39
- package/dist/impl/ua_object_type_impl.js.map +1 -1
- package/dist/impl/ua_reference_type_impl.d.ts +2 -1
- package/dist/impl/ua_reference_type_impl.d.ts.map +1 -0
- package/dist/impl/ua_reference_type_impl.js +41 -45
- package/dist/impl/ua_reference_type_impl.js.map +1 -1
- package/dist/impl/ua_variable_impl.d.ts +1 -0
- package/dist/impl/ua_variable_impl.d.ts.map +1 -0
- package/dist/impl/ua_variable_impl.js +373 -376
- package/dist/impl/ua_variable_impl.js.map +1 -1
- package/dist/impl/ua_variable_impl_ext_obj.d.ts +1 -0
- package/dist/impl/ua_variable_impl_ext_obj.d.ts.map +1 -0
- package/dist/impl/ua_variable_impl_ext_obj.js +79 -97
- package/dist/impl/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/impl/ua_variable_type_impl.d.ts +1 -0
- package/dist/impl/ua_variable_type_impl.d.ts.map +1 -0
- package/dist/impl/ua_variable_type_impl.js +77 -84
- package/dist/impl/ua_variable_type_impl.js.map +1 -1
- package/dist/impl/ua_view_impl.d.ts +1 -0
- package/dist/impl/ua_view_impl.d.ts.map +1 -0
- package/dist/impl/ua_view_impl.js +18 -22
- package/dist/impl/ua_view_impl.js.map +1 -1
- package/dist/impl/validate_data_type_correctness.d.ts +1 -0
- package/dist/impl/validate_data_type_correctness.d.ts.map +1 -0
- package/dist/impl/validate_data_type_correctness.js +24 -30
- package/dist/impl/validate_data_type_correctness.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distHelpers/add_event_generator_object.d.ts +1 -0
- package/distHelpers/add_event_generator_object.d.ts.map +1 -0
- package/distHelpers/add_event_generator_object.js +8 -11
- package/distHelpers/add_event_generator_object.js.map +1 -1
- package/distHelpers/address_space_digest.d.ts +1 -0
- package/distHelpers/address_space_digest.d.ts.map +1 -0
- package/distHelpers/address_space_digest.js +1 -5
- package/distHelpers/address_space_digest.js.map +1 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +1 -0
- package/distHelpers/alarms_and_conditions_demo.d.ts.map +1 -0
- package/distHelpers/alarms_and_conditions_demo.js +8 -11
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -1
- package/distHelpers/assertHasMatchingReference.d.ts +1 -0
- package/distHelpers/assertHasMatchingReference.d.ts.map +1 -0
- package/distHelpers/assertHasMatchingReference.js +6 -9
- package/distHelpers/assertHasMatchingReference.js.map +1 -1
- package/distHelpers/boiler_system.d.ts +1 -0
- package/distHelpers/boiler_system.d.ts.map +1 -0
- package/distHelpers/boiler_system.js +36 -40
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -0
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts.map +1 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js +29 -35
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
- package/distHelpers/date_utils.d.ts +1 -0
- package/distHelpers/date_utils.d.ts.map +1 -0
- package/distHelpers/date_utils.js +1 -4
- package/distHelpers/date_utils.js.map +1 -1
- package/distHelpers/dump_statemachine.d.ts +1 -0
- package/distHelpers/dump_statemachine.d.ts.map +1 -0
- package/distHelpers/dump_statemachine.js +1 -2
- package/distHelpers/dump_statemachine.js.map +1 -1
- package/distHelpers/get_address_space_fixture.d.ts +1 -0
- package/distHelpers/get_address_space_fixture.d.ts.map +1 -0
- package/distHelpers/get_address_space_fixture.js +12 -18
- package/distHelpers/get_address_space_fixture.js.map +1 -1
- package/distHelpers/get_mini_address_space.d.ts +1 -0
- package/distHelpers/get_mini_address_space.d.ts.map +1 -0
- package/distHelpers/get_mini_address_space.js +12 -18
- package/distHelpers/get_mini_address_space.js.map +1 -1
- package/distHelpers/index.d.ts +1 -0
- package/distHelpers/index.d.ts.map +1 -0
- package/distHelpers/index.js +10 -26
- package/distHelpers/index.js.map +1 -1
- package/distHelpers/mock_session.d.ts +1 -0
- package/distHelpers/mock_session.d.ts.map +1 -0
- package/distHelpers/mock_session.js +11 -16
- package/distHelpers/mock_session.js.map +1 -1
- package/distNodeJS/address_space_digest.d.ts +1 -0
- package/distNodeJS/address_space_digest.d.ts.map +1 -0
- package/distNodeJS/address_space_digest.js +3 -6
- package/distNodeJS/address_space_digest.js.map +1 -1
- package/distNodeJS/generate_address_space.d.ts +1 -0
- package/distNodeJS/generate_address_space.d.ts.map +1 -0
- package/distNodeJS/generate_address_space.js +67 -97
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/distNodeJS/index.d.ts +1 -0
- package/distNodeJS/index.d.ts.map +1 -0
- package/distNodeJS/index.js +3 -19
- package/distNodeJS/index.js.map +1 -1
- package/distNodeJS/nodeset_image_file_store.d.ts +1 -0
- package/distNodeJS/nodeset_image_file_store.d.ts.map +1 -0
- package/distNodeJS/nodeset_image_file_store.js +20 -28
- package/distNodeJS/nodeset_image_file_store.js.map +1 -1
- package/impl/_mandatory_child_or_requested_optional_filter.ts +3 -3
- package/impl/address_space.ts +75 -6
- package/impl/address_space_change_event_tools.ts +7 -0
- package/impl/address_space_private.ts +1 -0
- package/impl/alarms_and_conditions/condition_snapshot_impl.ts +1 -1
- package/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +1 -1
- package/impl/alarms_and_conditions/ua_alarm_condition_impl.ts +1 -1
- package/impl/alarms_and_conditions/ua_condition_impl.ts +1 -1
- package/impl/bulk_load_clock.ts +65 -0
- package/impl/data_access/semantics_changed.ts +39 -1
- package/impl/data_access/ua_multistate_discrete_impl.ts +1 -1
- package/impl/extension_object_array_node.ts +5 -5
- package/impl/historical_access/address_space_historical_data_node.ts +2 -2
- package/impl/namespace_impl.ts +119 -2
- package/impl/namespace_private.ts +3 -0
- package/impl/nodeid_manager.ts +13 -0
- package/impl/nodeset_tools/construct_namespace_dependency.ts +4 -4
- package/impl/nodeset_tools/dump_to_bsd.ts +1 -1
- package/impl/nodeset_tools/nodeset_to_xml.ts +1 -1
- package/impl/state_machine/finite_state_machine.ts +56 -10
- package/impl/state_machine/ua_shelving_state_machine_ex.ts +1 -1
- package/impl/state_machine/ua_two_state_variable.ts +1 -1
- package/impl/tool_isSubtypeOf.ts +1 -1
- package/impl/ua_data_type_impl.ts +26 -5
- package/impl/ua_method_impl.ts +10 -6
- package/impl/ua_object_impl.ts +6 -2
- package/impl/ua_variable_impl.ts +15 -8
- package/impl/ua_variable_type_impl.ts +3 -3
- package/nodeJS.d.ts +1 -1
- package/nodeJS.js +1 -1
- package/package.json +42 -41
- package/source_nodejs/generate_address_space.ts +31 -14
- package/testHelpers.d.ts +1 -1
- package/testHelpers.js +1 -1
- /package/bin/{nodeset_tool_common.js → nodeset_tool_common.cjs} +0 -0
|
@@ -1,72 +1,65 @@
|
|
|
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
1
|
/**
|
|
10
2
|
* @module node-opcua-address-space
|
|
11
3
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
4
|
+
import { types } from "node:util";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { defaultCloneFilter, makeDefaultCloneExtraInfo } from "node-opcua-address-space-base";
|
|
7
|
+
import { assert } from "node-opcua-assert";
|
|
8
|
+
import { AccessLevelFlag, AttributeIds, convertAccessLevelFlagToByte, isDataEncoding, isValidDataEncoding, makeAccessLevelFlag, NodeClass } from "node-opcua-data-model";
|
|
9
|
+
import { DataValue, extractRange, makeNowDataValue, sameDataValue } from "node-opcua-data-value";
|
|
10
|
+
import { coerceClock, getCurrentClock } from "node-opcua-date-time";
|
|
11
|
+
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
12
|
+
import { ExtensionObject, OpaqueStructure } from "node-opcua-extension-object";
|
|
13
|
+
import { NodeId } from "node-opcua-nodeid";
|
|
14
|
+
import { NumericRange } from "node-opcua-numeric-range";
|
|
15
|
+
import { WriteValue } from "node-opcua-service-write";
|
|
16
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
17
|
+
import { HistoryReadResult, PermissionType } from "node-opcua-types";
|
|
18
|
+
import { adjustVariant, DataType, sameVariant, Variant, VariantArrayType, verifyRankAndDimensions } from "node-opcua-variant";
|
|
19
|
+
import { convertToCallbackFunction1 } from "../api/helpers/multiform_func.js";
|
|
20
|
+
import { SessionContext } from "../api/session_context.js";
|
|
21
|
+
import { apply_condition_refresh } from "./apply_condition_refresh.js";
|
|
22
|
+
import { BaseNodeImpl } from "./base_node_impl.js";
|
|
23
|
+
import { _clone, ToStringBuilder, UAVariable_toString, valueRankToString } from "./base_node_private.js";
|
|
24
|
+
import { loadClock } from "./bulk_load_clock.js";
|
|
25
|
+
import { adjustDataValueStatusCode } from "./data_access/adjust_datavalue_status_code.js";
|
|
26
|
+
import { notifySemanticsChangedIfNeeded, raiseSemanticChangeEvent } from "./data_access/semantics_changed.js";
|
|
27
|
+
import { _getBasicDataType } from "./get_basic_datatype.js";
|
|
28
|
+
import { UADataTypeImpl } from "./ua_data_type_impl.js";
|
|
29
|
+
import { _bindExtensionObject, _bindExtensionObjectArrayOrMatrix, _installExtensionObjectBindingOnProperties, extractPartialData, incrementElement, propagateTouchValueDownward, propagateTouchValueDownwardArray, propagateTouchValueUpward, setExtensionObjectPartialValue } from "./ua_variable_impl_ext_obj.js";
|
|
30
|
+
import { validateDataTypeCorrectness } from "./validate_data_type_correctness.js";
|
|
31
|
+
const debugLog = make_debugLog("ua_variable_impl");
|
|
32
|
+
const warningLog = make_warningLog("ua_variable_impl");
|
|
33
|
+
const doDebug = checkDebugFlag("ua_variable_impl");
|
|
34
|
+
const errorLog = make_errorLog("ua_variable_impl");
|
|
42
35
|
// a colourless chalk; see ua_object_impl.ts for why it is not a Proxy over `chalk`
|
|
43
|
-
const plainChalk = new
|
|
44
|
-
function adjust_accessLevel(accessLevel) {
|
|
45
|
-
const flag =
|
|
46
|
-
|
|
36
|
+
const plainChalk = new chalk.Instance({ level: 0 });
|
|
37
|
+
export function adjust_accessLevel(accessLevel) {
|
|
38
|
+
const flag = makeAccessLevelFlag(accessLevel ?? "CurrentRead | CurrentWrite");
|
|
39
|
+
assert(Number.isFinite(flag));
|
|
47
40
|
return flag;
|
|
48
41
|
}
|
|
49
|
-
function adjust_userAccessLevel(userAccessLevel, accessLevel) {
|
|
42
|
+
export function adjust_userAccessLevel(userAccessLevel, accessLevel) {
|
|
50
43
|
if (userAccessLevel === undefined) {
|
|
51
44
|
return undefined;
|
|
52
45
|
}
|
|
53
46
|
userAccessLevel = adjust_accessLevel(userAccessLevel);
|
|
54
47
|
accessLevel = adjust_accessLevel(accessLevel);
|
|
55
|
-
return
|
|
48
|
+
return makeAccessLevelFlag(accessLevel & userAccessLevel);
|
|
56
49
|
}
|
|
57
50
|
function adjust_samplingInterval(minimumSamplingInterval) {
|
|
58
|
-
|
|
51
|
+
assert(Number.isFinite(minimumSamplingInterval));
|
|
59
52
|
if (minimumSamplingInterval < 0) {
|
|
60
53
|
return -1; // only -1 is a valid negative value for samplingInterval and means "unspecified"
|
|
61
54
|
}
|
|
62
55
|
return minimumSamplingInterval;
|
|
63
56
|
}
|
|
64
57
|
function is_Variant(v) {
|
|
65
|
-
return v instanceof
|
|
58
|
+
return v instanceof Variant;
|
|
66
59
|
}
|
|
67
60
|
function is_StatusCode(v) {
|
|
68
61
|
return !!(v?.constructor &&
|
|
69
|
-
(v instanceof
|
|
62
|
+
(v instanceof StatusCode ||
|
|
70
63
|
v.constructor.name === "ConstantStatusCode" ||
|
|
71
64
|
v.constructor.name === "StatusCode" ||
|
|
72
65
|
v.constructor.name === "ModifiableStatusCode"));
|
|
@@ -106,7 +99,7 @@ function default_func(dataValue1, callback1) {
|
|
|
106
99
|
* indicates if the history of the Variable is available via the OPC UA server.
|
|
107
100
|
*
|
|
108
101
|
*/
|
|
109
|
-
class UAVariableImpl extends
|
|
102
|
+
export class UAVariableImpl extends BaseNodeImpl {
|
|
110
103
|
// -------------- UAvaraibleImplExArray
|
|
111
104
|
$$variableType;
|
|
112
105
|
$$dataType = undefined;
|
|
@@ -114,7 +107,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
114
107
|
$$extensionObjectArray;
|
|
115
108
|
$$indexPropertyName;
|
|
116
109
|
// --------------
|
|
117
|
-
nodeClass =
|
|
110
|
+
nodeClass = NodeClass.Variable;
|
|
118
111
|
dataType;
|
|
119
112
|
_basicDataType;
|
|
120
113
|
// narrowing this to ExtensionObject breaks declaration-merging in ua_two_state_variable.ts and elsewhere
|
|
@@ -143,8 +136,8 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
143
136
|
refreshFunc;
|
|
144
137
|
__waiting_callbacks;
|
|
145
138
|
get typeDefinitionObj() {
|
|
146
|
-
|
|
147
|
-
if (super.typeDefinitionObj && super.typeDefinitionObj.nodeClass !==
|
|
139
|
+
/* c8 ignore next */
|
|
140
|
+
if (super.typeDefinitionObj && super.typeDefinitionObj.nodeClass !== NodeClass.VariableType) {
|
|
148
141
|
// this could happen in faulty external nodeset and has been seen once
|
|
149
142
|
// in an nano server
|
|
150
143
|
warningLog(super.typeDefinitionObj.toString());
|
|
@@ -160,7 +153,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
160
153
|
}
|
|
161
154
|
constructor(options) {
|
|
162
155
|
super(options);
|
|
163
|
-
|
|
156
|
+
verifyRankAndDimensions(options);
|
|
164
157
|
this.valueRank = options.valueRank ?? -1;
|
|
165
158
|
this.arrayDimensions = options.arrayDimensions ?? null;
|
|
166
159
|
this.dataType = this.resolveNodeId(options.dataType); // DataType (NodeId)
|
|
@@ -171,11 +164,13 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
171
164
|
// a Variant built from null takes the constructor's short path; the options form costs twice as much.
|
|
172
165
|
// Stamped with the clock of the construction: a variable nobody gives a value to (a nodeset
|
|
173
166
|
// Variable of an abstract data type has no default to make up) is read as it is, and the
|
|
174
|
-
// requested timestamps are expected on that Uncertain result too (FEAT-34)
|
|
175
|
-
|
|
176
|
-
this
|
|
177
|
-
|
|
178
|
-
|
|
167
|
+
// requested timestamps are expected on that Uncertain result too (FEAT-34).
|
|
168
|
+
// One reading for a whole load — see impl/bulk_load_clock.ts; outside a load of THIS
|
|
169
|
+
// address space this is getCurrentClock(), unchanged.
|
|
170
|
+
const now = loadClock(this.addressSpace);
|
|
171
|
+
this.$dataValue = new DataValue({
|
|
172
|
+
statusCode: StatusCodes.UncertainInitialValue,
|
|
173
|
+
value: new Variant(null),
|
|
179
174
|
sourceTimestamp: now.timestamp,
|
|
180
175
|
sourcePicoseconds: now.picoseconds,
|
|
181
176
|
serverTimestamp: now.timestamp,
|
|
@@ -196,7 +191,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
196
191
|
checkPermissionPrivate(context, permission) {
|
|
197
192
|
if (!context)
|
|
198
193
|
return true;
|
|
199
|
-
|
|
194
|
+
assert(context instanceof SessionContext);
|
|
200
195
|
if (context.checkPermission) {
|
|
201
196
|
if (!(context.checkPermission instanceof Function)) {
|
|
202
197
|
errorLog("context checkPermission is not a function");
|
|
@@ -215,43 +210,43 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
215
210
|
return this.checkAccessLevelPrivate(context, accessLevel);
|
|
216
211
|
}
|
|
217
212
|
isReadable(_context) {
|
|
218
|
-
return (this.accessLevel &
|
|
213
|
+
return (this.accessLevel & AccessLevelFlag.CurrentRead) === AccessLevelFlag.CurrentRead;
|
|
219
214
|
}
|
|
220
215
|
isUserReadable(context) {
|
|
221
216
|
if (!this.isReadable(context)) {
|
|
222
217
|
return false;
|
|
223
218
|
}
|
|
224
|
-
if (!this.checkPermissionPrivate(context,
|
|
219
|
+
if (!this.checkPermissionPrivate(context, PermissionType.Read)) {
|
|
225
220
|
return false;
|
|
226
221
|
}
|
|
227
|
-
return this.checkAccessLevelPrivate(context,
|
|
222
|
+
return this.checkAccessLevelPrivate(context, AccessLevelFlag.CurrentRead);
|
|
228
223
|
}
|
|
229
224
|
isWritable(_context) {
|
|
230
|
-
return (this.accessLevel &
|
|
225
|
+
return (this.accessLevel & AccessLevelFlag.CurrentWrite) === AccessLevelFlag.CurrentWrite;
|
|
231
226
|
}
|
|
232
227
|
isUserWritable(context) {
|
|
233
228
|
if (!this.isWritable(context)) {
|
|
234
229
|
return false;
|
|
235
230
|
}
|
|
236
|
-
return this.checkPermissionAndAccessLevelPrivate(context,
|
|
231
|
+
return this.checkPermissionAndAccessLevelPrivate(context, PermissionType.Write, AccessLevelFlag.CurrentWrite);
|
|
237
232
|
}
|
|
238
233
|
canUserReadHistory(context) {
|
|
239
|
-
return this.checkPermissionAndAccessLevelPrivate(context,
|
|
234
|
+
return this.checkPermissionAndAccessLevelPrivate(context, PermissionType.ReadHistory, AccessLevelFlag.HistoryRead);
|
|
240
235
|
}
|
|
241
236
|
canUserWriteHistorizingAttribute(context) {
|
|
242
|
-
if (context && !context.checkPermission(this,
|
|
237
|
+
if (context && !context.checkPermission(this, PermissionType.WriteHistorizing)) {
|
|
243
238
|
return false;
|
|
244
239
|
}
|
|
245
240
|
return true;
|
|
246
241
|
}
|
|
247
242
|
canUserInsertHistory(context) {
|
|
248
|
-
return this.checkPermissionAndAccessLevelPrivate(context,
|
|
243
|
+
return this.checkPermissionAndAccessLevelPrivate(context, PermissionType.InsertHistory, AccessLevelFlag.HistoryWrite);
|
|
249
244
|
}
|
|
250
245
|
canUserModifyHistory(context) {
|
|
251
|
-
return this.checkPermissionAndAccessLevelPrivate(context,
|
|
246
|
+
return this.checkPermissionAndAccessLevelPrivate(context, PermissionType.ModifyHistory, AccessLevelFlag.HistoryWrite);
|
|
252
247
|
}
|
|
253
248
|
canUserDeleteHistory(context) {
|
|
254
|
-
return this.checkPermissionAndAccessLevelPrivate(context,
|
|
249
|
+
return this.checkPermissionAndAccessLevelPrivate(context, PermissionType.DeleteHistory, AccessLevelFlag.HistoryWrite);
|
|
255
250
|
}
|
|
256
251
|
/**
|
|
257
252
|
*
|
|
@@ -282,7 +277,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
282
277
|
*/
|
|
283
278
|
readValue(context, indexRange, dataEncoding) {
|
|
284
279
|
if (!context) {
|
|
285
|
-
context =
|
|
280
|
+
context = SessionContext.defaultContext;
|
|
286
281
|
}
|
|
287
282
|
// A Bad result the variable makes up here carries the requested timestamps: a
|
|
288
283
|
// DataValue may carry them whatever its status, and the CTT expects them on every
|
|
@@ -291,20 +286,20 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
291
286
|
// nodeset reserves to a role nobody holds, FEAT-34). The clock of the denial is
|
|
292
287
|
// the honest source timestamp: the value behind it stays undisclosed.
|
|
293
288
|
if (context.isAccessRestricted(this)) {
|
|
294
|
-
return
|
|
289
|
+
return makeNowDataValue({ statusCode: StatusCodes.BadSecurityModeInsufficient });
|
|
295
290
|
}
|
|
296
291
|
if (!this.isReadable(context)) {
|
|
297
|
-
return
|
|
292
|
+
return makeNowDataValue({ statusCode: StatusCodes.BadNotReadable });
|
|
298
293
|
}
|
|
299
|
-
if (!this.checkPermissionPrivate(context,
|
|
300
|
-
return
|
|
294
|
+
if (!this.checkPermissionPrivate(context, PermissionType.Read)) {
|
|
295
|
+
return makeNowDataValue({ statusCode: StatusCodes.BadUserAccessDenied });
|
|
301
296
|
}
|
|
302
297
|
if (!this.isUserReadable(context)) {
|
|
303
|
-
return
|
|
298
|
+
return makeNowDataValue({ statusCode: StatusCodes.BadNotReadable });
|
|
304
299
|
}
|
|
305
|
-
if (!
|
|
300
|
+
if (!isValidDataEncoding(dataEncoding)) {
|
|
306
301
|
// Table 51: no encoding can be applied to a non-Structure value
|
|
307
|
-
return
|
|
302
|
+
return makeNowDataValue({ statusCode: StatusCodes.BadDataEncodingInvalid });
|
|
308
303
|
}
|
|
309
304
|
if (this._timestamped_get_func) {
|
|
310
305
|
if (this._timestamped_get_func.length === 0) {
|
|
@@ -312,7 +307,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
312
307
|
if (!Object.hasOwn(dataValueOrPromise.constructor.prototype, "then")) {
|
|
313
308
|
if (dataValueOrPromise !== this.$dataValue) {
|
|
314
309
|
// we may have a problem here if we use a getter that returns a dataValue that is a ExtensionObject
|
|
315
|
-
if (dataValueOrPromise.value?.dataType ===
|
|
310
|
+
if (dataValueOrPromise.value?.dataType === DataType.ExtensionObject) {
|
|
316
311
|
if (this.$extensionObject || this.$$extensionObjectArray) {
|
|
317
312
|
// we have an extension object already bound to this node
|
|
318
313
|
// the client is asking us to replace the object entirely by a new one
|
|
@@ -336,17 +331,17 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
336
331
|
let dataValue = this.$dataValue;
|
|
337
332
|
if (dataValue.statusCode.isGoodish()) {
|
|
338
333
|
// note : extractRange will clone the dataValue
|
|
339
|
-
dataValue =
|
|
334
|
+
dataValue = extractRange(dataValue, indexRange);
|
|
340
335
|
}
|
|
341
336
|
/* c8 ignore next */
|
|
342
|
-
if (dataValue.statusCode.equals(
|
|
343
|
-
dataValue.statusCode.equals(
|
|
344
|
-
|
|
337
|
+
if (dataValue.statusCode.equals(StatusCodes.BadWaitingForInitialData) ||
|
|
338
|
+
dataValue.statusCode.equals(StatusCodes.UncertainInitialValue)) {
|
|
339
|
+
/* c8 ignore next */
|
|
345
340
|
doDebug &&
|
|
346
|
-
debugLog(
|
|
347
|
-
|
|
341
|
+
debugLog(chalk.red(" Warning: UAVariable#readValue ") +
|
|
342
|
+
chalk.cyan(this.browseName.toString()) +
|
|
348
343
|
" (" +
|
|
349
|
-
|
|
344
|
+
chalk.yellow(this.nodeId.toString()) +
|
|
350
345
|
") exists but dataValue has not been defined");
|
|
351
346
|
}
|
|
352
347
|
return dataValue;
|
|
@@ -374,7 +369,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
374
369
|
}
|
|
375
370
|
_getEnumerationInfo() {
|
|
376
371
|
// DataType must be one of Enumeration
|
|
377
|
-
|
|
372
|
+
assert(this.isEnumeration(), "Variable is not an enumeration");
|
|
378
373
|
const dataTypeNode = this.addressSpace.findDataType(this.dataType);
|
|
379
374
|
return dataTypeNode._getEnumerationInfo();
|
|
380
375
|
}
|
|
@@ -395,7 +390,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
395
390
|
const dataValue = this.readValue();
|
|
396
391
|
dataValue.serverTimestamp = oldestDate.timestamp;
|
|
397
392
|
dataValue.serverPicoseconds = oldestDate.picoseconds;
|
|
398
|
-
const serverClock =
|
|
393
|
+
const serverClock = coerceClock(dataValue.serverTimestamp, dataValue.serverPicoseconds);
|
|
399
394
|
if (lessOrEqual(oldestDate, serverClock)) {
|
|
400
395
|
cb(null, dataValue);
|
|
401
396
|
return;
|
|
@@ -407,7 +402,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
407
402
|
}
|
|
408
403
|
}
|
|
409
404
|
const c1 = this.$dataValue.serverTimestamp
|
|
410
|
-
?
|
|
405
|
+
? coerceClock(this.$dataValue.serverTimestamp, this.$dataValue.serverPicoseconds)
|
|
411
406
|
: null;
|
|
412
407
|
if (c1 && lessOrEqual(oldestDate, c1)) {
|
|
413
408
|
const dataValue = this.readValue().clone();
|
|
@@ -421,7 +416,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
421
416
|
// c8 ignore next
|
|
422
417
|
if (err || !dataValue) {
|
|
423
418
|
errorLog("-------------- refresh call failed", this.browseName.toString(), this.nodeId.toString(), err?.message);
|
|
424
|
-
dataValue = { statusCode:
|
|
419
|
+
dataValue = { statusCode: StatusCodes.BadNoDataAvailable };
|
|
425
420
|
}
|
|
426
421
|
if (dataValue && dataValue !== this.$dataValue) {
|
|
427
422
|
this._internal_set_dataValue(coerceDataValue(dataValue), null);
|
|
@@ -432,7 +427,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
432
427
|
catch (err) {
|
|
433
428
|
errorLog("-------------- refresh call failed 2", this.browseName.toString(), this.nodeId.toString());
|
|
434
429
|
errorLog(err);
|
|
435
|
-
const dataValue = new
|
|
430
|
+
const dataValue = new DataValue({ statusCode: StatusCodes.BadInternalError });
|
|
436
431
|
this._internal_set_dataValue(dataValue, null);
|
|
437
432
|
cb(err, this.$dataValue);
|
|
438
433
|
}
|
|
@@ -460,7 +455,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
460
455
|
throw new Error(`UAVariable#writeEnumValue : value out of range ${value} in [${possibleValues}]`);
|
|
461
456
|
}
|
|
462
457
|
this.setValueFromSource({
|
|
463
|
-
dataType:
|
|
458
|
+
dataType: DataType.Int32,
|
|
464
459
|
value
|
|
465
460
|
});
|
|
466
461
|
}
|
|
@@ -469,47 +464,47 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
469
464
|
}
|
|
470
465
|
}
|
|
471
466
|
readAttribute(context, attributeId, indexRange, dataEncoding) {
|
|
472
|
-
context = context ||
|
|
473
|
-
|
|
467
|
+
context = context || SessionContext.defaultContext;
|
|
468
|
+
assert(context instanceof SessionContext);
|
|
474
469
|
const options = {};
|
|
475
|
-
if (attributeId !==
|
|
470
|
+
if (attributeId !== AttributeIds.Value) {
|
|
476
471
|
if (indexRange?.isDefined()) {
|
|
477
|
-
options.statusCode =
|
|
478
|
-
return new
|
|
472
|
+
options.statusCode = StatusCodes.BadIndexRangeNoData;
|
|
473
|
+
return new DataValue(options);
|
|
479
474
|
}
|
|
480
|
-
if (
|
|
481
|
-
options.statusCode =
|
|
482
|
-
return new
|
|
475
|
+
if (isDataEncoding(dataEncoding)) {
|
|
476
|
+
options.statusCode = StatusCodes.BadDataEncodingInvalid;
|
|
477
|
+
return new DataValue(options);
|
|
483
478
|
}
|
|
484
479
|
}
|
|
485
480
|
switch (attributeId) {
|
|
486
|
-
case
|
|
481
|
+
case AttributeIds.Value:
|
|
487
482
|
return this.readValue(context, indexRange, dataEncoding);
|
|
488
|
-
case
|
|
483
|
+
case AttributeIds.DataType:
|
|
489
484
|
return this._readDataType();
|
|
490
|
-
case
|
|
485
|
+
case AttributeIds.ValueRank:
|
|
491
486
|
return this._readValueRank();
|
|
492
|
-
case
|
|
487
|
+
case AttributeIds.ArrayDimensions:
|
|
493
488
|
return this._readArrayDimensions();
|
|
494
|
-
case
|
|
489
|
+
case AttributeIds.AccessLevel:
|
|
495
490
|
return this._readAccessLevel(context);
|
|
496
|
-
case
|
|
491
|
+
case AttributeIds.UserAccessLevel:
|
|
497
492
|
return this._readUserAccessLevel(context);
|
|
498
|
-
case
|
|
493
|
+
case AttributeIds.MinimumSamplingInterval:
|
|
499
494
|
return this._readMinimumSamplingInterval();
|
|
500
|
-
case
|
|
495
|
+
case AttributeIds.Historizing:
|
|
501
496
|
return this._readHistorizing();
|
|
502
|
-
case
|
|
497
|
+
case AttributeIds.AccessLevelEx:
|
|
503
498
|
return this._readAccessLevelEx(context);
|
|
504
499
|
default:
|
|
505
|
-
return
|
|
500
|
+
return BaseNodeImpl.prototype.readAttribute.call(this, context, attributeId);
|
|
506
501
|
}
|
|
507
502
|
}
|
|
508
503
|
getBasicDataType() {
|
|
509
|
-
return
|
|
504
|
+
return _getBasicDataType(this);
|
|
510
505
|
}
|
|
511
506
|
adjustVariant(variant) {
|
|
512
|
-
return
|
|
507
|
+
return adjustVariant(variant, this.valueRank, this.getBasicDataType());
|
|
513
508
|
}
|
|
514
509
|
verifyVariantCompatibility(variant) {
|
|
515
510
|
try {
|
|
@@ -521,17 +516,17 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
521
516
|
" this.dataType= " +
|
|
522
517
|
this.dataType.toString());
|
|
523
518
|
}
|
|
524
|
-
if (variant.dataType ===
|
|
525
|
-
(this.dataType.namespace !== 0 || this.dataType.value !==
|
|
519
|
+
if (variant.dataType === DataType.Boolean &&
|
|
520
|
+
(this.dataType.namespace !== 0 || this.dataType.value !== DataType.Boolean)) {
|
|
526
521
|
throw new Error("Variant must provide a valid Boolean : variant = " +
|
|
527
522
|
variant.toString() +
|
|
528
523
|
" this.dataType= " +
|
|
529
524
|
this.dataType.toString());
|
|
530
525
|
}
|
|
531
526
|
if (this.dataType.namespace === 0 &&
|
|
532
|
-
this.dataType.value ===
|
|
533
|
-
variant.dataType !==
|
|
534
|
-
variant.dataType !==
|
|
527
|
+
this.dataType.value === DataType.LocalizedText &&
|
|
528
|
+
variant.dataType !== DataType.LocalizedText &&
|
|
529
|
+
variant.dataType !== DataType.Null) {
|
|
535
530
|
throw new Error("Variant must provide a valid LocalizedText : variant = " +
|
|
536
531
|
variant.toString() +
|
|
537
532
|
" this.dataType= " +
|
|
@@ -539,15 +534,15 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
539
534
|
}
|
|
540
535
|
}
|
|
541
536
|
const basicType = this.getBasicDataType();
|
|
542
|
-
if (basicType ===
|
|
537
|
+
if (basicType === DataType.String && variant.dataType === DataType.ByteString) {
|
|
543
538
|
return; // this is allowed
|
|
544
539
|
}
|
|
545
|
-
if (basicType ===
|
|
540
|
+
if (basicType === DataType.ByteString && variant.dataType === DataType.String) {
|
|
546
541
|
return; // this is allowed
|
|
547
542
|
}
|
|
548
|
-
if (basicType !==
|
|
549
|
-
basicType !==
|
|
550
|
-
variant.dataType !==
|
|
543
|
+
if (basicType !== DataType.Null &&
|
|
544
|
+
basicType !== DataType.Variant &&
|
|
545
|
+
variant.dataType !== DataType.Null &&
|
|
551
546
|
variant.dataType !== basicType) {
|
|
552
547
|
const message = "UAVariable.setValueFromSource " +
|
|
553
548
|
this.browseName.toString() +
|
|
@@ -558,10 +553,10 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
558
553
|
":\n" +
|
|
559
554
|
"the provided variant must have the expected dataType!\n" +
|
|
560
555
|
" - the expected dataType is " +
|
|
561
|
-
|
|
556
|
+
chalk.cyan(DataType[basicType]) +
|
|
562
557
|
"\n" +
|
|
563
558
|
" - the actual dataType is " +
|
|
564
|
-
|
|
559
|
+
chalk.magenta(DataType[variant.dataType]) +
|
|
565
560
|
"\n" +
|
|
566
561
|
" - " +
|
|
567
562
|
variant.toString();
|
|
@@ -588,18 +583,18 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
588
583
|
*/
|
|
589
584
|
setValueFromSource(variant, statusCode, sourceTimestamp) {
|
|
590
585
|
try {
|
|
591
|
-
statusCode = statusCode ||
|
|
592
|
-
const variant1 =
|
|
586
|
+
statusCode = statusCode || StatusCodes.Good;
|
|
587
|
+
const variant1 = Variant.coerce(variant);
|
|
593
588
|
this.verifyVariantCompatibility(variant1);
|
|
594
|
-
const now =
|
|
595
|
-
const dataValue = new
|
|
589
|
+
const now = coerceClock(sourceTimestamp, 0);
|
|
590
|
+
const dataValue = new DataValue(null);
|
|
596
591
|
dataValue.serverPicoseconds = now.picoseconds;
|
|
597
592
|
dataValue.serverTimestamp = now.timestamp;
|
|
598
593
|
dataValue.sourcePicoseconds = now.picoseconds;
|
|
599
594
|
dataValue.sourceTimestamp = now.timestamp;
|
|
600
595
|
dataValue.statusCode = statusCode;
|
|
601
596
|
dataValue.value = variant1;
|
|
602
|
-
if (dataValue.value.dataType ===
|
|
597
|
+
if (dataValue.value.dataType === DataType.ExtensionObject) {
|
|
603
598
|
// early, detailed diagnostics on a malformed extension object (the actual throw
|
|
604
599
|
// happens below in _internal_set_dataValue).
|
|
605
600
|
const valueIsCorrect = this.checkExtensionObjectIsCorrect(dataValue.value.value);
|
|
@@ -636,7 +631,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
636
631
|
*
|
|
637
632
|
* @internal
|
|
638
633
|
*/
|
|
639
|
-
_setInitialDataValue(variant, statusCode =
|
|
634
|
+
_setInitialDataValue(variant, statusCode = StatusCodes.Good) {
|
|
640
635
|
// the loader creates every variable with an empty value object, which the constructor
|
|
641
636
|
// binds, so a bound setter is the norm here and not a reason to take the long path:
|
|
642
637
|
// setValueFromSource never consults it either. A bound extension object is.
|
|
@@ -645,13 +640,14 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
645
640
|
return;
|
|
646
641
|
}
|
|
647
642
|
try {
|
|
648
|
-
const variant1 =
|
|
643
|
+
const variant1 = Variant.coerce(variant);
|
|
649
644
|
this.verifyVariantCompatibility(variant1);
|
|
650
|
-
if (variant1.dataType ===
|
|
645
|
+
if (variant1.dataType === DataType.ExtensionObject && !this.checkExtensionObjectIsCorrect(variant1.value)) {
|
|
651
646
|
throw new Error("invalid extension object");
|
|
652
647
|
}
|
|
653
|
-
|
|
654
|
-
|
|
648
|
+
// the load's reading while this address space is being loaded, a fresh one otherwise
|
|
649
|
+
const now = loadClock(this.addressSpace);
|
|
650
|
+
this.$dataValue = new DataValue({
|
|
655
651
|
value: variant1,
|
|
656
652
|
statusCode,
|
|
657
653
|
sourceTimestamp: now.timestamp,
|
|
@@ -665,12 +661,12 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
665
661
|
}
|
|
666
662
|
}
|
|
667
663
|
adjustDataValueStatusCode(dataValue) {
|
|
668
|
-
const statusCode =
|
|
664
|
+
const statusCode = adjustDataValueStatusCode(this, dataValue, this.acceptValueOutOfRange || false);
|
|
669
665
|
return statusCode;
|
|
670
666
|
}
|
|
671
667
|
writeValue(context, dataValue, ...args) {
|
|
672
|
-
context = context ||
|
|
673
|
-
|
|
668
|
+
context = context || SessionContext.defaultContext;
|
|
669
|
+
assert(context instanceof SessionContext);
|
|
674
670
|
if (!dataValue.sourceTimestamp) {
|
|
675
671
|
// source timestamp was not specified by the caller
|
|
676
672
|
// we will set the timestamp ourself with the current clock
|
|
@@ -679,7 +675,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
679
675
|
dataValue.sourcePicoseconds = context.currentTime.picoseconds;
|
|
680
676
|
}
|
|
681
677
|
else {
|
|
682
|
-
const { timestamp, picoseconds } =
|
|
678
|
+
const { timestamp, picoseconds } = getCurrentClock();
|
|
683
679
|
dataValue.sourceTimestamp = timestamp;
|
|
684
680
|
dataValue.sourcePicoseconds = picoseconds;
|
|
685
681
|
}
|
|
@@ -692,7 +688,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
692
688
|
let indexRange = null;
|
|
693
689
|
let callback;
|
|
694
690
|
if (args.length === 1) {
|
|
695
|
-
indexRange = new
|
|
691
|
+
indexRange = new NumericRange();
|
|
696
692
|
callback = args[0];
|
|
697
693
|
}
|
|
698
694
|
else if (args.length === 2) {
|
|
@@ -702,30 +698,30 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
702
698
|
else {
|
|
703
699
|
throw new Error("Invalid Number of args");
|
|
704
700
|
}
|
|
705
|
-
|
|
706
|
-
|
|
701
|
+
assert(typeof callback === "function");
|
|
702
|
+
assert(dataValue instanceof DataValue);
|
|
707
703
|
// index range could be string
|
|
708
|
-
indexRange =
|
|
704
|
+
indexRange = NumericRange.coerce(indexRange);
|
|
709
705
|
// test write permission
|
|
710
706
|
if (!this.isWritable(context)) {
|
|
711
|
-
callback?.(null,
|
|
707
|
+
callback?.(null, StatusCodes.BadNotWritable);
|
|
712
708
|
return;
|
|
713
709
|
}
|
|
714
|
-
if (!this.checkPermissionPrivate(context,
|
|
715
|
-
callback?.(null,
|
|
710
|
+
if (!this.checkPermissionPrivate(context, PermissionType.Write)) {
|
|
711
|
+
callback?.(null, StatusCodes.BadUserAccessDenied);
|
|
716
712
|
return;
|
|
717
713
|
}
|
|
718
714
|
// isWritable() and the role permission above already passed, so a false result
|
|
719
715
|
// here can only come from the UserAccessLevel attribute withholding CurrentWrite
|
|
720
716
|
// for this user (Part 3 5.6.3): that is an access decision, not an unsupported call.
|
|
721
717
|
if (!this.isUserWritable(context)) {
|
|
722
|
-
callback?.(null,
|
|
718
|
+
callback?.(null, StatusCodes.BadUserAccessDenied);
|
|
723
719
|
return;
|
|
724
720
|
}
|
|
725
721
|
// adjust special case
|
|
726
722
|
const variant = adjustVariant2.call(this, dataValue.value);
|
|
727
723
|
const statusCode = this.checkVariantCompatibility(variant);
|
|
728
|
-
if (statusCode.isNot(
|
|
724
|
+
if (statusCode.isNot(StatusCodes.Good)) {
|
|
729
725
|
callback?.(null, statusCode);
|
|
730
726
|
return;
|
|
731
727
|
}
|
|
@@ -739,29 +735,29 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
739
735
|
if (!write_func) {
|
|
740
736
|
warningLog(` warning ${this.nodeId.toString()} ${this.browseName.toString()} has no setter. \n`);
|
|
741
737
|
warningLog("Please make sure to bind the variable or to pass a valid value: new Variant({}) during construction time");
|
|
742
|
-
callback?.(null,
|
|
738
|
+
callback?.(null, StatusCodes.BadNotWritable);
|
|
743
739
|
return;
|
|
744
740
|
}
|
|
745
|
-
|
|
741
|
+
assert(write_func);
|
|
746
742
|
write_func.call(this, dataValue, (err, statusCode1) => {
|
|
747
743
|
if (!err) {
|
|
748
744
|
dataValue && this.verifyVariantCompatibility(dataValue.value);
|
|
749
745
|
if (indexRange && !indexRange.isEmpty()) {
|
|
750
746
|
if (!indexRange.isValid()) {
|
|
751
|
-
callback?.(null,
|
|
747
|
+
callback?.(null, StatusCodes.BadIndexRangeInvalid);
|
|
752
748
|
return;
|
|
753
749
|
}
|
|
754
750
|
const newArrayOrMatrix = dataValue.value.value;
|
|
755
|
-
if (dataValue.value.arrayType ===
|
|
756
|
-
if (this.$dataValue.value.arrayType !==
|
|
757
|
-
callback(null,
|
|
751
|
+
if (dataValue.value.arrayType === VariantArrayType.Array) {
|
|
752
|
+
if (this.$dataValue.value.arrayType !== VariantArrayType.Array) {
|
|
753
|
+
callback(null, StatusCodes.BadTypeMismatch);
|
|
758
754
|
return;
|
|
759
755
|
}
|
|
760
756
|
// check that destination data is also an array
|
|
761
|
-
|
|
757
|
+
assert(check_valid_array(this.$dataValue.value.dataType, this.$dataValue.value.value));
|
|
762
758
|
const destArr = this.$dataValue.value.value;
|
|
763
759
|
const result = indexRange.set_values(destArr, newArrayOrMatrix);
|
|
764
|
-
if (result.statusCode.isNot(
|
|
760
|
+
if (result.statusCode.isNot(StatusCodes.Good)) {
|
|
765
761
|
callback?.(null, result.statusCode);
|
|
766
762
|
return;
|
|
767
763
|
}
|
|
@@ -769,11 +765,11 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
769
765
|
// scrap original array so we detect range
|
|
770
766
|
this.$dataValue.value.value = null;
|
|
771
767
|
}
|
|
772
|
-
else if (dataValue.value.arrayType ===
|
|
768
|
+
else if (dataValue.value.arrayType === VariantArrayType.Matrix) {
|
|
773
769
|
const dimensions = this.$dataValue.value.dimensions;
|
|
774
|
-
if (this.$dataValue.value.arrayType !==
|
|
770
|
+
if (this.$dataValue.value.arrayType !== VariantArrayType.Matrix || !dimensions) {
|
|
775
771
|
// not a matrix !
|
|
776
|
-
callback?.(null,
|
|
772
|
+
callback?.(null, StatusCodes.BadTypeMismatch);
|
|
777
773
|
return;
|
|
778
774
|
}
|
|
779
775
|
const matrix = this.$dataValue.value.value;
|
|
@@ -781,7 +777,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
781
777
|
matrix,
|
|
782
778
|
dimensions
|
|
783
779
|
}, newArrayOrMatrix);
|
|
784
|
-
if (result.statusCode.isNot(
|
|
780
|
+
if (result.statusCode.isNot(StatusCodes.Good)) {
|
|
785
781
|
callback?.(null, result.statusCode);
|
|
786
782
|
return;
|
|
787
783
|
}
|
|
@@ -791,7 +787,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
791
787
|
this.$dataValue.value.value = null;
|
|
792
788
|
}
|
|
793
789
|
else {
|
|
794
|
-
callback?.(null,
|
|
790
|
+
callback?.(null, StatusCodes.BadTypeMismatch);
|
|
795
791
|
return;
|
|
796
792
|
}
|
|
797
793
|
}
|
|
@@ -799,10 +795,10 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
799
795
|
this._internal_set_dataValue(dataValue, indexRange);
|
|
800
796
|
}
|
|
801
797
|
catch (err) {
|
|
802
|
-
if (
|
|
798
|
+
if (types.isNativeError(err)) {
|
|
803
799
|
warningLog(err.message);
|
|
804
800
|
}
|
|
805
|
-
callback?.(null,
|
|
801
|
+
callback?.(null, StatusCodes.BadInternalError);
|
|
806
802
|
return;
|
|
807
803
|
}
|
|
808
804
|
}
|
|
@@ -816,48 +812,48 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
816
812
|
throw new Error("Internal error");
|
|
817
813
|
}
|
|
818
814
|
if (!this.canUserWriteAttribute(context, writeValueOptions.attributeId)) {
|
|
819
|
-
callback(null,
|
|
815
|
+
callback(null, StatusCodes.BadUserAccessDenied);
|
|
820
816
|
return;
|
|
821
817
|
}
|
|
822
|
-
const writeValue = writeValueOptions instanceof
|
|
823
|
-
context = context ||
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
818
|
+
const writeValue = writeValueOptions instanceof WriteValue ? writeValueOptions : new WriteValue(writeValueOptions);
|
|
819
|
+
context = context || SessionContext.defaultContext;
|
|
820
|
+
assert(context instanceof SessionContext);
|
|
821
|
+
assert(writeValue instanceof WriteValue);
|
|
822
|
+
assert(writeValue.value instanceof DataValue);
|
|
823
|
+
assert(writeValue.value?.value instanceof Variant);
|
|
824
|
+
assert(typeof callback === "function");
|
|
829
825
|
// Spec 1.0.2 Part 4 page 58
|
|
830
826
|
// If the SourceTimestamp or the ServerTimestamp is specified, the Server shall
|
|
831
827
|
// use these values.
|
|
832
828
|
// xx _apply_default_timestamps(writeValue.value);
|
|
833
829
|
switch (writeValue.attributeId) {
|
|
834
|
-
case
|
|
830
|
+
case AttributeIds.Value:
|
|
835
831
|
this.writeValue(context, writeValue.value, writeValue.indexRange, callback);
|
|
836
832
|
break;
|
|
837
|
-
case
|
|
838
|
-
if (writeValue.value?.value.dataType !==
|
|
839
|
-
callback(null,
|
|
833
|
+
case AttributeIds.Historizing:
|
|
834
|
+
if (writeValue.value?.value.dataType !== DataType.Boolean) {
|
|
835
|
+
callback(null, StatusCodes.BadTypeMismatch);
|
|
840
836
|
break;
|
|
841
837
|
}
|
|
842
|
-
if (!this.checkPermissionPrivate(context,
|
|
843
|
-
callback(null,
|
|
838
|
+
if (!this.checkPermissionPrivate(context, PermissionType.WriteHistorizing)) {
|
|
839
|
+
callback(null, StatusCodes.BadUserAccessDenied);
|
|
844
840
|
break;
|
|
845
841
|
}
|
|
846
842
|
if (!this.canUserWriteHistorizingAttribute(context)) {
|
|
847
|
-
callback(null,
|
|
843
|
+
callback(null, StatusCodes.BadHistoryOperationUnsupported);
|
|
848
844
|
break;
|
|
849
845
|
}
|
|
850
846
|
// Historizing is a real, writable attribute of a Variable (Part 3 5.6.2); a node
|
|
851
847
|
// without an HA Configuration simply cannot honour it right now, which is
|
|
852
848
|
// BadNotWritable, not BadNotSupported (that would mean the attribute never applies).
|
|
853
849
|
if (!this.getChildByName("HA Configuration")) {
|
|
854
|
-
callback(null,
|
|
850
|
+
callback(null, StatusCodes.BadNotWritable);
|
|
855
851
|
break;
|
|
856
852
|
}
|
|
857
853
|
// check if user is allowed to do that !
|
|
858
854
|
// TODO
|
|
859
855
|
this.historizing = !!writeValue.value?.value.value; // yes ! indeed !
|
|
860
|
-
callback(null,
|
|
856
|
+
callback(null, StatusCodes.Good);
|
|
861
857
|
break;
|
|
862
858
|
default:
|
|
863
859
|
super.writeAttribute(context, writeValue, callback);
|
|
@@ -874,23 +870,23 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
874
870
|
checkVariantCompatibility(value) {
|
|
875
871
|
// test dataType
|
|
876
872
|
if (!this._validate_DataType(value.dataType)) {
|
|
877
|
-
return
|
|
873
|
+
return StatusCodes.BadTypeMismatch;
|
|
878
874
|
}
|
|
879
875
|
try {
|
|
880
876
|
this.verifyVariantCompatibility(value);
|
|
881
877
|
}
|
|
882
878
|
catch (_err) {
|
|
883
|
-
return
|
|
879
|
+
return StatusCodes.BadTypeMismatch;
|
|
884
880
|
}
|
|
885
|
-
return
|
|
881
|
+
return StatusCodes.Good;
|
|
886
882
|
}
|
|
887
883
|
/**
|
|
888
884
|
* touch the source timestamp of a Variable and cascade up the change
|
|
889
885
|
* to the parent variable if any.
|
|
890
886
|
*/
|
|
891
887
|
touchValue(optionalNow) {
|
|
892
|
-
const now = optionalNow ||
|
|
893
|
-
|
|
888
|
+
const now = optionalNow || getCurrentClock();
|
|
889
|
+
propagateTouchValueUpward(this, now);
|
|
894
890
|
}
|
|
895
891
|
/**
|
|
896
892
|
* bind a variable with a get and set functions.
|
|
@@ -1023,24 +1019,24 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1023
1019
|
this._historyRead = UAVariableImpl.prototype._historyRead;
|
|
1024
1020
|
}
|
|
1025
1021
|
options = options || {};
|
|
1026
|
-
|
|
1027
|
-
|
|
1022
|
+
assert(typeof this._timestamped_set_func !== "function", "UAVariable already bound");
|
|
1023
|
+
assert(typeof this._timestamped_get_func !== "function", "UAVariable already bound");
|
|
1028
1024
|
bind_getter.call(this, options);
|
|
1029
1025
|
bind_setter.call(this, options);
|
|
1030
1026
|
const _historyRead = options.historyRead;
|
|
1031
1027
|
if (_historyRead) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1028
|
+
assert(typeof this._historyRead !== "function" || this._historyRead === UAVariableImpl.prototype._historyRead);
|
|
1029
|
+
assert(typeof _historyRead === "function");
|
|
1034
1030
|
this._historyRead = _historyRead;
|
|
1035
|
-
|
|
1031
|
+
assert(this._historyRead.length === 6);
|
|
1036
1032
|
}
|
|
1037
1033
|
// post conditions
|
|
1038
|
-
|
|
1039
|
-
|
|
1034
|
+
assert(typeof this._timestamped_set_func === "function");
|
|
1035
|
+
assert(this._timestamped_set_func?.length === 2, "expecting 2 parameters");
|
|
1040
1036
|
}
|
|
1041
1037
|
readValueAsync(context, callback) {
|
|
1042
|
-
|
|
1043
|
-
context = context ||
|
|
1038
|
+
assert(typeof callback === "function");
|
|
1039
|
+
context = context || SessionContext.defaultContext;
|
|
1044
1040
|
this.__waiting_callbacks = this.__waiting_callbacks || [];
|
|
1045
1041
|
this.__waiting_callbacks.push(callback);
|
|
1046
1042
|
const _readValueAsync_in_progress = this.__waiting_callbacks.length >= 2;
|
|
@@ -1048,18 +1044,18 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1048
1044
|
return;
|
|
1049
1045
|
}
|
|
1050
1046
|
if (this.isDisposed()) {
|
|
1051
|
-
callback?.(null, new
|
|
1047
|
+
callback?.(null, new DataValue({ statusCode: StatusCodes.BadNodeIdUnknown }));
|
|
1052
1048
|
return;
|
|
1053
1049
|
}
|
|
1054
1050
|
const readImmediate = (innerCallback) => {
|
|
1055
|
-
|
|
1051
|
+
assert(this.$dataValue instanceof DataValue);
|
|
1056
1052
|
const dataValue = this.readValue(context);
|
|
1057
1053
|
innerCallback(null, dataValue);
|
|
1058
1054
|
};
|
|
1059
1055
|
let func;
|
|
1060
1056
|
// stamped like the same gates of readValue(): the requested timestamps are expected
|
|
1061
1057
|
// on a Bad result too (FEAT-34)
|
|
1062
|
-
const answerStatusOnly = (statusCode) => (innerCallback) => innerCallback(null,
|
|
1058
|
+
const answerStatusOnly = (statusCode) => (innerCallback) => innerCallback(null, makeNowDataValue({ statusCode }));
|
|
1063
1059
|
if (context.isAccessRestricted(this)) {
|
|
1064
1060
|
// same gate as readValue(): a variable bound with a simple get()
|
|
1065
1061
|
// also gets a refreshFunc, sending every read down the asyncRefresh
|
|
@@ -1067,19 +1063,19 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1067
1063
|
// through readValue(). Without this check here, a node hardened
|
|
1068
1064
|
// with AccessRestrictions(EncryptionRequired) answered its value
|
|
1069
1065
|
// over an unencrypted channel.
|
|
1070
|
-
func = answerStatusOnly(
|
|
1066
|
+
func = answerStatusOnly(StatusCodes.BadSecurityModeInsufficient);
|
|
1071
1067
|
}
|
|
1072
1068
|
else if (!this.isReadable(context)) {
|
|
1073
|
-
func = answerStatusOnly(
|
|
1069
|
+
func = answerStatusOnly(StatusCodes.BadNotReadable);
|
|
1074
1070
|
}
|
|
1075
|
-
else if (!this.checkPermissionPrivate(context,
|
|
1076
|
-
func = answerStatusOnly(
|
|
1071
|
+
else if (!this.checkPermissionPrivate(context, PermissionType.Read)) {
|
|
1072
|
+
func = answerStatusOnly(StatusCodes.BadUserAccessDenied);
|
|
1077
1073
|
}
|
|
1078
1074
|
else if (!this.isUserReadable(context)) {
|
|
1079
|
-
func = answerStatusOnly(
|
|
1075
|
+
func = answerStatusOnly(StatusCodes.BadNotReadable);
|
|
1080
1076
|
}
|
|
1081
1077
|
else {
|
|
1082
|
-
const clock =
|
|
1078
|
+
const clock = getCurrentClock();
|
|
1083
1079
|
func = typeof this.refreshFunc === "function" ? this.asyncRefresh.bind(this, clock) : readImmediate;
|
|
1084
1080
|
}
|
|
1085
1081
|
const satisfy_callbacks = (err, dataValue) => {
|
|
@@ -1097,8 +1093,8 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1097
1093
|
catch (err) {
|
|
1098
1094
|
// c8 ignore next
|
|
1099
1095
|
if (doDebug) {
|
|
1100
|
-
debugLog(
|
|
1101
|
-
if (
|
|
1096
|
+
debugLog(chalk.red("func readValueAsync has failed "));
|
|
1097
|
+
if (types.isNativeError(err)) {
|
|
1102
1098
|
debugLog(" stack", err.stack);
|
|
1103
1099
|
}
|
|
1104
1100
|
}
|
|
@@ -1125,14 +1121,14 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1125
1121
|
userAccessLevel: this.userAccessLevel,
|
|
1126
1122
|
valueRank: this.valueRank
|
|
1127
1123
|
};
|
|
1128
|
-
const newVariable =
|
|
1124
|
+
const newVariable = _clone(this, UAVariableImpl, options, optionalFilter || defaultCloneFilter, extraInfo || makeDefaultCloneExtraInfo(this));
|
|
1129
1125
|
newVariable.bindVariable();
|
|
1130
|
-
|
|
1131
|
-
|
|
1126
|
+
assert(typeof newVariable._timestamped_set_func === "function");
|
|
1127
|
+
assert(newVariable.dataType === this.dataType);
|
|
1132
1128
|
newVariable.$dataValue = this.$dataValue.clone();
|
|
1133
1129
|
// also bind extension object
|
|
1134
1130
|
const v = newVariable.$dataValue.value;
|
|
1135
|
-
if (v.dataType ===
|
|
1131
|
+
if (v.dataType === DataType.ExtensionObject && v.value && v.arrayType === VariantArrayType.Scalar) {
|
|
1136
1132
|
try {
|
|
1137
1133
|
newVariable.bindExtensionObject(newVariable.$dataValue.value.value);
|
|
1138
1134
|
}
|
|
@@ -1152,7 +1148,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1152
1148
|
getDataTypeNode() {
|
|
1153
1149
|
const addressSpace = this.addressSpace;
|
|
1154
1150
|
if (this.dataType.isEmpty()) {
|
|
1155
|
-
this.dataType = this.resolveNodeId(
|
|
1151
|
+
this.dataType = this.resolveNodeId(DataType.Variant);
|
|
1156
1152
|
}
|
|
1157
1153
|
const dt = addressSpace.findNode(this.dataType);
|
|
1158
1154
|
// c8 ignore next
|
|
@@ -1178,7 +1174,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1178
1174
|
// has not yet been loaded !
|
|
1179
1175
|
return true;
|
|
1180
1176
|
}
|
|
1181
|
-
if (dataType.nodeId.namespace === 0 && dataType.nodeId.value ===
|
|
1177
|
+
if (dataType.nodeId.namespace === 0 && dataType.nodeId.value === DataType.ExtensionObject) {
|
|
1182
1178
|
return true;
|
|
1183
1179
|
}
|
|
1184
1180
|
const Constructor = addressSpace.getExtensionObjectConstructor(this.dataType);
|
|
@@ -1221,7 +1217,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1221
1217
|
if (extObj.constructor.name === Constructor.name) {
|
|
1222
1218
|
return true;
|
|
1223
1219
|
}
|
|
1224
|
-
if (extObj instanceof
|
|
1220
|
+
if (extObj instanceof OpaqueStructure) {
|
|
1225
1221
|
throw new Error("An opaque structure is not expected here");
|
|
1226
1222
|
}
|
|
1227
1223
|
// let's verify that the constructor is a sub-class of Constructor
|
|
@@ -1271,67 +1267,67 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1271
1267
|
* precondition:
|
|
1272
1268
|
*/
|
|
1273
1269
|
installExtensionObjectVariables() {
|
|
1274
|
-
|
|
1270
|
+
_installExtensionObjectBindingOnProperties(this, { createMissingProp: true });
|
|
1275
1271
|
}
|
|
1276
1272
|
/**
|
|
1277
1273
|
|
|
1278
1274
|
* @return {ExtensionObject}
|
|
1279
1275
|
*/
|
|
1280
1276
|
bindExtensionObjectScalar(optionalExtensionObject, options) {
|
|
1281
|
-
|
|
1282
|
-
return
|
|
1277
|
+
assert(this.valueRank === -1, "expecting an Scalar variable here");
|
|
1278
|
+
return _bindExtensionObject(this, optionalExtensionObject, options);
|
|
1283
1279
|
}
|
|
1284
1280
|
bindExtensionObjectArray(optionalExtensionObject, options) {
|
|
1285
|
-
|
|
1286
|
-
return
|
|
1281
|
+
assert(this.valueRank >= 1, "expecting an Array or a Matrix variable here");
|
|
1282
|
+
return _bindExtensionObjectArrayOrMatrix(this, optionalExtensionObject, options);
|
|
1287
1283
|
}
|
|
1288
1284
|
bindExtensionObject(optionalExtensionObject, options) {
|
|
1289
1285
|
// coerce to ExtensionObject[] when this.valueRank === 1
|
|
1290
1286
|
if (optionalExtensionObject &&
|
|
1291
1287
|
this.valueRank === 1 &&
|
|
1292
1288
|
!Array.isArray(optionalExtensionObject) &&
|
|
1293
|
-
optionalExtensionObject instanceof
|
|
1289
|
+
optionalExtensionObject instanceof ExtensionObject) {
|
|
1294
1290
|
warningLog("bindExtensionObject: coerce to ExtensionObject[] when valueRank === 1 and value is a scalar extension object");
|
|
1295
1291
|
optionalExtensionObject = [optionalExtensionObject];
|
|
1296
1292
|
}
|
|
1297
1293
|
if (optionalExtensionObject) {
|
|
1298
1294
|
if (Array.isArray(optionalExtensionObject)) {
|
|
1299
|
-
|
|
1300
|
-
return
|
|
1295
|
+
assert(this.valueRank >= 1, "bindExtensionObject: expecting an Array of Matrix variable here");
|
|
1296
|
+
return _bindExtensionObjectArrayOrMatrix(this, optionalExtensionObject, options);
|
|
1301
1297
|
}
|
|
1302
1298
|
else {
|
|
1303
1299
|
if (this.valueRank !== -1 && this.valueRank !== 0) {
|
|
1304
1300
|
throw new Error(`bindExtensionObject: expecting an Scalar variable here but got value rank ${this.valueRank}`);
|
|
1305
1301
|
}
|
|
1306
|
-
return
|
|
1302
|
+
return _bindExtensionObject(this, optionalExtensionObject, options);
|
|
1307
1303
|
}
|
|
1308
1304
|
}
|
|
1309
|
-
|
|
1305
|
+
assert(optionalExtensionObject === undefined || optionalExtensionObject === null);
|
|
1310
1306
|
if (this.valueRank === -1) {
|
|
1311
|
-
return
|
|
1307
|
+
return _bindExtensionObject(this, undefined, options);
|
|
1312
1308
|
}
|
|
1313
1309
|
else if (this.valueRank === 1) {
|
|
1314
|
-
return
|
|
1310
|
+
return _bindExtensionObjectArrayOrMatrix(this, undefined, options);
|
|
1315
1311
|
}
|
|
1316
1312
|
else if (this.valueRank > 1) {
|
|
1317
|
-
return
|
|
1313
|
+
return _bindExtensionObjectArrayOrMatrix(this, undefined, options);
|
|
1318
1314
|
}
|
|
1319
1315
|
// unsupported case ...
|
|
1320
1316
|
return null;
|
|
1321
1317
|
}
|
|
1322
1318
|
updateExtensionObjectPartial(partialExtensionObject) {
|
|
1323
|
-
|
|
1319
|
+
setExtensionObjectPartialValue(this, partialExtensionObject);
|
|
1324
1320
|
return this.$extensionObject;
|
|
1325
1321
|
}
|
|
1326
1322
|
incrementExtensionObjectPartial(path) {
|
|
1327
1323
|
const extensionObject = this.readValue().value.value;
|
|
1328
|
-
const partialData =
|
|
1329
|
-
|
|
1330
|
-
|
|
1324
|
+
const partialData = extractPartialData(path, extensionObject);
|
|
1325
|
+
incrementElement(path, partialData);
|
|
1326
|
+
setExtensionObjectPartialValue(this, partialData);
|
|
1331
1327
|
}
|
|
1332
1328
|
toString() {
|
|
1333
|
-
const options = new
|
|
1334
|
-
|
|
1329
|
+
const options = new ToStringBuilder();
|
|
1330
|
+
UAVariable_toString.call(this, options);
|
|
1335
1331
|
return options.toString();
|
|
1336
1332
|
}
|
|
1337
1333
|
toJSON() {
|
|
@@ -1341,7 +1337,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1341
1337
|
const dv = this.$dataValue;
|
|
1342
1338
|
if (dv) {
|
|
1343
1339
|
statusCode = dv.statusCode?.toString();
|
|
1344
|
-
if (dv.value && !(dv.value.value instanceof
|
|
1340
|
+
if (dv.value && !(dv.value.value instanceof OpaqueStructure)) {
|
|
1345
1341
|
value = dv.value.value;
|
|
1346
1342
|
}
|
|
1347
1343
|
}
|
|
@@ -1355,13 +1351,13 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1355
1351
|
dataType: this.dataType?.toString(),
|
|
1356
1352
|
valueRank: this.valueRank,
|
|
1357
1353
|
arrayDimensions: this.arrayDimensions,
|
|
1358
|
-
accessLevel:
|
|
1354
|
+
accessLevel: AccessLevelFlag[this.accessLevel],
|
|
1359
1355
|
statusCode,
|
|
1360
1356
|
value
|
|
1361
1357
|
};
|
|
1362
1358
|
}
|
|
1363
1359
|
[Symbol.for("nodejs.util.inspect.custom")](depth, inspectOptions) {
|
|
1364
|
-
const c = inspectOptions?.colors === false ? plainChalk :
|
|
1360
|
+
const c = inspectOptions?.colors === false ? plainChalk : chalk;
|
|
1365
1361
|
const typeName = this.typeDefinitionObj?.browseName.toString() ?? "?";
|
|
1366
1362
|
const displayName = this.displayName.length ? this.displayName.map((d) => d.text).join(" | ") : "";
|
|
1367
1363
|
if (depth !== null && depth <= 0) {
|
|
@@ -1378,7 +1374,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1378
1374
|
if (dv.value &&
|
|
1379
1375
|
dv.value.value !== undefined &&
|
|
1380
1376
|
dv.value.value !== null &&
|
|
1381
|
-
!(dv.value.value instanceof
|
|
1377
|
+
!(dv.value.value instanceof OpaqueStructure)) {
|
|
1382
1378
|
const v = dv.value.value;
|
|
1383
1379
|
valueStr = typeof v === "object" ? Object.prototype.toString.call(v) : String(v);
|
|
1384
1380
|
if (valueStr.length > 80)
|
|
@@ -1394,8 +1390,8 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1394
1390
|
c.yellow(" typeDefinition : ") + typeName,
|
|
1395
1391
|
c.yellow(" displayName : ") + displayName,
|
|
1396
1392
|
c.yellow(" dataType : ") + dt,
|
|
1397
|
-
c.yellow(" valueRank : ") +
|
|
1398
|
-
c.yellow(" accessLevel : ") +
|
|
1393
|
+
c.yellow(" valueRank : ") + valueRankToString(this.valueRank),
|
|
1394
|
+
c.yellow(" accessLevel : ") + AccessLevelFlag[this.accessLevel]
|
|
1399
1395
|
];
|
|
1400
1396
|
if (this.arrayDimensions?.length) {
|
|
1401
1397
|
lines.push(c.yellow(" arrayDimensions: ") + JSON.stringify(this.arrayDimensions));
|
|
@@ -1412,10 +1408,10 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1412
1408
|
return lines.join("\n");
|
|
1413
1409
|
}
|
|
1414
1410
|
historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback) {
|
|
1415
|
-
|
|
1416
|
-
|
|
1411
|
+
assert(context instanceof SessionContext);
|
|
1412
|
+
assert(typeof callback === "function");
|
|
1417
1413
|
if (typeof this._historyRead !== "function") {
|
|
1418
|
-
callback?.(null, new
|
|
1414
|
+
callback?.(null, new HistoryReadResult({ statusCode: StatusCodes.BadNotReadable }));
|
|
1419
1415
|
return;
|
|
1420
1416
|
}
|
|
1421
1417
|
this._historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationData, callback);
|
|
@@ -1428,20 +1424,20 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1428
1424
|
throw new Error("");
|
|
1429
1425
|
}
|
|
1430
1426
|
_historyRead(context, _historyReadDetails, _indexRange, _dataEncoding, _continuationData, callback) {
|
|
1431
|
-
if (!this.checkPermissionPrivate(context,
|
|
1432
|
-
const result = new
|
|
1433
|
-
statusCode:
|
|
1427
|
+
if (!this.checkPermissionPrivate(context, PermissionType.ReadHistory)) {
|
|
1428
|
+
const result = new HistoryReadResult({
|
|
1429
|
+
statusCode: StatusCodes.BadUserAccessDenied
|
|
1434
1430
|
});
|
|
1435
1431
|
callback(null, result);
|
|
1436
1432
|
}
|
|
1437
1433
|
if (!this.canUserReadHistory(context)) {
|
|
1438
|
-
const result = new
|
|
1439
|
-
statusCode:
|
|
1434
|
+
const result = new HistoryReadResult({
|
|
1435
|
+
statusCode: StatusCodes.BadHistoryOperationUnsupported
|
|
1440
1436
|
});
|
|
1441
1437
|
callback(null, result);
|
|
1442
1438
|
}
|
|
1443
|
-
const result = new
|
|
1444
|
-
statusCode:
|
|
1439
|
+
const result = new HistoryReadResult({
|
|
1440
|
+
statusCode: StatusCodes.BadHistoryOperationUnsupported
|
|
1445
1441
|
});
|
|
1446
1442
|
callback(null, result);
|
|
1447
1443
|
}
|
|
@@ -1462,26 +1458,26 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1462
1458
|
throw new Error("");
|
|
1463
1459
|
}
|
|
1464
1460
|
_validate_DataType(variantDataType) {
|
|
1465
|
-
return
|
|
1461
|
+
return validateDataTypeCorrectness(this.addressSpace, this.dataType, variantDataType, /* allow Nulls */ false, this.nodeId);
|
|
1466
1462
|
}
|
|
1467
1463
|
_internal_set_value(value) {
|
|
1468
|
-
if (value.dataType !==
|
|
1464
|
+
if (value.dataType !== DataType.Null) {
|
|
1469
1465
|
this.verifyVariantCompatibility(value);
|
|
1470
1466
|
}
|
|
1471
1467
|
this.$dataValue.value = value;
|
|
1472
1468
|
}
|
|
1473
1469
|
_internal_set_dataValue(dataValue, indexRange) {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1470
|
+
assert(dataValue, "expecting a dataValue");
|
|
1471
|
+
assert(dataValue instanceof DataValue, "expecting dataValue to be a DataValue");
|
|
1472
|
+
assert(dataValue !== this.$dataValue, "expecting dataValue to be different from previous DataValue instance");
|
|
1477
1473
|
const addressSpace = this.addressSpace;
|
|
1478
|
-
|
|
1474
|
+
/* c8 ignore next */
|
|
1479
1475
|
if (!addressSpace) {
|
|
1480
1476
|
warningLog("UAVariable#_internal_set_dataValue : no addressSpace ! may be node has already been deleted ?");
|
|
1481
1477
|
return;
|
|
1482
1478
|
}
|
|
1483
|
-
|
|
1484
|
-
if (dataValue.value.arrayType ===
|
|
1479
|
+
/* c8 ignore next */
|
|
1480
|
+
if (dataValue.value.arrayType === VariantArrayType.Matrix) {
|
|
1485
1481
|
if (!dataValue.value.dimensions) {
|
|
1486
1482
|
throw new Error("missing dimensions: a Matrix Variant needs a dimension");
|
|
1487
1483
|
}
|
|
@@ -1491,7 +1487,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1491
1487
|
}
|
|
1492
1488
|
}
|
|
1493
1489
|
// c8 ignore next
|
|
1494
|
-
if (dataValue.value.dataType ===
|
|
1490
|
+
if (dataValue.value.dataType === DataType.ExtensionObject) {
|
|
1495
1491
|
// c8 ignore next
|
|
1496
1492
|
if (!this.checkExtensionObjectIsCorrect(dataValue.value.value)) {
|
|
1497
1493
|
warningLog(dataValue.toString());
|
|
@@ -1505,34 +1501,34 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1505
1501
|
* @private
|
|
1506
1502
|
*/
|
|
1507
1503
|
_inner_replace_dataValue(dataValue, indexRange) {
|
|
1508
|
-
|
|
1504
|
+
assert(this.$dataValue.value instanceof Variant);
|
|
1509
1505
|
const old_dataValue = this.$dataValue.clone();
|
|
1510
|
-
if (this.$$extensionObjectArray && dataValue.value.arrayType !==
|
|
1506
|
+
if (this.$$extensionObjectArray && dataValue.value.arrayType !== VariantArrayType.Scalar) {
|
|
1511
1507
|
// we have a bounded array or matrix
|
|
1512
|
-
|
|
1508
|
+
assert(Array.isArray(dataValue.value.value));
|
|
1513
1509
|
if (this.$$extensionObjectArray !== this.$dataValue.value.value) {
|
|
1514
1510
|
throw new Error("internal error");
|
|
1515
1511
|
}
|
|
1516
1512
|
this.$$extensionObjectArray = dataValue.value.value;
|
|
1517
1513
|
this.$dataValue.value.value = dataValue.value.value;
|
|
1518
|
-
this.$dataValue.statusCode = dataValue.statusCode ||
|
|
1514
|
+
this.$dataValue.statusCode = dataValue.statusCode || StatusCodes.Good;
|
|
1519
1515
|
this.$dataValue.serverTimestamp = dataValue.serverTimestamp;
|
|
1520
1516
|
this.$dataValue.serverPicoseconds = dataValue.serverPicoseconds;
|
|
1521
1517
|
this.$dataValue.sourceTimestamp = dataValue.sourceTimestamp;
|
|
1522
1518
|
this.$dataValue.sourcePicoseconds = dataValue.sourcePicoseconds;
|
|
1523
1519
|
}
|
|
1524
|
-
else if (this._basicDataType ===
|
|
1520
|
+
else if (this._basicDataType === DataType.ExtensionObject &&
|
|
1525
1521
|
this.valueRank === -1 &&
|
|
1526
1522
|
this.$set_ExtensionObject &&
|
|
1527
|
-
dataValue.value.arrayType ===
|
|
1523
|
+
dataValue.value.arrayType === VariantArrayType.Scalar) {
|
|
1528
1524
|
// the entire extension object is changed.
|
|
1529
|
-
this.$dataValue.statusCode = this.$dataValue.statusCode ||
|
|
1530
|
-
const preciseClock =
|
|
1525
|
+
this.$dataValue.statusCode = this.$dataValue.statusCode || StatusCodes.Good;
|
|
1526
|
+
const preciseClock = coerceClock(this.$dataValue.sourceTimestamp, this.$dataValue.sourcePicoseconds);
|
|
1531
1527
|
this.$set_ExtensionObject(dataValue.value.value, preciseClock, new Set());
|
|
1532
1528
|
}
|
|
1533
1529
|
else {
|
|
1534
1530
|
this.$dataValue = dataValue;
|
|
1535
|
-
this.$dataValue.statusCode = this.$dataValue.statusCode ||
|
|
1531
|
+
this.$dataValue.statusCode = this.$dataValue.statusCode || StatusCodes.Good;
|
|
1536
1532
|
}
|
|
1537
1533
|
// repair missing timestamps
|
|
1538
1534
|
const now = new Date();
|
|
@@ -1544,7 +1540,7 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1544
1540
|
this.$dataValue.sourceTimestamp = old_dataValue.sourceTimestamp || now;
|
|
1545
1541
|
this.$dataValue.sourcePicoseconds = old_dataValue.sourcePicoseconds || 0;
|
|
1546
1542
|
}
|
|
1547
|
-
if (!
|
|
1543
|
+
if (!sameDataValue(old_dataValue, dataValue)) {
|
|
1548
1544
|
// a Property that carries the semantics of a DataItem (EURange, TrueState, ...) has to make
|
|
1549
1545
|
// the DataItem's next notification carry the SemanticsChanged bit. Done from the Property
|
|
1550
1546
|
// rather than with a listener installed when the DataItem is built, because a hand-built
|
|
@@ -1552,18 +1548,18 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1552
1548
|
// ... but a Property receiving its first value is a Variable being built, not a
|
|
1553
1549
|
// semantics change: until then its StatusCode is UncertainInitialValue.
|
|
1554
1550
|
if (old_dataValue.statusCode.isGood()) {
|
|
1555
|
-
|
|
1551
|
+
notifySemanticsChangedIfNeeded(this);
|
|
1556
1552
|
}
|
|
1557
|
-
if (this.getBasicDataType() ===
|
|
1558
|
-
const preciseClock =
|
|
1553
|
+
if (this.getBasicDataType() === DataType.ExtensionObject) {
|
|
1554
|
+
const preciseClock = coerceClock(this.$dataValue.sourceTimestamp, this.$dataValue.sourcePicoseconds);
|
|
1559
1555
|
const cache = new Set();
|
|
1560
1556
|
if (this.$$extensionObjectArray) {
|
|
1561
1557
|
this.touchValue(preciseClock);
|
|
1562
|
-
|
|
1558
|
+
propagateTouchValueDownwardArray(this, preciseClock, cache);
|
|
1563
1559
|
}
|
|
1564
1560
|
else {
|
|
1565
1561
|
this.touchValue(preciseClock);
|
|
1566
|
-
|
|
1562
|
+
propagateTouchValueDownward(this, preciseClock, cache);
|
|
1567
1563
|
}
|
|
1568
1564
|
}
|
|
1569
1565
|
else {
|
|
@@ -1572,117 +1568,119 @@ class UAVariableImpl extends base_node_impl_js_1.BaseNodeImpl {
|
|
|
1572
1568
|
}
|
|
1573
1569
|
}
|
|
1574
1570
|
_conditionRefresh(_cache) {
|
|
1575
|
-
|
|
1571
|
+
apply_condition_refresh.call(this, _cache);
|
|
1576
1572
|
}
|
|
1577
1573
|
handle_semantic_changed(_dataValue) {
|
|
1578
1574
|
this.semantic_version = this.semantic_version + 1;
|
|
1579
1575
|
this.emit("semantic_changed");
|
|
1576
|
+
// the bit tells whoever monitors this DataItem; the event tells whoever monitors the
|
|
1577
|
+
// Server object (OPC 10000-5 6.4.31). Both have to come from this one place.
|
|
1578
|
+
raiseSemanticChangeEvent(this);
|
|
1580
1579
|
}
|
|
1581
1580
|
_readDataType() {
|
|
1582
|
-
|
|
1581
|
+
assert(this.dataType instanceof NodeId);
|
|
1583
1582
|
const options = {
|
|
1584
|
-
statusCode:
|
|
1583
|
+
statusCode: StatusCodes.Good,
|
|
1585
1584
|
value: {
|
|
1586
|
-
dataType:
|
|
1585
|
+
dataType: DataType.NodeId,
|
|
1587
1586
|
value: this.dataType
|
|
1588
1587
|
}
|
|
1589
1588
|
};
|
|
1590
|
-
return new
|
|
1589
|
+
return new DataValue(options);
|
|
1591
1590
|
}
|
|
1592
1591
|
_readValueRank() {
|
|
1593
|
-
|
|
1592
|
+
assert(typeof this.valueRank === "number");
|
|
1594
1593
|
const options = {
|
|
1595
|
-
statusCode:
|
|
1596
|
-
value: { dataType:
|
|
1594
|
+
statusCode: StatusCodes.Good,
|
|
1595
|
+
value: { dataType: DataType.Int32, value: this.valueRank }
|
|
1597
1596
|
};
|
|
1598
|
-
return new
|
|
1597
|
+
return new DataValue(options);
|
|
1599
1598
|
}
|
|
1600
1599
|
_readArrayDimensions() {
|
|
1601
|
-
|
|
1602
|
-
|
|
1600
|
+
assert(Array.isArray(this.arrayDimensions) || this.arrayDimensions === null);
|
|
1601
|
+
assert(!this.arrayDimensions || this.valueRank > 0, "arrayDimension must be null if valueRank <0");
|
|
1603
1602
|
const options = {
|
|
1604
|
-
statusCode:
|
|
1605
|
-
value: { dataType:
|
|
1603
|
+
statusCode: StatusCodes.Good,
|
|
1604
|
+
value: { dataType: DataType.UInt32, arrayType: VariantArrayType.Array, value: this.arrayDimensions }
|
|
1606
1605
|
};
|
|
1607
|
-
return new
|
|
1606
|
+
return new DataValue(options);
|
|
1608
1607
|
}
|
|
1609
1608
|
_readAccessLevel(context) {
|
|
1610
|
-
|
|
1609
|
+
assert(context instanceof SessionContext);
|
|
1611
1610
|
const options = {
|
|
1612
|
-
statusCode:
|
|
1613
|
-
value: { dataType:
|
|
1611
|
+
statusCode: StatusCodes.Good,
|
|
1612
|
+
value: { dataType: DataType.Byte, value: convertAccessLevelFlagToByte(this.accessLevel) }
|
|
1614
1613
|
};
|
|
1615
|
-
return new
|
|
1614
|
+
return new DataValue(options);
|
|
1616
1615
|
}
|
|
1617
1616
|
_readAccessLevelEx(context) {
|
|
1618
|
-
|
|
1617
|
+
assert(context instanceof SessionContext);
|
|
1619
1618
|
const options = {
|
|
1620
|
-
statusCode:
|
|
1619
|
+
statusCode: StatusCodes.Good,
|
|
1621
1620
|
// Extra flags are not supported yet. to do:
|
|
1622
|
-
value: { dataType:
|
|
1621
|
+
value: { dataType: DataType.UInt32, value: convertAccessLevelFlagToByte(this.accessLevel) }
|
|
1623
1622
|
};
|
|
1624
|
-
return new
|
|
1623
|
+
return new DataValue(options);
|
|
1625
1624
|
}
|
|
1626
1625
|
_readUserAccessLevel(context) {
|
|
1627
|
-
|
|
1626
|
+
assert(context instanceof SessionContext);
|
|
1628
1627
|
const effectiveUserAccessLevel = _calculateEffectiveUserAccessLevelFromPermission(this, context, this.userAccessLevel);
|
|
1629
1628
|
const options = {
|
|
1630
1629
|
value: {
|
|
1631
|
-
dataType:
|
|
1632
|
-
statusCode:
|
|
1633
|
-
value:
|
|
1630
|
+
dataType: DataType.Byte,
|
|
1631
|
+
statusCode: StatusCodes.Good,
|
|
1632
|
+
value: convertAccessLevelFlagToByte(effectiveUserAccessLevel)
|
|
1634
1633
|
}
|
|
1635
1634
|
};
|
|
1636
|
-
return new
|
|
1635
|
+
return new DataValue(options);
|
|
1637
1636
|
}
|
|
1638
1637
|
_readMinimumSamplingInterval() {
|
|
1639
1638
|
// expect a Duration => Double
|
|
1640
1639
|
const options = {};
|
|
1641
1640
|
if (this.minimumSamplingInterval === undefined) {
|
|
1642
|
-
options.statusCode =
|
|
1641
|
+
options.statusCode = StatusCodes.BadAttributeIdInvalid;
|
|
1643
1642
|
}
|
|
1644
1643
|
else {
|
|
1645
|
-
options.value = { dataType:
|
|
1646
|
-
options.statusCode =
|
|
1644
|
+
options.value = { dataType: DataType.Double, value: this.minimumSamplingInterval };
|
|
1645
|
+
options.statusCode = StatusCodes.Good;
|
|
1647
1646
|
}
|
|
1648
|
-
return new
|
|
1647
|
+
return new DataValue(options);
|
|
1649
1648
|
}
|
|
1650
1649
|
_readHistorizing() {
|
|
1651
|
-
|
|
1650
|
+
assert(typeof this.historizing === "boolean");
|
|
1652
1651
|
const options = {
|
|
1653
|
-
statusCode:
|
|
1654
|
-
value: { dataType:
|
|
1652
|
+
statusCode: StatusCodes.Good,
|
|
1653
|
+
value: { dataType: DataType.Boolean, value: !!this.historizing }
|
|
1655
1654
|
};
|
|
1656
|
-
return new
|
|
1655
|
+
return new DataValue(options);
|
|
1657
1656
|
}
|
|
1658
1657
|
}
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
UAVariableImpl.prototype.
|
|
1662
|
-
UAVariableImpl.prototype.
|
|
1663
|
-
UAVariableImpl.prototype.
|
|
1664
|
-
UAVariableImpl.prototype.
|
|
1665
|
-
UAVariableImpl.prototype.readValueAsync = (0, thenify_ex_1.withCallback)(UAVariableImpl.prototype.readValueAsync);
|
|
1658
|
+
import { withCallback } from "thenify-ex";
|
|
1659
|
+
UAVariableImpl.prototype.asyncRefresh = withCallback(UAVariableImpl.prototype.asyncRefresh);
|
|
1660
|
+
UAVariableImpl.prototype.writeValue = withCallback(UAVariableImpl.prototype.writeValue);
|
|
1661
|
+
UAVariableImpl.prototype.writeAttribute = withCallback(UAVariableImpl.prototype.writeAttribute);
|
|
1662
|
+
UAVariableImpl.prototype.historyRead = withCallback(UAVariableImpl.prototype.historyRead);
|
|
1663
|
+
UAVariableImpl.prototype.readValueAsync = withCallback(UAVariableImpl.prototype.readValueAsync);
|
|
1666
1664
|
function check_valid_array(dataType, array) {
|
|
1667
1665
|
if (Array.isArray(array)) {
|
|
1668
1666
|
return true;
|
|
1669
1667
|
}
|
|
1670
1668
|
switch (dataType) {
|
|
1671
|
-
case
|
|
1669
|
+
case DataType.Double:
|
|
1672
1670
|
return array instanceof Float64Array;
|
|
1673
|
-
case
|
|
1671
|
+
case DataType.Float:
|
|
1674
1672
|
return array instanceof Float32Array;
|
|
1675
|
-
case
|
|
1673
|
+
case DataType.Int32:
|
|
1676
1674
|
return array instanceof Int32Array;
|
|
1677
|
-
case
|
|
1675
|
+
case DataType.Int16:
|
|
1678
1676
|
return array instanceof Int16Array;
|
|
1679
|
-
case
|
|
1677
|
+
case DataType.SByte:
|
|
1680
1678
|
return array instanceof Int8Array;
|
|
1681
|
-
case
|
|
1679
|
+
case DataType.UInt32:
|
|
1682
1680
|
return array instanceof Uint32Array;
|
|
1683
|
-
case
|
|
1681
|
+
case DataType.UInt16:
|
|
1684
1682
|
return array instanceof Uint16Array;
|
|
1685
|
-
case
|
|
1683
|
+
case DataType.Byte:
|
|
1686
1684
|
return array instanceof Uint8Array || array instanceof Buffer;
|
|
1687
1685
|
}
|
|
1688
1686
|
return false;
|
|
@@ -1719,13 +1717,13 @@ function _calculateEffectiveUserAccessLevelFromPermission(node, context, userAcc
|
|
|
1719
1717
|
}
|
|
1720
1718
|
userAccessLevel = node.userAccessLevel === undefined ? node.accessLevel : node.userAccessLevel & node.accessLevel;
|
|
1721
1719
|
if (context.checkPermission) {
|
|
1722
|
-
|
|
1723
|
-
userAccessLevel = __adjustFlag(
|
|
1724
|
-
userAccessLevel = __adjustFlag(
|
|
1725
|
-
userAccessLevel = __adjustFlag(
|
|
1726
|
-
userAccessLevel = __adjustFlag(
|
|
1727
|
-
userAccessLevel = __adjustFlag(
|
|
1728
|
-
userAccessLevel = __adjustFlag(
|
|
1720
|
+
assert(context.checkPermission instanceof Function);
|
|
1721
|
+
userAccessLevel = __adjustFlag(PermissionType.Read, AccessLevelFlag.CurrentRead, userAccessLevel);
|
|
1722
|
+
userAccessLevel = __adjustFlag(PermissionType.Write, AccessLevelFlag.CurrentWrite, userAccessLevel);
|
|
1723
|
+
userAccessLevel = __adjustFlag(PermissionType.Write, AccessLevelFlag.StatusWrite, userAccessLevel);
|
|
1724
|
+
userAccessLevel = __adjustFlag(PermissionType.Write, AccessLevelFlag.TimestampWrite, userAccessLevel);
|
|
1725
|
+
userAccessLevel = __adjustFlag(PermissionType.ReadHistory, AccessLevelFlag.HistoryRead, userAccessLevel);
|
|
1726
|
+
userAccessLevel = __adjustFlag(PermissionType.DeleteHistory, AccessLevelFlag.HistoryWrite, userAccessLevel);
|
|
1729
1727
|
return userAccessLevel;
|
|
1730
1728
|
}
|
|
1731
1729
|
else {
|
|
@@ -1736,16 +1734,16 @@ function adjustVariant2(variant) {
|
|
|
1736
1734
|
// convert Variant( Scalar|ByteString) => Variant(Array|ByteArray)
|
|
1737
1735
|
const _addressSpace = this.addressSpace;
|
|
1738
1736
|
const basicType = this.getBasicDataType();
|
|
1739
|
-
variant =
|
|
1737
|
+
variant = adjustVariant(variant, this.valueRank, basicType);
|
|
1740
1738
|
return variant;
|
|
1741
1739
|
}
|
|
1742
1740
|
function _not_writable_timestamped_set_func(dataValue, callback) {
|
|
1743
|
-
|
|
1744
|
-
callback(null,
|
|
1741
|
+
assert(dataValue instanceof DataValue);
|
|
1742
|
+
callback(null, StatusCodes.BadNotWritable, null);
|
|
1745
1743
|
}
|
|
1746
1744
|
function _default_writable_timestamped_set_func(dataValue, callback) {
|
|
1747
|
-
|
|
1748
|
-
callback(null,
|
|
1745
|
+
assert(dataValue instanceof DataValue);
|
|
1746
|
+
callback(null, StatusCodes.Good, dataValue);
|
|
1749
1747
|
}
|
|
1750
1748
|
function turn_sync_to_async(f, numberOfArgs) {
|
|
1751
1749
|
if (f.length <= numberOfArgs) {
|
|
@@ -1775,24 +1773,24 @@ function turn_sync_to_async(f, numberOfArgs) {
|
|
|
1775
1773
|
};
|
|
1776
1774
|
}
|
|
1777
1775
|
else {
|
|
1778
|
-
|
|
1776
|
+
assert(f.length === numberOfArgs + 1);
|
|
1779
1777
|
return f;
|
|
1780
1778
|
}
|
|
1781
1779
|
}
|
|
1782
1780
|
const _default_minimumSamplingInterval = 1000;
|
|
1783
1781
|
function coerceDataValue(dataValue) {
|
|
1784
|
-
if (dataValue instanceof
|
|
1782
|
+
if (dataValue instanceof DataValue) {
|
|
1785
1783
|
return dataValue;
|
|
1786
1784
|
}
|
|
1787
|
-
return new
|
|
1785
|
+
return new DataValue(dataValue);
|
|
1788
1786
|
}
|
|
1789
1787
|
// variation #3 :
|
|
1790
1788
|
function _Variable_bind_with_async_refresh(options) {
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1789
|
+
assert(this instanceof UAVariableImpl);
|
|
1790
|
+
assert(typeof options.refreshFunc === "function");
|
|
1791
|
+
assert(!options.get, "a getter shall not be specified when refreshFunc is set");
|
|
1792
|
+
assert(!options.timestamped_get, "a getter shall not be specified when refreshFunc is set");
|
|
1793
|
+
assert(!this.refreshFunc);
|
|
1796
1794
|
this.refreshFunc = options.refreshFunc;
|
|
1797
1795
|
/*
|
|
1798
1796
|
// TO DO : REVISIT THIS ASSUMPTION
|
|
@@ -1808,10 +1806,10 @@ function _Variable_bind_with_async_refresh(options) {
|
|
|
1808
1806
|
// variation 2
|
|
1809
1807
|
function _Variable_bind_with_timestamped_get(options) {
|
|
1810
1808
|
/* jshint validthis: true */
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1809
|
+
assert(this instanceof UAVariableImpl);
|
|
1810
|
+
assert(typeof options.timestamped_get === "function");
|
|
1811
|
+
assert(!options.get, "should not specify 'get' when 'timestamped_get' exists ");
|
|
1812
|
+
assert(!this._timestamped_get_func);
|
|
1815
1813
|
const async_refresh_func = (callback) => {
|
|
1816
1814
|
Promise.resolve(this._timestamped_get_func.call(this))
|
|
1817
1815
|
.then((dataValue) => callback(null, dataValue))
|
|
@@ -1828,8 +1826,8 @@ function _Variable_bind_with_timestamped_get(options) {
|
|
|
1828
1826
|
const dataValue_verify = timestamped_get.call(pThis);
|
|
1829
1827
|
// dataValue_verify should be a DataValue or a Promise
|
|
1830
1828
|
/* c8 ignore next */
|
|
1831
|
-
if (!(dataValue_verify instanceof
|
|
1832
|
-
errorLog(
|
|
1829
|
+
if (!(dataValue_verify instanceof DataValue) && typeof dataValue_verify.then !== "function") {
|
|
1830
|
+
errorLog(chalk.red(" Bind variable error: "), " the timestamped_get function must return a DataValue or a Promise<DataValue>" +
|
|
1833
1831
|
"\n value_check.constructor.name ", dataValue_verify ? dataValue_verify.constructor.name : "null");
|
|
1834
1832
|
throw new Error(" Bind variable error: " + " the timestamped_get function must return a DataValue");
|
|
1835
1833
|
}
|
|
@@ -1845,31 +1843,31 @@ function _Variable_bind_with_timestamped_get(options) {
|
|
|
1845
1843
|
}
|
|
1846
1844
|
// variation 1
|
|
1847
1845
|
function _Variable_bind_with_simple_get(options) {
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1846
|
+
assert(this instanceof UAVariableImpl);
|
|
1847
|
+
assert(typeof options.get === "function", "should specify get function");
|
|
1848
|
+
assert(options.get?.length === 0, "get function should not have arguments");
|
|
1849
|
+
assert(!options.timestamped_get, "should not specify a timestamped_get function when get is specified");
|
|
1850
|
+
assert(!this._timestamped_get_func);
|
|
1851
|
+
assert(!this._get_func);
|
|
1854
1852
|
this._get_func = options.get;
|
|
1855
1853
|
const timestamped_get_func_from__Variable_bind_with_simple_get = () => {
|
|
1856
1854
|
const value = this._get_func();
|
|
1857
1855
|
/* c8 ignore next */
|
|
1858
1856
|
if (!is_Variant_or_StatusCode(value)) {
|
|
1859
|
-
errorLog(
|
|
1857
|
+
errorLog(chalk.red(" Bind variable error: "), " : the getter must return a Variant or a StatusCode" + "\nvalue_check.constructor.name ", value ? value.constructor.name : "null");
|
|
1860
1858
|
throw new Error(" bindVariable : the value getter function returns a invalid result ( expecting a Variant or a StatusCode !!!");
|
|
1861
1859
|
}
|
|
1862
1860
|
if (is_StatusCode(value)) {
|
|
1863
|
-
return new
|
|
1861
|
+
return new DataValue({ statusCode: value });
|
|
1864
1862
|
}
|
|
1865
1863
|
else {
|
|
1866
|
-
if (!this.$dataValue?.statusCode.isGoodish() || !
|
|
1864
|
+
if (!this.$dataValue?.statusCode.isGoodish() || !sameVariant(this.$dataValue.value, value)) {
|
|
1867
1865
|
// rebuilding artificially timestamps with current clock as they are not provided
|
|
1868
1866
|
// by the underlying getter function
|
|
1869
|
-
const { timestamp: sourceTimestamp, picoseconds: sourcePicoseconds } =
|
|
1867
|
+
const { timestamp: sourceTimestamp, picoseconds: sourcePicoseconds } = getCurrentClock();
|
|
1870
1868
|
const serverTimestamp = sourceTimestamp;
|
|
1871
1869
|
const serverPicoseconds = sourcePicoseconds;
|
|
1872
|
-
this._inner_replace_dataValue(new
|
|
1870
|
+
this._inner_replace_dataValue(new DataValue({ value, sourceTimestamp, sourcePicoseconds, serverTimestamp, serverPicoseconds }));
|
|
1873
1871
|
}
|
|
1874
1872
|
return this.$dataValue;
|
|
1875
1873
|
}
|
|
@@ -1880,36 +1878,36 @@ function _Variable_bind_with_simple_get(options) {
|
|
|
1880
1878
|
});
|
|
1881
1879
|
}
|
|
1882
1880
|
function _Variable_bind_with_simple_set(options) {
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1881
|
+
assert(this instanceof UAVariableImpl);
|
|
1882
|
+
assert(typeof options.set === "function", "should specify set function");
|
|
1883
|
+
assert(!options.timestamped_set, "should not specify a timestamped_set function");
|
|
1884
|
+
assert(!this._timestamped_set_func);
|
|
1885
|
+
assert(!this._set_func);
|
|
1888
1886
|
//
|
|
1889
1887
|
const set_func = turn_sync_to_async(options.set, 1);
|
|
1890
1888
|
this._set_func = set_func;
|
|
1891
|
-
|
|
1889
|
+
assert(set_func.length === 2, " set function must have 2 arguments ( variant, callback)");
|
|
1892
1890
|
this._timestamped_set_func = (timestamped_value, callback) => {
|
|
1893
|
-
|
|
1891
|
+
assert(timestamped_value instanceof DataValue);
|
|
1894
1892
|
set_func.call(this, timestamped_value.value, (err, statusCode) => {
|
|
1895
1893
|
// c8 ignore next
|
|
1896
1894
|
if (!err && !statusCode) {
|
|
1897
|
-
errorLog(
|
|
1898
|
-
errorLog(
|
|
1899
|
-
return callback(err,
|
|
1895
|
+
errorLog(chalk.red("UAVariable Binding Error _set_func must return a StatusCode, check the bindVariable parameters"));
|
|
1896
|
+
errorLog(chalk.yellow("StatusCode.Good is assumed"));
|
|
1897
|
+
return callback(err, StatusCodes.Good, timestamped_value);
|
|
1900
1898
|
}
|
|
1901
1899
|
if (statusCode?.isNotGood()) {
|
|
1902
1900
|
// record the value but still record the statusCode !
|
|
1903
1901
|
timestamped_value.statusCode = statusCode;
|
|
1904
1902
|
}
|
|
1905
|
-
callback(err, statusCode ??
|
|
1903
|
+
callback(err, statusCode ?? StatusCodes.BadInternalError, timestamped_value);
|
|
1906
1904
|
});
|
|
1907
1905
|
};
|
|
1908
1906
|
}
|
|
1909
1907
|
function _Variable_bind_with_timestamped_set(options) {
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
this._timestamped_set_func =
|
|
1908
|
+
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>{}");
|
|
1909
|
+
assert(!options.set, "should not specify set when timestamped_set_func exists ");
|
|
1910
|
+
this._timestamped_set_func = convertToCallbackFunction1(options.timestamped_set);
|
|
1913
1911
|
}
|
|
1914
1912
|
function bind_setter(options) {
|
|
1915
1913
|
if (options.set && typeof options.set === "function") {
|
|
@@ -1923,7 +1921,7 @@ function bind_setter(options) {
|
|
|
1923
1921
|
}
|
|
1924
1922
|
else if (typeof options.timestamped_set === "function") {
|
|
1925
1923
|
// variation 2
|
|
1926
|
-
|
|
1924
|
+
assert(typeof options.timestamped_get === "function", "timestamped_set must be used with timestamped_get ");
|
|
1927
1925
|
_Variable_bind_with_timestamped_set.call(this, {
|
|
1928
1926
|
set: undefined,
|
|
1929
1927
|
timestamped_set: options.timestamped_set
|
|
@@ -1964,7 +1962,7 @@ function bind_getter(options) {
|
|
|
1964
1962
|
_Variable_bind_with_async_refresh.call(this, { refreshFunc: options.refreshFunc });
|
|
1965
1963
|
}
|
|
1966
1964
|
else {
|
|
1967
|
-
|
|
1965
|
+
assert(!Object.hasOwn(options, "set"), "getter is missing : a getter must be provided if a setter is provided");
|
|
1968
1966
|
// xx bind_variant.call(this,options);
|
|
1969
1967
|
if (options.dataType !== undefined) {
|
|
1970
1968
|
// if (options.dataType !== DataType.ExtensionObject) {
|
|
@@ -1973,7 +1971,7 @@ function bind_getter(options) {
|
|
|
1973
1971
|
}
|
|
1974
1972
|
}
|
|
1975
1973
|
}
|
|
1976
|
-
class UAVariableImplT extends UAVariableImpl {
|
|
1974
|
+
export class UAVariableImplT extends UAVariableImpl {
|
|
1977
1975
|
readValue(context, indexRange, dataEncoding) {
|
|
1978
1976
|
return super.readValue(context, indexRange, dataEncoding);
|
|
1979
1977
|
}
|
|
@@ -1997,18 +1995,17 @@ class UAVariableImplT extends UAVariableImpl {
|
|
|
1997
1995
|
return super.writeValue(context, dataValue, indexRangeOrCallback, callback);
|
|
1998
1996
|
}
|
|
1999
1997
|
}
|
|
2000
|
-
exports.UAVariableImplT = UAVariableImplT;
|
|
2001
1998
|
function changeUAVariableDataType(uaVariable, newDataType, valueLike) {
|
|
2002
|
-
let value = valueLike ? (valueLike instanceof
|
|
1999
|
+
let value = valueLike ? (valueLike instanceof Variant ? valueLike : new Variant(valueLike)) : null;
|
|
2003
2000
|
const addressSpace = uaVariable.addressSpace;
|
|
2004
2001
|
const newDataTypeNode = addressSpace.findNode(newDataType);
|
|
2005
2002
|
// c8 ignore next
|
|
2006
|
-
if (!newDataTypeNode || !(newDataTypeNode instanceof
|
|
2003
|
+
if (!newDataTypeNode || !(newDataTypeNode instanceof UADataTypeImpl)) {
|
|
2007
2004
|
throw new Error(`Cannot find newDataTypeNode ${newDataType.toString()}`);
|
|
2008
2005
|
}
|
|
2009
2006
|
const newBaseDataType = newDataTypeNode.basicDataType;
|
|
2010
2007
|
// c8 ignore next
|
|
2011
|
-
if (newBaseDataType ===
|
|
2008
|
+
if (newBaseDataType === DataType.Null) {
|
|
2012
2009
|
throw new Error("newDataTypeNode must be a DataType");
|
|
2013
2010
|
}
|
|
2014
2011
|
if (!value) {
|