node-opcua-address-space 2.74.0 → 2.76.1
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 -257
- package/dist/source/helpers/argument_list.js.map +1 -1
- 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 -73
- package/dist/source/helpers/multiform_func.js.map +1 -1
- 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 -58
- package/dist/source/index.js +83 -87
- package/dist/source/index.js.map +1 -1
- 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 -199
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js +2 -9
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +12 -14
- 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 -6
- 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 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +1 -0
- 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 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +4 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +20 -5
- 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 -10
- 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 -24
- 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 -1387
- package/dist/src/address_space.js.map +1 -1
- 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 -231
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +657 -666
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +9 -8
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +61 -46
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/src/alarms_and_conditions/index.d.ts +16 -18
- package/dist/src/alarms_and_conditions/index.js +32 -34
- package/dist/src/alarms_and_conditions/index.js.map +1 -1
- 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 -26
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +56 -56
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
- 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_limit_alarm_impl.js.map +1 -1
- 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_deviation_alarm_impl.js.map +1 -1
- 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 -161
- 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 -29
- package/dist/src/event_data.js +64 -95
- package/dist/src/event_data.js.map +1 -1
- 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 -44
- package/dist/src/index_current.js +74 -75
- package/dist/src/index_current.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +461 -458
- package/dist/src/namespace_impl.js +1732 -1732
- package/dist/src/namespace_impl.js.map +1 -1
- 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 -162
- package/dist/src/ua_object_impl.js.map +1 -1
- 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 -114
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -1
- 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 -37
- package/source/helpers/argument_list.ts +2 -0
- package/source/helpers/multiform_func.ts +5 -3
- package/source/index.ts +0 -2
- package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +12 -30
- package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +8 -6
- package/source/interfaces/alarms_and_conditions/install_setpoint_options.ts +9 -0
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +4 -0
- package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +4 -0
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +4 -0
- package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +16 -1
- package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +5 -0
- package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +1 -0
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +1 -2
- package/source/loader/namespace_post_step.ts +26 -3
- package/source/loader/register_node_promoter.ts +5 -4
- package/source/namespace_alarm_and_condition.ts +48 -23
- package/src/address_space.ts +22 -16
- package/src/alarms_and_conditions/condition.ts +1 -1
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +95 -102
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +33 -18
- package/src/alarms_and_conditions/index.ts +0 -2
- 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 +9 -6
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +5 -6
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +6 -8
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +5 -3
- 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 +30 -26
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +1 -1
- package/src/event_data.ts +47 -77
- package/src/index_current.ts +0 -1
- package/src/namespace_impl.ts +47 -26
- package/src/state_machine/ua_two_state_variable.ts +2 -3
- package/src/ua_object_impl.ts +1 -2
- package/test_helpers/add_event_generator_object.ts +0 -1
- package/test_helpers/alarms_and_conditions_demo.ts +4 -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
- package/source/helpers/check_event_clause.ts +0 -55
- package/src/alarms_and_conditions/check_where_clause.ts +0 -147
- package/src/alarms_and_conditions/extract_event_fields.ts +0 -103
|
@@ -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"));
|
|
@@ -1123,11 +1126,11 @@ function _add_comment_method(
|
|
|
1123
1126
|
callback: CallbackT<CallMethodResultOptions>
|
|
1124
1127
|
) {
|
|
1125
1128
|
//
|
|
1126
|
-
// The AddComment Method is used to apply a comment to a specific state of a Condition
|
|
1127
|
-
// instance. Normally, the NodeId of the
|
|
1128
|
-
// Service. However, some Servers do not expose Condition instances in the AddressSpace.
|
|
1129
|
-
// Therefore all Servers shall also allow Clients to call the AddComment Method by specifying
|
|
1130
|
-
// ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the
|
|
1129
|
+
// The AddComment Method is used to apply a comment to a specific state of a Condition
|
|
1130
|
+
// instance. Normally, the NodeId of the Object instance is passed as the ObjectId to the Call
|
|
1131
|
+
// Service. However, some Servers do not expose Condition instances in the AddressSpace.
|
|
1132
|
+
// Therefore, all Servers shall also allow Clients to call the AddComment Method by specifying
|
|
1133
|
+
// ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the
|
|
1131
1134
|
// ConditionType Node.
|
|
1132
1135
|
// Signature
|
|
1133
1136
|
// - EventId EventId identifying a particular Event Notification where a state was reported for a
|
|
@@ -5,13 +5,12 @@ import { assert } from "node-opcua-assert";
|
|
|
5
5
|
import { DataValue } from "node-opcua-data-value";
|
|
6
6
|
import { NodeId } from "node-opcua-nodeid";
|
|
7
7
|
import { DataType, VariantOptions } from "node-opcua-variant";
|
|
8
|
-
import { UAExclusiveDeviationAlarm_Base } from "node-opcua-nodeset-ua";
|
|
9
8
|
import { UAVariable, UAVariableT } from "node-opcua-address-space-base";
|
|
10
9
|
import { AddressSpace } from "../address_space";
|
|
11
10
|
import { NamespacePrivate } from "../namespace_private";
|
|
12
11
|
import { UAExclusiveDeviationAlarmEx } from "../../source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex";
|
|
13
12
|
import { InstantiateExclusiveLimitAlarmOptions } from "../../source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options";
|
|
14
|
-
import { InstallSetPointOptions } from "../../source/interfaces/alarms_and_conditions/install_setpoint_options";
|
|
13
|
+
import { InstallSetPointOptions, SetPointSupport } from "../../source/interfaces/alarms_and_conditions/install_setpoint_options";
|
|
15
14
|
import {
|
|
16
15
|
DeviationAlarmHelper_getSetpointNodeNode,
|
|
17
16
|
DeviationAlarmHelper_getSetpointValue,
|
|
@@ -30,6 +29,8 @@ export declare interface UAExclusiveDeviationAlarmImpl extends UAExclusiveDeviat
|
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
export class UAExclusiveDeviationAlarmImpl extends UAExclusiveLimitAlarmImpl implements UAExclusiveDeviationAlarmEx {
|
|
32
|
+
|
|
33
|
+
|
|
33
34
|
public static instantiate(
|
|
34
35
|
namespace: NamespacePrivate,
|
|
35
36
|
type: string | NodeId,
|
|
@@ -57,7 +58,7 @@ export class UAExclusiveDeviationAlarmImpl extends UAExclusiveLimitAlarmImpl imp
|
|
|
57
58
|
return alarm;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
public getSetpointNodeNode():
|
|
61
|
+
public getSetpointNodeNode(): UAVariableT<number, DataType.Double> | UAVariableT<number, DataType.Float> | undefined {
|
|
61
62
|
return DeviationAlarmHelper_getSetpointNodeNode.call(this);
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -83,9 +84,7 @@ export class UAExclusiveDeviationAlarmImpl extends UAExclusiveLimitAlarmImpl imp
|
|
|
83
84
|
UAExclusiveLimitAlarmImpl.prototype._setStateBasedOnInputValue.call(this, value - setpointValue);
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
export interface UAExclusiveDeviationAlarmHelper {
|
|
87
|
-
setpointNode: UAVariableT<NodeId, DataType.NodeId>;
|
|
88
|
-
setpointNodeNode: UAVariable;
|
|
87
|
+
export interface UAExclusiveDeviationAlarmHelper extends SetPointSupport{
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
/*
|
|
@@ -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
|
}
|
|
@@ -14,9 +14,7 @@ import { UAShelvedStateMachineEx } from "../../source";
|
|
|
14
14
|
import { InstantiateLimitAlarmOptions } from "../../source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options";
|
|
15
15
|
import { UALimitAlarmEx } from "../../source/interfaces/alarms_and_conditions/ua_limit_alarm_ex";
|
|
16
16
|
import { NamespacePrivate } from "../namespace_private";
|
|
17
|
-
import {
|
|
18
|
-
UAAlarmConditionImpl
|
|
19
|
-
} from "./ua_alarm_condition_impl";
|
|
17
|
+
import { UAAlarmConditionImpl } from "./ua_alarm_condition_impl";
|
|
20
18
|
|
|
21
19
|
const warningLog = make_warningLog("AlarmsAndConditions");
|
|
22
20
|
|
|
@@ -35,11 +33,11 @@ const uaLimitAlarmInputSupportedDataType: DataType[] = [
|
|
|
35
33
|
DataType.UInt32
|
|
36
34
|
];
|
|
37
35
|
|
|
38
|
-
export interface UALimitAlarmImpl extends UALimitAlarmEx
|
|
36
|
+
export interface UALimitAlarmImpl extends UALimitAlarmEx {
|
|
39
37
|
shelvingState?: UAShelvedStateMachineEx;
|
|
40
38
|
}
|
|
41
39
|
export class UALimitAlarmImpl extends UAAlarmConditionImpl implements UALimitAlarmEx {
|
|
42
|
-
|
|
40
|
+
/**
|
|
43
41
|
* @method (static)UALimitAlarm.instantiate
|
|
44
42
|
* @param namespace {INamespace}
|
|
45
43
|
* @param limitAlarmTypeId
|
|
@@ -127,8 +125,8 @@ export class UALimitAlarmImpl extends UAAlarmConditionImpl implements UALimitAla
|
|
|
127
125
|
throw new Error(message);
|
|
128
126
|
}
|
|
129
127
|
|
|
130
|
-
if (Object.prototype.hasOwnProperty.call(options, "highHighLimit")) {
|
|
131
|
-
alarmNode.setHighHighLimit(options.highHighLimit);
|
|
128
|
+
if (Object.prototype.hasOwnProperty.call(options, "highHighLimit") && options.highHighLimit !== undefined) {
|
|
129
|
+
alarmNode.setHighHighLimit(options.highHighLimit!);
|
|
132
130
|
}
|
|
133
131
|
if (Object.prototype.hasOwnProperty.call(options, "highLimit")) {
|
|
134
132
|
alarmNode.setHighLimit(options.highLimit);
|
|
@@ -136,7 +134,7 @@ export class UALimitAlarmImpl extends UAAlarmConditionImpl implements UALimitAla
|
|
|
136
134
|
if (Object.prototype.hasOwnProperty.call(options, "lowLimit")) {
|
|
137
135
|
alarmNode.setLowLimit(options.lowLimit);
|
|
138
136
|
}
|
|
139
|
-
if (Object.prototype.hasOwnProperty.call(options, "lowLowLimit")) {
|
|
137
|
+
if (Object.prototype.hasOwnProperty.call(options, "lowLowLimit") && options.lowLowLimit != undefined) {
|
|
140
138
|
alarmNode.setLowLowLimit(options.lowLowLimit);
|
|
141
139
|
}
|
|
142
140
|
|
|
@@ -6,8 +6,8 @@ import { assert } from "node-opcua-assert";
|
|
|
6
6
|
|
|
7
7
|
import { DataValue } from "node-opcua-data-value";
|
|
8
8
|
import { NodeId } from "node-opcua-nodeid";
|
|
9
|
-
import { VariantOptions } from "node-opcua-variant";
|
|
10
|
-
import { UAVariable } from "node-opcua-address-space-base";
|
|
9
|
+
import { DataType, VariantOptions } from "node-opcua-variant";
|
|
10
|
+
import { UAVariable, UAVariableT } from "node-opcua-address-space-base";
|
|
11
11
|
import { NamespacePrivate } from "../namespace_private";
|
|
12
12
|
import { AddressSpace } from "../address_space";
|
|
13
13
|
import { InstantiateLimitAlarmOptions } from "../../source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options";
|
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
} from "./deviation_alarm_helper";
|
|
21
21
|
import { UALimitAlarmImpl } from "./ua_limit_alarm_impl";
|
|
22
22
|
import { UANonExclusiveLimitAlarmImpl } from "./ua_non_exclusive_limit_alarm_impl";
|
|
23
|
+
|
|
24
|
+
|
|
23
25
|
export declare interface UANonExclusiveDeviationAlarmImpl extends UANonExclusiveLimitAlarmImpl, UANonExclusiveDeviationAlarmEx {
|
|
24
26
|
on(eventName: string, eventHandler: any): this;
|
|
25
27
|
get addressSpace(): AddressSpace;
|
|
@@ -63,7 +65,7 @@ export class UANonExclusiveDeviationAlarmImpl extends UANonExclusiveLimitAlarmIm
|
|
|
63
65
|
super._setStateBasedOnInputValue(value - setpointValue);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
public getSetpointNodeNode():
|
|
68
|
+
public getSetpointNodeNode(): UAVariableT<number, DataType.Double> | UAVariableT<number, DataType.Float> | undefined {
|
|
67
69
|
return DeviationAlarmHelper_getSetpointNodeNode.call(this);
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -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,18 +1,20 @@
|
|
|
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";
|
|
12
14
|
import { InstantiateOffNormalAlarmOptions } from "../../source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options";
|
|
13
15
|
import { UADiscreteAlarmEx } from "../../source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex";
|
|
14
16
|
import { AddressSpacePrivate } from "../address_space_private";
|
|
15
|
-
import {
|
|
17
|
+
import { UADiscreteAlarmImpl } from "./ua_discrete_alarm_impl";
|
|
16
18
|
|
|
17
19
|
function isEqual(value1: any, value2: any) {
|
|
18
20
|
return value1 === value2;
|
|
@@ -32,14 +34,13 @@ 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
|
-
|
|
43
44
|
export declare interface UAOffNormalAlarmImpl extends UAOffNormalAlarmEx, UADiscreteAlarmImpl {
|
|
44
45
|
on(eventName: string, eventHandler: any): this;
|
|
45
46
|
}
|
|
@@ -54,7 +55,7 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
54
55
|
* When the value of inputNode doesn't match the normalState node value, then the alarm is raised.
|
|
55
56
|
*
|
|
56
57
|
*/
|
|
57
|
-
public static instantiate(
|
|
58
|
+
public static instantiate<T, DT extends DataType>(
|
|
58
59
|
namespace: INamespace,
|
|
59
60
|
limitAlarmTypeId: string | NodeId,
|
|
60
61
|
options: InstantiateOffNormalAlarmOptions,
|
|
@@ -103,21 +104,24 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
103
104
|
* If this Variable is not in the AddressSpace, a NULL NodeId shall be provided.
|
|
104
105
|
*
|
|
105
106
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (normalState) {
|
|
117
|
-
// install normalState monitoring for change
|
|
118
|
-
normalState.on("value_changed", (newDataValue: DataValue /*, oldDataValue: DataValue*/) => {
|
|
119
|
-
alarmNode._onNormalStateDataValueChange(newDataValue);
|
|
107
|
+
if (options.normalState) {
|
|
108
|
+
const normalState = addressSpace._coerceNode(options.normalState) as UAVariable | null;
|
|
109
|
+
const normalStateNodeId = normalState ? normalState.nodeId : new NodeId();
|
|
110
|
+
alarmNode.normalState.setValueFromSource({ dataType: DataType.NodeId, value: normalStateNodeId });
|
|
111
|
+
alarmNode.normalState.on("value_changed", (newDataValue: DataValue /*, oldDataValue: DataValue*/) => {
|
|
112
|
+
// The node that contains the normalState value has changed.
|
|
113
|
+
// we must remove the listener on current normalState and replace
|
|
114
|
+
// normalState with the new one and set listener again
|
|
115
|
+
// to do:
|
|
120
116
|
});
|
|
117
|
+
if (normalState) {
|
|
118
|
+
// install normalState monitoring for change
|
|
119
|
+
normalState.on("value_changed", (newDataValue: DataValue /*, oldDataValue: DataValue*/) => {
|
|
120
|
+
alarmNode._onNormalStateDataValueChange(newDataValue);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
alarmNode.normalState.setValueFromSource({ dataType: DataType.NodeId, value: NodeId.nullNodeId });
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
alarmNode._mayBe_updateAlarmState();
|
|
@@ -134,9 +138,9 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
134
138
|
// Property the Alarm is Active. If this Variable is not in the AddressSpace, a Null NodeId shall
|
|
135
139
|
// be provided.
|
|
136
140
|
|
|
137
|
-
public getNormalStateNode():
|
|
141
|
+
public getNormalStateNode(): UAVariableT<NodeId, DataType.NodeId> | null {
|
|
138
142
|
const nodeId = this.normalState.readValue().value.value;
|
|
139
|
-
const node = this.addressSpace.findNode(nodeId) as
|
|
143
|
+
const node = this.addressSpace.findNode(nodeId) as UAVariableT<NodeId, DataType.NodeId>;
|
|
140
144
|
if (!node) {
|
|
141
145
|
return null;
|
|
142
146
|
}
|
|
@@ -146,19 +150,19 @@ export class UAOffNormalAlarmImpl extends UADiscreteAlarmImpl implements UAOffNo
|
|
|
146
150
|
/**
|
|
147
151
|
* @method getNormalStateValue
|
|
148
152
|
*/
|
|
149
|
-
public getNormalStateValue():
|
|
153
|
+
public getNormalStateValue(): NodeId | null {
|
|
150
154
|
const normalStateNode = this.getNormalStateNode();
|
|
151
155
|
if (!normalStateNode) {
|
|
152
156
|
return null;
|
|
153
157
|
}
|
|
154
|
-
return normalStateNode.readValue().value.value;
|
|
158
|
+
return normalStateNode.readValue().value.value as NodeId;
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
/**
|
|
158
162
|
* @method setNormalStateValue
|
|
159
163
|
* @param value
|
|
160
164
|
*/
|
|
161
|
-
public setNormalStateValue(value:
|
|
165
|
+
public setNormalStateValue(value: NodeIdLike): void {
|
|
162
166
|
const normalStateNode = this.getNormalStateNode();
|
|
163
167
|
throw new Error("Not Implemented yet");
|
|
164
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
|
|