node-opcua-address-space 2.97.0 → 2.98.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/package.json +37 -37
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +4 -3
- package/src/alarms_and_conditions/ua_condition_impl.ts +14 -9
- package/src/base_node_private.ts +73 -28
- package/src/ua_variable_type_impl.ts +35 -17
- package/dist/source/address_space_ts.d.ts +0 -118
- package/dist/source/address_space_ts.js +0 -18
- package/dist/source/address_space_ts.js.map +0 -1
- package/dist/source/continuation_points/continuation_point_manager.d.ts +0 -91
- package/dist/source/continuation_points/continuation_point_manager.js +0 -201
- package/dist/source/continuation_points/continuation_point_manager.js.map +0 -1
- package/dist/source/helpers/adjust_browse_direction.d.ts +0 -5
- package/dist/source/helpers/adjust_browse_direction.js +0 -12
- package/dist/source/helpers/adjust_browse_direction.js.map +0 -1
- package/dist/source/helpers/argument_list.d.ts +0 -33
- package/dist/source/helpers/argument_list.js +0 -255
- package/dist/source/helpers/argument_list.js.map +0 -1
- package/dist/source/helpers/call_helpers.d.ts +0 -6
- package/dist/source/helpers/call_helpers.js +0 -72
- package/dist/source/helpers/call_helpers.js.map +0 -1
- package/dist/source/helpers/coerce_enum_value.d.ts +0 -6
- package/dist/source/helpers/coerce_enum_value.js +0 -34
- package/dist/source/helpers/coerce_enum_value.js.map +0 -1
- package/dist/source/helpers/dump_tools.d.ts +0 -14
- package/dist/source/helpers/dump_tools.js +0 -79
- package/dist/source/helpers/dump_tools.js.map +0 -1
- package/dist/source/helpers/ensure_secure_access.d.ts +0 -9
- package/dist/source/helpers/ensure_secure_access.js +0 -77
- package/dist/source/helpers/ensure_secure_access.js.map +0 -1
- package/dist/source/helpers/make_optionals_map.d.ts +0 -21
- package/dist/source/helpers/make_optionals_map.js +0 -30
- package/dist/source/helpers/make_optionals_map.js.map +0 -1
- package/dist/source/helpers/multiform_func.d.ts +0 -11
- package/dist/source/helpers/multiform_func.js +0 -76
- package/dist/source/helpers/multiform_func.js.map +0 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +0 -3
- package/dist/source/helpers/resolve_opaque_on_address_space.js +0 -37
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +0 -1
- package/dist/source/index.d.ts +0 -61
- package/dist/source/index.js +0 -90
- package/dist/source/index.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +0 -19
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +0 -193
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +0 -12
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +0 -10
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +0 -9
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +0 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +0 -20
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +0 -23
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +0 -32
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +0 -19
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +0 -42
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +0 -7
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -26
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +0 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +0 -20
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +0 -26
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +0 -8
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +0 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +0 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +0 -21
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +0 -24
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +0 -12
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +0 -1
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +0 -8
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +0 -3
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +0 -1
- package/dist/source/interfaces/extension_object_constructor.d.ts +0 -10
- package/dist/source/interfaces/extension_object_constructor.js +0 -3
- package/dist/source/interfaces/extension_object_constructor.js.map +0 -1
- package/dist/source/interfaces/nodeset_loader_options.d.ts +0 -4
- package/dist/source/interfaces/nodeset_loader_options.js +0 -3
- package/dist/source/interfaces/nodeset_loader_options.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +0 -12
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +0 -3
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +0 -49
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +0 -3
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +0 -11
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +0 -3
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +0 -30
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js +0 -3
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +0 -234
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +0 -3
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +0 -1
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +0 -6
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +0 -3
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +0 -1
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +0 -8
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +0 -3
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +0 -1
- package/dist/source/loader/decode_xml_extension_object.d.ts +0 -6
- package/dist/source/loader/decode_xml_extension_object.js +0 -72
- package/dist/source/loader/decode_xml_extension_object.js.map +0 -1
- package/dist/source/loader/ensure_datatype_extracted.d.ts +0 -5
- package/dist/source/loader/ensure_datatype_extracted.js +0 -71
- package/dist/source/loader/ensure_datatype_extracted.js.map +0 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +0 -11
- package/dist/source/loader/generateAddressSpaceRaw.js +0 -46
- package/dist/source/loader/generateAddressSpaceRaw.js.map +0 -1
- package/dist/source/loader/load_nodeset2.d.ts +0 -17
- package/dist/source/loader/load_nodeset2.js +0 -1484
- package/dist/source/loader/load_nodeset2.js.map +0 -1
- package/dist/source/loader/make_semver_compatible.d.ts +0 -6
- package/dist/source/loader/make_semver_compatible.js +0 -26
- package/dist/source/loader/make_semver_compatible.js.map +0 -1
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +0 -28
- package/dist/source/loader/make_xml_extension_object_parser.js +0 -327
- package/dist/source/loader/make_xml_extension_object_parser.js.map +0 -1
- package/dist/source/loader/namespace_post_step.d.ts +0 -10
- package/dist/source/loader/namespace_post_step.js +0 -62
- package/dist/source/loader/namespace_post_step.js.map +0 -1
- package/dist/source/loader/register_node_promoter.d.ts +0 -2
- package/dist/source/loader/register_node_promoter.js +0 -10
- package/dist/source/loader/register_node_promoter.js.map +0 -1
- package/dist/source/namespace.d.ts +0 -6
- package/dist/source/namespace.js +0 -3
- package/dist/source/namespace.js.map +0 -1
- package/dist/source/namespace_alarm_and_condition.d.ts +0 -32
- package/dist/source/namespace_alarm_and_condition.js +0 -3
- package/dist/source/namespace_alarm_and_condition.js.map +0 -1
- package/dist/source/namespace_data_access.d.ts +0 -42
- package/dist/source/namespace_data_access.js +0 -3
- package/dist/source/namespace_data_access.js.map +0 -1
- package/dist/source/namespace_machine_state.d.ts +0 -8
- package/dist/source/namespace_machine_state.js +0 -3
- package/dist/source/namespace_machine_state.js.map +0 -1
- package/dist/source/pseudo_session.d.ts +0 -72
- package/dist/source/pseudo_session.js +0 -255
- package/dist/source/pseudo_session.js.map +0 -1
- package/dist/source/session_context.d.ts +0 -111
- package/dist/source/session_context.js +0 -265
- package/dist/source/session_context.js.map +0 -1
- package/dist/source/set_namespace_meta_data.d.ts +0 -2
- package/dist/source/set_namespace_meta_data.js +0 -60
- package/dist/source/set_namespace_meta_data.js.map +0 -1
- package/dist/source/ua_root_folder.d.ts +0 -9
- package/dist/source/ua_root_folder.js +0 -3
- package/dist/source/ua_root_folder.js.map +0 -1
- package/dist/source/ua_two_state_variable_ex.d.ts +0 -23
- package/dist/source/ua_two_state_variable_ex.js +0 -3
- package/dist/source/ua_two_state_variable_ex.js.map +0 -1
- package/dist/source/xml_writer.d.ts +0 -18
- package/dist/source/xml_writer.js +0 -3
- package/dist/source/xml_writer.js.map +0 -1
- package/dist/src/address_space.d.ts +0 -387
- package/dist/src/address_space.js +0 -1386
- package/dist/src/address_space.js.map +0 -1
- package/dist/src/address_space_change_event_tools.d.ts +0 -6
- package/dist/src/address_space_change_event_tools.js +0 -153
- package/dist/src/address_space_change_event_tools.js.map +0 -1
- package/dist/src/address_space_private.d.ts +0 -43
- package/dist/src/address_space_private.js +0 -3
- package/dist/src/address_space_private.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition.d.ts +0 -5
- package/dist/src/alarms_and_conditions/condition.js +0 -79
- package/dist/src/alarms_and_conditions/condition.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +0 -26
- package/dist/src/alarms_and_conditions/condition_info_impl.js +0 -55
- package/dist/src/alarms_and_conditions/condition_info_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +0 -222
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +0 -658
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +0 -9
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +0 -61
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +0 -1
- package/dist/src/alarms_and_conditions/index.d.ts +0 -16
- package/dist/src/alarms_and_conditions/index.js +0 -33
- package/dist/src/alarms_and_conditions/index.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +0 -44
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +0 -245
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +0 -93
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +0 -419
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +0 -26
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +0 -39
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +0 -44
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +0 -184
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +0 -153
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +0 -1029
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +0 -14
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +0 -35
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +0 -24
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +0 -57
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +0 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +0 -12
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +0 -23
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +0 -87
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +0 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +0 -8
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +0 -79
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +0 -251
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +0 -24
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +0 -51
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +0 -19
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +0 -163
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +0 -46
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +0 -166
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +0 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +0 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +0 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +0 -1
- package/dist/src/apply_condition_refresh.d.ts +0 -6
- package/dist/src/apply_condition_refresh.js +0 -28
- package/dist/src/apply_condition_refresh.js.map +0 -1
- package/dist/src/base_node_impl.d.ts +0 -284
- package/dist/src/base_node_impl.js +0 -1455
- package/dist/src/base_node_impl.js.map +0 -1
- package/dist/src/base_node_private.d.ts +0 -81
- package/dist/src/base_node_private.js +0 -804
- package/dist/src/base_node_private.js.map +0 -1
- package/dist/src/check_value_rank_compatibility.d.ts +0 -15
- package/dist/src/check_value_rank_compatibility.js +0 -82
- package/dist/src/check_value_rank_compatibility.js.map +0 -1
- package/dist/src/data_access/add_dataItem_stuff.d.ts +0 -11
- package/dist/src/data_access/add_dataItem_stuff.js +0 -62
- package/dist/src/data_access/add_dataItem_stuff.js.map +0 -1
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +0 -1
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +0 -35
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +0 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +0 -32
- package/dist/src/data_access/ua_multistate_discrete_impl.js +0 -131
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +0 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +0 -52
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +0 -254
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +0 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +0 -25
- package/dist/src/data_access/ua_two_state_discrete_impl.js +0 -156
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +0 -1
- package/dist/src/event_data.d.ts +0 -34
- package/dist/src/event_data.js +0 -65
- package/dist/src/event_data.js.map +0 -1
- package/dist/src/extension_object_array_node.d.ts +0 -23
- package/dist/src/extension_object_array_node.js +0 -249
- package/dist/src/extension_object_array_node.js.map +0 -1
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +0 -26
- package/dist/src/historical_access/address_space_historical_data_node.js +0 -653
- package/dist/src/historical_access/address_space_historical_data_node.js.map +0 -1
- package/dist/src/idx_iterator.d.ts +0 -8
- package/dist/src/idx_iterator.js +0 -51
- package/dist/src/idx_iterator.js.map +0 -1
- package/dist/src/index_current.d.ts +0 -46
- package/dist/src/index_current.js +0 -78
- package/dist/src/index_current.js.map +0 -1
- package/dist/src/namespace_impl.d.ts +0 -456
- package/dist/src/namespace_impl.js +0 -1763
- package/dist/src/namespace_impl.js.map +0 -1
- package/dist/src/namespace_private.d.ts +0 -23
- package/dist/src/namespace_private.js +0 -33
- package/dist/src/namespace_private.js.map +0 -1
- package/dist/src/nodeid_manager.d.ts +0 -37
- package/dist/src/nodeid_manager.js +0 -184
- package/dist/src/nodeid_manager.js.map +0 -1
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +0 -2
- package/dist/src/nodeset_tools/adjust_namespace_array.js +0 -14
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +0 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +0 -18
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +0 -141
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +0 -1
- package/dist/src/nodeset_tools/dump_to_bsd.d.ts +0 -2
- package/dist/src/nodeset_tools/dump_to_bsd.js +0 -165
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +0 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +0 -10
- package/dist/src/nodeset_tools/nodeset_to_xml.js +0 -1288
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +0 -1
- package/dist/src/private_namespace.d.ts +0 -5
- package/dist/src/private_namespace.js +0 -20
- package/dist/src/private_namespace.js.map +0 -1
- package/dist/src/reference_impl.d.ts +0 -43
- package/dist/src/reference_impl.js +0 -140
- package/dist/src/reference_impl.js.map +0 -1
- package/dist/src/role_permissions.d.ts +0 -2
- package/dist/src/role_permissions.js +0 -11
- package/dist/src/role_permissions.js.map +0 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +0 -81
- package/dist/src/state_machine/finite_state_machine.js +0 -389
- package/dist/src/state_machine/finite_state_machine.js.map +0 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +0 -38
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +0 -251
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +0 -1
- package/dist/src/state_machine/ua_two_state_variable.d.ts +0 -61
- package/dist/src/state_machine/ua_two_state_variable.js +0 -332
- package/dist/src/state_machine/ua_two_state_variable.js.map +0 -1
- package/dist/src/tool_isSubtypeOf.d.ts +0 -18
- package/dist/src/tool_isSubtypeOf.js +0 -125
- package/dist/src/tool_isSubtypeOf.js.map +0 -1
- package/dist/src/tool_isSupertypeOf.d.ts +0 -18
- package/dist/src/tool_isSupertypeOf.js +0 -125
- package/dist/src/tool_isSupertypeOf.js.map +0 -1
- package/dist/src/ua_condition_type.d.ts +0 -8
- package/dist/src/ua_condition_type.js +0 -3
- package/dist/src/ua_condition_type.js.map +0 -1
- package/dist/src/ua_data_type_impl.d.ts +0 -89
- package/dist/src/ua_data_type_impl.js +0 -369
- package/dist/src/ua_data_type_impl.js.map +0 -1
- package/dist/src/ua_method_impl.d.ts +0 -42
- package/dist/src/ua_method_impl.js +0 -218
- package/dist/src/ua_method_impl.js.map +0 -1
- package/dist/src/ua_object_impl.d.ts +0 -35
- package/dist/src/ua_object_impl.js +0 -169
- package/dist/src/ua_object_impl.js.map +0 -1
- package/dist/src/ua_object_type_impl.d.ts +0 -50
- package/dist/src/ua_object_type_impl.js +0 -127
- package/dist/src/ua_object_type_impl.js.map +0 -1
- package/dist/src/ua_reference_type_impl.d.ts +0 -45
- package/dist/src/ua_reference_type_impl.js +0 -142
- package/dist/src/ua_reference_type_impl.js.map +0 -1
- package/dist/src/ua_variable_impl.d.ts +0 -380
- package/dist/src/ua_variable_impl.js +0 -1739
- package/dist/src/ua_variable_impl.js.map +0 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +0 -23
- package/dist/src/ua_variable_impl_ext_obj.js +0 -671
- package/dist/src/ua_variable_impl_ext_obj.js.map +0 -1
- package/dist/src/ua_variable_type_impl.d.ts +0 -74
- package/dist/src/ua_variable_type_impl.js +0 -582
- package/dist/src/ua_variable_type_impl.js.map +0 -1
- package/dist/src/ua_view_impl.d.ts +0 -19
- package/dist/src/ua_view_impl.js +0 -44
- package/dist/src/ua_view_impl.js.map +0 -1
- package/distHelpers/add_event_generator_object.d.ts +0 -3
- package/distHelpers/add_event_generator_object.js +0 -65
- package/distHelpers/add_event_generator_object.js.map +0 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +0 -9
- package/distHelpers/alarms_and_conditions_demo.js +0 -116
- package/distHelpers/alarms_and_conditions_demo.js.map +0 -1
- package/distHelpers/assertHasMatchingReference.d.ts +0 -19
- package/distHelpers/assertHasMatchingReference.js +0 -41
- package/distHelpers/assertHasMatchingReference.js.map +0 -1
- package/distHelpers/boiler_system.d.ts +0 -113
- package/distHelpers/boiler_system.js +0 -396
- package/distHelpers/boiler_system.js.map +0 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +0 -5
- package/distHelpers/create_minimalist_address_space_nodeset.js +0 -172
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +0 -1
- package/distHelpers/date_utils.d.ts +0 -3
- package/distHelpers/date_utils.js +0 -10
- package/distHelpers/date_utils.js.map +0 -1
- package/distHelpers/dump_statemachine.d.ts +0 -0
- package/distHelpers/dump_statemachine.js +0 -128
- package/distHelpers/dump_statemachine.js.map +0 -1
- package/distHelpers/get_address_space_fixture.d.ts +0 -1
- package/distHelpers/get_address_space_fixture.js +0 -31
- package/distHelpers/get_address_space_fixture.js.map +0 -1
- package/distHelpers/get_mini_address_space.d.ts +0 -7
- package/distHelpers/get_mini_address_space.js +0 -37
- package/distHelpers/get_mini_address_space.js.map +0 -1
- package/distHelpers/index.d.ts +0 -12
- package/distHelpers/index.js +0 -29
- package/distHelpers/index.js.map +0 -1
- package/distHelpers/mock_session.d.ts +0 -10
- package/distHelpers/mock_session.js +0 -26
- package/distHelpers/mock_session.js.map +0 -1
- package/distNodeJS/generate_address_space.d.ts +0 -6
- package/distNodeJS/generate_address_space.js +0 -53
- package/distNodeJS/generate_address_space.js.map +0 -1
- package/distNodeJS/index.d.ts +0 -1
- package/distNodeJS/index.js +0 -18
- package/distNodeJS/index.js.map +0 -1
- package/source/helpers/dump_tools.ts +0 -92
- package/src/nodeset_tools/dump_to_bsd.ts +0 -198
- package/test_helpers/dump_statemachine.ts +0 -155
|
@@ -1,671 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.propagateTouchValueDownwardArray = exports.extractPartialData = exports.incrementElement = exports.setElement = exports.getElement = exports._bindExtensionObjectArrayOrMatrix = exports._bindExtensionObject = exports._installExtensionObjectBindingOnProperties = exports.setExtensionObjectPartialValue = exports.propagateTouchValueDownward = exports.propagateTouchValueUpward = exports._touchValue = exports.getProxyTarget = void 0;
|
|
4
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
5
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
6
|
-
const node_opcua_date_time_1 = require("node-opcua-date-time");
|
|
7
|
-
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
8
|
-
const node_opcua_extension_object_1 = require("node-opcua-extension-object");
|
|
9
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
10
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
11
|
-
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
12
|
-
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
13
|
-
const ua_variable_impl_1 = require("./ua_variable_impl");
|
|
14
|
-
const idx_iterator_1 = require("./idx_iterator");
|
|
15
|
-
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
|
|
16
|
-
const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
|
|
17
|
-
// const doDebug = true; // checkDebugFlag(__filename);
|
|
18
|
-
// const debugLog = make_warningLog(__filename);
|
|
19
|
-
const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
|
|
20
|
-
const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
|
|
21
|
-
function w(str, n) {
|
|
22
|
-
return str.padEnd(n).substring(n);
|
|
23
|
-
}
|
|
24
|
-
function isProxy(ext) {
|
|
25
|
-
return ext.$isProxy ? true : false;
|
|
26
|
-
}
|
|
27
|
-
function getProxyVariable(ext) {
|
|
28
|
-
(0, node_opcua_assert_1.default)(isProxy(ext));
|
|
29
|
-
return ext.$variable;
|
|
30
|
-
}
|
|
31
|
-
function getProxyVariableForProp(ext, prop) {
|
|
32
|
-
const uaVariable = getProxyVariable(ext);
|
|
33
|
-
if (!uaVariable)
|
|
34
|
-
return undefined;
|
|
35
|
-
return uaVariable[prop];
|
|
36
|
-
}
|
|
37
|
-
function getProxyTarget(ext) {
|
|
38
|
-
(0, node_opcua_assert_1.default)(isProxy(ext));
|
|
39
|
-
const target = ext.$proxyTarget;
|
|
40
|
-
if (target && isProxy(target)) {
|
|
41
|
-
return getProxyTarget(target);
|
|
42
|
-
}
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
exports.getProxyTarget = getProxyTarget;
|
|
46
|
-
function unProxy(ext) {
|
|
47
|
-
return isProxy(ext) ? getProxyTarget(ext) : ext;
|
|
48
|
-
}
|
|
49
|
-
function _extensionObjectFieldGetter(getVariable, target, key /*, receiver*/) {
|
|
50
|
-
if (key === "$isProxy") {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
if (key === "$proxyTarget") {
|
|
54
|
-
return target;
|
|
55
|
-
}
|
|
56
|
-
if (key === "$variable") {
|
|
57
|
-
return getVariable();
|
|
58
|
-
}
|
|
59
|
-
if (target[key] === undefined) {
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
return target[key];
|
|
63
|
-
}
|
|
64
|
-
function _extensionObjectFieldSetter(getVariable, target, key, value /*, receiver*/) {
|
|
65
|
-
target[key] = value;
|
|
66
|
-
if (isProxy(target)) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
const uaVariable = getVariable();
|
|
70
|
-
if (!uaVariable)
|
|
71
|
-
return true;
|
|
72
|
-
const child = uaVariable[key];
|
|
73
|
-
if (child && child.touchValue) {
|
|
74
|
-
child.touchValue();
|
|
75
|
-
}
|
|
76
|
-
return true; // true means the set operation has succeeded
|
|
77
|
-
}
|
|
78
|
-
function makeHandler(getVariable) {
|
|
79
|
-
const handler = {
|
|
80
|
-
get: _extensionObjectFieldGetter.bind(null, getVariable),
|
|
81
|
-
set: _extensionObjectFieldSetter.bind(null, getVariable)
|
|
82
|
-
};
|
|
83
|
-
return handler;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* inconditionnaly change the time stamp of the variable
|
|
87
|
-
* if the variable is being listened to, and if the minimumSamplingInterval is exactly zero,
|
|
88
|
-
* then the change will be reported to the observer
|
|
89
|
-
*
|
|
90
|
-
*/
|
|
91
|
-
function _touchValue(property, now) {
|
|
92
|
-
property.$dataValue.sourceTimestamp = now.timestamp;
|
|
93
|
-
property.$dataValue.sourcePicoseconds = now.picoseconds;
|
|
94
|
-
property.$dataValue.serverTimestamp = now.timestamp;
|
|
95
|
-
property.$dataValue.serverPicoseconds = now.picoseconds;
|
|
96
|
-
property.$dataValue.statusCode = node_opcua_status_code_1.StatusCodes.Good;
|
|
97
|
-
if (property.listenerCount("value_changed") > 0) {
|
|
98
|
-
property.emit("value_changed", property.$dataValue.clone());
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports._touchValue = _touchValue;
|
|
102
|
-
function propagateTouchValueUpward(self, now, cache) {
|
|
103
|
-
_touchValue(self, now);
|
|
104
|
-
if (self.parent && self.parent.nodeClass === node_opcua_data_model_1.NodeClass.Variable) {
|
|
105
|
-
const parentVar = self.parent;
|
|
106
|
-
if (!parentVar.isExtensionObject())
|
|
107
|
-
return;
|
|
108
|
-
if (cache) {
|
|
109
|
-
if (cache.has(parentVar))
|
|
110
|
-
return;
|
|
111
|
-
cache.add(parentVar);
|
|
112
|
-
}
|
|
113
|
-
propagateTouchValueUpward(parentVar, now, cache);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.propagateTouchValueUpward = propagateTouchValueUpward;
|
|
117
|
-
function propagateTouchValueDownward(self, now, cache) {
|
|
118
|
-
if (!self.isExtensionObject())
|
|
119
|
-
return;
|
|
120
|
-
// also propagate changes to embeded variables
|
|
121
|
-
const dataTypeNode = self.getDataTypeNode();
|
|
122
|
-
const definition = dataTypeNode.getStructureDefinition();
|
|
123
|
-
for (const field of definition.fields || []) {
|
|
124
|
-
const property = self.getChildByName(field.name);
|
|
125
|
-
if (property) {
|
|
126
|
-
if (cache) {
|
|
127
|
-
if (cache.has(property)) {
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
cache.add(property);
|
|
131
|
-
}
|
|
132
|
-
_touchValue(property, now);
|
|
133
|
-
// to do cascade recursivelly ?
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
exports.propagateTouchValueDownward = propagateTouchValueDownward;
|
|
138
|
-
function setExtensionObjectPartialValue(node, partialObject, sourceTimestamp) {
|
|
139
|
-
const variablesToUpdate = new Set();
|
|
140
|
-
const extensionObject = node.$extensionObject;
|
|
141
|
-
if (!extensionObject) {
|
|
142
|
-
throw new Error("setExtensionObjectValue node has no extension object " + node.browseName.toString());
|
|
143
|
-
}
|
|
144
|
-
function _update_extension_object(extObject, partialObject1) {
|
|
145
|
-
const keys = Object.keys(partialObject1);
|
|
146
|
-
for (const prop of keys) {
|
|
147
|
-
if (extObject[prop] instanceof Object) {
|
|
148
|
-
_update_extension_object(extObject[prop], partialObject1[prop]);
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
if (isProxy(extObject)) {
|
|
152
|
-
// collect element we have to update
|
|
153
|
-
const target = getProxyTarget(extObject);
|
|
154
|
-
(0, node_opcua_assert_1.default)(!isProxy(target), "something wierd!");
|
|
155
|
-
target[prop] = partialObject1[prop];
|
|
156
|
-
const variable = getProxyVariableForProp(extObject, prop);
|
|
157
|
-
variable && variablesToUpdate.add(variable);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
extObject[prop] = partialObject1[prop];
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
_update_extension_object(extensionObject, partialObject);
|
|
166
|
-
const now = sourceTimestamp || (0, node_opcua_date_time_1.getCurrentClock)();
|
|
167
|
-
const cache = new Set();
|
|
168
|
-
for (const c of variablesToUpdate) {
|
|
169
|
-
if (cache.has(c))
|
|
170
|
-
continue;
|
|
171
|
-
propagateTouchValueUpward(c, now, cache);
|
|
172
|
-
propagateTouchValueDownward(c, now, cache);
|
|
173
|
-
cache.add(c);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
exports.setExtensionObjectPartialValue = setExtensionObjectPartialValue;
|
|
177
|
-
function getOrCreateProperty(variableNode, field, options) {
|
|
178
|
-
const dt = variableNode.getDataTypeNode();
|
|
179
|
-
// the namespace for the structure browse name elements
|
|
180
|
-
const structureNamespace = dt.nodeId.namespace;
|
|
181
|
-
const components = variableNode.getComponents();
|
|
182
|
-
let property;
|
|
183
|
-
const selectedComponents = components.filter((f) => f instanceof ua_variable_impl_1.UAVariableImpl && f.browseName.name.toString() === field.name);
|
|
184
|
-
// istanbul ignore next
|
|
185
|
-
if (field.dataType.value === node_opcua_variant_1.DataType.Variant) {
|
|
186
|
-
warningLog("Warning : variant is not supported in ExtensionObject");
|
|
187
|
-
}
|
|
188
|
-
if (selectedComponents.length === 1) {
|
|
189
|
-
property = selectedComponents[0];
|
|
190
|
-
/* istanbul ignore next */
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
if (!options.createMissingProp) {
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
debugLog("adding missing array variable", field.name, variableNode.browseName.toString(), variableNode.nodeId.toString());
|
|
197
|
-
// todo: Handle array appropriately...
|
|
198
|
-
(0, node_opcua_assert_1.default)(selectedComponents.length === 0);
|
|
199
|
-
// create a variable (Note we may use ns=1;s=parentName/0:PropertyName)
|
|
200
|
-
property = variableNode.namespace.addVariable({
|
|
201
|
-
browseName: { namespaceIndex: structureNamespace, name: field.name.toString() },
|
|
202
|
-
componentOf: variableNode,
|
|
203
|
-
dataType: field.dataType,
|
|
204
|
-
minimumSamplingInterval: variableNode.minimumSamplingInterval,
|
|
205
|
-
accessLevel: variableNode.accessLevel,
|
|
206
|
-
accessRestrictions: variableNode.accessRestrictions,
|
|
207
|
-
rolePermissions: variableNode.rolePermissions
|
|
208
|
-
});
|
|
209
|
-
(0, node_opcua_assert_1.default)(property.minimumSamplingInterval === variableNode.minimumSamplingInterval);
|
|
210
|
-
}
|
|
211
|
-
return property;
|
|
212
|
-
}
|
|
213
|
-
function prepareVariantValue(dataType, value) {
|
|
214
|
-
if ((dataType === node_opcua_variant_1.DataType.Int32 || dataType === node_opcua_variant_1.DataType.UInt32) && value && value.key) {
|
|
215
|
-
value = value.value;
|
|
216
|
-
}
|
|
217
|
-
return value;
|
|
218
|
-
}
|
|
219
|
-
function installExt(uaVariable, ext) {
|
|
220
|
-
ext = unProxy(ext);
|
|
221
|
-
uaVariable.$extensionObject = new Proxy(ext, makeHandler(() => uaVariable));
|
|
222
|
-
const addressSpace = uaVariable.addressSpace;
|
|
223
|
-
const definition = uaVariable.dataTypeObj.getStructureDefinition();
|
|
224
|
-
const structure = addressSpace.findDataType("Structure");
|
|
225
|
-
for (const field of definition.fields || []) {
|
|
226
|
-
if (field.dataType) {
|
|
227
|
-
const dataTypeNode = addressSpace.findDataType(field.dataType);
|
|
228
|
-
// istanbul ignore next
|
|
229
|
-
if (dataTypeNode && dataTypeNode.isSubtypeOf(structure)) {
|
|
230
|
-
// sub structure .. let make an handler too
|
|
231
|
-
const camelCaseName = (0, node_opcua_utils_1.lowerFirstLetter)(field.name);
|
|
232
|
-
const subExtObj = uaVariable.$extensionObject[camelCaseName];
|
|
233
|
-
if (subExtObj) {
|
|
234
|
-
uaVariable.$extensionObject[camelCaseName] = new Proxy(subExtObj, makeHandler(() => {
|
|
235
|
-
return uaVariable.getComponentByName(field.name);
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
doDebug && warningLog("extension object is null");
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
function _installExtensionObjectBindingOnProperties(uaVariable, options) {
|
|
246
|
-
// may be extension object mechanism has alreday been install
|
|
247
|
-
// in this case we just need to rebind the properties...
|
|
248
|
-
if (uaVariable.$extensionObject) {
|
|
249
|
-
const extObj = uaVariable.$extensionObject;
|
|
250
|
-
uaVariable.bindExtensionObject(extObj, { createMissingProp: true, force: true });
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
if (uaVariable.$$extensionObjectArray) {
|
|
254
|
-
const extObj = uaVariable.$$extensionObjectArray;
|
|
255
|
-
_bindExtensionObjectArrayOrMatrix(uaVariable, extObj, { createMissingProp: true, force: true });
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const dataValue = uaVariable.readValue();
|
|
259
|
-
const extObj = dataValue.value.value;
|
|
260
|
-
if (extObj instanceof node_opcua_extension_object_1.ExtensionObject) {
|
|
261
|
-
uaVariable.bindExtensionObject(extObj, { createMissingProp: true, force: true });
|
|
262
|
-
}
|
|
263
|
-
else if (extObj instanceof Array) {
|
|
264
|
-
// istanbul ignore else
|
|
265
|
-
if (dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Array || dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Matrix) {
|
|
266
|
-
_bindExtensionObjectArrayOrMatrix(uaVariable, extObj, { createMissingProp: true, force: true });
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
throw new Error("Internal Error, unexpected case");
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
exports._installExtensionObjectBindingOnProperties = _installExtensionObjectBindingOnProperties;
|
|
274
|
-
function _installFields2(uaVariable, { get, set }, options) {
|
|
275
|
-
options = options || { createMissingProp: false };
|
|
276
|
-
const dt = uaVariable.getDataTypeNode();
|
|
277
|
-
const definition = dt.getStructureDefinition();
|
|
278
|
-
for (const field of definition.fields || []) {
|
|
279
|
-
if (node_opcua_nodeid_1.NodeId.sameNodeId(node_opcua_nodeid_1.NodeId.nullNodeId, field.dataType)) {
|
|
280
|
-
warningLog("field.dataType is null ! ", field.name, node_opcua_nodeid_1.NodeId.nullNodeId.toString());
|
|
281
|
-
warningLog(field.toString());
|
|
282
|
-
warningLog(" dataType replaced with BaseDataType ");
|
|
283
|
-
warningLog(definition.toString());
|
|
284
|
-
field.dataType = uaVariable.resolveNodeId("BaseDataType");
|
|
285
|
-
}
|
|
286
|
-
const propertyNode = getOrCreateProperty(uaVariable, field, options);
|
|
287
|
-
if (!propertyNode) {
|
|
288
|
-
continue;
|
|
289
|
-
}
|
|
290
|
-
propertyNode.$dataValue.statusCode = node_opcua_status_code_1.StatusCodes.Good;
|
|
291
|
-
propertyNode.$dataValue.sourceTimestamp = uaVariable.$dataValue.sourceTimestamp;
|
|
292
|
-
propertyNode.$dataValue.sourcePicoseconds = uaVariable.$dataValue.sourcePicoseconds;
|
|
293
|
-
propertyNode.$dataValue.serverTimestamp = uaVariable.$dataValue.serverTimestamp;
|
|
294
|
-
propertyNode.$dataValue.serverPicoseconds = uaVariable.$dataValue.serverPicoseconds;
|
|
295
|
-
propertyNode.$dataValue.value.dataType = propertyNode.dataTypeObj.basicDataType;
|
|
296
|
-
propertyNode.$dataValue.value.arrayType = propertyNode.valueRank === -1 ? node_opcua_variant_1.VariantArrayType.Scalar : (propertyNode.valueRank === 1 ? node_opcua_variant_1.VariantArrayType.Array : node_opcua_variant_1.VariantArrayType.Matrix);
|
|
297
|
-
propertyNode.$dataValue.value.dimensions = propertyNode.valueRank > 1 ? propertyNode.arrayDimensions : null;
|
|
298
|
-
const fieldName = field.name;
|
|
299
|
-
installDataValueGetter(propertyNode, () => get(fieldName));
|
|
300
|
-
(0, node_opcua_assert_1.default)(propertyNode._inner_replace_dataValue);
|
|
301
|
-
propertyNode._inner_replace_dataValue = (dataValue, indexRange) => {
|
|
302
|
-
/** */
|
|
303
|
-
const sourceTime = (0, node_opcua_date_time_1.coerceClock)(dataValue.sourceTimestamp, dataValue.sourcePicoseconds);
|
|
304
|
-
const value = dataValue.value.value;
|
|
305
|
-
set(field.name, value, sourceTime);
|
|
306
|
-
propertyNode.touchValue(sourceTime);
|
|
307
|
-
};
|
|
308
|
-
if (propertyNode.dataTypeObj.basicDataType === node_opcua_variant_1.DataType.ExtensionObject) {
|
|
309
|
-
_installFields2(propertyNode, {
|
|
310
|
-
get: (fieldName) => {
|
|
311
|
-
const mainFieldName = field.name;
|
|
312
|
-
return get(mainFieldName)[(0, node_opcua_utils_1.lowerFirstLetter)(fieldName)];
|
|
313
|
-
},
|
|
314
|
-
set: (fieldName, value, sourceTime) => {
|
|
315
|
-
const mainFieldName = field.name;
|
|
316
|
-
get(mainFieldName)[(0, node_opcua_utils_1.lowerFirstLetter)(fieldName)] = value;
|
|
317
|
-
}
|
|
318
|
-
}, options);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
function installDataValueGetter(propertyNode, get) {
|
|
323
|
-
Object.defineProperty(propertyNode.$dataValue.value, "value", { get });
|
|
324
|
-
const $ = propertyNode.$dataValue;
|
|
325
|
-
Object.defineProperty(propertyNode, "$dataValue", {
|
|
326
|
-
get() {
|
|
327
|
-
return $;
|
|
328
|
-
},
|
|
329
|
-
set: (value) => {
|
|
330
|
-
throw new Error("$dataValue is now frozen and should not be modified this way !\n contact sterfive.com");
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
function isVariableContainingExtensionObject(uaVariable) {
|
|
335
|
-
const addressSpace = uaVariable.addressSpace;
|
|
336
|
-
const structure = addressSpace.findDataType("Structure");
|
|
337
|
-
if (!structure) {
|
|
338
|
-
// the addressSpace is limited and doesn't provide extension object
|
|
339
|
-
// bindExtensionObject cannot be performed and shall finish here.
|
|
340
|
-
return false;
|
|
341
|
-
}
|
|
342
|
-
(0, node_opcua_assert_1.default)(structure.browseName.toString() === "Structure", "expecting DataType Structure to be in IAddressSpace");
|
|
343
|
-
const dt = uaVariable.getDataTypeNode();
|
|
344
|
-
if (!dt.isSubtypeOf(structure)) {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
return true;
|
|
348
|
-
}
|
|
349
|
-
function _innerBindExtensionObjectScalar(uaVariable, { get, set, setField }, options) {
|
|
350
|
-
uaVariable.$dataValue.statusCode = node_opcua_status_code_1.StatusCodes.Good;
|
|
351
|
-
uaVariable.$dataValue.value.dataType = node_opcua_variant_1.DataType.ExtensionObject;
|
|
352
|
-
uaVariable.$dataValue.value.arrayType = node_opcua_variant_1.VariantArrayType.Scalar;
|
|
353
|
-
uaVariable.setValueFromSource = function (variant) {
|
|
354
|
-
setExtensionObjectPartialValue(this, variant.value);
|
|
355
|
-
};
|
|
356
|
-
installDataValueGetter(uaVariable, get);
|
|
357
|
-
uaVariable.$set_ExtensionObject = set;
|
|
358
|
-
_installFields2(uaVariable, {
|
|
359
|
-
get: (fieldName) => {
|
|
360
|
-
const extObj = get();
|
|
361
|
-
return extObj[(0, node_opcua_utils_1.lowerFirstLetter)(fieldName)];
|
|
362
|
-
},
|
|
363
|
-
set: (fieldName, value, sourceTime) => {
|
|
364
|
-
setField(fieldName, value, sourceTime);
|
|
365
|
-
}
|
|
366
|
-
}, options);
|
|
367
|
-
}
|
|
368
|
-
// eslint-disable-next-line complexity
|
|
369
|
-
function _bindExtensionObject(uaVariable, optionalExtensionObject, options) {
|
|
370
|
-
var _a, _b;
|
|
371
|
-
options = options || { createMissingProp: false };
|
|
372
|
-
// istanbul ignore next
|
|
373
|
-
if (!isVariableContainingExtensionObject(uaVariable)) {
|
|
374
|
-
return null;
|
|
375
|
-
}
|
|
376
|
-
// istanbul ignore next
|
|
377
|
-
if (optionalExtensionObject && uaVariable.valueRank === 0) {
|
|
378
|
-
warningLog(uaVariable.browseName.toString() + ": valueRank was zero but needed to be adjusted to -1 (Scalar) in bindExtensionObject");
|
|
379
|
-
uaVariable.valueRank = -1;
|
|
380
|
-
}
|
|
381
|
-
const addressSpace = uaVariable.addressSpace;
|
|
382
|
-
let extensionObject_;
|
|
383
|
-
// istanbul ignore next
|
|
384
|
-
if (uaVariable.valueRank !== -1 && uaVariable.valueRank !== 1) {
|
|
385
|
-
throw new Error("Cannot bind an extension object here, valueRank must be scalar (-1) or one-dimensional (1)");
|
|
386
|
-
}
|
|
387
|
-
// istanbul ignore next
|
|
388
|
-
doDebug && debugLog(" ------------------------------ binding ", uaVariable.browseName.toString(), uaVariable.nodeId.toString());
|
|
389
|
-
// ignore bindExtensionObject on sub extension object, bindExtensionObject has to be called from the top most object
|
|
390
|
-
if (!options.force &&
|
|
391
|
-
uaVariable.parent &&
|
|
392
|
-
(uaVariable.parent.nodeClass === node_opcua_data_model_1.NodeClass.Variable || uaVariable.parent.nodeClass === node_opcua_data_model_1.NodeClass.VariableType)) {
|
|
393
|
-
const parentDataType = uaVariable.parent.dataType;
|
|
394
|
-
const dataTypeNode = addressSpace.findNode(parentDataType);
|
|
395
|
-
const structure = addressSpace.findDataType("Structure");
|
|
396
|
-
// istanbul ignore next
|
|
397
|
-
if (dataTypeNode && dataTypeNode.isSubtypeOf(structure)) {
|
|
398
|
-
// warningLog(
|
|
399
|
-
// "Ignoring bindExtensionObject on sub extension object",
|
|
400
|
-
// "child=",
|
|
401
|
-
// self.browseName.toString(),
|
|
402
|
-
// "parent=",
|
|
403
|
-
// self.parent.browseName.toString()
|
|
404
|
-
// );
|
|
405
|
-
return null;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
// -------------------- make sure we do not bind a variable twice ....
|
|
409
|
-
if (uaVariable.$extensionObject && !optionalExtensionObject) {
|
|
410
|
-
// istanbul ignore next
|
|
411
|
-
if (!uaVariable.checkExtensionObjectIsCorrect(uaVariable.$extensionObject)) {
|
|
412
|
-
warningLog("on node : ", uaVariable.browseName.toString(), uaVariable.nodeId.toString(), "dataType=", uaVariable.dataType.toString({ addressSpace: uaVariable.addressSpace }));
|
|
413
|
-
warningLog((_a = uaVariable.$extensionObject) === null || _a === void 0 ? void 0 : _a.toString());
|
|
414
|
-
throw new Error("bindExtensionObject: $extensionObject is incorrect: we are expecting a " +
|
|
415
|
-
uaVariable.dataType.toString({ addressSpace: uaVariable.addressSpace }) +
|
|
416
|
-
" but we got a " +
|
|
417
|
-
((_b = uaVariable.$extensionObject) === null || _b === void 0 ? void 0 : _b.schema.name));
|
|
418
|
-
}
|
|
419
|
-
return uaVariable.$extensionObject;
|
|
420
|
-
}
|
|
421
|
-
// istanbul ignore next
|
|
422
|
-
if (uaVariable.dataTypeObj.isAbstract) {
|
|
423
|
-
warningLog("Warning the DataType associated with this Variable is abstract ", uaVariable.dataTypeObj.browseName.toString());
|
|
424
|
-
warningLog("You need to provide a extension object yourself ");
|
|
425
|
-
throw new Error("bindExtensionObject requires a extensionObject as associated dataType is only abstract");
|
|
426
|
-
}
|
|
427
|
-
const s = uaVariable.readValue();
|
|
428
|
-
if (s.value && s.value.dataType === node_opcua_variant_1.DataType.ExtensionObject && s.value.value && optionalExtensionObject) {
|
|
429
|
-
// we want to replace the extension object
|
|
430
|
-
s.value.value = null;
|
|
431
|
-
}
|
|
432
|
-
innerBindExtensionObject();
|
|
433
|
-
(0, node_opcua_assert_1.default)(uaVariable.$extensionObject instanceof Object);
|
|
434
|
-
return uaVariable.$extensionObject;
|
|
435
|
-
function innerBindExtensionObject() {
|
|
436
|
-
if (s.value && (s.value.dataType === node_opcua_variant_1.DataType.Null || (s.value.dataType === node_opcua_variant_1.DataType.ExtensionObject && !s.value.value))) {
|
|
437
|
-
if (uaVariable.valueRank === -1 /** Scalar */) {
|
|
438
|
-
extensionObject_ = optionalExtensionObject || addressSpace.constructExtensionObject(uaVariable.dataType, {});
|
|
439
|
-
installExt(uaVariable, extensionObject_);
|
|
440
|
-
_innerBindExtensionObjectScalar(uaVariable, {
|
|
441
|
-
get: () => uaVariable.$extensionObject,
|
|
442
|
-
set: (value) => installExt(uaVariable, value),
|
|
443
|
-
setField: (fieldName, value) => {
|
|
444
|
-
const extObj = uaVariable.$extensionObject;
|
|
445
|
-
getProxyTarget(extObj)[(0, node_opcua_utils_1.lowerFirstLetter)(fieldName)] = value;
|
|
446
|
-
}
|
|
447
|
-
}, options);
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
else if (uaVariable.valueRank === 1 /** Array */) {
|
|
451
|
-
throw new Error("Should not get there ! Please fix me");
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
errorLog(uaVariable.toString());
|
|
455
|
-
errorLog("Unsupported case ! valueRank= ", uaVariable.valueRank);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
else {
|
|
459
|
-
// verify that variant has the correct type
|
|
460
|
-
(0, node_opcua_assert_1.default)(s.value.dataType === node_opcua_variant_1.DataType.ExtensionObject);
|
|
461
|
-
installExt(uaVariable, s.value.value);
|
|
462
|
-
_innerBindExtensionObjectScalar(uaVariable, {
|
|
463
|
-
get: () => uaVariable.$extensionObject,
|
|
464
|
-
set: (value) => installExt(uaVariable, value),
|
|
465
|
-
setField: (fieldName, value) => {
|
|
466
|
-
const extObj = uaVariable.$extensionObject;
|
|
467
|
-
getProxyTarget(extObj)[(0, node_opcua_utils_1.lowerFirstLetter)(fieldName)] = value;
|
|
468
|
-
}
|
|
469
|
-
}, options);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
exports._bindExtensionObject = _bindExtensionObject;
|
|
474
|
-
const getIndexAsText = (index) => {
|
|
475
|
-
if (typeof index === "number")
|
|
476
|
-
return `${index}`;
|
|
477
|
-
return `${index.map((a) => a.toString()).join(",")}`;
|
|
478
|
-
};
|
|
479
|
-
const composeBrowseNameAndNodeId = (uaVariable, indexes) => {
|
|
480
|
-
const iAsText = getIndexAsText(indexes);
|
|
481
|
-
const browseName = (0, node_opcua_data_model_1.coerceQualifiedName)(iAsText);
|
|
482
|
-
let nodeId;
|
|
483
|
-
if (uaVariable.nodeId.identifierType === node_opcua_nodeid_1.NodeIdType.STRING) {
|
|
484
|
-
nodeId = new node_opcua_nodeid_1.NodeId(node_opcua_nodeid_1.NodeIdType.STRING, uaVariable.nodeId.value + `[${iAsText}]`, uaVariable.nodeId.namespace);
|
|
485
|
-
}
|
|
486
|
-
return { browseName, nodeId };
|
|
487
|
-
};
|
|
488
|
-
// eslint-disable-next-line max-statements, complexity
|
|
489
|
-
function _bindExtensionObjectArrayOrMatrix(uaVariable, optionalExtensionObjectArray, options) {
|
|
490
|
-
options = options || { createMissingProp: false };
|
|
491
|
-
options.createMissingProp = options.createMissingProp || false;
|
|
492
|
-
// istanbul ignore next
|
|
493
|
-
if (uaVariable.valueRank < 1) {
|
|
494
|
-
throw new Error("Variable must be a MultiDimensional array");
|
|
495
|
-
}
|
|
496
|
-
const arrayDimensions = uaVariable.arrayDimensions || [];
|
|
497
|
-
// istanbul ignore next
|
|
498
|
-
if (!isVariableContainingExtensionObject(uaVariable)) {
|
|
499
|
-
return [];
|
|
500
|
-
}
|
|
501
|
-
if (!optionalExtensionObjectArray && uaVariable.$dataValue.value.value) {
|
|
502
|
-
(0, node_opcua_assert_1.default)(Array.isArray(uaVariable.$dataValue.value.value));
|
|
503
|
-
optionalExtensionObjectArray = uaVariable.$dataValue.value.value;
|
|
504
|
-
}
|
|
505
|
-
if ((arrayDimensions.length === 0 || arrayDimensions.length === 1 && arrayDimensions[0] === 0) && optionalExtensionObjectArray) {
|
|
506
|
-
arrayDimensions[0] = optionalExtensionObjectArray.length;
|
|
507
|
-
}
|
|
508
|
-
const totalLength = arrayDimensions.reduce((p, c) => p * c, 1);
|
|
509
|
-
/** */
|
|
510
|
-
const addressSpace = uaVariable.addressSpace;
|
|
511
|
-
if (optionalExtensionObjectArray) {
|
|
512
|
-
if (optionalExtensionObjectArray.length !== totalLength) {
|
|
513
|
-
throw new Error(`optionalExtensionObjectArray must have the expected number of element matching ${arrayDimensions}`);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
if (!optionalExtensionObjectArray) {
|
|
517
|
-
optionalExtensionObjectArray = [];
|
|
518
|
-
for (let i = 0; i < totalLength; i++) {
|
|
519
|
-
optionalExtensionObjectArray[i] = addressSpace.constructExtensionObject(uaVariable.dataType, {});
|
|
520
|
-
;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
uaVariable.$$extensionObjectArray = optionalExtensionObjectArray;
|
|
524
|
-
uaVariable.$dataValue.value.arrayType = uaVariable.valueRank === 1 ? node_opcua_variant_1.VariantArrayType.Array : node_opcua_variant_1.VariantArrayType.Matrix;
|
|
525
|
-
uaVariable.$dataValue.value.dimensions = uaVariable.valueRank === 1 ? null : (uaVariable.arrayDimensions || []);
|
|
526
|
-
uaVariable.$dataValue.value.dataType = node_opcua_variant_1.DataType.ExtensionObject;
|
|
527
|
-
uaVariable.$dataValue.value.value = uaVariable.$$extensionObjectArray;
|
|
528
|
-
// make sure uaVariable.$dataValue cannot be inadvertantly changed from this point onward
|
|
529
|
-
const $dataValue = uaVariable.$dataValue;
|
|
530
|
-
Object.defineProperty(uaVariable, "$dataValue", {
|
|
531
|
-
get() {
|
|
532
|
-
return $dataValue;
|
|
533
|
-
},
|
|
534
|
-
set() {
|
|
535
|
-
throw new Error("$dataValue is now sealed , you should not change internal $dataValue!");
|
|
536
|
-
},
|
|
537
|
-
// writable: true,
|
|
538
|
-
enumerable: true,
|
|
539
|
-
configurable: true,
|
|
540
|
-
});
|
|
541
|
-
uaVariable.bindVariable({
|
|
542
|
-
get: () => uaVariable.$dataValue.value
|
|
543
|
-
}, true);
|
|
544
|
-
const namespace = uaVariable.namespace;
|
|
545
|
-
const indexIterator = new idx_iterator_1.IndexIterator(arrayDimensions);
|
|
546
|
-
for (let i = 0; i < totalLength; i++) {
|
|
547
|
-
const index = indexIterator.next();
|
|
548
|
-
const { browseName, nodeId } = composeBrowseNameAndNodeId(uaVariable, index);
|
|
549
|
-
let uaElement = uaVariable.getComponentByName(browseName);
|
|
550
|
-
if (!uaElement) {
|
|
551
|
-
if (!options.createMissingProp) {
|
|
552
|
-
continue;
|
|
553
|
-
}
|
|
554
|
-
uaElement = namespace.addVariable({
|
|
555
|
-
browseName,
|
|
556
|
-
nodeId,
|
|
557
|
-
componentOf: uaVariable,
|
|
558
|
-
dataType: uaVariable.dataType,
|
|
559
|
-
valueRank: -1,
|
|
560
|
-
accessLevel: uaVariable.accessLevel
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
uaElement.$dataValue.statusCode = node_opcua_status_code_1.StatusCodes.Good;
|
|
564
|
-
uaElement.$dataValue.sourceTimestamp = uaVariable.$dataValue.sourceTimestamp;
|
|
565
|
-
uaElement.$dataValue.sourcePicoseconds = uaVariable.$dataValue.sourcePicoseconds;
|
|
566
|
-
uaElement.$dataValue.serverTimestamp = uaVariable.$dataValue.serverTimestamp;
|
|
567
|
-
uaElement.$dataValue.serverPicoseconds = uaVariable.$dataValue.serverPicoseconds;
|
|
568
|
-
uaElement.$dataValue.value.dataType = node_opcua_variant_1.DataType.ExtensionObject;
|
|
569
|
-
uaElement.$dataValue.value.arrayType = node_opcua_variant_1.VariantArrayType.Scalar;
|
|
570
|
-
{
|
|
571
|
-
const capturedIndex = i;
|
|
572
|
-
const capturedUaElement = uaElement;
|
|
573
|
-
_innerBindExtensionObjectScalar(uaElement, {
|
|
574
|
-
get: () => uaVariable.$$extensionObjectArray[capturedIndex],
|
|
575
|
-
set: (newValue, sourceTimestamp, cache) => {
|
|
576
|
-
(0, node_opcua_assert_1.default)(!isProxy(uaVariable.$$extensionObjectArray[capturedIndex]));
|
|
577
|
-
uaVariable.$$extensionObjectArray[capturedIndex] = newValue;
|
|
578
|
-
if (uaVariable.$$extensionObjectArray !== uaVariable.$dataValue.value.value) {
|
|
579
|
-
console.log("uaVariable", uaVariable.nodeId.toString());
|
|
580
|
-
console.log("Houston! We have a problem ");
|
|
581
|
-
}
|
|
582
|
-
propagateTouchValueDownward(capturedUaElement, sourceTimestamp, cache);
|
|
583
|
-
propagateTouchValueUpward(capturedUaElement, sourceTimestamp, cache);
|
|
584
|
-
},
|
|
585
|
-
setField: (fieldName, newValue, sourceTimestamp, cache) => {
|
|
586
|
-
// istanbul ignore next doDebug && debugLog("setField", fieldName, newValue, sourceTimestamp, cache);
|
|
587
|
-
const extObj = uaVariable.$$extensionObjectArray[capturedIndex];
|
|
588
|
-
(isProxy(extObj) ? getProxyTarget(extObj) : extObj)[(0, node_opcua_utils_1.lowerFirstLetter)(fieldName)] = newValue;
|
|
589
|
-
propagateTouchValueUpward(capturedUaElement, sourceTimestamp, cache);
|
|
590
|
-
}
|
|
591
|
-
}, Object.assign(Object.assign({}, options), { force: true }));
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
return uaVariable.$$extensionObjectArray;
|
|
595
|
-
}
|
|
596
|
-
exports._bindExtensionObjectArrayOrMatrix = _bindExtensionObjectArrayOrMatrix;
|
|
597
|
-
function getElement(path, data) {
|
|
598
|
-
if (typeof path === "string") {
|
|
599
|
-
path = path.split(".");
|
|
600
|
-
}
|
|
601
|
-
let a = data;
|
|
602
|
-
for (const e of path) {
|
|
603
|
-
a = a[e];
|
|
604
|
-
}
|
|
605
|
-
return a;
|
|
606
|
-
}
|
|
607
|
-
exports.getElement = getElement;
|
|
608
|
-
function setElement(path, data, value) {
|
|
609
|
-
if (typeof path === "string") {
|
|
610
|
-
path = path.split(".");
|
|
611
|
-
}
|
|
612
|
-
const last = path.pop();
|
|
613
|
-
let a = data;
|
|
614
|
-
for (const e of path) {
|
|
615
|
-
a = a[e];
|
|
616
|
-
}
|
|
617
|
-
a[last] = value;
|
|
618
|
-
}
|
|
619
|
-
exports.setElement = setElement;
|
|
620
|
-
function incrementElement(path, data) {
|
|
621
|
-
const value = getElement(path, data);
|
|
622
|
-
setElement(path, data, value + 1);
|
|
623
|
-
}
|
|
624
|
-
exports.incrementElement = incrementElement;
|
|
625
|
-
function extractPartialData(path, extensionObject) {
|
|
626
|
-
let name;
|
|
627
|
-
if (typeof path === "string") {
|
|
628
|
-
path = path.split(".");
|
|
629
|
-
}
|
|
630
|
-
(0, node_opcua_assert_1.default)(path instanceof Array);
|
|
631
|
-
let i;
|
|
632
|
-
// read partial value
|
|
633
|
-
const partialData = {};
|
|
634
|
-
let p = partialData;
|
|
635
|
-
for (i = 0; i < path.length - 1; i++) {
|
|
636
|
-
name = path[i];
|
|
637
|
-
p[name] = {};
|
|
638
|
-
p = p[name];
|
|
639
|
-
}
|
|
640
|
-
name = path[path.length - 1];
|
|
641
|
-
p[name] = 0;
|
|
642
|
-
let c1 = partialData;
|
|
643
|
-
let c2 = extensionObject;
|
|
644
|
-
for (i = 0; i < path.length - 1; i++) {
|
|
645
|
-
name = path[i];
|
|
646
|
-
c1 = partialData[name];
|
|
647
|
-
c2 = extensionObject[name];
|
|
648
|
-
}
|
|
649
|
-
name = path[path.length - 1];
|
|
650
|
-
c1[name] = c2[name];
|
|
651
|
-
return partialData;
|
|
652
|
-
}
|
|
653
|
-
exports.extractPartialData = extractPartialData;
|
|
654
|
-
function propagateTouchValueDownwardArray(uaVariable, now, cache) {
|
|
655
|
-
if (!uaVariable.$$extensionObjectArray)
|
|
656
|
-
return;
|
|
657
|
-
const arrayDimensions = uaVariable.arrayDimensions || [];
|
|
658
|
-
const totalLength = uaVariable.$$extensionObjectArray.length;
|
|
659
|
-
const indexIterator = new idx_iterator_1.IndexIterator(arrayDimensions);
|
|
660
|
-
for (let i = 0; i < totalLength; i++) {
|
|
661
|
-
const index = indexIterator.next();
|
|
662
|
-
const { browseName, nodeId } = composeBrowseNameAndNodeId(uaVariable, index);
|
|
663
|
-
const uaElement = uaVariable.getComponentByName(browseName);
|
|
664
|
-
if ((uaElement === null || uaElement === void 0 ? void 0 : uaElement.nodeClass) === node_opcua_data_model_1.NodeClass.Variable) {
|
|
665
|
-
uaElement.touchValue(now);
|
|
666
|
-
propagateTouchValueDownward(uaElement, now, cache);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
exports.propagateTouchValueDownwardArray = propagateTouchValueDownwardArray;
|
|
671
|
-
//# sourceMappingURL=ua_variable_impl_ext_obj.js.map
|