node-opcua-address-space 2.51.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/.mocharc.yml +12 -0
- package/LICENSE +20 -0
- package/dist/source/address_space_ts.d.ts +122 -0
- package/dist/source/address_space_ts.js +18 -0
- package/dist/source/address_space_ts.js.map +1 -0
- package/dist/source/continuation_points/continuation_point_manager.d.ts +21 -0
- package/dist/source/continuation_points/continuation_point_manager.js +100 -0
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -0
- package/dist/source/helpers/adjust_browse_direction.d.ts +5 -0
- package/dist/source/helpers/adjust_browse_direction.js +12 -0
- package/dist/source/helpers/adjust_browse_direction.js.map +1 -0
- package/dist/source/helpers/argument_list.d.ts +30 -0
- package/dist/source/helpers/argument_list.js +237 -0
- package/dist/source/helpers/argument_list.js.map +1 -0
- package/dist/source/helpers/call_helpers.d.ts +6 -0
- package/dist/source/helpers/call_helpers.js +71 -0
- package/dist/source/helpers/call_helpers.js.map +1 -0
- package/dist/source/helpers/check_event_clause.d.ts +17 -0
- package/dist/source/helpers/check_event_clause.js +53 -0
- package/dist/source/helpers/check_event_clause.js.map +1 -0
- package/dist/source/helpers/coerce_enum_value.d.ts +6 -0
- package/dist/source/helpers/coerce_enum_value.js +34 -0
- package/dist/source/helpers/coerce_enum_value.js.map +1 -0
- package/dist/source/helpers/dump_tools.d.ts +14 -0
- package/dist/source/helpers/dump_tools.js +79 -0
- package/dist/source/helpers/dump_tools.js.map +1 -0
- package/dist/source/helpers/ensure_secure_access.d.ts +9 -0
- package/dist/source/helpers/ensure_secure_access.js +90 -0
- package/dist/source/helpers/ensure_secure_access.js.map +1 -0
- package/dist/source/helpers/make_optionals_map.d.ts +21 -0
- package/dist/source/helpers/make_optionals_map.js +30 -0
- package/dist/source/helpers/make_optionals_map.js.map +1 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +3 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js +37 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -0
- package/dist/source/index.d.ts +39 -0
- package/dist/source/index.js +62 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +12 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +25 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +21 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +27 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +24 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +17 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +12 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +8 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +11 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +69 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +74 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/state_machine.d.ts +342 -0
- package/dist/source/interfaces/state_machine/state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +18 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +222 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +29 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +6 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +26 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +41 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js +3 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js.map +1 -0
- package/dist/source/interfaces/ua_authorisation_service.d.ts +1 -0
- package/dist/source/interfaces/ua_authorisation_service.js +3 -0
- package/dist/source/interfaces/ua_authorisation_service.js.map +1 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +8 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +10 -0
- package/dist/source/loader/generateAddressSpaceRaw.js +59 -0
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -0
- package/dist/source/loader/load_nodeset2.d.ts +13 -0
- package/dist/source/loader/load_nodeset2.js +1392 -0
- package/dist/source/loader/load_nodeset2.js.map +1 -0
- package/dist/source/loader/namespace_post_step.d.ts +6 -0
- package/dist/source/loader/namespace_post_step.js +48 -0
- package/dist/source/loader/namespace_post_step.js.map +1 -0
- package/dist/source/loader/register_node_promoter.d.ts +3 -0
- package/dist/source/loader/register_node_promoter.js +10 -0
- package/dist/source/loader/register_node_promoter.js.map +1 -0
- package/dist/source/namespace.d.ts +6 -0
- package/dist/source/namespace.js +3 -0
- package/dist/source/namespace.js.map +1 -0
- package/dist/source/namespace_alarm_and_condition.d.ts +24 -0
- package/dist/source/namespace_alarm_and_condition.js +3 -0
- package/dist/source/namespace_alarm_and_condition.js.map +1 -0
- package/dist/source/namespace_data_access.d.ts +42 -0
- package/dist/source/namespace_data_access.js +3 -0
- package/dist/source/namespace_data_access.js.map +1 -0
- package/dist/source/namespace_machine_state.d.ts +7 -0
- package/dist/source/namespace_machine_state.js +3 -0
- package/dist/source/namespace_machine_state.js.map +1 -0
- package/dist/source/pseudo_session.d.ts +55 -0
- package/dist/source/pseudo_session.js +205 -0
- package/dist/source/pseudo_session.js.map +1 -0
- package/dist/source/session_context.d.ts +111 -0
- package/dist/source/session_context.js +266 -0
- package/dist/source/session_context.js.map +1 -0
- package/dist/source/set_namespace_meta_data.d.ts +2 -0
- package/dist/source/set_namespace_meta_data.js +60 -0
- package/dist/source/set_namespace_meta_data.js.map +1 -0
- package/dist/source/ua_namespace_meta_data_type.d.ts +71 -0
- package/dist/source/ua_namespace_meta_data_type.js +3 -0
- package/dist/source/ua_namespace_meta_data_type.js.map +1 -0
- package/dist/source/ua_root_folder.d.ts +9 -0
- package/dist/source/ua_root_folder.js +3 -0
- package/dist/source/ua_root_folder.js.map +1 -0
- package/dist/source/ua_two_state_variable_ex.d.ts +23 -0
- package/dist/source/ua_two_state_variable_ex.js +3 -0
- package/dist/source/ua_two_state_variable_ex.js.map +1 -0
- package/dist/source/xml_writer.d.ts +9 -0
- package/dist/source/xml_writer.js +3 -0
- package/dist/source/xml_writer.js.map +1 -0
- package/dist/src/address_space.d.ts +393 -0
- package/dist/src/address_space.js +1375 -0
- package/dist/src/address_space.js.map +1 -0
- package/dist/src/address_space_change_event_tools.d.ts +6 -0
- package/dist/src/address_space_change_event_tools.js +150 -0
- package/dist/src/address_space_change_event_tools.js.map +1 -0
- package/dist/src/address_space_private.d.ts +44 -0
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -0
- package/dist/src/alarms_and_conditions/base_event_type.d.ts +26 -0
- package/dist/src/alarms_and_conditions/base_event_type.js +41 -0
- package/dist/src/alarms_and_conditions/base_event_type.js.map +1 -0
- package/dist/src/alarms_and_conditions/check_where_clause.d.ts +4 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js +110 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition.d.ts +5 -0
- package/dist/src/alarms_and_conditions/condition.js +81 -0
- package/dist/src/alarms_and_conditions/condition.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_info.d.ts +27 -0
- package/dist/src/alarms_and_conditions/condition_info.js +55 -0
- package/dist/src/alarms_and_conditions/condition_info.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +232 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js +667 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +21 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +47 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +10 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js +90 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js.map +1 -0
- package/dist/src/alarms_and_conditions/index.d.ts +18 -0
- package/dist/src/alarms_and_conditions/index.js +31 -0
- package/dist/src/alarms_and_conditions/index.js.map +1 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +22 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js +241 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +1 -0
- package/dist/src/alarms_and_conditions/trip_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js +21 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +54 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +255 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +62 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +138 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +460 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +118 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +417 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +29 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +39 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +35 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +32 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +21 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +26 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +191 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js +1029 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +182 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1021 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +11 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +17 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +24 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +59 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +57 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +14 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +17 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +9 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +12 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +22 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +38 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +6 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +11 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +76 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js +237 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +98 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +233 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +62 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +51 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +49 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +176 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +25 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +163 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +47 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +151 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +39 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +136 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/apply_condition_refresh.d.ts +6 -0
- package/dist/src/apply_condition_refresh.js +28 -0
- package/dist/src/apply_condition_refresh.js.map +1 -0
- package/dist/src/base_node.d.ts +279 -0
- package/dist/src/base_node.js +1364 -0
- package/dist/src/base_node.js.map +1 -0
- package/dist/src/base_node_impl.d.ts +281 -0
- package/dist/src/base_node_impl.js +1394 -0
- package/dist/src/base_node_impl.js.map +1 -0
- package/dist/src/base_node_private.d.ts +61 -0
- package/dist/src/base_node_private.js +521 -0
- package/dist/src/base_node_private.js.map +1 -0
- package/dist/src/data_access/add_dataItem_stuff.d.ts +11 -0
- package/dist/src/data_access/add_dataItem_stuff.js +62 -0
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +35 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_analog_item.d.ts +13 -0
- package/dist/src/data_access/ua_analog_item.js +37 -0
- package/dist/src/data_access/ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_data_item.d.ts +16 -0
- package/dist/src/data_access/ua_data_item.js +66 -0
- package/dist/src/data_access/ua_data_item.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete.d.ts +23 -0
- package/dist/src/data_access/ua_multistate_discrete.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +32 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -0
- package/dist/src/data_access/ua_multistate_value_discrete.d.ts +51 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js +249 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/src/data_access/ua_two_state_discrete.d.ts +25 -0
- package/dist/src/data_access/ua_two_state_discrete.js +154 -0
- package/dist/src/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/src/event_data.d.ts +29 -0
- package/dist/src/event_data.js +96 -0
- package/dist/src/event_data.js.map +1 -0
- package/dist/src/extension_object_array_node.d.ts +61 -0
- package/dist/src/extension_object_array_node.js +266 -0
- package/dist/src/extension_object_array_node.js.map +1 -0
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +26 -0
- package/dist/src/historical_access/address_space_historical_data_node.js +662 -0
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -0
- package/dist/src/index_current.d.ts +42 -0
- package/dist/src/index_current.js +71 -0
- package/dist/src/index_current.js.map +1 -0
- package/dist/src/namespace.d.ts +475 -0
- package/dist/src/namespace.js +1775 -0
- package/dist/src/namespace.js.map +1 -0
- package/dist/src/namespace_impl.d.ts +463 -0
- package/dist/src/namespace_impl.js +1763 -0
- package/dist/src/namespace_impl.js.map +1 -0
- package/dist/src/namespace_private.d.ts +21 -0
- package/dist/src/namespace_private.js +29 -0
- package/dist/src/namespace_private.js.map +1 -0
- package/dist/src/nodeid_manager.d.ts +36 -0
- package/dist/src/nodeid_manager.js +196 -0
- package/dist/src/nodeid_manager.js.map +1 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +2 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js +14 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +1 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +39 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js +1155 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js +147 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -0
- package/dist/src/reference.d.ts +43 -0
- package/dist/src/reference.js +138 -0
- package/dist/src/reference.js.map +1 -0
- package/dist/src/reference_impl.d.ts +43 -0
- package/dist/src/reference_impl.js +138 -0
- package/dist/src/reference_impl.js.map +1 -0
- package/dist/src/role_permissions.d.ts +2 -0
- package/dist/src/role_permissions.js +11 -0
- package/dist/src/role_permissions.js.map +1 -0
- package/dist/src/session_context.d.ts +4 -0
- package/dist/src/session_context.js +9 -0
- package/dist/src/session_context.js.map +1 -0
- package/dist/src/state_machine/finite_state_machine.d.ts +67 -0
- package/dist/src/state_machine/finite_state_machine.js +354 -0
- package/dist/src/state_machine/finite_state_machine.js.map +1 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +34 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +244 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
- package/dist/src/state_machine/ua_two_state_variable.d.ts +61 -0
- package/dist/src/state_machine/ua_two_state_variable.js +332 -0
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/src/tool_isSupertypeOf.d.ts +17 -0
- package/dist/src/tool_isSupertypeOf.js +103 -0
- package/dist/src/tool_isSupertypeOf.js.map +1 -0
- package/dist/src/ua_condition_type.d.ts +8 -0
- package/dist/src/ua_condition_type.js +3 -0
- package/dist/src/ua_condition_type.js.map +1 -0
- package/dist/src/ua_data_type.d.ts +83 -0
- package/dist/src/ua_data_type.js +289 -0
- package/dist/src/ua_data_type.js.map +1 -0
- package/dist/src/ua_data_type_impl.d.ts +83 -0
- package/dist/src/ua_data_type_impl.js +291 -0
- package/dist/src/ua_data_type_impl.js.map +1 -0
- package/dist/src/ua_method.d.ts +42 -0
- package/dist/src/ua_method.js +204 -0
- package/dist/src/ua_method.js.map +1 -0
- package/dist/src/ua_method_impl.d.ts +40 -0
- package/dist/src/ua_method_impl.js +203 -0
- package/dist/src/ua_method_impl.js.map +1 -0
- package/dist/src/ua_object.d.ts +29 -0
- package/dist/src/ua_object.js +153 -0
- package/dist/src/ua_object.js.map +1 -0
- package/dist/src/ua_object_impl.d.ts +29 -0
- package/dist/src/ua_object_impl.js +156 -0
- package/dist/src/ua_object_impl.js.map +1 -0
- package/dist/src/ua_object_type.d.ts +49 -0
- package/dist/src/ua_object_type.js +124 -0
- package/dist/src/ua_object_type.js.map +1 -0
- package/dist/src/ua_object_type_impl.d.ts +48 -0
- package/dist/src/ua_object_type_impl.js +124 -0
- package/dist/src/ua_object_type_impl.js.map +1 -0
- package/dist/src/ua_reference_type.d.ts +42 -0
- package/dist/src/ua_reference_type.js +138 -0
- package/dist/src/ua_reference_type.js.map +1 -0
- package/dist/src/ua_reference_type_impl.d.ts +43 -0
- package/dist/src/ua_reference_type_impl.js +138 -0
- package/dist/src/ua_reference_type_impl.js.map +1 -0
- package/dist/src/ua_variable.d.ts +346 -0
- package/dist/src/ua_variable.js +1721 -0
- package/dist/src/ua_variable.js.map +1 -0
- package/dist/src/ua_variable_impl.d.ts +353 -0
- package/dist/src/ua_variable_impl.js +1719 -0
- package/dist/src/ua_variable_impl.js.map +1 -0
- package/dist/src/ua_variable_type.d.ts +54 -0
- package/dist/src/ua_variable_type.js +555 -0
- package/dist/src/ua_variable_type.js.map +1 -0
- package/dist/src/ua_variable_type_impl.d.ts +63 -0
- package/dist/src/ua_variable_type_impl.js +556 -0
- package/dist/src/ua_variable_type_impl.js.map +1 -0
- package/dist/src/ua_view.d.ts +16 -0
- package/dist/src/ua_view.js +42 -0
- package/dist/src/ua_view.js.map +1 -0
- package/dist/src/ua_view_impl.d.ts +15 -0
- package/dist/src/ua_view_impl.js +37 -0
- package/dist/src/ua_view_impl.js.map +1 -0
- package/distHelpers/add_event_generator_object.d.ts +3 -0
- package/distHelpers/add_event_generator_object.js +66 -0
- package/distHelpers/add_event_generator_object.js.map +1 -0
- package/distHelpers/alarms_and_conditions_demo.d.ts +10 -0
- package/distHelpers/alarms_and_conditions_demo.js +115 -0
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -0
- package/distHelpers/assertHasMatchingReference.d.ts +19 -0
- package/distHelpers/assertHasMatchingReference.js +41 -0
- package/distHelpers/assertHasMatchingReference.js.map +1 -0
- package/distHelpers/boiler_system.d.ts +113 -0
- package/distHelpers/boiler_system.js +397 -0
- package/distHelpers/boiler_system.js.map +1 -0
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +5 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js +171 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -0
- package/distHelpers/dump_statemachine.d.ts +6 -0
- package/distHelpers/dump_statemachine.js +116 -0
- package/distHelpers/dump_statemachine.js.map +1 -0
- package/distHelpers/get_address_space_fixture.d.ts +1 -0
- package/distHelpers/get_address_space_fixture.js +31 -0
- package/distHelpers/get_address_space_fixture.js.map +1 -0
- package/distHelpers/get_mini_address_space.d.ts +7 -0
- package/distHelpers/get_mini_address_space.js +37 -0
- package/distHelpers/get_mini_address_space.js.map +1 -0
- package/distHelpers/index.d.ts +11 -0
- package/distHelpers/index.js +24 -0
- package/distHelpers/index.js.map +1 -0
- package/distNodeJS/generate_address_space.d.ts +4 -0
- package/distNodeJS/generate_address_space.js +31 -0
- package/distNodeJS/generate_address_space.js.map +1 -0
- package/distNodeJS/index.d.ts +1 -0
- package/distNodeJS/index.js +14 -0
- package/distNodeJS/index.js.map +1 -0
- package/generate.js +1 -0
- package/nodeJS.d.ts +1 -0
- package/nodeJS.js +1 -0
- package/package.json +87 -0
- package/source/address_space_ts.ts +217 -0
- package/source/continuation_points/continuation_point_manager.ts +121 -0
- package/source/helpers/adjust_browse_direction.ts +15 -0
- package/source/helpers/argument_list.ts +286 -0
- package/source/helpers/call_helpers.ts +112 -0
- package/source/helpers/check_event_clause.ts +62 -0
- package/source/helpers/coerce_enum_value.ts +33 -0
- package/source/helpers/dump_tools.ts +92 -0
- package/source/helpers/ensure_secure_access.ts +88 -0
- package/source/helpers/make_optionals_map.ts +49 -0
- package/source/helpers/resolve_opaque_on_address_space.ts +23 -0
- package/source/index.ts +49 -0
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +13 -0
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +26 -0
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +34 -0
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +14 -0
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +10 -0
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +14 -0
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +13 -0
- package/source/interfaces/state_machine/ua_state_machine_type.ts +261 -0
- package/source/interfaces/state_machine/ua_transition_ex.ts +7 -0
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +8 -0
- package/source/loader/generateAddressSpaceRaw.ts +79 -0
- package/source/loader/load_nodeset2.ts +1600 -0
- package/source/loader/namespace_post_step.ts +36 -0
- package/source/loader/register_node_promoter.ts +8 -0
- package/source/namespace.ts +9 -0
- package/source/namespace_alarm_and_condition.ts +47 -0
- package/source/namespace_data_access.ts +60 -0
- package/source/namespace_machine_state.ts +13 -0
- package/source/pseudo_session.ts +288 -0
- package/source/session_context.ts +345 -0
- package/source/set_namespace_meta_data.ts +68 -0
- package/source/ua_root_folder.ts +10 -0
- package/source/ua_two_state_variable_ex.ts +35 -0
- package/source/xml_writer.ts +15 -0
- package/source_nodejs/generate_address_space.ts +36 -0
- package/source_nodejs/index.ts +1 -0
- package/src/address_space.ts +1575 -0
- package/src/address_space_change_event_tools.ts +177 -0
- package/src/address_space_private.ts +98 -0
- package/src/alarms_and_conditions/check_where_clause.ts +148 -0
- package/src/alarms_and_conditions/condition.ts +89 -0
- package/src/alarms_and_conditions/condition_info.ts +66 -0
- package/src/alarms_and_conditions/condition_snapshot.ts +766 -0
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +66 -0
- package/src/alarms_and_conditions/extract_event_fields.ts +104 -0
- package/src/alarms_and_conditions/index.ts +18 -0
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +339 -0
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +513 -0
- package/src/alarms_and_conditions/ua_base_event_impl.ts +55 -0
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +50 -0
- package/src/alarms_and_conditions/ua_condition_impl.ts +1298 -0
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +81 -0
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +110 -0
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +19 -0
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +130 -0
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +24 -0
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +305 -0
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +108 -0
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +224 -0
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +186 -0
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +27 -0
- package/src/apply_condition_refresh.ts +30 -0
- package/src/base_node_impl.ts +1749 -0
- package/src/base_node_private.ts +690 -0
- package/src/data_access/add_dataItem_stuff.ts +75 -0
- package/src/data_access/check_variant_compatibility_ua_analog_item.ts +41 -0
- package/src/data_access/ua_multistate_discrete_impl.ts +168 -0
- package/src/data_access/ua_multistate_value_discrete.ts +299 -0
- package/src/data_access/ua_two_state_discrete.ts +185 -0
- package/src/event_data.ts +117 -0
- package/src/extension_object_array_node.ts +325 -0
- package/src/historical_access/address_space_historical_data_node.ts +828 -0
- package/src/index_current.ts +52 -0
- package/src/namespace_impl.ts +2181 -0
- package/src/namespace_private.ts +60 -0
- package/src/nodeid_manager.ts +228 -0
- package/src/nodeset_tools/adjust_namespace_array.ts +11 -0
- package/src/nodeset_tools/construct_namespace_dependency.ts +40 -0
- package/src/nodeset_tools/nodeset_to_xml.ts +1317 -0
- package/src/nodeset_tools/typedictionary_to_xml.ts +175 -0
- package/src/reference_impl.ts +169 -0
- package/src/role_permissions.ts +6 -0
- package/src/state_machine/finite_state_machine.ts +428 -0
- package/src/state_machine/ua_shelving_state_machine_ex.ts +314 -0
- package/src/state_machine/ua_two_state_variable.ts +421 -0
- package/src/tool_isSupertypeOf.ts +129 -0
- package/src/ua_condition_type.ts +10 -0
- package/src/ua_data_type_impl.ts +356 -0
- package/src/ua_method_impl.ts +278 -0
- package/src/ua_object_impl.ts +203 -0
- package/src/ua_object_type_impl.ts +158 -0
- package/src/ua_reference_type_impl.ts +174 -0
- package/src/ua_variable_impl.ts +2277 -0
- package/src/ua_variable_type_impl.ts +741 -0
- package/src/ua_view_impl.ts +54 -0
- package/testHelpers.d.ts +1 -0
- package/testHelpers.js +1 -0
- package/test_helpers/add_event_generator_object.ts +71 -0
- package/test_helpers/alarms_and_conditions_demo.ts +147 -0
- package/test_helpers/assertHasMatchingReference.ts +43 -0
- package/test_helpers/boiler_system.ts +618 -0
- package/test_helpers/create_minimalist_address_space_nodeset.ts +208 -0
- package/test_helpers/dump_statemachine.ts +155 -0
- package/test_helpers/get_address_space_fixture.ts +30 -0
- package/test_helpers/get_mini_address_space.ts +42 -0
- package/test_helpers/index.ts +11 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +136 -0
- package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -0
- package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -0
- package/test_helpers/test_fixtures/dataType_with_structures.xml +605 -0
- package/test_helpers/test_fixtures/dataType_with_union.xml +1 -0
- package/test_helpers/test_fixtures/datatype_as_per_1.04.xml +91 -0
- package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -0
- package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1303 -0
- package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -0
- package/test_helpers/test_fixtures/issue_846.xml +3172 -0
- package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +33 -0
- package/test_helpers/test_fixtures/mini.Node.Set2.xml +4508 -0
- package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -0
- package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
import * as chalk from "chalk";
|
|
5
|
+
|
|
6
|
+
import { UAReference, BaseNode, UAObject, UAVariable } from "node-opcua-address-space-base";
|
|
7
|
+
import { assert } from "node-opcua-assert";
|
|
8
|
+
import { BrowseDirection, NodeClass } from "node-opcua-data-model";
|
|
9
|
+
import { Enum, EnumItem } from "node-opcua-enum";
|
|
10
|
+
import { NodeId } from "node-opcua-nodeid";
|
|
11
|
+
import { ModelChangeStructureDataType } from "node-opcua-types";
|
|
12
|
+
|
|
13
|
+
import { AddressSpacePrivate } from "./address_space_private";
|
|
14
|
+
import { BaseNodeImpl } from "./base_node_impl";
|
|
15
|
+
|
|
16
|
+
const verbFlags = new Enum({
|
|
17
|
+
// NodeAdded 0 Indicates the affected Node has been added.
|
|
18
|
+
NodeAdded: 0x01,
|
|
19
|
+
|
|
20
|
+
// NodeDeleted 1 Indicates the affected Node has been deleted.
|
|
21
|
+
NodeDeleted: 0x02,
|
|
22
|
+
|
|
23
|
+
// ReferenceAdded 2 Indicates a Reference has been added. The affected Node may
|
|
24
|
+
ReferenceAdded: 0x04,
|
|
25
|
+
|
|
26
|
+
// be either a SourceNode or TargetNode. Note that an added
|
|
27
|
+
// bidirectional Reference is reflected by two ChangeStructures.
|
|
28
|
+
// ReferenceDeleted 3 Indicates a Reference has been deleted. The affected Node may
|
|
29
|
+
// be either a SourceNode or TargetNode. Note that a deleted
|
|
30
|
+
// bidirectional Reference is reflected by two ChangeStructures.
|
|
31
|
+
ReferenceDeleted: 0x08,
|
|
32
|
+
|
|
33
|
+
// DataTypeChanged 4 This verb may be used only for affected Nodes that are
|
|
34
|
+
// Variables or VariableTypes. It indicates that the DataType
|
|
35
|
+
// Attribute has changed.
|
|
36
|
+
DataTypeChanged: 0x10
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
function makeVerb(verbs: any): number {
|
|
40
|
+
const e: EnumItem = verbFlags.get(verbs)!;
|
|
41
|
+
assert(e !== null);
|
|
42
|
+
return e.value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function _handle_add_reference_change_event(node1: BaseNode, node2id: NodeId): void {
|
|
46
|
+
const addressSpace = node1.addressSpace as AddressSpacePrivate;
|
|
47
|
+
|
|
48
|
+
const node2 = addressSpace.findNode(node2id)! as BaseNode;
|
|
49
|
+
|
|
50
|
+
if (node1.nodeVersion || (node2 && node2.nodeVersion)) {
|
|
51
|
+
// a event has to be send
|
|
52
|
+
addressSpace.modelChangeTransaction(() => {
|
|
53
|
+
function _getTypeDef(node: BaseNode) {
|
|
54
|
+
if (node.nodeClass === NodeClass.Object || node.nodeClass === NodeClass.Variable) {
|
|
55
|
+
return (<UAVariable | UAObject>node).typeDefinitionObj.nodeId;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let modelChangeTgt = new ModelChangeStructureDataType({
|
|
61
|
+
affected: node1.nodeId,
|
|
62
|
+
affectedType: _getTypeDef(node1),
|
|
63
|
+
verb: makeVerb("ReferenceAdded")
|
|
64
|
+
});
|
|
65
|
+
addressSpace._collectModelChange(null, modelChangeTgt);
|
|
66
|
+
|
|
67
|
+
modelChangeTgt = new ModelChangeStructureDataType({
|
|
68
|
+
affected: node2.nodeId,
|
|
69
|
+
affectedType: _getTypeDef(node2),
|
|
70
|
+
verb: makeVerb("ReferenceAdded")
|
|
71
|
+
});
|
|
72
|
+
addressSpace._collectModelChange(null, modelChangeTgt);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
(ModelChangeStructureDataType as any).prototype.toString = function (options: any): string {
|
|
79
|
+
if (!options) {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
const addressSpace = options.addressSpace;
|
|
83
|
+
|
|
84
|
+
function n(nodeId: NodeId | null) {
|
|
85
|
+
if (!nodeId || nodeId.isEmpty()) {
|
|
86
|
+
return "";
|
|
87
|
+
}
|
|
88
|
+
const node = addressSpace.findNode(nodeId)!;
|
|
89
|
+
return '"' + nodeId.toString() + '"' + chalk.yellow(" /* " + (node ? node.browseName.toString() : "???") + " */");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let str = "{ verb:" + verbFlags.get(this.verb)!.key + ",";
|
|
93
|
+
str += " affected: " + n(this.affected) + ",";
|
|
94
|
+
str += " type: " + n(this.affectedType) + " }";
|
|
95
|
+
return str;
|
|
96
|
+
};
|
|
97
|
+
} catch (err) {
|
|
98
|
+
//
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function _handle_model_change_event(node: BaseNodeImpl): void {
|
|
102
|
+
const addressSpace = node.addressSpace as AddressSpacePrivate;
|
|
103
|
+
//
|
|
104
|
+
const parent = node.parent!;
|
|
105
|
+
|
|
106
|
+
if (parent && (parent as BaseNode).nodeVersion) {
|
|
107
|
+
addressSpace.modelChangeTransaction(() => {
|
|
108
|
+
let typeDefinitionNodeId = null;
|
|
109
|
+
|
|
110
|
+
if (node.nodeClass === NodeClass.Object || node.nodeClass === NodeClass.Variable) {
|
|
111
|
+
typeDefinitionNodeId = node.typeDefinitionObj.nodeId;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const modelChange1 = new ModelChangeStructureDataType({
|
|
115
|
+
affected: node.nodeId,
|
|
116
|
+
affectedType: typeDefinitionNodeId,
|
|
117
|
+
verb: makeVerb("NodeAdded")
|
|
118
|
+
});
|
|
119
|
+
addressSpace._collectModelChange(null, modelChange1);
|
|
120
|
+
|
|
121
|
+
const modelChangeSrc = new ModelChangeStructureDataType({
|
|
122
|
+
affected: parent.nodeId,
|
|
123
|
+
affectedType: null,
|
|
124
|
+
verb: makeVerb("ReferenceAdded")
|
|
125
|
+
});
|
|
126
|
+
addressSpace._collectModelChange(null, modelChangeSrc);
|
|
127
|
+
|
|
128
|
+
// bidirectional
|
|
129
|
+
if ((node as BaseNode).nodeVersion) {
|
|
130
|
+
const modelChangeTgt = new ModelChangeStructureDataType({
|
|
131
|
+
affected: node.nodeId,
|
|
132
|
+
affectedType: typeDefinitionNodeId,
|
|
133
|
+
verb: makeVerb("ReferenceAdded")
|
|
134
|
+
});
|
|
135
|
+
addressSpace._collectModelChange(null, modelChangeTgt);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function _handle_delete_node_model_change_event(node: BaseNode): void {
|
|
142
|
+
const addressSpace = node.addressSpace as AddressSpacePrivate;
|
|
143
|
+
|
|
144
|
+
// get backward references
|
|
145
|
+
const references = node.findReferencesEx("HierarchicalReferences", BrowseDirection.Inverse)!;
|
|
146
|
+
|
|
147
|
+
const parentNodes = references.map((r: UAReference) => {
|
|
148
|
+
return addressSpace.findNode(r.nodeId)! as BaseNode;
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const versionableNodes = parentNodes.filter((n: BaseNode) => !!n?.nodeVersion);
|
|
152
|
+
|
|
153
|
+
if (versionableNodes.length >= 1 || !!node.nodeVersion) {
|
|
154
|
+
addressSpace.modelChangeTransaction(() => {
|
|
155
|
+
// ...
|
|
156
|
+
for (const r of references) {
|
|
157
|
+
const target = addressSpace.findNode(r.nodeId)!;
|
|
158
|
+
|
|
159
|
+
const modelChangeSrc_l = new ModelChangeStructureDataType({
|
|
160
|
+
affected: target.nodeId,
|
|
161
|
+
affectedType: null,
|
|
162
|
+
verb: makeVerb("ReferenceDeleted")
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
addressSpace._collectModelChange(null, modelChangeSrc_l);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const modelChangeSrc = new ModelChangeStructureDataType({
|
|
169
|
+
affected: node.nodeId,
|
|
170
|
+
affectedType: (<UAVariable | UAObject>node).typeDefinition,
|
|
171
|
+
verb: makeVerb("NodeDeleted")
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
addressSpace._collectModelChange(null, modelChangeSrc);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.Private
|
|
3
|
+
*/
|
|
4
|
+
import { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object";
|
|
5
|
+
import { NodeClass, QualifiedNameLike } from "node-opcua-data-model";
|
|
6
|
+
import { ExtensionObject } from "node-opcua-extension-object";
|
|
7
|
+
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
8
|
+
import { ModelChangeStructureDataType, ReadProcessedDetails, HistoryReadResult } from "node-opcua-types";
|
|
9
|
+
import { NumericRange } from "node-opcua-numeric-range";
|
|
10
|
+
import { CallbackT } from "node-opcua-status-code";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
IAddressSpace,
|
|
14
|
+
BaseNode,
|
|
15
|
+
UADataType,
|
|
16
|
+
UAView,
|
|
17
|
+
ISessionContext,
|
|
18
|
+
AddReferenceOpts,
|
|
19
|
+
ContinuationPoint,
|
|
20
|
+
UAVariableType,
|
|
21
|
+
UAObjectType,
|
|
22
|
+
UAReference,
|
|
23
|
+
UAVariable
|
|
24
|
+
} from "node-opcua-address-space-base";
|
|
25
|
+
|
|
26
|
+
import { UARootFolder } from "../source/ua_root_folder";
|
|
27
|
+
|
|
28
|
+
import { NamespacePrivate } from "./namespace_private";
|
|
29
|
+
import { ExtensionObjectConstructorFuncWithSchema } from "./ua_data_type_impl";
|
|
30
|
+
import { UANamespace} from "./namespace_impl";
|
|
31
|
+
|
|
32
|
+
export interface AddressSpacePrivate extends IAddressSpace {
|
|
33
|
+
|
|
34
|
+
rootFolder: UARootFolder;
|
|
35
|
+
|
|
36
|
+
isFrugal: boolean;
|
|
37
|
+
suspendBackReference: boolean;
|
|
38
|
+
|
|
39
|
+
_condition_refresh_in_progress: boolean;
|
|
40
|
+
|
|
41
|
+
_coerceNode(node: string | BaseNode | NodeIdLike): BaseNode | null;
|
|
42
|
+
|
|
43
|
+
_coerceFolder(folder: string | BaseNode | NodeId): BaseNode | null;
|
|
44
|
+
|
|
45
|
+
_coerce_DataType(dataType: NodeIdLike | BaseNode): NodeId;
|
|
46
|
+
|
|
47
|
+
_coerceType(
|
|
48
|
+
baseType: string | NodeId | BaseNode,
|
|
49
|
+
topMostBaseType: string,
|
|
50
|
+
nodeClass: NodeClass
|
|
51
|
+
): UAVariableType | UAObjectType;
|
|
52
|
+
_coerceTypeDefinition(typeDefinition: string | NodeId): NodeId;
|
|
53
|
+
|
|
54
|
+
_coerce_VariableTypeIds(dataType: NodeId | string | BaseNode): NodeId;
|
|
55
|
+
|
|
56
|
+
getDefaultNamespace(): NamespacePrivate;
|
|
57
|
+
|
|
58
|
+
getOwnNamespace(): NamespacePrivate;
|
|
59
|
+
|
|
60
|
+
getNamespace(indexOrName: number | string): UANamespace;
|
|
61
|
+
|
|
62
|
+
registerNamespace(namespaceUri: string): UANamespace;
|
|
63
|
+
|
|
64
|
+
getNamespaceArray(): NamespacePrivate[];
|
|
65
|
+
|
|
66
|
+
getExtensionObjectConstructor(dataType: NodeId | UADataType): ExtensionObjectConstructorFuncWithSchema;
|
|
67
|
+
|
|
68
|
+
constructExtensionObject(dataType: UADataType | NodeId, options?: any): ExtensionObject;
|
|
69
|
+
|
|
70
|
+
normalizeReferenceType(params: AddReferenceOpts | UAReference): UAReference;
|
|
71
|
+
|
|
72
|
+
normalizeReferenceTypes(references: AddReferenceOpts[] | UAReference[] | null): UAReference[];
|
|
73
|
+
|
|
74
|
+
_register(node: BaseNode): void;
|
|
75
|
+
|
|
76
|
+
resolveNodeId(nodeIdLike: NodeIdLike): NodeId;
|
|
77
|
+
|
|
78
|
+
modelChangeTransaction(action: () => void): void;
|
|
79
|
+
|
|
80
|
+
_collectModelChange(view: UAView | null, data: ModelChangeStructureDataType): void;
|
|
81
|
+
|
|
82
|
+
deleteNode(nodeId: NodeId): void;
|
|
83
|
+
|
|
84
|
+
getDataTypeManager(): ExtraDataTypeManager;
|
|
85
|
+
|
|
86
|
+
///
|
|
87
|
+
_readProcessedDetails?: (
|
|
88
|
+
variable: UAVariable,
|
|
89
|
+
context: ISessionContext,
|
|
90
|
+
historyReadDetails: ReadProcessedDetails,
|
|
91
|
+
indexRange: NumericRange | null,
|
|
92
|
+
dataEncoding: QualifiedNameLike | null,
|
|
93
|
+
continuationPoint: ContinuationPoint | null,
|
|
94
|
+
callback: CallbackT<HistoryReadResult>
|
|
95
|
+
) => void;
|
|
96
|
+
|
|
97
|
+
isEnumeration(dataType: NodeId): boolean;
|
|
98
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ContentFilter, FilterOperator, LiteralOperand, SimpleAttributeOperand, FilterOperand, ElementOperand
|
|
3
|
+
} from "node-opcua-types";
|
|
4
|
+
import { DataType } from "node-opcua-variant";
|
|
5
|
+
import { NodeClass } from "node-opcua-data-model";
|
|
6
|
+
import { ExtensionObject } from "node-opcua-extension-object";
|
|
7
|
+
import { NodeId, sameNodeId } from "node-opcua-nodeid";
|
|
8
|
+
import { IAddressSpace, IEventData, ISessionContext, UAObject, UAObjectType, UAReferenceType, UAVariableType } from "node-opcua-address-space-base";
|
|
9
|
+
|
|
10
|
+
import { SessionContext } from "../../source/session_context";
|
|
11
|
+
import { extractEventFields } from "./extract_event_fields";
|
|
12
|
+
|
|
13
|
+
function checkNot(
|
|
14
|
+
addressSpace: IAddressSpace,
|
|
15
|
+
sessionContext: ISessionContext,
|
|
16
|
+
whereClause: ContentFilter,
|
|
17
|
+
eventData: IEventData,
|
|
18
|
+
filteredOperands: FilterOperand[]
|
|
19
|
+
): boolean {
|
|
20
|
+
|
|
21
|
+
if (filteredOperands[0] instanceof ElementOperand) {
|
|
22
|
+
const index = (filteredOperands[0] as ElementOperand).index;
|
|
23
|
+
return !__checkWhereClause(addressSpace, sessionContext, whereClause, index, eventData);
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function checkOfType(
|
|
29
|
+
addressSpace: IAddressSpace,
|
|
30
|
+
ofType: LiteralOperand,
|
|
31
|
+
eventData: IEventData
|
|
32
|
+
): boolean {
|
|
33
|
+
|
|
34
|
+
// istanbul ignore next
|
|
35
|
+
if (!ofType) {
|
|
36
|
+
throw new Error("invalid operand");
|
|
37
|
+
}
|
|
38
|
+
// istanbul ignore next
|
|
39
|
+
if (ofType.value.dataType !== DataType.NodeId) {
|
|
40
|
+
throw new Error("invalid operand type (expecting Nodeid");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const ofTypeNode = addressSpace.findNode(ofType.value.value) as UAObjectType | UAReferenceType | UAVariableType;
|
|
44
|
+
|
|
45
|
+
// istanbul ignore next
|
|
46
|
+
if (!ofTypeNode) {
|
|
47
|
+
return false; // the ofType node is not known, we don't know what to do
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// istanbul ignore next
|
|
51
|
+
if (ofTypeNode.nodeClass !== NodeClass.ObjectType) {
|
|
52
|
+
throw new Error("operand should be a ObjectType " + ofTypeNode.nodeId.toString());
|
|
53
|
+
}
|
|
54
|
+
const node = eventData.$eventDataSource! as (UAObjectType | UAObject | UAReferenceType | UAVariableType);
|
|
55
|
+
if (!node) {
|
|
56
|
+
throw new Error("cannot find node " + eventData.$eventDataSource?.toString());
|
|
57
|
+
}
|
|
58
|
+
if (node.nodeClass === NodeClass.ObjectType) {
|
|
59
|
+
return node.isSupertypeOf(ofTypeNode);
|
|
60
|
+
}
|
|
61
|
+
if (node.nodeClass === NodeClass.Object && node.typeDefinitionObj) {
|
|
62
|
+
return node.typeDefinitionObj.isSupertypeOf(ofTypeNode);
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _extractValue(operand: SimpleAttributeOperand, eventData: IEventData): NodeId | null {
|
|
68
|
+
// eventData.readValue;
|
|
69
|
+
const v = extractEventFields(SessionContext.defaultContext, [operand], eventData)[0];
|
|
70
|
+
return v.value as NodeId;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function checkInList(
|
|
74
|
+
addressSpace: IAddressSpace,
|
|
75
|
+
filterOperands: ExtensionObject[],
|
|
76
|
+
eventData: IEventData
|
|
77
|
+
): boolean {
|
|
78
|
+
|
|
79
|
+
const operand0 = filterOperands[0];
|
|
80
|
+
if (!(operand0 instanceof SimpleAttributeOperand)) {
|
|
81
|
+
// unsupported case
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const nodeId: NodeId | null = _extractValue(operand0, eventData);
|
|
85
|
+
if (!nodeId) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
function _is(nodeId1: NodeId, operandX: LiteralOperand): boolean {
|
|
89
|
+
|
|
90
|
+
const operandNode = addressSpace.findNode(operandX.value.value as NodeId);
|
|
91
|
+
if (!operandNode) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return sameNodeId(nodeId1, operandNode.nodeId);
|
|
95
|
+
}
|
|
96
|
+
for (let i = 1; i < filterOperands.length; i++) {
|
|
97
|
+
const filterOperand = filterOperands[i];
|
|
98
|
+
if ((filterOperand instanceof LiteralOperand) && _is(nodeId, filterOperand)) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function __checkWhereClause(
|
|
106
|
+
addressSpace: IAddressSpace,
|
|
107
|
+
sessionContext: ISessionContext,
|
|
108
|
+
whereClause: ContentFilter,
|
|
109
|
+
index: number,
|
|
110
|
+
eventData: IEventData
|
|
111
|
+
): boolean {
|
|
112
|
+
|
|
113
|
+
if (!whereClause.elements || whereClause.elements.length === 0) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
const element = whereClause.elements[index];
|
|
117
|
+
if (!element) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
switch (element.filterOperator) {
|
|
121
|
+
case FilterOperator.Not:
|
|
122
|
+
return checkNot(addressSpace, sessionContext, whereClause, eventData, element.filterOperands as FilterOperand[]);
|
|
123
|
+
case FilterOperator.OfType:
|
|
124
|
+
return checkOfType(addressSpace, element.filterOperands![0] as LiteralOperand, eventData);
|
|
125
|
+
case FilterOperator.InList:
|
|
126
|
+
return checkInList(addressSpace, element.filterOperands as ExtensionObject[], eventData);
|
|
127
|
+
default:
|
|
128
|
+
// from Spec OPC Unified Architecture, Part 4 133 Release 1.04
|
|
129
|
+
// Any basic FilterOperator in Table 119 may be used in the whereClause, however, only the
|
|
130
|
+
// OfType_14 FilterOperator from Table 120 is permitted.
|
|
131
|
+
// tslint:disable-next-line: no-console
|
|
132
|
+
console.log("whereClause = ", whereClause.toString());
|
|
133
|
+
throw new Error("Only OfType operator are allowed in checkWhereClause")
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function checkWhereClause(
|
|
138
|
+
addressSpace: IAddressSpace,
|
|
139
|
+
sessionContext: ISessionContext,
|
|
140
|
+
whereClause: ContentFilter,
|
|
141
|
+
eventData: IEventData
|
|
142
|
+
): boolean {
|
|
143
|
+
|
|
144
|
+
if (!whereClause.elements || whereClause.elements.length === 0) {
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
return __checkWhereClause(addressSpace, sessionContext, whereClause, 0, eventData);
|
|
148
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.AlarmsAndConditions
|
|
3
|
+
*/
|
|
4
|
+
// tslint:disable:no-console
|
|
5
|
+
// tslint:disable:no-var-requires
|
|
6
|
+
require("set-prototype-of");
|
|
7
|
+
import { assert } from "node-opcua-assert";
|
|
8
|
+
import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
9
|
+
import { minDate } from "node-opcua-factory";
|
|
10
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
11
|
+
|
|
12
|
+
import { ConditionSnapshot } from "./condition_snapshot";
|
|
13
|
+
|
|
14
|
+
export function _setAckedState(
|
|
15
|
+
self: ConditionSnapshot,
|
|
16
|
+
requestedAckedState: boolean,
|
|
17
|
+
conditionEventId?: Buffer,
|
|
18
|
+
comment?: string | LocalizedText | LocalizedTextLike
|
|
19
|
+
): StatusCode {
|
|
20
|
+
|
|
21
|
+
assert(self instanceof ConditionSnapshot);
|
|
22
|
+
|
|
23
|
+
const ackedState = self.getAckedState();
|
|
24
|
+
|
|
25
|
+
if (ackedState && requestedAckedState) {
|
|
26
|
+
return StatusCodes.BadConditionBranchAlreadyAcked;
|
|
27
|
+
}
|
|
28
|
+
self._set_twoStateVariable("ackedState", requestedAckedState);
|
|
29
|
+
return StatusCodes.Good;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// tslint:disable:max-classes-per-file
|
|
33
|
+
function prepare_date(sourceTimestamp: { value: Date } | null) {
|
|
34
|
+
if (!sourceTimestamp || !sourceTimestamp.value) {
|
|
35
|
+
return minDate;
|
|
36
|
+
}
|
|
37
|
+
assert(sourceTimestamp.value instanceof Date);
|
|
38
|
+
return sourceTimestamp;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
As per spec OPCUA 1.03 part 9:
|
|
43
|
+
|
|
44
|
+
A Condition’s EnabledState effects the generation of Event Notifications and as such results
|
|
45
|
+
in the following specific behaviour:
|
|
46
|
+
* When the Condition instance enters the Disabled state, the Retain Property of this
|
|
47
|
+
Condition shall be set to FALSE by the Server to indicate to the Client that the
|
|
48
|
+
Condition instance is currently not of interest to Clients.
|
|
49
|
+
* When the Condition instance enters the enabled state, the Condition shall be
|
|
50
|
+
evaluated and all of its Properties updated to reflect the current values. If this
|
|
51
|
+
evaluation causes the Retain Property to transition to TRUE for any ConditionBranch,
|
|
52
|
+
then an Event Notification shall be generated for that ConditionBranch.
|
|
53
|
+
* The Server may choose to continue to test for a Condition instance while it is
|
|
54
|
+
Disabled. However, no Event Notifications will be generated while the Condition
|
|
55
|
+
instance is disabled.
|
|
56
|
+
* For any Condition that exists in the Address Space the Attributes and the following
|
|
57
|
+
Variables will continue to have valid values even in the Disabled state; EventId, Event
|
|
58
|
+
Type, Source Node, Source Name, Time, and EnabledState.
|
|
59
|
+
Other properties may no longer provide current valid values.
|
|
60
|
+
All Variables that are no longer provided shall return a status of BadConditionDisabled.
|
|
61
|
+
The Event that reports the Disabled state should report the properties as NULL or with a status
|
|
62
|
+
of BadConditionDisabled.
|
|
63
|
+
When enabled, changes to the following components shall cause a ConditionType Event Notification:
|
|
64
|
+
- Quality
|
|
65
|
+
- Severity (inherited from BaseEventType)
|
|
66
|
+
- Comment
|
|
67
|
+
|
|
68
|
+
// spec :
|
|
69
|
+
// The HasCondition ReferenceType is a concrete ReferenceType and can be used directly. It is
|
|
70
|
+
// a subtype of NonHierarchicalReferences.
|
|
71
|
+
// The semantic of this ReferenceType is to specify the relationship between a ConditionSource
|
|
72
|
+
// and its Conditions. Each ConditionSource shall be the target of a HasEventSource Reference
|
|
73
|
+
// or a sub type of HasEventSource. The Address Space organisation that shall be provided for
|
|
74
|
+
// Clients to detect Conditions and ConditionSources is defined in Clause 6. Various examples
|
|
75
|
+
// for the use of this ReferenceType can be found in B.2.
|
|
76
|
+
// HasCondition References can be used in the Type definition of an Object or a Variable. In this
|
|
77
|
+
// case, the SourceNode of this ReferenceType shall be an ObjectType or VariableType Node or
|
|
78
|
+
// one of their InstanceDeclaration Nodes. The TargetNode shall be a Condition instance
|
|
79
|
+
// declaration or a ConditionType. The following rules for instantiation apply:
|
|
80
|
+
// All HasCondition References used in a Type shall exist in instances of these Types as
|
|
81
|
+
// well.
|
|
82
|
+
// If the TargetNode in the Type definition is a ConditionType, the same TargetNode will
|
|
83
|
+
// be referenced on the instance.
|
|
84
|
+
// HasCondition References may be used solely in the instance space when they are not
|
|
85
|
+
// available in Type definitions. In this case the SourceNode of this ReferenceType shall be an
|
|
86
|
+
// Object, Variable or Method Node. The TargetNode shall be a Condition instance or a
|
|
87
|
+
// ConditionType.
|
|
88
|
+
|
|
89
|
+
*/
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.AlarmsAndConditions
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { UInt16 } from "node-opcua-basic-types";
|
|
6
|
+
import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
7
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
8
|
+
import { ConditionInfoOptions } from "../../source/interfaces/alarms_and_conditions/condition_info_i";
|
|
9
|
+
|
|
10
|
+
export interface ConditionInfo {
|
|
11
|
+
message: LocalizedText | null;
|
|
12
|
+
quality: StatusCode | null;
|
|
13
|
+
severity: UInt16 | null;
|
|
14
|
+
retain: boolean | null;
|
|
15
|
+
isDifferentFrom(otherConditionInfo: ConditionInfo): boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @class ConditionInfo
|
|
19
|
+
* @param options {Object}
|
|
20
|
+
* @param options.message {String|LocalizedText} the event message
|
|
21
|
+
* @param options.severity {UInt16} severity
|
|
22
|
+
* @param options.quality {StatusCode} quality
|
|
23
|
+
* @param options.retain {Boolean} retain flag
|
|
24
|
+
* @constructor
|
|
25
|
+
*/
|
|
26
|
+
export class ConditionInfo {
|
|
27
|
+
public message: LocalizedText | null = null;
|
|
28
|
+
public quality: StatusCode | null = null;
|
|
29
|
+
public severity: UInt16 | null = 0;
|
|
30
|
+
public retain: boolean | null = false;
|
|
31
|
+
|
|
32
|
+
constructor(options: ConditionInfoOptions) {
|
|
33
|
+
this.severity = null;
|
|
34
|
+
this.quality = null;
|
|
35
|
+
this.message = null;
|
|
36
|
+
this.retain = null;
|
|
37
|
+
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(options, "message") && options.message) {
|
|
39
|
+
this.message = LocalizedText.coerce(options.message);
|
|
40
|
+
}
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(options, "quality") && options.quality !== null) {
|
|
42
|
+
this.quality = options.quality!;
|
|
43
|
+
}
|
|
44
|
+
if (Object.prototype.hasOwnProperty.call(options, "severity") && options.severity !== null) {
|
|
45
|
+
assert(typeof options.severity === "number");
|
|
46
|
+
this.severity = options.severity!;
|
|
47
|
+
}
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(options, "retain") && options.retain !== null) {
|
|
49
|
+
assert(typeof options.retain === "boolean");
|
|
50
|
+
this.retain = options.retain!;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @method isDifferentFrom
|
|
56
|
+
* @param otherConditionInfo {ConditionInfo}
|
|
57
|
+
* @return {Boolean}
|
|
58
|
+
*/
|
|
59
|
+
public isDifferentFrom(otherConditionInfo: ConditionInfo): boolean {
|
|
60
|
+
return (
|
|
61
|
+
this.severity !== otherConditionInfo.severity ||
|
|
62
|
+
this.quality !== otherConditionInfo.quality ||
|
|
63
|
+
this.message !== otherConditionInfo.message
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|