node-opcua-address-space 2.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.yml +12 -0
- package/LICENSE +20 -0
- package/dist/source/address_space_ts.d.ts +122 -0
- package/dist/source/address_space_ts.js +18 -0
- package/dist/source/address_space_ts.js.map +1 -0
- package/dist/source/continuation_points/continuation_point_manager.d.ts +21 -0
- package/dist/source/continuation_points/continuation_point_manager.js +100 -0
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -0
- package/dist/source/helpers/adjust_browse_direction.d.ts +5 -0
- package/dist/source/helpers/adjust_browse_direction.js +12 -0
- package/dist/source/helpers/adjust_browse_direction.js.map +1 -0
- package/dist/source/helpers/argument_list.d.ts +30 -0
- package/dist/source/helpers/argument_list.js +237 -0
- package/dist/source/helpers/argument_list.js.map +1 -0
- package/dist/source/helpers/call_helpers.d.ts +6 -0
- package/dist/source/helpers/call_helpers.js +71 -0
- package/dist/source/helpers/call_helpers.js.map +1 -0
- package/dist/source/helpers/check_event_clause.d.ts +17 -0
- package/dist/source/helpers/check_event_clause.js +53 -0
- package/dist/source/helpers/check_event_clause.js.map +1 -0
- package/dist/source/helpers/coerce_enum_value.d.ts +6 -0
- package/dist/source/helpers/coerce_enum_value.js +34 -0
- package/dist/source/helpers/coerce_enum_value.js.map +1 -0
- package/dist/source/helpers/dump_tools.d.ts +14 -0
- package/dist/source/helpers/dump_tools.js +79 -0
- package/dist/source/helpers/dump_tools.js.map +1 -0
- package/dist/source/helpers/ensure_secure_access.d.ts +9 -0
- package/dist/source/helpers/ensure_secure_access.js +90 -0
- package/dist/source/helpers/ensure_secure_access.js.map +1 -0
- package/dist/source/helpers/make_optionals_map.d.ts +21 -0
- package/dist/source/helpers/make_optionals_map.js +30 -0
- package/dist/source/helpers/make_optionals_map.js.map +1 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +3 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js +37 -0
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -0
- package/dist/source/index.d.ts +39 -0
- package/dist/source/index.js +62 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +12 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_discrete_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +25 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +21 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +27 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +24 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +17 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +12 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +4 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item.js.map +1 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +8 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js +3 -0
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +11 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +69 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +74 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/state_machine.d.ts +342 -0
- package/dist/source/interfaces/state_machine/state_machine.js +3 -0
- package/dist/source/interfaces/state_machine/state_machine.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +12 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +49 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +18 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +11 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +222 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +29 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_state_variable.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +6 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js +3 -0
- package/dist/source/interfaces/state_machine/ua_transition_ex.js.map +1 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +26 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js +3 -0
- package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +41 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js +3 -0
- package/dist/source/interfaces/subscription_diagnostics_variable.js.map +1 -0
- package/dist/source/interfaces/ua_authorisation_service.d.ts +1 -0
- package/dist/source/interfaces/ua_authorisation_service.js +3 -0
- package/dist/source/interfaces/ua_authorisation_service.js.map +1 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +8 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -0
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +10 -0
- package/dist/source/loader/generateAddressSpaceRaw.js +59 -0
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -0
- package/dist/source/loader/load_nodeset2.d.ts +13 -0
- package/dist/source/loader/load_nodeset2.js +1392 -0
- package/dist/source/loader/load_nodeset2.js.map +1 -0
- package/dist/source/loader/namespace_post_step.d.ts +6 -0
- package/dist/source/loader/namespace_post_step.js +48 -0
- package/dist/source/loader/namespace_post_step.js.map +1 -0
- package/dist/source/loader/register_node_promoter.d.ts +3 -0
- package/dist/source/loader/register_node_promoter.js +10 -0
- package/dist/source/loader/register_node_promoter.js.map +1 -0
- package/dist/source/namespace.d.ts +6 -0
- package/dist/source/namespace.js +3 -0
- package/dist/source/namespace.js.map +1 -0
- package/dist/source/namespace_alarm_and_condition.d.ts +24 -0
- package/dist/source/namespace_alarm_and_condition.js +3 -0
- package/dist/source/namespace_alarm_and_condition.js.map +1 -0
- package/dist/source/namespace_data_access.d.ts +42 -0
- package/dist/source/namespace_data_access.js +3 -0
- package/dist/source/namespace_data_access.js.map +1 -0
- package/dist/source/namespace_machine_state.d.ts +7 -0
- package/dist/source/namespace_machine_state.js +3 -0
- package/dist/source/namespace_machine_state.js.map +1 -0
- package/dist/source/pseudo_session.d.ts +55 -0
- package/dist/source/pseudo_session.js +205 -0
- package/dist/source/pseudo_session.js.map +1 -0
- package/dist/source/session_context.d.ts +111 -0
- package/dist/source/session_context.js +266 -0
- package/dist/source/session_context.js.map +1 -0
- package/dist/source/set_namespace_meta_data.d.ts +2 -0
- package/dist/source/set_namespace_meta_data.js +60 -0
- package/dist/source/set_namespace_meta_data.js.map +1 -0
- package/dist/source/ua_namespace_meta_data_type.d.ts +71 -0
- package/dist/source/ua_namespace_meta_data_type.js +3 -0
- package/dist/source/ua_namespace_meta_data_type.js.map +1 -0
- package/dist/source/ua_root_folder.d.ts +9 -0
- package/dist/source/ua_root_folder.js +3 -0
- package/dist/source/ua_root_folder.js.map +1 -0
- package/dist/source/ua_two_state_variable_ex.d.ts +23 -0
- package/dist/source/ua_two_state_variable_ex.js +3 -0
- package/dist/source/ua_two_state_variable_ex.js.map +1 -0
- package/dist/source/xml_writer.d.ts +9 -0
- package/dist/source/xml_writer.js +3 -0
- package/dist/source/xml_writer.js.map +1 -0
- package/dist/src/address_space.d.ts +393 -0
- package/dist/src/address_space.js +1375 -0
- package/dist/src/address_space.js.map +1 -0
- package/dist/src/address_space_change_event_tools.d.ts +6 -0
- package/dist/src/address_space_change_event_tools.js +150 -0
- package/dist/src/address_space_change_event_tools.js.map +1 -0
- package/dist/src/address_space_private.d.ts +44 -0
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -0
- package/dist/src/alarms_and_conditions/base_event_type.d.ts +26 -0
- package/dist/src/alarms_and_conditions/base_event_type.js +41 -0
- package/dist/src/alarms_and_conditions/base_event_type.js.map +1 -0
- package/dist/src/alarms_and_conditions/check_where_clause.d.ts +4 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js +110 -0
- package/dist/src/alarms_and_conditions/check_where_clause.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition.d.ts +5 -0
- package/dist/src/alarms_and_conditions/condition.js +81 -0
- package/dist/src/alarms_and_conditions/condition.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_info.d.ts +27 -0
- package/dist/src/alarms_and_conditions/condition_info.js +55 -0
- package/dist/src/alarms_and_conditions/condition_info.js.map +1 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +232 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js +667 -0
- package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +21 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +47 -0
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +10 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js +90 -0
- package/dist/src/alarms_and_conditions/extract_event_fields.js.map +1 -0
- package/dist/src/alarms_and_conditions/index.d.ts +18 -0
- package/dist/src/alarms_and_conditions/index.js +31 -0
- package/dist/src/alarms_and_conditions/index.js.map +1 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +22 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js +241 -0
- package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +1 -0
- package/dist/src/alarms_and_conditions/trip_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js +21 -0
- package/dist/src/alarms_and_conditions/trip_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +54 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +255 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +62 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +244 -0
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +138 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +460 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +118 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +417 -0
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +29 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +39 -0
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +35 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +32 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +21 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +26 -0
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +191 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js +1029 -0
- package/dist/src/alarms_and_conditions/ua_condition_base.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +182 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +1021 -0
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +11 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +17 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +58 -0
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +24 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +59 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +57 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +14 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +17 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +9 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +12 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +22 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +38 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +87 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +6 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +11 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +10 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js +8 -0
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +76 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js +237 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +98 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +233 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +27 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +62 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +28 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +51 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +49 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +176 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +25 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +163 -0
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +47 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +151 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +39 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +136 -0
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +1 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +16 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +18 -0
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -0
- package/dist/src/apply_condition_refresh.d.ts +6 -0
- package/dist/src/apply_condition_refresh.js +28 -0
- package/dist/src/apply_condition_refresh.js.map +1 -0
- package/dist/src/base_node.d.ts +279 -0
- package/dist/src/base_node.js +1364 -0
- package/dist/src/base_node.js.map +1 -0
- package/dist/src/base_node_impl.d.ts +281 -0
- package/dist/src/base_node_impl.js +1394 -0
- package/dist/src/base_node_impl.js.map +1 -0
- package/dist/src/base_node_private.d.ts +61 -0
- package/dist/src/base_node_private.js +521 -0
- package/dist/src/base_node_private.js.map +1 -0
- package/dist/src/data_access/add_dataItem_stuff.d.ts +11 -0
- package/dist/src/data_access/add_dataItem_stuff.js +62 -0
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +1 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +35 -0
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_analog_item.d.ts +13 -0
- package/dist/src/data_access/ua_analog_item.js +37 -0
- package/dist/src/data_access/ua_analog_item.js.map +1 -0
- package/dist/src/data_access/ua_data_item.d.ts +16 -0
- package/dist/src/data_access/ua_data_item.js +66 -0
- package/dist/src/data_access/ua_data_item.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete.d.ts +23 -0
- package/dist/src/data_access/ua_multistate_discrete.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete.js.map +1 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +32 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js +131 -0
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -0
- package/dist/src/data_access/ua_multistate_value_discrete.d.ts +51 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js +249 -0
- package/dist/src/data_access/ua_multistate_value_discrete.js.map +1 -0
- package/dist/src/data_access/ua_two_state_discrete.d.ts +25 -0
- package/dist/src/data_access/ua_two_state_discrete.js +154 -0
- package/dist/src/data_access/ua_two_state_discrete.js.map +1 -0
- package/dist/src/event_data.d.ts +29 -0
- package/dist/src/event_data.js +96 -0
- package/dist/src/event_data.js.map +1 -0
- package/dist/src/extension_object_array_node.d.ts +61 -0
- package/dist/src/extension_object_array_node.js +266 -0
- package/dist/src/extension_object_array_node.js.map +1 -0
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +26 -0
- package/dist/src/historical_access/address_space_historical_data_node.js +662 -0
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -0
- package/dist/src/index_current.d.ts +42 -0
- package/dist/src/index_current.js +71 -0
- package/dist/src/index_current.js.map +1 -0
- package/dist/src/namespace.d.ts +475 -0
- package/dist/src/namespace.js +1775 -0
- package/dist/src/namespace.js.map +1 -0
- package/dist/src/namespace_impl.d.ts +463 -0
- package/dist/src/namespace_impl.js +1763 -0
- package/dist/src/namespace_impl.js.map +1 -0
- package/dist/src/namespace_private.d.ts +21 -0
- package/dist/src/namespace_private.js +29 -0
- package/dist/src/namespace_private.js.map +1 -0
- package/dist/src/nodeid_manager.d.ts +36 -0
- package/dist/src/nodeid_manager.js +196 -0
- package/dist/src/nodeid_manager.js.map +1 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +2 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js +14 -0
- package/dist/src/nodeset_tools/adjust_namespace_array.js.map +1 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +39 -0
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js +1155 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.d.ts +2 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js +147 -0
- package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -0
- package/dist/src/reference.d.ts +43 -0
- package/dist/src/reference.js +138 -0
- package/dist/src/reference.js.map +1 -0
- package/dist/src/reference_impl.d.ts +43 -0
- package/dist/src/reference_impl.js +138 -0
- package/dist/src/reference_impl.js.map +1 -0
- package/dist/src/role_permissions.d.ts +2 -0
- package/dist/src/role_permissions.js +11 -0
- package/dist/src/role_permissions.js.map +1 -0
- package/dist/src/session_context.d.ts +4 -0
- package/dist/src/session_context.js +9 -0
- package/dist/src/session_context.js.map +1 -0
- package/dist/src/state_machine/finite_state_machine.d.ts +67 -0
- package/dist/src/state_machine/finite_state_machine.js +354 -0
- package/dist/src/state_machine/finite_state_machine.js.map +1 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +34 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +244 -0
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -0
- package/dist/src/state_machine/ua_two_state_variable.d.ts +61 -0
- package/dist/src/state_machine/ua_two_state_variable.js +332 -0
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -0
- package/dist/src/tool_isSupertypeOf.d.ts +17 -0
- package/dist/src/tool_isSupertypeOf.js +103 -0
- package/dist/src/tool_isSupertypeOf.js.map +1 -0
- package/dist/src/ua_condition_type.d.ts +8 -0
- package/dist/src/ua_condition_type.js +3 -0
- package/dist/src/ua_condition_type.js.map +1 -0
- package/dist/src/ua_data_type.d.ts +83 -0
- package/dist/src/ua_data_type.js +289 -0
- package/dist/src/ua_data_type.js.map +1 -0
- package/dist/src/ua_data_type_impl.d.ts +83 -0
- package/dist/src/ua_data_type_impl.js +291 -0
- package/dist/src/ua_data_type_impl.js.map +1 -0
- package/dist/src/ua_method.d.ts +42 -0
- package/dist/src/ua_method.js +204 -0
- package/dist/src/ua_method.js.map +1 -0
- package/dist/src/ua_method_impl.d.ts +40 -0
- package/dist/src/ua_method_impl.js +203 -0
- package/dist/src/ua_method_impl.js.map +1 -0
- package/dist/src/ua_object.d.ts +29 -0
- package/dist/src/ua_object.js +153 -0
- package/dist/src/ua_object.js.map +1 -0
- package/dist/src/ua_object_impl.d.ts +29 -0
- package/dist/src/ua_object_impl.js +156 -0
- package/dist/src/ua_object_impl.js.map +1 -0
- package/dist/src/ua_object_type.d.ts +49 -0
- package/dist/src/ua_object_type.js +124 -0
- package/dist/src/ua_object_type.js.map +1 -0
- package/dist/src/ua_object_type_impl.d.ts +48 -0
- package/dist/src/ua_object_type_impl.js +124 -0
- package/dist/src/ua_object_type_impl.js.map +1 -0
- package/dist/src/ua_reference_type.d.ts +42 -0
- package/dist/src/ua_reference_type.js +138 -0
- package/dist/src/ua_reference_type.js.map +1 -0
- package/dist/src/ua_reference_type_impl.d.ts +43 -0
- package/dist/src/ua_reference_type_impl.js +138 -0
- package/dist/src/ua_reference_type_impl.js.map +1 -0
- package/dist/src/ua_variable.d.ts +346 -0
- package/dist/src/ua_variable.js +1721 -0
- package/dist/src/ua_variable.js.map +1 -0
- package/dist/src/ua_variable_impl.d.ts +353 -0
- package/dist/src/ua_variable_impl.js +1719 -0
- package/dist/src/ua_variable_impl.js.map +1 -0
- package/dist/src/ua_variable_type.d.ts +54 -0
- package/dist/src/ua_variable_type.js +555 -0
- package/dist/src/ua_variable_type.js.map +1 -0
- package/dist/src/ua_variable_type_impl.d.ts +63 -0
- package/dist/src/ua_variable_type_impl.js +556 -0
- package/dist/src/ua_variable_type_impl.js.map +1 -0
- package/dist/src/ua_view.d.ts +16 -0
- package/dist/src/ua_view.js +42 -0
- package/dist/src/ua_view.js.map +1 -0
- package/dist/src/ua_view_impl.d.ts +15 -0
- package/dist/src/ua_view_impl.js +37 -0
- package/dist/src/ua_view_impl.js.map +1 -0
- package/distHelpers/add_event_generator_object.d.ts +3 -0
- package/distHelpers/add_event_generator_object.js +66 -0
- package/distHelpers/add_event_generator_object.js.map +1 -0
- package/distHelpers/alarms_and_conditions_demo.d.ts +10 -0
- package/distHelpers/alarms_and_conditions_demo.js +115 -0
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -0
- package/distHelpers/assertHasMatchingReference.d.ts +19 -0
- package/distHelpers/assertHasMatchingReference.js +41 -0
- package/distHelpers/assertHasMatchingReference.js.map +1 -0
- package/distHelpers/boiler_system.d.ts +113 -0
- package/distHelpers/boiler_system.js +397 -0
- package/distHelpers/boiler_system.js.map +1 -0
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +5 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js +171 -0
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -0
- package/distHelpers/dump_statemachine.d.ts +6 -0
- package/distHelpers/dump_statemachine.js +116 -0
- package/distHelpers/dump_statemachine.js.map +1 -0
- package/distHelpers/get_address_space_fixture.d.ts +1 -0
- package/distHelpers/get_address_space_fixture.js +31 -0
- package/distHelpers/get_address_space_fixture.js.map +1 -0
- package/distHelpers/get_mini_address_space.d.ts +7 -0
- package/distHelpers/get_mini_address_space.js +37 -0
- package/distHelpers/get_mini_address_space.js.map +1 -0
- package/distHelpers/index.d.ts +11 -0
- package/distHelpers/index.js +24 -0
- package/distHelpers/index.js.map +1 -0
- package/distNodeJS/generate_address_space.d.ts +4 -0
- package/distNodeJS/generate_address_space.js +31 -0
- package/distNodeJS/generate_address_space.js.map +1 -0
- package/distNodeJS/index.d.ts +1 -0
- package/distNodeJS/index.js +14 -0
- package/distNodeJS/index.js.map +1 -0
- package/generate.js +1 -0
- package/nodeJS.d.ts +1 -0
- package/nodeJS.js +1 -0
- package/package.json +87 -0
- package/source/address_space_ts.ts +217 -0
- package/source/continuation_points/continuation_point_manager.ts +121 -0
- package/source/helpers/adjust_browse_direction.ts +15 -0
- package/source/helpers/argument_list.ts +286 -0
- package/source/helpers/call_helpers.ts +112 -0
- package/source/helpers/check_event_clause.ts +62 -0
- package/source/helpers/coerce_enum_value.ts +33 -0
- package/source/helpers/dump_tools.ts +92 -0
- package/source/helpers/ensure_secure_access.ts +88 -0
- package/source/helpers/make_optionals_map.ts +49 -0
- package/source/helpers/resolve_opaque_on_address_space.ts +23 -0
- package/source/index.ts +49 -0
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +13 -0
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +26 -0
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +34 -0
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +14 -0
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +10 -0
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +14 -0
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +50 -0
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +13 -0
- package/source/interfaces/state_machine/ua_state_machine_type.ts +261 -0
- package/source/interfaces/state_machine/ua_transition_ex.ts +7 -0
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +8 -0
- package/source/loader/generateAddressSpaceRaw.ts +79 -0
- package/source/loader/load_nodeset2.ts +1600 -0
- package/source/loader/namespace_post_step.ts +36 -0
- package/source/loader/register_node_promoter.ts +8 -0
- package/source/namespace.ts +9 -0
- package/source/namespace_alarm_and_condition.ts +47 -0
- package/source/namespace_data_access.ts +60 -0
- package/source/namespace_machine_state.ts +13 -0
- package/source/pseudo_session.ts +288 -0
- package/source/session_context.ts +345 -0
- package/source/set_namespace_meta_data.ts +68 -0
- package/source/ua_root_folder.ts +10 -0
- package/source/ua_two_state_variable_ex.ts +35 -0
- package/source/xml_writer.ts +15 -0
- package/source_nodejs/generate_address_space.ts +36 -0
- package/source_nodejs/index.ts +1 -0
- package/src/address_space.ts +1575 -0
- package/src/address_space_change_event_tools.ts +177 -0
- package/src/address_space_private.ts +98 -0
- package/src/alarms_and_conditions/check_where_clause.ts +148 -0
- package/src/alarms_and_conditions/condition.ts +89 -0
- package/src/alarms_and_conditions/condition_info.ts +66 -0
- package/src/alarms_and_conditions/condition_snapshot.ts +766 -0
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +66 -0
- package/src/alarms_and_conditions/extract_event_fields.ts +104 -0
- package/src/alarms_and_conditions/index.ts +18 -0
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +339 -0
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +513 -0
- package/src/alarms_and_conditions/ua_base_event_impl.ts +55 -0
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +50 -0
- package/src/alarms_and_conditions/ua_condition_impl.ts +1298 -0
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +81 -0
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +110 -0
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +19 -0
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +130 -0
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +24 -0
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +305 -0
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +108 -0
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +224 -0
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +186 -0
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +27 -0
- package/src/apply_condition_refresh.ts +30 -0
- package/src/base_node_impl.ts +1749 -0
- package/src/base_node_private.ts +690 -0
- package/src/data_access/add_dataItem_stuff.ts +75 -0
- package/src/data_access/check_variant_compatibility_ua_analog_item.ts +41 -0
- package/src/data_access/ua_multistate_discrete_impl.ts +168 -0
- package/src/data_access/ua_multistate_value_discrete.ts +299 -0
- package/src/data_access/ua_two_state_discrete.ts +185 -0
- package/src/event_data.ts +117 -0
- package/src/extension_object_array_node.ts +325 -0
- package/src/historical_access/address_space_historical_data_node.ts +828 -0
- package/src/index_current.ts +52 -0
- package/src/namespace_impl.ts +2181 -0
- package/src/namespace_private.ts +60 -0
- package/src/nodeid_manager.ts +228 -0
- package/src/nodeset_tools/adjust_namespace_array.ts +11 -0
- package/src/nodeset_tools/construct_namespace_dependency.ts +40 -0
- package/src/nodeset_tools/nodeset_to_xml.ts +1317 -0
- package/src/nodeset_tools/typedictionary_to_xml.ts +175 -0
- package/src/reference_impl.ts +169 -0
- package/src/role_permissions.ts +6 -0
- package/src/state_machine/finite_state_machine.ts +428 -0
- package/src/state_machine/ua_shelving_state_machine_ex.ts +314 -0
- package/src/state_machine/ua_two_state_variable.ts +421 -0
- package/src/tool_isSupertypeOf.ts +129 -0
- package/src/ua_condition_type.ts +10 -0
- package/src/ua_data_type_impl.ts +356 -0
- package/src/ua_method_impl.ts +278 -0
- package/src/ua_object_impl.ts +203 -0
- package/src/ua_object_type_impl.ts +158 -0
- package/src/ua_reference_type_impl.ts +174 -0
- package/src/ua_variable_impl.ts +2277 -0
- package/src/ua_variable_type_impl.ts +741 -0
- package/src/ua_view_impl.ts +54 -0
- package/testHelpers.d.ts +1 -0
- package/testHelpers.js +1 -0
- package/test_helpers/add_event_generator_object.ts +71 -0
- package/test_helpers/alarms_and_conditions_demo.ts +147 -0
- package/test_helpers/assertHasMatchingReference.ts +43 -0
- package/test_helpers/boiler_system.ts +618 -0
- package/test_helpers/create_minimalist_address_space_nodeset.ts +208 -0
- package/test_helpers/dump_statemachine.ts +155 -0
- package/test_helpers/get_address_space_fixture.ts +30 -0
- package/test_helpers/get_mini_address_space.ts +42 -0
- package/test_helpers/index.ts +11 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -0
- package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +136 -0
- package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -0
- package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -0
- package/test_helpers/test_fixtures/dataType_with_structures.xml +605 -0
- package/test_helpers/test_fixtures/dataType_with_union.xml +1 -0
- package/test_helpers/test_fixtures/datatype_as_per_1.04.xml +91 -0
- package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -0
- package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1303 -0
- package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -0
- package/test_helpers/test_fixtures/issue_846.xml +3172 -0
- package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +33 -0
- package/test_helpers/test_fixtures/mini.Node.Set2.xml +4508 -0
- package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -0
- package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -0
- package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
|
|
6
|
+
import { VariableTypeIds } from "node-opcua-constants";
|
|
7
|
+
import { BrowseDirection, coerceLocalizedText, LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
8
|
+
import { DataValueT, DataValueOptionsT } from "node-opcua-data-value";
|
|
9
|
+
import { NodeId, resolveNodeId } from "node-opcua-nodeid";
|
|
10
|
+
import { sameNodeId } from "node-opcua-nodeid";
|
|
11
|
+
import { StatusCodes,StatusCode, StatusCodeCallback } from "node-opcua-status-code";
|
|
12
|
+
import { Variant, VariantLike, VariantT } from "node-opcua-variant";
|
|
13
|
+
import { DataType } from "node-opcua-variant";
|
|
14
|
+
import { BaseNode, BindVariableOptions, INamespace, UAReference, UAVariable, ISessionContext } from "node-opcua-address-space-base";
|
|
15
|
+
import { UATwoStateVariable } from "node-opcua-nodeset-ua";
|
|
16
|
+
import { NumericRange } from "node-opcua-numeric-range";
|
|
17
|
+
import { QualifiedNameLike } from "node-opcua-data-model";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// public interfaces
|
|
21
|
+
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
22
|
+
import { AddTwoStateVariableOptions } from "../../source/address_space_ts";
|
|
23
|
+
import { UATwoStateVariableEx } from "../../source/ua_two_state_variable_ex";
|
|
24
|
+
// private types
|
|
25
|
+
import { UAVariableImpl, UAVariableImplT } from "../ua_variable_impl";
|
|
26
|
+
|
|
27
|
+
const hasTrueSubState_ReferenceTypeNodeId = resolveNodeId("HasTrueSubState");
|
|
28
|
+
const hasFalseSubState_ReferenceTypeNodeId = resolveNodeId("HasFalseSubState");
|
|
29
|
+
|
|
30
|
+
// Release 1.03 12 OPC Unified Architecture, Part 9
|
|
31
|
+
// Two-state state machines
|
|
32
|
+
// Most states defined in this standard are simple – i.e. they are either TRUE or FALSE. The
|
|
33
|
+
// TwoStateVariableType is introduced specifically for this use case. More complex states are
|
|
34
|
+
// modelled by using a StateMachineType defined in Part 5.
|
|
35
|
+
// The TwoStateVariableType is derived from the StateVariableType.
|
|
36
|
+
//
|
|
37
|
+
// Attribute Value
|
|
38
|
+
// BrowseName TwoStateVariableType
|
|
39
|
+
// DataType LocalizedText
|
|
40
|
+
// ValueRank -1 (-1 = Scalar)
|
|
41
|
+
// IsAbstract False
|
|
42
|
+
//
|
|
43
|
+
// Subtype of the StateVariableType defined in Part 5.
|
|
44
|
+
// Note that a Reference to this subtype is not shown in the definition of the StateVariableType
|
|
45
|
+
//
|
|
46
|
+
// References NodeClass BrowseName DataType TypeDefinition Modelling Rule
|
|
47
|
+
// HasProperty Variable Id Boolean PropertyType Mandatory
|
|
48
|
+
// HasProperty Variable TransitionTime UtcTime PropertyType Optional
|
|
49
|
+
// HasProperty Variable EffectiveTransitionTime UtcTime PropertyType Optional
|
|
50
|
+
// HasProperty Variable TrueState LocalizedText PropertyType Optional
|
|
51
|
+
// HasProperty Variable FalseState LocalizedText PropertyType Optional
|
|
52
|
+
// HasTrueSubState StateMachine or
|
|
53
|
+
// TwoStateVariableType
|
|
54
|
+
// <StateIdentifier> Defined in Clause 5.4.2 Optional
|
|
55
|
+
// HasFalseSubState StateMachine or
|
|
56
|
+
// TwoStateVariableType
|
|
57
|
+
// <StateIdentifier> Defined in Clause 5.4.3 Optional
|
|
58
|
+
|
|
59
|
+
function _updateTransitionTime(node: UATwoStateVariableEx) {
|
|
60
|
+
// TransitionTime specifies the time when the current state was entered.
|
|
61
|
+
if (node.transitionTime) {
|
|
62
|
+
node.transitionTime.setValueFromSource({ dataType: DataType.DateTime, value: new Date() });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _updateEffectiveTransitionTime(node: UATwoStateVariableImpl) {
|
|
67
|
+
if (node.effectiveTransitionTime) {
|
|
68
|
+
// xx console.log("xxxx _updateEffectiveTransitionTime
|
|
69
|
+
// because subStateNode ",subStateNode.browseName.toString());
|
|
70
|
+
node.effectiveTransitionTime.setValueFromSource({
|
|
71
|
+
dataType: DataType.DateTime,
|
|
72
|
+
value: new Date()
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function _getEffectiveDisplayName<T, DT extends DataType>(
|
|
78
|
+
node: UATwoStateVariableImpl
|
|
79
|
+
): DataValueT<LocalizedText, DataType.LocalizedText> {
|
|
80
|
+
const humanReadableString = _getHumanReadableString(node);
|
|
81
|
+
if (humanReadableString.statusCode !== StatusCodes.Good) {
|
|
82
|
+
return humanReadableString;
|
|
83
|
+
}
|
|
84
|
+
const boolValue = node.getValue();
|
|
85
|
+
|
|
86
|
+
let subStateNodes;
|
|
87
|
+
if (boolValue) {
|
|
88
|
+
subStateNodes = node.findReferencesExAsObject("HasTrueSubState", BrowseDirection.Forward);
|
|
89
|
+
} else {
|
|
90
|
+
subStateNodes = node.findReferencesExAsObject("HasFalseSubState", BrowseDirection.Forward);
|
|
91
|
+
}
|
|
92
|
+
const states = subStateNodes.forEach((n: any) => {
|
|
93
|
+
// todo happen
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return humanReadableString;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function _getHumanReadableString(node: UATwoStateVariableImpl): DataValueT<LocalizedText, DataType.LocalizedText> {
|
|
100
|
+
const dataValue = node.id.readValue();
|
|
101
|
+
|
|
102
|
+
if (dataValue.statusCode !== StatusCodes.Good) {
|
|
103
|
+
const _c = dataValue.clone() as DataValueT<LocalizedText, DataType.LocalizedText>;
|
|
104
|
+
_c.value = new Variant({
|
|
105
|
+
dataType: DataType.LocalizedText,
|
|
106
|
+
value: coerceLocalizedText("")!
|
|
107
|
+
}) as VariantT<LocalizedText, DataType.LocalizedText>;
|
|
108
|
+
|
|
109
|
+
return _c;
|
|
110
|
+
}
|
|
111
|
+
assert(dataValue.value.dataType === DataType.Boolean);
|
|
112
|
+
const boolValue = dataValue.value.value;
|
|
113
|
+
|
|
114
|
+
// The Value Attribute of a TwoStateVariable contains the current state as a human readable name.
|
|
115
|
+
// The EnabledState for example, might contain the name “Enabled” when TRUE and “Disabled” when FALSE.
|
|
116
|
+
|
|
117
|
+
const dataValue2 = dataValue.clone();
|
|
118
|
+
dataValue2.value = new Variant({
|
|
119
|
+
dataType: DataType.LocalizedText,
|
|
120
|
+
value: boolValue ? node.getTrueState() : node.getFalseState()
|
|
121
|
+
});
|
|
122
|
+
return dataValue2 as DataValueT<LocalizedText, DataType.LocalizedText>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function _install_TwoStateVariable_machinery(
|
|
126
|
+
node: UAVariable,
|
|
127
|
+
options: TwoStateVariableInitializeOptions
|
|
128
|
+
): UATwoStateVariableEx {
|
|
129
|
+
assert(node.dataTypeObj.browseName.toString() === "LocalizedText");
|
|
130
|
+
assert(node.minimumSamplingInterval === 0);
|
|
131
|
+
assert(node.typeDefinitionObj.browseName.toString() === "TwoStateVariableType");
|
|
132
|
+
assert(node.dataTypeObj.browseName.toString() === "LocalizedText");
|
|
133
|
+
assert(Object.prototype.hasOwnProperty.call(node,"valueRank") && (node.valueRank === -1 || node.valueRank === 0));
|
|
134
|
+
|
|
135
|
+
// promote node into a UATwoStateVariable
|
|
136
|
+
const _node = promoteToTwoStateVariable(node);
|
|
137
|
+
(node as UATwoStateVariableImpl).initialize(options);
|
|
138
|
+
return _node;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function promoteToTwoStateVariable(node: UAVariable): UATwoStateVariableEx {
|
|
142
|
+
if (node instanceof UATwoStateVariableImpl) {
|
|
143
|
+
return node as unknown as UATwoStateVariableEx;
|
|
144
|
+
}
|
|
145
|
+
// istanbul ignore next
|
|
146
|
+
if (!(node instanceof UAVariableImpl)) {
|
|
147
|
+
throw new Error("Trying to promote a invalid object");
|
|
148
|
+
}
|
|
149
|
+
Object.setPrototypeOf(node, UATwoStateVariableImpl.prototype);
|
|
150
|
+
return node as unknown as UATwoStateVariableEx;
|
|
151
|
+
}
|
|
152
|
+
registerNodePromoter(VariableTypeIds.TwoStateVariableType, promoteToTwoStateVariable);
|
|
153
|
+
|
|
154
|
+
export interface TwoStateVariableInitializeOptions {
|
|
155
|
+
trueState?: LocalizedTextLike;
|
|
156
|
+
falseState?: LocalizedTextLike;
|
|
157
|
+
isFalseSubStateOf?: NodeId | string | BaseNode;
|
|
158
|
+
isTrueSubStateOf?: NodeId | string | BaseNode;
|
|
159
|
+
|
|
160
|
+
value?: boolean | BindVariableOptions;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare interface UATwoStateVariableImpl extends UATwoStateVariableEx {
|
|
164
|
+
on():this;
|
|
165
|
+
once():this;
|
|
166
|
+
readValue(
|
|
167
|
+
context?: ISessionContext | null,
|
|
168
|
+
indexRange?: NumericRange,
|
|
169
|
+
dataEncoding?: QualifiedNameLike | null
|
|
170
|
+
): DataValueT<LocalizedText, DataType.LocalizedText>;
|
|
171
|
+
writeValue(
|
|
172
|
+
context: ISessionContext,
|
|
173
|
+
dataValue: DataValueT<LocalizedText, DataType.LocalizedText>,
|
|
174
|
+
indexRange: NumericRange | null,
|
|
175
|
+
callback: StatusCodeCallback
|
|
176
|
+
): void;
|
|
177
|
+
|
|
178
|
+
writeValue(
|
|
179
|
+
context: ISessionContext,
|
|
180
|
+
dataValue: DataValueT<LocalizedText, DataType.LocalizedText>,
|
|
181
|
+
callback: StatusCodeCallback
|
|
182
|
+
): void;
|
|
183
|
+
writeValue(
|
|
184
|
+
context: ISessionContext,
|
|
185
|
+
dataValue: DataValueT<LocalizedText, DataType.LocalizedText>,
|
|
186
|
+
indexRange?: NumericRange | null
|
|
187
|
+
): Promise<StatusCode>;
|
|
188
|
+
}
|
|
189
|
+
/***
|
|
190
|
+
* @class UATwoStateVariable
|
|
191
|
+
* @constructor
|
|
192
|
+
* @extends UAVariable
|
|
193
|
+
*/
|
|
194
|
+
export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataType.LocalizedText> implements UATwoStateVariableEx {
|
|
195
|
+
private _trueState?: string;
|
|
196
|
+
private _falseState?: string;
|
|
197
|
+
|
|
198
|
+
public constructor(opts: any) {
|
|
199
|
+
super(opts);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
get isFalseSubStateOf(): UATwoStateVariableEx {
|
|
203
|
+
return super.isFalseSubStateOf as UATwoStateVariableEx;
|
|
204
|
+
}
|
|
205
|
+
get isTrueSubStateOf(): UATwoStateVariableEx {
|
|
206
|
+
return super.isTrueSubStateOf as UATwoStateVariableEx;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
public initialize(options: TwoStateVariableInitializeOptions): void {
|
|
210
|
+
|
|
211
|
+
if (options.trueState) {
|
|
212
|
+
assert(!!options.falseState);
|
|
213
|
+
assert(typeof options.trueState === "string");
|
|
214
|
+
assert(typeof options.falseState === "string");
|
|
215
|
+
|
|
216
|
+
if (this.falseState) {
|
|
217
|
+
this.falseState.setValueFromSource({
|
|
218
|
+
dataType: DataType.LocalizedText,
|
|
219
|
+
value: coerceLocalizedText(options.falseState)
|
|
220
|
+
});
|
|
221
|
+
} else {
|
|
222
|
+
this._trueState = coerceLocalizedText(options.trueState)!.text!;
|
|
223
|
+
}
|
|
224
|
+
if (this.trueState) {
|
|
225
|
+
this.trueState.setValueFromSource({
|
|
226
|
+
dataType: DataType.LocalizedText,
|
|
227
|
+
value: coerceLocalizedText(options.trueState)
|
|
228
|
+
});
|
|
229
|
+
} else {
|
|
230
|
+
this._falseState = coerceLocalizedText(options.falseState)!.text!;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// handle isTrueSubStateOf
|
|
235
|
+
if (options.isTrueSubStateOf) {
|
|
236
|
+
this.addReference({
|
|
237
|
+
isForward: false,
|
|
238
|
+
nodeId: options.isTrueSubStateOf,
|
|
239
|
+
referenceType: "HasTrueSubState"
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (options.isFalseSubStateOf) {
|
|
244
|
+
this.addReference({
|
|
245
|
+
isForward: false,
|
|
246
|
+
nodeId: options.isFalseSubStateOf,
|
|
247
|
+
referenceType: "HasFalseSubState"
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (options.value === undefined) {
|
|
252
|
+
this.id.setValueFromSource(
|
|
253
|
+
{
|
|
254
|
+
dataType: "Boolean",
|
|
255
|
+
value: false
|
|
256
|
+
},
|
|
257
|
+
StatusCodes.UncertainInitialValue
|
|
258
|
+
);
|
|
259
|
+
} else if (typeof options.value === "boolean") {
|
|
260
|
+
this.id.setValueFromSource(
|
|
261
|
+
{
|
|
262
|
+
dataType: "Boolean",
|
|
263
|
+
value: options.value
|
|
264
|
+
},
|
|
265
|
+
StatusCodes.Good
|
|
266
|
+
);
|
|
267
|
+
} else if (Object.prototype.hasOwnProperty.call(options.value,"dataType")) {
|
|
268
|
+
assert((options.value as VariantLike).dataType === DataType.Boolean);
|
|
269
|
+
this.id.setValueFromSource(options.value as VariantLike, StatusCodes.Good);
|
|
270
|
+
} else {
|
|
271
|
+
this.id.bindVariable(options.value);
|
|
272
|
+
}
|
|
273
|
+
this._postInitialize();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
public _postInitialize(): void {
|
|
277
|
+
if (this.effectiveTransitionTime) {
|
|
278
|
+
// install "value_changed" event handler on SubState that are already defined
|
|
279
|
+
const subStates = this.getTrueSubStates().concat(this.getFalseSubStates());
|
|
280
|
+
for (const subState of subStates) {
|
|
281
|
+
subState.on("value_changed", () => _updateEffectiveTransitionTime(this));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// it should be possible to define a trueState and falseState LocalizedText even if
|
|
286
|
+
// the trueState or FalseState node is not exposed. Therefore we need to store their value
|
|
287
|
+
// into dedicated variables.
|
|
288
|
+
this.id.on("value_changed", () => {
|
|
289
|
+
this._internal_set_dataValue(_getHumanReadableString(this));
|
|
290
|
+
});
|
|
291
|
+
this._internal_set_dataValue(_getHumanReadableString(this));
|
|
292
|
+
|
|
293
|
+
// todo : also set the effectiveDisplayName if present
|
|
294
|
+
|
|
295
|
+
// from spec Part 5
|
|
296
|
+
// Release 1.03 OPC Unified Architecture, Part 5
|
|
297
|
+
// EffectiveDisplayName contains a human readable name for the current state of the state
|
|
298
|
+
// machine after taking the state of any SubStateMachines in account. There is no rule specified
|
|
299
|
+
// for which state or sub-state should be used. It is up to the Server and will depend on the
|
|
300
|
+
// semantics of the StateMachineType
|
|
301
|
+
//
|
|
302
|
+
// EffectiveDisplayName will be constructed by adding the EnableState
|
|
303
|
+
// and the State of the addTrue state
|
|
304
|
+
if (this.effectiveDisplayName) {
|
|
305
|
+
this.id.on("value_changed", () => {
|
|
306
|
+
(this.effectiveDisplayName! as UAVariableImpl)._internal_set_dataValue(_getEffectiveDisplayName(this));
|
|
307
|
+
});
|
|
308
|
+
(this.effectiveDisplayName! as UAVariableImpl)._internal_set_dataValue(_getEffectiveDisplayName(this));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* @method setValue
|
|
313
|
+
* @param boolValue {Boolean}
|
|
314
|
+
*/
|
|
315
|
+
public setValue(boolValue: boolean): void {
|
|
316
|
+
assert(typeof boolValue === "boolean");
|
|
317
|
+
const dataValue = this.id!.readValue();
|
|
318
|
+
const oldValue = dataValue.value.value;
|
|
319
|
+
if (dataValue.statusCode === StatusCodes.Good && boolValue === oldValue) {
|
|
320
|
+
return; // nothing to do
|
|
321
|
+
}
|
|
322
|
+
//
|
|
323
|
+
this.id.setValueFromSource(new Variant({ dataType: DataType.Boolean, value: boolValue }));
|
|
324
|
+
_updateTransitionTime(this);
|
|
325
|
+
_updateEffectiveTransitionTime(this);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @method getValue
|
|
330
|
+
* @return {Boolean}
|
|
331
|
+
*/
|
|
332
|
+
public getValue(): boolean {
|
|
333
|
+
const dataValue = this.id!.readValue();
|
|
334
|
+
assert(dataValue.statusCode === StatusCodes.Good);
|
|
335
|
+
assert(dataValue.value.dataType === DataType.Boolean);
|
|
336
|
+
return dataValue.value.value;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @method getValueAsString
|
|
341
|
+
* @return {string}
|
|
342
|
+
*/
|
|
343
|
+
public getValueAsString(): string {
|
|
344
|
+
const dataValue = this.readValue();
|
|
345
|
+
assert(dataValue.statusCode === StatusCodes.Good);
|
|
346
|
+
assert(dataValue.value.dataType === DataType.LocalizedText);
|
|
347
|
+
return dataValue.value.value.text?.toString() || "";
|
|
348
|
+
}
|
|
349
|
+
public getTrueState(): LocalizedText {
|
|
350
|
+
return this.trueState ? this.trueState.readValue().value.value : coerceLocalizedText(this._trueState || "TRUE")!;
|
|
351
|
+
}
|
|
352
|
+
public getFalseState(): LocalizedText {
|
|
353
|
+
return this.falseState ? this.falseState.readValue().value.value : coerceLocalizedText(this._falseState || "FALSE")!;
|
|
354
|
+
}
|
|
355
|
+
// TODO : shall we care about overloading the remove_backward_reference method ?
|
|
356
|
+
// some TrueSubState and FalseSubState relationship may be added later
|
|
357
|
+
// so we need a mechanism to keep adding the "value_changed" event handle on subStates that
|
|
358
|
+
// will be defined later.
|
|
359
|
+
// install change detection on sub State
|
|
360
|
+
// this is useful to change the effective transitionTime
|
|
361
|
+
// EffectiveTransitionTime specifies the time when the current state or one of its sub states was entered.
|
|
362
|
+
// If, for example, a LevelAlarm is active and – while active – switches several times between High and
|
|
363
|
+
// HighHigh, then the TransitionTime stays at the point in time where the Alarm became active whereas the
|
|
364
|
+
// EffectiveTransitionTime changes with each shift of a sub state.
|
|
365
|
+
public _add_backward_reference(reference: UAReference): void {
|
|
366
|
+
super._add_backward_reference(reference);
|
|
367
|
+
|
|
368
|
+
if (
|
|
369
|
+
reference.isForward &&
|
|
370
|
+
(sameNodeId(reference.referenceType, hasTrueSubState_ReferenceTypeNodeId) ||
|
|
371
|
+
sameNodeId(reference.referenceType, hasFalseSubState_ReferenceTypeNodeId))
|
|
372
|
+
) {
|
|
373
|
+
const addressSpace = this.addressSpace;
|
|
374
|
+
// add event handle
|
|
375
|
+
const subState = addressSpace.findNode(reference.nodeId) as UAVariable;
|
|
376
|
+
subState.on("value_changed", _updateEffectiveTransitionTime.bind(null, this, subState));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export function _addTwoStateVariable(namespace: INamespace, options: AddTwoStateVariableOptions): UATwoStateVariableEx {
|
|
382
|
+
const addressSpace = namespace.addressSpace;
|
|
383
|
+
|
|
384
|
+
const twoStateVariableType = addressSpace.findVariableType("TwoStateVariableType");
|
|
385
|
+
if (!twoStateVariableType) {
|
|
386
|
+
throw new Error("cannot find TwoStateVariableType");
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
options.optionals = options.optionals || [];
|
|
390
|
+
if (options.trueState) {
|
|
391
|
+
options.optionals.push("TrueState");
|
|
392
|
+
}
|
|
393
|
+
if (options.falseState) {
|
|
394
|
+
options.optionals.push("FalseState");
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// we want event based changes...
|
|
398
|
+
options.minimumSamplingInterval = 0;
|
|
399
|
+
|
|
400
|
+
const node = twoStateVariableType.instantiate({
|
|
401
|
+
browseName: options.browseName,
|
|
402
|
+
|
|
403
|
+
nodeId: options.nodeId,
|
|
404
|
+
|
|
405
|
+
description: options.description,
|
|
406
|
+
|
|
407
|
+
componentOf: options.componentOf,
|
|
408
|
+
organizedBy: options.organizedBy,
|
|
409
|
+
|
|
410
|
+
modellingRule: options.modellingRule,
|
|
411
|
+
|
|
412
|
+
dataType: resolveNodeId(DataType.LocalizedText),
|
|
413
|
+
|
|
414
|
+
minimumSamplingInterval: options.minimumSamplingInterval,
|
|
415
|
+
|
|
416
|
+
optionals: options.optionals
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
const _node = _install_TwoStateVariable_machinery(node, options);
|
|
420
|
+
return _node;
|
|
421
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { assert } from "node-opcua-assert";
|
|
6
|
+
import { NodeId, resolveNodeId } from "node-opcua-nodeid";
|
|
7
|
+
import { sameNodeId } from "node-opcua-nodeid";
|
|
8
|
+
import { BaseNode, UADataType, UAObjectType, UAReference, UAReferenceType, UAVariableType } from "node-opcua-address-space-base";
|
|
9
|
+
|
|
10
|
+
import { BaseNode_getCache } from "./base_node_private";
|
|
11
|
+
import { ReferenceImpl } from "./reference_impl";
|
|
12
|
+
import { BaseNodeImpl } from "./base_node_impl";
|
|
13
|
+
import { UAReferenceTypeImpl } from "./ua_reference_type_impl";
|
|
14
|
+
import { UADataTypeImpl } from "./ua_data_type_impl";
|
|
15
|
+
import { UAObjectTypeImpl } from "./ua_object_type_impl";
|
|
16
|
+
import { UAVariableTypeImpl } from "./ua_variable_type_impl";
|
|
17
|
+
|
|
18
|
+
const HasSubTypeNodeId = resolveNodeId("HasSubtype");
|
|
19
|
+
|
|
20
|
+
function _filterSubType(reference: UAReference) {
|
|
21
|
+
return sameNodeId(reference.referenceType, HasSubTypeNodeId) && !reference.isForward;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type BaseNodeConstructor<T extends BaseNode> = new () => T;
|
|
25
|
+
|
|
26
|
+
function _slow_isSupertypeOf<T extends UAType>(this: T, Class: typeof BaseNodeImpl, baseType: T): boolean {
|
|
27
|
+
assert(this instanceof Class);
|
|
28
|
+
assert(baseType instanceof Class, " Object must have same type");
|
|
29
|
+
assert(this.addressSpace);
|
|
30
|
+
|
|
31
|
+
if (sameNodeId(this.nodeId, baseType.nodeId)) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const references = this.allReferences();
|
|
35
|
+
|
|
36
|
+
const subTypes = references.filter(_filterSubType);
|
|
37
|
+
assert(subTypes.length <= 1, "should have zero or one subtype no more");
|
|
38
|
+
|
|
39
|
+
for (const subType1 of subTypes) {
|
|
40
|
+
const subTypeId = subType1.nodeId;
|
|
41
|
+
const subTypeNode = (this.addressSpace.findNode(subTypeId) as any) as T;
|
|
42
|
+
// istanbul ignore next
|
|
43
|
+
if (!subTypeNode) {
|
|
44
|
+
throw new Error("Cannot find object with nodeId " + subTypeId.toString());
|
|
45
|
+
}
|
|
46
|
+
if (sameNodeId(subTypeNode.nodeId, baseType.nodeId)) {
|
|
47
|
+
return true;
|
|
48
|
+
} else {
|
|
49
|
+
if (_slow_isSupertypeOf.call(subTypeNode, Class, baseType)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type MemberFuncValue<T, P, R> = (this: T, param: P) => R;
|
|
58
|
+
|
|
59
|
+
// http://jsperf.com/underscore-js-memoize-refactor-test
|
|
60
|
+
// http://addyosmani.com/blog/faster-javascript-memoization/
|
|
61
|
+
function wrap_memoize<T, P, R>(
|
|
62
|
+
func: MemberFuncValue<T, P, R>,
|
|
63
|
+
hashFunc?: (this: T, param: any) => string
|
|
64
|
+
): MemberFuncValue<T, P, R> {
|
|
65
|
+
if (undefined === hashFunc) {
|
|
66
|
+
hashFunc = (_p: T) => (_p as any).toString();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return function memoize(this: any, param: any) {
|
|
70
|
+
if (!this.__cache) {
|
|
71
|
+
this.__cache = {};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const hash = hashFunc!.call(this, param);
|
|
75
|
+
|
|
76
|
+
let cache_value = this.__cache[hash];
|
|
77
|
+
|
|
78
|
+
if (cache_value === undefined) {
|
|
79
|
+
cache_value = func.call(this, param);
|
|
80
|
+
this.__cache[hash] = cache_value;
|
|
81
|
+
}
|
|
82
|
+
return cache_value;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function hashBaseNode(e: BaseNode): string {
|
|
87
|
+
return e.nodeId.value.toString();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type IsSupertypeOfFunc<T extends UAType> = (this: T, baseType: T) => boolean;
|
|
91
|
+
|
|
92
|
+
export type UAType = UAReferenceType | UADataType | UAObjectType | UAVariableType;
|
|
93
|
+
|
|
94
|
+
export function construct_isSupertypeOf<T extends UAType>(Class: typeof BaseNodeImpl): IsSupertypeOfFunc<T> {
|
|
95
|
+
assert(typeof Class === "function");
|
|
96
|
+
return wrap_memoize(function (this: T, baseType: T): boolean {
|
|
97
|
+
assert(baseType instanceof Class);
|
|
98
|
+
assert(this instanceof Class);
|
|
99
|
+
return _slow_isSupertypeOf.call(this, Class, baseType);
|
|
100
|
+
}, hashBaseNode);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function construct_slow_isSupertypeOf<T extends UAType>(Class: typeof BaseNodeImpl) {
|
|
104
|
+
return function (this: T, baseType: T) {
|
|
105
|
+
return _slow_isSupertypeOf.call(this, Class, baseType);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* returns the nodeId of the Type which is the super type of this
|
|
111
|
+
*/
|
|
112
|
+
export function get_subtypeOf<T extends BaseNode>(this: T): NodeId | null {
|
|
113
|
+
const s = get_subtypeOfObj.call(this);
|
|
114
|
+
return s ? s.nodeId : null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function get_subtypeOfObj(this: BaseNode): BaseNode | null {
|
|
118
|
+
const _cache = BaseNode_getCache(this);
|
|
119
|
+
|
|
120
|
+
if (!_cache._subtypeOfObj) {
|
|
121
|
+
const is_subtype_of_ref = this.findReference("HasSubtype", false);
|
|
122
|
+
if (is_subtype_of_ref) {
|
|
123
|
+
_cache._subtypeOfObj = ReferenceImpl.resolveReferenceNode(this.addressSpace, is_subtype_of_ref);
|
|
124
|
+
} else {
|
|
125
|
+
_cache._subtypeOfObj = null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return _cache._subtypeOfObj;
|
|
129
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UAMethod, UAObjectType } from "node-opcua-address-space-base";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface UAConditionType extends UAObjectType {
|
|
5
|
+
disable: UAMethod;
|
|
6
|
+
enable: UAMethod;
|
|
7
|
+
conditionRefresh: UAMethod;
|
|
8
|
+
conditionRefresh2: UAMethod;
|
|
9
|
+
addComment: UAMethod;
|
|
10
|
+
}
|