node-opcua-address-space 2.75.0 → 2.76.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/dist/source/address_space_ts.d.ts +118 -118
- package/dist/source/address_space_ts.js +17 -17
- package/dist/source/continuation_points/continuation_point_manager.d.ts +32 -32
- package/dist/source/continuation_points/continuation_point_manager.js +195 -195
- package/dist/source/helpers/adjust_browse_direction.d.ts +5 -5
- package/dist/source/helpers/adjust_browse_direction.js +11 -11
- package/dist/source/helpers/argument_list.d.ts +33 -33
- package/dist/source/helpers/argument_list.js +258 -258
- package/dist/source/helpers/call_helpers.d.ts +6 -6
- package/dist/source/helpers/call_helpers.js +70 -70
- package/dist/source/helpers/coerce_enum_value.d.ts +6 -6
- package/dist/source/helpers/coerce_enum_value.js +33 -33
- package/dist/source/helpers/dump_tools.d.ts +14 -14
- package/dist/source/helpers/dump_tools.js +78 -78
- package/dist/source/helpers/ensure_secure_access.d.ts +9 -9
- package/dist/source/helpers/ensure_secure_access.js +76 -76
- package/dist/source/helpers/make_optionals_map.d.ts +21 -21
- package/dist/source/helpers/make_optionals_map.js +29 -29
- package/dist/source/helpers/multiform_func.d.ts +11 -11
- package/dist/source/helpers/multiform_func.js +75 -75
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +3 -3
- package/dist/source/helpers/resolve_opaque_on_address_space.js +36 -36
- package/dist/source/index.d.ts +56 -56
- package/dist/source/index.js +83 -83
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +19 -19
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +193 -193
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +12 -12
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +10 -10
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +7 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +7 -7
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +9 -9
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +20 -20
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +23 -23
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +32 -32
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +19 -15
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +42 -42
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +7 -7
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +25 -25
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +20 -20
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +26 -26
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +8 -8
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.js +2 -2
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +10 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.js +2 -2
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +21 -21
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +2 -2
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +24 -24
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +2 -2
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +12 -12
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +2 -2
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +8 -8
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +2 -2
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -12
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +2 -2
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -49
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +2 -2
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -11
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +2 -2
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +30 -30
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.js +2 -2
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +222 -222
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +2 -2
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +6 -6
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +8 -8
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +2 -2
- package/dist/source/loader/decode_xml_extension_object.d.ts +6 -6
- package/dist/source/loader/decode_xml_extension_object.js +71 -71
- package/dist/source/loader/ensure_datatype_extracted.d.ts +5 -5
- package/dist/source/loader/ensure_datatype_extracted.js +45 -45
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +10 -10
- package/dist/source/loader/generateAddressSpaceRaw.js +45 -45
- package/dist/source/loader/load_nodeset2.d.ts +16 -16
- package/dist/source/loader/load_nodeset2.js +1461 -1461
- package/dist/source/loader/make_semver_compatible.d.ts +6 -6
- package/dist/source/loader/make_semver_compatible.js +25 -25
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +28 -28
- package/dist/source/loader/make_xml_extension_object_parser.js +325 -325
- package/dist/source/loader/namespace_post_step.d.ts +10 -6
- package/dist/source/loader/namespace_post_step.js +61 -47
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/loader/register_node_promoter.d.ts +2 -3
- package/dist/source/loader/register_node_promoter.js +9 -9
- package/dist/source/loader/register_node_promoter.js.map +1 -1
- package/dist/source/namespace.d.ts +6 -6
- package/dist/source/namespace.js +2 -2
- package/dist/source/namespace_alarm_and_condition.d.ts +32 -32
- package/dist/source/namespace_alarm_and_condition.js +2 -2
- package/dist/source/namespace_data_access.d.ts +42 -42
- package/dist/source/namespace_data_access.js +2 -2
- package/dist/source/namespace_machine_state.d.ts +7 -7
- package/dist/source/namespace_machine_state.js +2 -2
- package/dist/source/pseudo_session.d.ts +55 -55
- package/dist/source/pseudo_session.js +203 -203
- package/dist/source/session_context.d.ts +111 -111
- package/dist/source/session_context.js +265 -265
- package/dist/source/set_namespace_meta_data.d.ts +2 -2
- package/dist/source/set_namespace_meta_data.js +59 -59
- package/dist/source/ua_root_folder.d.ts +9 -9
- package/dist/source/ua_root_folder.js +2 -2
- package/dist/source/ua_two_state_variable_ex.d.ts +23 -23
- package/dist/source/ua_two_state_variable_ex.js +2 -2
- package/dist/source/xml_writer.d.ts +9 -9
- package/dist/source/xml_writer.js +2 -2
- package/dist/src/address_space.d.ts +392 -392
- package/dist/src/address_space.js +1392 -1392
- package/dist/src/address_space_change_event_tools.d.ts +6 -6
- package/dist/src/address_space_change_event_tools.js +149 -149
- package/dist/src/address_space_private.d.ts +43 -43
- package/dist/src/address_space_private.js +2 -2
- package/dist/src/alarms_and_conditions/condition.d.ts +5 -5
- package/dist/src/alarms_and_conditions/condition.js +78 -78
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +26 -26
- package/dist/src/alarms_and_conditions/condition_info_impl.js +54 -54
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +222 -222
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +657 -657
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +9 -9
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +61 -61
- package/dist/src/alarms_and_conditions/index.d.ts +16 -16
- package/dist/src/alarms_and_conditions/index.js +32 -32
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +44 -44
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -244
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +93 -93
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +419 -416
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +26 -26
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +38 -38
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +44 -36
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +183 -118
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +153 -153
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1028 -1024
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +14 -14
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +34 -34
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +24 -24
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +56 -56
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +11 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +11 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +23 -23
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +86 -86
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +11 -11
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +7 -7
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +79 -79
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +250 -250
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +24 -24
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +50 -50
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +19 -19
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +162 -162
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +46 -46
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +166 -166
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +18 -18
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +17 -17
- package/dist/src/apply_condition_refresh.d.ts +6 -6
- package/dist/src/apply_condition_refresh.js +27 -27
- package/dist/src/base_node_impl.d.ts +281 -281
- package/dist/src/base_node_impl.js +1395 -1395
- package/dist/src/base_node_private.d.ts +61 -61
- package/dist/src/base_node_private.js +705 -705
- package/dist/src/data_access/add_dataItem_stuff.d.ts +11 -11
- package/dist/src/data_access/add_dataItem_stuff.js +61 -61
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -1
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +34 -34
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +32 -32
- package/dist/src/data_access/ua_multistate_discrete_impl.js +130 -130
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +51 -51
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +249 -249
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +25 -25
- package/dist/src/data_access/ua_two_state_discrete_impl.js +153 -153
- package/dist/src/event_data.d.ts +34 -34
- package/dist/src/event_data.js +64 -64
- package/dist/src/extension_object_array_node.d.ts +61 -61
- package/dist/src/extension_object_array_node.js +276 -276
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +26 -26
- package/dist/src/historical_access/address_space_historical_data_node.js +630 -630
- package/dist/src/index_current.d.ts +43 -43
- package/dist/src/index_current.js +74 -74
- package/dist/src/namespace_impl.d.ts +461 -461
- package/dist/src/namespace_impl.js +1732 -1732
- package/dist/src/namespace_private.d.ts +21 -21
- package/dist/src/namespace_private.js +32 -32
- package/dist/src/nodeid_manager.d.ts +36 -36
- package/dist/src/nodeid_manager.js +197 -197
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +2 -2
- package/dist/src/nodeset_tools/adjust_namespace_array.js +13 -13
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -2
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +83 -83
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +2 -2
- package/dist/src/nodeset_tools/nodeset_to_xml.js +1155 -1155
- package/dist/src/nodeset_tools/typedictionary_to_xml.d.ts +2 -2
- package/dist/src/nodeset_tools/typedictionary_to_xml.js +154 -154
- package/dist/src/reference_impl.d.ts +43 -43
- package/dist/src/reference_impl.js +139 -139
- package/dist/src/role_permissions.d.ts +2 -2
- package/dist/src/role_permissions.js +10 -10
- package/dist/src/state_machine/finite_state_machine.d.ts +67 -67
- package/dist/src/state_machine/finite_state_machine.js +353 -353
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +38 -38
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +250 -250
- package/dist/src/state_machine/ua_two_state_variable.d.ts +61 -61
- package/dist/src/state_machine/ua_two_state_variable.js +331 -331
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/tool_isSupertypeOf.d.ts +17 -17
- package/dist/src/tool_isSupertypeOf.js +108 -108
- package/dist/src/ua_condition_type.d.ts +8 -8
- package/dist/src/ua_condition_type.js +2 -2
- package/dist/src/ua_data_type_impl.d.ts +93 -93
- package/dist/src/ua_data_type_impl.js +371 -371
- package/dist/src/ua_method_impl.d.ts +41 -41
- package/dist/src/ua_method_impl.js +208 -208
- package/dist/src/ua_object_impl.d.ts +35 -35
- package/dist/src/ua_object_impl.js +161 -161
- package/dist/src/ua_object_type_impl.d.ts +48 -48
- package/dist/src/ua_object_type_impl.js +124 -124
- package/dist/src/ua_reference_type_impl.d.ts +43 -43
- package/dist/src/ua_reference_type_impl.js +139 -139
- package/dist/src/ua_variable_impl.d.ts +351 -351
- package/dist/src/ua_variable_impl.js +1604 -1604
- package/dist/src/ua_variable_impl_ext_obj.d.ts +17 -17
- package/dist/src/ua_variable_impl_ext_obj.js +437 -437
- package/dist/src/ua_variable_type_impl.d.ts +62 -62
- package/dist/src/ua_variable_type_impl.js +570 -570
- package/dist/src/ua_view_impl.d.ts +19 -19
- package/dist/src/ua_view_impl.js +43 -43
- package/distHelpers/add_event_generator_object.d.ts +3 -3
- package/distHelpers/add_event_generator_object.js +64 -65
- package/distHelpers/add_event_generator_object.js.map +1 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +9 -9
- package/distHelpers/alarms_and_conditions_demo.js +115 -115
- package/distHelpers/assertHasMatchingReference.d.ts +19 -19
- package/distHelpers/assertHasMatchingReference.js +40 -40
- package/distHelpers/boiler_system.d.ts +113 -113
- package/distHelpers/boiler_system.js +395 -395
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +5 -5
- package/distHelpers/create_minimalist_address_space_nodeset.js +171 -171
- package/distHelpers/date_utils.d.ts +3 -3
- package/distHelpers/date_utils.js +9 -9
- package/distHelpers/dump_statemachine.js +127 -127
- package/distHelpers/get_address_space_fixture.d.ts +1 -1
- package/distHelpers/get_address_space_fixture.js +30 -30
- package/distHelpers/get_mini_address_space.d.ts +7 -7
- package/distHelpers/get_mini_address_space.js +36 -36
- package/distHelpers/index.d.ts +12 -12
- package/distHelpers/index.js +28 -28
- package/distHelpers/mock_session.d.ts +14 -14
- package/distHelpers/mock_session.js +25 -25
- package/distNodeJS/generate_address_space.d.ts +4 -4
- package/distNodeJS/generate_address_space.js +41 -41
- package/distNodeJS/index.d.ts +1 -1
- package/distNodeJS/index.js +17 -17
- package/generate.js +1 -1
- package/package.json +36 -38
- package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +5 -0
- package/source/loader/namespace_post_step.ts +26 -3
- package/source/loader/register_node_promoter.ts +5 -4
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +4 -1
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +106 -49
- package/src/alarms_and_conditions/ua_condition_impl.ts +4 -1
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +3 -3
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +12 -10
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +1 -1
- package/src/state_machine/ua_two_state_variable.ts +1 -2
- package/test_helpers/add_event_generator_object.ts +0 -1
- package/dist/source/helpers/check_event_clause.d.ts +0 -17
- package/dist/source/helpers/check_event_clause.js +0 -53
- package/dist/source/helpers/check_event_clause.js.map +0 -1
- package/dist/src/alarms_and_conditions/check_where_clause.d.ts +0 -4
- package/dist/src/alarms_and_conditions/check_where_clause.js +0 -110
- package/dist/src/alarms_and_conditions/check_where_clause.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_info.d.ts +0 -27
- package/dist/src/alarms_and_conditions/condition_info.js +0 -55
- package/dist/src/alarms_and_conditions/condition_info.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +0 -233
- package/dist/src/alarms_and_conditions/condition_snapshot.js +0 -667
- package/dist/src/alarms_and_conditions/condition_snapshot.js.map +0 -1
- package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +0 -10
- package/dist/src/alarms_and_conditions/extract_event_fields.js +0 -90
- package/dist/src/alarms_and_conditions/extract_event_fields.js.map +0 -1
- package/dist/src/data_access/ua_multistate_value_discrete.d.ts +0 -51
- package/dist/src/data_access/ua_multistate_value_discrete.js +0 -250
- package/dist/src/data_access/ua_multistate_value_discrete.js.map +0 -1
- package/dist/src/data_access/ua_two_state_discrete.d.ts +0 -25
- package/dist/src/data_access/ua_two_state_discrete.js +0 -154
- package/dist/src/data_access/ua_two_state_discrete.js.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { NodeIdLike, resolveNodeId } from "node-opcua-nodeid";
|
|
2
2
|
import { UAObject, UAVariable } from "node-opcua-address-space-base";
|
|
3
3
|
|
|
4
|
-
import { g_promotableObject } from "./namespace_post_step";
|
|
4
|
+
import { g_promotableObject, Promoter } from "./namespace_post_step";
|
|
5
5
|
|
|
6
6
|
export function registerNodePromoter(
|
|
7
|
-
|
|
8
|
-
promoter:
|
|
7
|
+
standardNodeId: number,
|
|
8
|
+
promoter: Promoter,
|
|
9
|
+
applyOnTypes = false
|
|
9
10
|
): void {
|
|
10
|
-
g_promotableObject[resolveNodeId(
|
|
11
|
+
g_promotableObject[resolveNodeId(standardNodeId).toString()] = { promoter, onInstanceOnly: applyOnTypes };
|
|
11
12
|
}
|
|
@@ -191,6 +191,9 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
|
|
|
191
191
|
public activateAlarm(): void {
|
|
192
192
|
// will set acknowledgeable to false and retain to true
|
|
193
193
|
const branch = this.currentBranch();
|
|
194
|
+
if (!branch) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
194
197
|
branch.setRetain(true);
|
|
195
198
|
branch.setActiveState(true);
|
|
196
199
|
branch.setAckedState(false);
|
|
@@ -418,7 +421,7 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
|
|
|
418
421
|
});
|
|
419
422
|
} else {
|
|
420
423
|
return new ConditionInfoImpl({
|
|
421
|
-
message: "Condition
|
|
424
|
+
message: "Condition is " + value + " and state is " + stateData,
|
|
422
425
|
quality: StatusCodes.Good,
|
|
423
426
|
retain: true,
|
|
424
427
|
severity: 150
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* @module node-opcua-address-space.AlarmsAndConditions
|
|
3
3
|
*/
|
|
4
4
|
import { Certificate, exploreCertificate, makeSHA1Thumbprint } from "node-opcua-crypto";
|
|
5
|
-
import { DateTime, minOPCUADate } from "node-opcua-basic-types";
|
|
5
|
+
import { DateTime, minOPCUADate, StatusCodes } from "node-opcua-basic-types";
|
|
6
6
|
import { make_warningLog } from "node-opcua-debug";
|
|
7
7
|
import { NodeId } from "node-opcua-nodeid";
|
|
8
|
-
import { DataType, VariantOptions } from "node-opcua-variant";
|
|
8
|
+
import { DataType, Variant, VariantOptions } from "node-opcua-variant";
|
|
9
9
|
import { INamespace, UAObject, UAProperty } from "node-opcua-address-space-base";
|
|
10
10
|
import { ObjectTypeIds } from "node-opcua-constants";
|
|
11
11
|
import { makeAccessLevelExFlag } from "node-opcua-data-model";
|
|
@@ -16,97 +16,136 @@ import { UASystemOffNormalAlarmImpl } from "./ua_system_off_normal_alarm_impl";
|
|
|
16
16
|
|
|
17
17
|
const warningLog = make_warningLog("AlarmsAndConditions");
|
|
18
18
|
|
|
19
|
+
const ellipsis = (arg0: string, arg1 = 4) => {
|
|
20
|
+
arg1 = Math.max(arg1, 4);
|
|
21
|
+
return arg0.length <= arg1 ? arg0 : arg0.slice(0, arg1 / 2) + "..." + arg0.slice(arg0.length - arg1 / 2);
|
|
22
|
+
};
|
|
23
|
+
const d = (d: Date) => {
|
|
24
|
+
return d.toISOString();
|
|
25
|
+
};
|
|
19
26
|
export function instantiateCertificateExpirationAlarm(
|
|
20
27
|
namespace: INamespace,
|
|
21
28
|
alarmType: "CertificateExpirationAlarmType",
|
|
22
|
-
options: InstantiateOffNormalAlarmOptions
|
|
23
|
-
data?: Record<string, VariantOptions>
|
|
24
|
-
|
|
29
|
+
options: InstantiateOffNormalAlarmOptions
|
|
25
30
|
): UACertificateExpirationAlarmEx {
|
|
26
|
-
return UACertificateExpirationAlarmImpl.instantiate(namespace,alarmType, options
|
|
31
|
+
return UACertificateExpirationAlarmImpl.instantiate(namespace, alarmType, options);
|
|
27
32
|
}
|
|
28
33
|
|
|
29
|
-
|
|
30
34
|
interface UACertificateExpirationAlarmImpl {
|
|
31
|
-
expirationDate: UAProperty<Date, /*z*/DataType.DateTime>;
|
|
32
|
-
expirationLimit?: UAProperty<number, /*z*/DataType.Double>;
|
|
33
|
-
certificateType: UAProperty<NodeId, /*z*/DataType.NodeId>;
|
|
34
|
-
certificate: UAProperty<Buffer, /*z*/DataType.ByteString>;
|
|
35
|
+
expirationDate: UAProperty<Date, /*z*/ DataType.DateTime>;
|
|
36
|
+
expirationLimit?: UAProperty<number, /*z*/ DataType.Double>;
|
|
37
|
+
certificateType: UAProperty<NodeId, /*z*/ DataType.NodeId>;
|
|
38
|
+
certificate: UAProperty<Buffer, /*z*/ DataType.ByteString>;
|
|
35
39
|
}
|
|
40
|
+
|
|
41
|
+
// This Simple DataType is a Double that defines an interval of time in milliseconds (fractions can be used to define sub-millisecond values).
|
|
42
|
+
// Negative values are generally invalid but may have special meanings where the Duration is used.
|
|
43
|
+
export const OneDayDuration = 1000 * 60 * 60 * 24;
|
|
44
|
+
export const TwoWeeksDuration = OneDayDuration * 2 * 7;
|
|
45
|
+
|
|
36
46
|
/**
|
|
37
47
|
* This UACertificateExpirationAlarm (SystemOffNormalAlarmType) is raised by the Server when the Server’s
|
|
38
48
|
* Certificate is within the ExpirationLimit
|
|
39
49
|
* of expiration. This alarm automatically returns to normal when the certificate is updated.
|
|
40
50
|
*/
|
|
41
51
|
class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implements UACertificateExpirationAlarmEx {
|
|
42
|
-
|
|
52
|
+
private timer: any;
|
|
43
53
|
|
|
44
54
|
public static instantiate(
|
|
45
55
|
namespace: INamespace,
|
|
46
56
|
alarmType: "CertificateExpirationAlarmType",
|
|
47
|
-
options: InstantiateOffNormalAlarmOptions
|
|
48
|
-
data?: Record<string, VariantOptions>
|
|
57
|
+
options: InstantiateOffNormalAlarmOptions
|
|
58
|
+
// data?: Record<string, VariantOptions>
|
|
49
59
|
): UACertificateExpirationAlarmImpl {
|
|
50
60
|
const alarm = UASystemOffNormalAlarmImpl.instantiate(
|
|
51
61
|
namespace,
|
|
52
62
|
alarmType || "CertificateExpirationAlarmType",
|
|
53
|
-
options
|
|
54
|
-
data
|
|
63
|
+
options
|
|
64
|
+
// data
|
|
55
65
|
) as UACertificateExpirationAlarmImpl;
|
|
56
|
-
|
|
57
|
-
alarm._post_initialize();
|
|
66
|
+
promoteToCertificateExpirationAlarm(alarm);
|
|
58
67
|
return alarm;
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
public getExpirationDate(): DateTime {
|
|
70
|
+
public getExpirationDate(): DateTime | null {
|
|
62
71
|
return this.expirationDate.readValue().value.value;
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
public
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
public updateAlarmState2(isActive: boolean, severity: number, message: string) {
|
|
75
|
+
//xx console.log(`${message} ${severity} ${d(new Date())}`);
|
|
76
|
+
isActive ? this.activateAlarm() : this.deactivateAlarm();
|
|
77
|
+
|
|
78
|
+
this.raiseNewCondition({
|
|
79
|
+
message,
|
|
80
|
+
quality: StatusCodes.Good,
|
|
81
|
+
retain: isActive ? true : false,
|
|
82
|
+
severity
|
|
69
83
|
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public update() {
|
|
87
|
+
this._updateAlarm();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private _updateAlarm() {
|
|
91
|
+
const expirationDate = this.getExpirationDate();
|
|
92
|
+
|
|
70
93
|
const now = new Date();
|
|
94
|
+
|
|
71
95
|
const expirationLimit = this.getExpirationLimit();
|
|
72
96
|
|
|
73
97
|
const checkDate = new Date(now.getTime() + +expirationLimit);
|
|
74
98
|
|
|
75
|
-
const
|
|
99
|
+
const certificate = this.getCertificate();
|
|
76
100
|
|
|
77
|
-
if (expirationDate
|
|
78
|
-
if (!this.currentBranch().getActiveState()) {
|
|
79
|
-
|
|
80
|
-
`CertificateExpirationAlarm: becomes active, certificate ${thumbprint} endDate ${expirationDate.toUTCString()} checkDate=${checkDate.toUTCString()} expirationLimit=${expirationLimit}`
|
|
81
|
-
);
|
|
101
|
+
if (!expirationDate || (expirationDate === minOPCUADate && !certificate)) {
|
|
102
|
+
if (!this.currentBranch() || this.currentBranch().getActiveState()) {
|
|
103
|
+
this.updateAlarmState2(true, 255, "certificate is missing");
|
|
82
104
|
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const thumbprint = ellipsis(makeSHA1Thumbprint(this.getCertificate() || Buffer.alloc(0)).toString("hex"), 10);
|
|
109
|
+
const info = `| end date: ${d(expirationDate)} | expirationLimit=${expirationLimit}|`;
|
|
110
|
+
//
|
|
111
|
+
|
|
112
|
+
if (expirationDate.getTime() <= checkDate.getTime()) {
|
|
83
113
|
// also raise the event
|
|
84
114
|
if (expirationDate.getTime() <= now.getTime()) {
|
|
85
|
-
this.
|
|
86
|
-
true,
|
|
87
|
-
`certificate ${thumbprint} has expired : end date is ${expirationDate.toUTCString()} checkDate=${checkDate.toUTCString()} expirationLimit=${expirationLimit}`
|
|
88
|
-
);
|
|
115
|
+
this.updateAlarmState2(true, 250, `certificate ${thumbprint} has expired ${info}`);
|
|
89
116
|
} else {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
117
|
+
// check--------------------+
|
|
118
|
+
// expiry---------------+ |
|
|
119
|
+
// today-----+ | |
|
|
120
|
+
// v v v
|
|
121
|
+
// ----------------+----------+---------+----------+
|
|
122
|
+
const t1 = checkDate.getTime() - now.getTime();
|
|
123
|
+
const t2 = checkDate.getTime() - expirationDate.getTime();
|
|
124
|
+
const severity = t1 === 0 ? 255 : Math.floor((t2 / t1) * 100) + 100;
|
|
125
|
+
this.updateAlarmState2(true, severity, `certificate ${thumbprint} is about to expire ${info}`);
|
|
94
126
|
}
|
|
95
127
|
} else {
|
|
96
|
-
|
|
97
|
-
warningLog(
|
|
98
|
-
`CertificateExpirationAlarm: becomes desactivated, certificate ${thumbprint} endDate ${expirationDate.toUTCString()} expirationLimit=${expirationLimit}`
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
// also raise the event
|
|
102
|
-
this.updateAlarmState(
|
|
103
|
-
false,
|
|
104
|
-
`certificate ${thumbprint} end date is OK: ${expirationDate.toString()} , expirationLimit=${expirationLimit}`
|
|
105
|
-
);
|
|
128
|
+
this.updateAlarmState2(false, 0, `certificate ${thumbprint} is OK! ${info}`);
|
|
106
129
|
}
|
|
107
130
|
}
|
|
108
131
|
|
|
132
|
+
public setExpirationDate(expirationDate: Date): void {
|
|
133
|
+
this.expirationDate.setValueFromSource({
|
|
134
|
+
dataType: DataType.DateTime,
|
|
135
|
+
value: expirationDate
|
|
136
|
+
});
|
|
137
|
+
this._updateAlarm();
|
|
138
|
+
}
|
|
139
|
+
|
|
109
140
|
public getExpirationLimit(): number {
|
|
141
|
+
// This shall be a positive number. If the property is not provided, a default of 2 weeks shall be used.
|
|
142
|
+
if (!this.expirationLimit) {
|
|
143
|
+
return TwoWeeksDuration;
|
|
144
|
+
}
|
|
145
|
+
const dataValue = this.expirationLimit!.readValue();
|
|
146
|
+
if ((dataValue as any).dataType === DataType.Null) {
|
|
147
|
+
return TwoWeeksDuration;
|
|
148
|
+
}
|
|
110
149
|
return (this.expirationLimit?.readValue().value.value as number) || 0;
|
|
111
150
|
}
|
|
112
151
|
|
|
@@ -115,13 +154,14 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
|
|
|
115
154
|
dataType: DataType.Double,
|
|
116
155
|
value
|
|
117
156
|
});
|
|
157
|
+
this._updateAlarm();
|
|
118
158
|
}
|
|
119
159
|
|
|
120
160
|
public getCertificate(): Certificate | null {
|
|
121
161
|
return (this.certificate.readValue().value.value as Certificate | null) || null;
|
|
122
162
|
}
|
|
123
163
|
|
|
124
|
-
|
|
164
|
+
private _extractAndSetExpiryDate(certificate: Certificate | null): void {
|
|
125
165
|
if (certificate && certificate.length > 0) {
|
|
126
166
|
const info = exploreCertificate(certificate);
|
|
127
167
|
if (info.tbsCertificate.validity.notAfter instanceof Date) {
|
|
@@ -132,12 +172,22 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
|
|
|
132
172
|
} else {
|
|
133
173
|
this.setExpirationDate(minOPCUADate);
|
|
134
174
|
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
public setCertificate(certificate: Certificate | null): void {
|
|
135
178
|
this.certificate.setValueFromSource({
|
|
136
179
|
dataType: DataType.ByteString,
|
|
137
180
|
value: certificate
|
|
138
181
|
});
|
|
182
|
+
this._extractAndSetExpiryDate(certificate);
|
|
139
183
|
}
|
|
140
184
|
|
|
185
|
+
stopTimer() {
|
|
186
|
+
if (this.timer) {
|
|
187
|
+
clearInterval(this.timer);
|
|
188
|
+
this.timer = null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
141
191
|
_post_initialize() {
|
|
142
192
|
if (this.expirationLimit) {
|
|
143
193
|
this.expirationLimit.accessLevel = makeAccessLevelExFlag("CurrentRead | CurrentWrite");
|
|
@@ -148,6 +198,13 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
|
|
|
148
198
|
this.setCertificate(certificate);
|
|
149
199
|
});
|
|
150
200
|
}
|
|
201
|
+
const certificate = this.getCertificate();
|
|
202
|
+
this._extractAndSetExpiryDate(certificate);
|
|
203
|
+
|
|
204
|
+
this.addressSpace.registerShutdownTask(() => {
|
|
205
|
+
this.stopTimer();
|
|
206
|
+
});
|
|
207
|
+
this.timer = setInterval(() => this.update(), OneDayDuration / 48);
|
|
151
208
|
}
|
|
152
209
|
}
|
|
153
210
|
|
|
@@ -160,4 +217,4 @@ export function promoteToCertificateExpirationAlarm(node: UAObject): UACertifica
|
|
|
160
217
|
_node._post_initialize();
|
|
161
218
|
return _node;
|
|
162
219
|
}
|
|
163
|
-
registerNodePromoter(ObjectTypeIds.CertificateExpirationAlarmType, promoteToCertificateExpirationAlarm);
|
|
220
|
+
registerNodePromoter(ObjectTypeIds.CertificateExpirationAlarmType, promoteToCertificateExpirationAlarm, true);
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
QualifiedName
|
|
19
19
|
} from "node-opcua-data-model";
|
|
20
20
|
import { DataValue } from "node-opcua-data-value";
|
|
21
|
-
import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
|
|
21
|
+
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
22
22
|
import { minDate } from "node-opcua-basic-types";
|
|
23
23
|
import { coerceNodeId, makeNodeId, NodeId, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
24
24
|
import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
@@ -52,6 +52,7 @@ import { ConditionSnapshotImpl } from "./condition_snapshot_impl";
|
|
|
52
52
|
const debugLog = make_debugLog(__filename);
|
|
53
53
|
const errorLog = make_errorLog(__filename);
|
|
54
54
|
const doDebug = checkDebugFlag(__filename);
|
|
55
|
+
const warningLog = make_warningLog(__filename);
|
|
55
56
|
|
|
56
57
|
export declare interface UAConditionImpl extends UAConditionEx, UABaseEventImpl {
|
|
57
58
|
on(eventName: string, eventHandler: any): this;
|
|
@@ -450,6 +451,8 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
|
|
|
450
451
|
node._bubble_up_event(eventData);
|
|
451
452
|
}
|
|
452
453
|
}
|
|
454
|
+
} else {
|
|
455
|
+
warningLog("Condition ", this.nodeId.toString(), "is not linked to a Object with a IsConditionOf(reversed(HasCondition))");
|
|
453
456
|
}
|
|
454
457
|
// xx console.log("MMMMMMMM%%%%%%%%%%%%%%%%%%%%% branch " +
|
|
455
458
|
// branch.getBranchId().toString() + " eventId = " + branch.getEventId().toString("hex"));
|
|
@@ -104,7 +104,7 @@ export class UAExclusiveLimitAlarmImpl extends UALimitAlarmImpl implements UAExc
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
if (state !== oldState) {
|
|
107
|
-
this._signalNewCondition(state, isActive, value.
|
|
107
|
+
this._signalNewCondition(state, isActive, value.toFixed(3));
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -106,7 +106,7 @@ export class UANonExclusiveLimitAlarmImpl extends UALimitAlarmImpl implements UA
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
public _calculateConditionInfo(
|
|
109
|
-
|
|
109
|
+
state: string | null,
|
|
110
110
|
isActive: boolean,
|
|
111
111
|
value: string,
|
|
112
112
|
oldConditionInfo: ConditionInfo
|
|
@@ -120,7 +120,7 @@ export class UANonExclusiveLimitAlarmImpl extends UALimitAlarmImpl implements UA
|
|
|
120
120
|
});
|
|
121
121
|
} else {
|
|
122
122
|
return new ConditionInfoImpl({
|
|
123
|
-
message: "Condition
|
|
123
|
+
message: "Condition is " + value + " and state is " + state,
|
|
124
124
|
quality: StatusCodes.Good,
|
|
125
125
|
retain: true,
|
|
126
126
|
severity: 150
|
|
@@ -196,7 +196,7 @@ export class UANonExclusiveLimitAlarmImpl extends UALimitAlarmImpl implements UA
|
|
|
196
196
|
});
|
|
197
197
|
|
|
198
198
|
if (count > 0) {
|
|
199
|
-
this._signalNewCondition2(states, isActive, value.
|
|
199
|
+
this._signalNewCondition2(states, isActive, value.toFixed(3));
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-address-space.AlarmsAndConditions
|
|
3
3
|
*/
|
|
4
|
-
import { INamespace, UAVariable } from "node-opcua-address-space-base";
|
|
4
|
+
import { INamespace, UAVariable, UAVariableT } from "node-opcua-address-space-base";
|
|
5
5
|
import { assert } from "node-opcua-assert";
|
|
6
6
|
import { DataValue } from "node-opcua-data-value";
|
|
7
7
|
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
8
|
+
|
|
8
9
|
import { UAOffNormalAlarm_Base } from "node-opcua-nodeset-ua";
|
|
10
|
+
import { NumericalRangeInvalid } from "node-opcua-numeric-range";
|
|
9
11
|
import { StatusCodes } from "node-opcua-status-code";
|
|
10
12
|
import * as utils from "node-opcua-utils";
|
|
11
13
|
import { DataType, VariantOptions } from "node-opcua-variant";
|
|
@@ -32,11 +34,11 @@ export declare interface UAOffNormalAlarmEx
|
|
|
32
34
|
| "suppressedState"
|
|
33
35
|
>,
|
|
34
36
|
UADiscreteAlarmEx {
|
|
35
|
-
getNormalStateNode():
|
|
37
|
+
getNormalStateNode(): UAVariableT<NodeId, DataType.NodeId> | null;
|
|
36
38
|
|
|
37
|
-
getNormalStateValue():
|
|
39
|
+
getNormalStateValue(): NodeId | null;
|
|
38
40
|
|
|
39
|
-
setNormalStateValue(value:
|
|
41
|
+
setNormalStateValue(value: NodeIdLike): void;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export declare interface UAOffNormalAlarmImpl extends UAOffNormalAlarmEx, UADiscreteAlarmImpl {
|
|
@@ -53,7 +55,7 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
53
55
|
* When the value of inputNode doesn't match the normalState node value, then the alarm is raised.
|
|
54
56
|
*
|
|
55
57
|
*/
|
|
56
|
-
public static instantiate(
|
|
58
|
+
public static instantiate<T, DT extends DataType>(
|
|
57
59
|
namespace: INamespace,
|
|
58
60
|
limitAlarmTypeId: string | NodeId,
|
|
59
61
|
options: InstantiateOffNormalAlarmOptions,
|
|
@@ -136,9 +138,9 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
136
138
|
// Property the Alarm is Active. If this Variable is not in the AddressSpace, a Null NodeId shall
|
|
137
139
|
// be provided.
|
|
138
140
|
|
|
139
|
-
public getNormalStateNode():
|
|
141
|
+
public getNormalStateNode(): UAVariableT<NodeId, DataType.NodeId> | null {
|
|
140
142
|
const nodeId = this.normalState.readValue().value.value;
|
|
141
|
-
const node = this.addressSpace.findNode(nodeId) as
|
|
143
|
+
const node = this.addressSpace.findNode(nodeId) as UAVariableT<NodeId, DataType.NodeId>;
|
|
142
144
|
if (!node) {
|
|
143
145
|
return null;
|
|
144
146
|
}
|
|
@@ -148,19 +150,19 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
148
150
|
/**
|
|
149
151
|
* @method getNormalStateValue
|
|
150
152
|
*/
|
|
151
|
-
public getNormalStateValue():
|
|
153
|
+
public getNormalStateValue(): NodeId | null {
|
|
152
154
|
const normalStateNode = this.getNormalStateNode();
|
|
153
155
|
if (!normalStateNode) {
|
|
154
156
|
return null;
|
|
155
157
|
}
|
|
156
|
-
return normalStateNode.readValue().value.value;
|
|
158
|
+
return normalStateNode.readValue().value.value as NodeId;
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
/**
|
|
160
162
|
* @method setNormalStateValue
|
|
161
163
|
* @param value
|
|
162
164
|
*/
|
|
163
|
-
public setNormalStateValue(value:
|
|
165
|
+
public setNormalStateValue(value: NodeIdLike): void {
|
|
164
166
|
const normalStateNode = this.getNormalStateNode();
|
|
165
167
|
throw new Error("Not Implemented yet");
|
|
166
168
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { INamespace } from "node-opcua-address-space-base";
|
|
5
5
|
import { NodeId } from "node-opcua-nodeid";
|
|
6
|
-
import { VariantOptions } from "node-opcua-variant";
|
|
6
|
+
import { DataType, VariantOptions } from "node-opcua-variant";
|
|
7
7
|
import { InstantiateOffNormalAlarmOptions } from "../../source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options";
|
|
8
8
|
import { UAOffNormalAlarmImpl } from "./ua_off_normal_alarm_impl";
|
|
9
9
|
|
|
@@ -5,14 +5,13 @@ import { assert } from "node-opcua-assert";
|
|
|
5
5
|
|
|
6
6
|
import { VariableTypeIds } from "node-opcua-constants";
|
|
7
7
|
import { BrowseDirection, coerceLocalizedText, LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
8
|
-
import { DataValueT
|
|
8
|
+
import { DataValueT } from "node-opcua-data-value";
|
|
9
9
|
import { NodeId, resolveNodeId } from "node-opcua-nodeid";
|
|
10
10
|
import { sameNodeId } from "node-opcua-nodeid";
|
|
11
11
|
import { StatusCodes, StatusCode, StatusCodeCallback } from "node-opcua-status-code";
|
|
12
12
|
import { Variant, VariantLike, VariantT } from "node-opcua-variant";
|
|
13
13
|
import { DataType } from "node-opcua-variant";
|
|
14
14
|
import { BaseNode, BindVariableOptions, INamespace, UAReference, UAVariable, ISessionContext } from "node-opcua-address-space-base";
|
|
15
|
-
import { UATwoStateVariable } from "node-opcua-nodeset-ua";
|
|
16
15
|
import { NumericRange } from "node-opcua-numeric-range";
|
|
17
16
|
import { QualifiedNameLike } from "node-opcua-data-model";
|
|
18
17
|
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SimpleAttributeOperand } from "node-opcua-service-filter";
|
|
2
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
3
|
-
import { BaseNode, UAObjectType } from "node-opcua-address-space-base";
|
|
4
|
-
/**
|
|
5
|
-
* @method checkSelectClause
|
|
6
|
-
* @param parentNode
|
|
7
|
-
* @param selectClause
|
|
8
|
-
* @return {Array<StatusCode>}
|
|
9
|
-
*/
|
|
10
|
-
export declare function checkSelectClause(parentNode: BaseNode, selectClause: SimpleAttributeOperand): StatusCode;
|
|
11
|
-
/**
|
|
12
|
-
* @method checkSelectClauses
|
|
13
|
-
* @param eventTypeNode
|
|
14
|
-
* @param selectClauses
|
|
15
|
-
* @return an array of StatusCode
|
|
16
|
-
*/
|
|
17
|
-
export declare function checkSelectClauses(eventTypeNode: UAObjectType, selectClauses: SimpleAttributeOperand[]): StatusCode[];
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkSelectClauses = exports.checkSelectClause = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-address-space
|
|
6
|
-
*/
|
|
7
|
-
// tslint:disable:no-console
|
|
8
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
9
|
-
const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path");
|
|
10
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
11
|
-
/**
|
|
12
|
-
* @method checkSelectClause
|
|
13
|
-
* @param parentNode
|
|
14
|
-
* @param selectClause
|
|
15
|
-
* @return {Array<StatusCode>}
|
|
16
|
-
*/
|
|
17
|
-
function checkSelectClause(parentNode, selectClause) {
|
|
18
|
-
//
|
|
19
|
-
const addressSpace = parentNode.addressSpace;
|
|
20
|
-
// istanbul ignore next
|
|
21
|
-
if (selectClause.typeDefinitionId.isEmpty()) {
|
|
22
|
-
return node_opcua_status_code_1.StatusCodes.Good;
|
|
23
|
-
}
|
|
24
|
-
const eventTypeNode = addressSpace.findEventType(selectClause.typeDefinitionId);
|
|
25
|
-
if (!eventTypeNode || !(eventTypeNode.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType)) {
|
|
26
|
-
// xx console.log("eventTypeNode = ",selectClause.typeDefinitionId.toString());
|
|
27
|
-
// xx console.log("eventTypeNode = ",eventTypeNode);
|
|
28
|
-
// istanbul ignore next
|
|
29
|
-
if (eventTypeNode) {
|
|
30
|
-
console.log(eventTypeNode.toString());
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// istanbul ignore next
|
|
34
|
-
if (eventTypeNode.nodeClass !== node_opcua_data_model_1.NodeClass.ObjectType) {
|
|
35
|
-
throw new Error("Expecting a ObjectType");
|
|
36
|
-
}
|
|
37
|
-
// navigate to the innerNode specified by the browsePath [ QualifiedName]
|
|
38
|
-
const browsePath = (0, node_opcua_service_translate_browse_path_1.constructBrowsePathFromQualifiedName)(eventTypeNode, selectClause.browsePath);
|
|
39
|
-
const browsePathResult = addressSpace.browsePath(browsePath);
|
|
40
|
-
return browsePathResult.statusCode;
|
|
41
|
-
}
|
|
42
|
-
exports.checkSelectClause = checkSelectClause;
|
|
43
|
-
/**
|
|
44
|
-
* @method checkSelectClauses
|
|
45
|
-
* @param eventTypeNode
|
|
46
|
-
* @param selectClauses
|
|
47
|
-
* @return an array of StatusCode
|
|
48
|
-
*/
|
|
49
|
-
function checkSelectClauses(eventTypeNode, selectClauses) {
|
|
50
|
-
return selectClauses.map(checkSelectClause.bind(null, eventTypeNode));
|
|
51
|
-
}
|
|
52
|
-
exports.checkSelectClauses = checkSelectClauses;
|
|
53
|
-
//# sourceMappingURL=check_event_clause.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check_event_clause.js","sourceRoot":"","sources":["../../../source/helpers/check_event_clause.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,4BAA4B;AAC5B,iEAAkD;AAElD,uGAAgG;AAChG,mEAAiE;AAGjE;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,UAAoB,EAAE,YAAoC;IACxF,EAAE;IACF,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;IAE7C,uBAAuB;IACvB,IAAI,YAAY,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE;QACzC,OAAO,oCAAW,CAAC,IAAI,CAAC;KAC3B;IACD,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAC;IAEjF,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,SAAS,KAAK,iCAAS,CAAC,UAAU,CAAC,EAAE;QACvE,+EAA+E;QAC/E,oDAAoD;QACpD,uBAAuB;QACvB,IAAI,aAAa,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;SACzC;KACJ;IAED,uBAAuB;IACvB,IAAI,aAAa,CAAC,SAAS,KAAK,iCAAS,CAAC,UAAU,EAAE;QAClD,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;KAC7C;IAED,yEAAyE;IACzE,MAAM,UAAU,GAAG,IAAA,+EAAoC,EAAC,aAAa,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAChG,MAAM,gBAAgB,GAAG,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC7D,OAAO,gBAAgB,CAAC,UAAU,CAAC;AACvC,CAAC;AA5BD,8CA4BC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,aAA2B,EAAE,aAAuC;IACnG,OAAO,aAAa,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;AAC1E,CAAC;AAFD,gDAEC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ContentFilter } from "node-opcua-types";
|
|
2
|
-
import { IAddressSpace, IEventData, ISessionContext } from "node-opcua-address-space-base";
|
|
3
|
-
export declare function __checkWhereClause(addressSpace: IAddressSpace, sessionContext: ISessionContext, whereClause: ContentFilter, index: number, eventData: IEventData): boolean;
|
|
4
|
-
export declare function checkWhereClause(addressSpace: IAddressSpace, sessionContext: ISessionContext, whereClause: ContentFilter, eventData: IEventData): boolean;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkWhereClause = exports.__checkWhereClause = void 0;
|
|
4
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
5
|
-
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
6
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
7
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
8
|
-
const session_context_1 = require("../../source/session_context");
|
|
9
|
-
const extract_event_fields_1 = require("./extract_event_fields");
|
|
10
|
-
function checkNot(addressSpace, sessionContext, whereClause, eventData, filteredOperands) {
|
|
11
|
-
if (filteredOperands[0] instanceof node_opcua_types_1.ElementOperand) {
|
|
12
|
-
const index = filteredOperands[0].index;
|
|
13
|
-
return !__checkWhereClause(addressSpace, sessionContext, whereClause, index, eventData);
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
function checkOfType(addressSpace, ofType, eventData) {
|
|
18
|
-
var _a;
|
|
19
|
-
// istanbul ignore next
|
|
20
|
-
if (!ofType) {
|
|
21
|
-
throw new Error("invalid operand");
|
|
22
|
-
}
|
|
23
|
-
// istanbul ignore next
|
|
24
|
-
if (ofType.value.dataType !== node_opcua_variant_1.DataType.NodeId) {
|
|
25
|
-
throw new Error("invalid operand type (expecting Nodeid");
|
|
26
|
-
}
|
|
27
|
-
const ofTypeNode = addressSpace.findNode(ofType.value.value);
|
|
28
|
-
// istanbul ignore next
|
|
29
|
-
if (!ofTypeNode) {
|
|
30
|
-
return false; // the ofType node is not known, we don't know what to do
|
|
31
|
-
}
|
|
32
|
-
// istanbul ignore next
|
|
33
|
-
if (ofTypeNode.nodeClass !== node_opcua_data_model_1.NodeClass.ObjectType) {
|
|
34
|
-
throw new Error("operand should be a ObjectType " + ofTypeNode.nodeId.toString());
|
|
35
|
-
}
|
|
36
|
-
const node = eventData.$eventDataSource;
|
|
37
|
-
if (!node) {
|
|
38
|
-
throw new Error("cannot find node " + ((_a = eventData.$eventDataSource) === null || _a === void 0 ? void 0 : _a.toString()));
|
|
39
|
-
}
|
|
40
|
-
if (node.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType) {
|
|
41
|
-
return node.isSupertypeOf(ofTypeNode);
|
|
42
|
-
}
|
|
43
|
-
if (node.nodeClass === node_opcua_data_model_1.NodeClass.Object && node.typeDefinitionObj) {
|
|
44
|
-
return node.typeDefinitionObj.isSupertypeOf(ofTypeNode);
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
function _extractValue(operand, eventData) {
|
|
49
|
-
// eventData.readValue;
|
|
50
|
-
const v = (0, extract_event_fields_1.extractEventFields)(session_context_1.SessionContext.defaultContext, [operand], eventData)[0];
|
|
51
|
-
return v.value;
|
|
52
|
-
}
|
|
53
|
-
function checkInList(addressSpace, filterOperands, eventData) {
|
|
54
|
-
const operand0 = filterOperands[0];
|
|
55
|
-
if (!(operand0 instanceof node_opcua_types_1.SimpleAttributeOperand)) {
|
|
56
|
-
// unsupported case
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
const nodeId = _extractValue(operand0, eventData);
|
|
60
|
-
if (!nodeId) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
function _is(nodeId1, operandX) {
|
|
64
|
-
const operandNode = addressSpace.findNode(operandX.value.value);
|
|
65
|
-
if (!operandNode) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return (0, node_opcua_nodeid_1.sameNodeId)(nodeId1, operandNode.nodeId);
|
|
69
|
-
}
|
|
70
|
-
for (let i = 1; i < filterOperands.length; i++) {
|
|
71
|
-
const filterOperand = filterOperands[i];
|
|
72
|
-
if (filterOperand instanceof node_opcua_types_1.LiteralOperand && _is(nodeId, filterOperand)) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
function __checkWhereClause(addressSpace, sessionContext, whereClause, index, eventData) {
|
|
79
|
-
if (!whereClause.elements || whereClause.elements.length === 0) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
const element = whereClause.elements[index];
|
|
83
|
-
if (!element) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
switch (element.filterOperator) {
|
|
87
|
-
case node_opcua_types_1.FilterOperator.Not:
|
|
88
|
-
return checkNot(addressSpace, sessionContext, whereClause, eventData, element.filterOperands);
|
|
89
|
-
case node_opcua_types_1.FilterOperator.OfType:
|
|
90
|
-
return checkOfType(addressSpace, element.filterOperands[0], eventData);
|
|
91
|
-
case node_opcua_types_1.FilterOperator.InList:
|
|
92
|
-
return checkInList(addressSpace, element.filterOperands, eventData);
|
|
93
|
-
default:
|
|
94
|
-
// from Spec OPC Unified Architecture, Part 4 133 Release 1.04
|
|
95
|
-
// Any basic FilterOperator in Table 119 may be used in the whereClause, however, only the
|
|
96
|
-
// OfType_14 FilterOperator from Table 120 is permitted.
|
|
97
|
-
// tslint:disable-next-line: no-console
|
|
98
|
-
console.log("whereClause = ", whereClause.toString());
|
|
99
|
-
throw new Error("Only OfType operator are allowed in checkWhereClause");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.__checkWhereClause = __checkWhereClause;
|
|
103
|
-
function checkWhereClause(addressSpace, sessionContext, whereClause, eventData) {
|
|
104
|
-
if (!whereClause.elements || whereClause.elements.length === 0) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
return __checkWhereClause(addressSpace, sessionContext, whereClause, 0, eventData);
|
|
108
|
-
}
|
|
109
|
-
exports.checkWhereClause = checkWhereClause;
|
|
110
|
-
//# sourceMappingURL=check_where_clause.js.map
|