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,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.DataAccess
|
|
3
|
+
*/
|
|
4
|
+
// Release 1.02 5 OPC Unified Architecture, Part 8
|
|
5
|
+
|
|
6
|
+
// HasProperty Variable Definition String PropertyType Optional
|
|
7
|
+
// HasProperty Variable ValuePrecision Double PropertyType Optional
|
|
8
|
+
|
|
9
|
+
// Clients may read or write DataItems, or monitor them for value changes. The services needed for
|
|
10
|
+
// these operations are specified in Part 4. Changes are defined as a change in status (quality) or a
|
|
11
|
+
// change in value that exceeds a client - defined range called a Deadband. To detect the value change,
|
|
12
|
+
// the difference between the current value and the last reported value is compared to the Deadband.
|
|
13
|
+
|
|
14
|
+
// Definition is a vendor - specific, human readable string that specifies how the value of this DataItem is
|
|
15
|
+
// calculated. Definition is non - localized and will often contain an equation that can be parsed by
|
|
16
|
+
// certain clients.
|
|
17
|
+
// Example: Definition ::= “(TempA – 25) + TempB”
|
|
18
|
+
|
|
19
|
+
// ValuePrecision specifies the maximum precision that the server can maintain for the item based on
|
|
20
|
+
// restrictions in the target environment.
|
|
21
|
+
// ValuePrecision can be used for the following DataTypes:
|
|
22
|
+
// * For Float and Double values it specifies the number of digits after the decimal place.
|
|
23
|
+
// * For DateTime values it indicates the minimum time difference in nanoseconds. For example,
|
|
24
|
+
// a ValuePrecision of 20 000 000 defines a precision of 20 ms.
|
|
25
|
+
// The ValuePrecision Property is an approximation that is intended to prov ide guidance to a Client. A
|
|
26
|
+
// Server is expected to silently round any value with more precision that it supports. This implies that
|
|
27
|
+
// a Client may encounter cases where the value read back from a Server differs from the value that it
|
|
28
|
+
// wrote to the Server. This difference shall be no more than the difference suggested by this Property
|
|
29
|
+
|
|
30
|
+
import { assert } from "node-opcua-assert";
|
|
31
|
+
import { DataType, Variant } from "node-opcua-variant";
|
|
32
|
+
|
|
33
|
+
import { UAVariable, ModellingRuleType } from "node-opcua-address-space-base";
|
|
34
|
+
|
|
35
|
+
const definition_Description =
|
|
36
|
+
"Definition is a vendor - specific," + " human readable string that specifies how the value of this DataItem is calculated.";
|
|
37
|
+
const valuePrecision_Description = "";
|
|
38
|
+
|
|
39
|
+
interface add_dataItem_stuffOptions {
|
|
40
|
+
definition?: string;
|
|
41
|
+
valuePrecision?: number;
|
|
42
|
+
modellingRule?: ModellingRuleType;
|
|
43
|
+
}
|
|
44
|
+
export function add_dataItem_stuff(variable: UAVariable, options: add_dataItem_stuffOptions) :void{
|
|
45
|
+
const addressSpace = variable.addressSpace;
|
|
46
|
+
const namespace = addressSpace.getNamespace(variable.nodeId.namespace);
|
|
47
|
+
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(options,"definition")) {
|
|
49
|
+
namespace.addVariable({
|
|
50
|
+
browseName: { name: "Definition", namespaceIndex: 0 },
|
|
51
|
+
dataType: "String",
|
|
52
|
+
description: definition_Description,
|
|
53
|
+
minimumSamplingInterval: 0,
|
|
54
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
55
|
+
propertyOf: variable,
|
|
56
|
+
typeDefinition: "PropertyType",
|
|
57
|
+
value: new Variant({ dataType: DataType.String, value: options.definition })
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (Object.prototype.hasOwnProperty.call(options,"valuePrecision")) {
|
|
62
|
+
assert(typeof options.valuePrecision === "number");
|
|
63
|
+
|
|
64
|
+
namespace.addVariable({
|
|
65
|
+
browseName: { name: "ValuePrecision", namespaceIndex: 0 },
|
|
66
|
+
dataType: "Double",
|
|
67
|
+
description: valuePrecision_Description,
|
|
68
|
+
minimumSamplingInterval: 0,
|
|
69
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
70
|
+
propertyOf: variable,
|
|
71
|
+
typeDefinition: "PropertyType",
|
|
72
|
+
value: new Variant({ dataType: DataType.Double, value: options.valuePrecision })
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.DataAccess
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { UAAnalogItem } from "node-opcua-nodeset-ua";
|
|
6
|
+
import { StatusCodes } from "node-opcua-status-code";
|
|
7
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
8
|
+
import { Range } from "node-opcua-types";
|
|
9
|
+
import { DataType, Variant } from "node-opcua-variant";
|
|
10
|
+
import { UAVariableImpl } from "../ua_variable_impl";
|
|
11
|
+
|
|
12
|
+
function validate_value_range(range: Range, variant: Variant) {
|
|
13
|
+
if (variant.value < range.low || variant.value > range.high) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function checkVariantCompatibilityUAAnalogItem(this: UAVariableImpl, value: Variant): StatusCode {
|
|
21
|
+
|
|
22
|
+
assert(value instanceof Variant);
|
|
23
|
+
// test dataType
|
|
24
|
+
if (!this._validate_DataType(value.dataType)) {
|
|
25
|
+
return StatusCodes.BadTypeMismatch;
|
|
26
|
+
}
|
|
27
|
+
const analogItem = this as unknown as UAAnalogItem<any, any>;
|
|
28
|
+
// AnalogDataItem
|
|
29
|
+
if (analogItem.instrumentRange) {
|
|
30
|
+
if (!validate_value_range(analogItem.instrumentRange.readValue().value.value as Range, value)) {
|
|
31
|
+
return StatusCodes.BadOutOfRange;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return StatusCodes.Good;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* extend default checkVariantCompatibility on base class with this one
|
|
40
|
+
*/
|
|
41
|
+
UAVariableImpl.prototype.checkVariantCompatibility = checkVariantCompatibilityUAAnalogItem;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.DataAccess
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { VariableTypeIds } from "node-opcua-constants";
|
|
6
|
+
import { coerceLocalizedText, LocalizedText } from "node-opcua-data-model";
|
|
7
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
8
|
+
import { DataType, VariantArrayType, Variant } from "node-opcua-variant";
|
|
9
|
+
import { BindVariableOptions, INamespace, UAVariable, UAProperty } from "node-opcua-address-space-base";
|
|
10
|
+
|
|
11
|
+
import { UAMultiStateDiscrete, UAMultiStateDiscrete_Base } from "node-opcua-nodeset-ua";
|
|
12
|
+
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
13
|
+
import { UAVariableImpl } from "../ua_variable_impl";
|
|
14
|
+
import { AddMultiStateDiscreteOptions } from "../../source/address_space_ts";
|
|
15
|
+
import { add_dataItem_stuff } from "./add_dataItem_stuff";
|
|
16
|
+
|
|
17
|
+
export { UAMultiStateDiscrete } from "node-opcua-nodeset-ua";
|
|
18
|
+
|
|
19
|
+
export interface UAMultiStateDiscreteEx<T, DT extends DataType> extends UAMultiStateDiscrete_Base<T, DT> {
|
|
20
|
+
//------------ helpers ------------------
|
|
21
|
+
getValue(): number;
|
|
22
|
+
getValueAsString(): string;
|
|
23
|
+
getIndex(value: string): number;
|
|
24
|
+
setValue(value: string | number): void;
|
|
25
|
+
checkVariantCompatibility(value: Variant): StatusCode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface UAMultiStateDiscreteImpl<T, DT extends DataType> {
|
|
29
|
+
enumStrings: UAProperty<LocalizedText[], DataType.LocalizedText>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @class UAMultiStateDiscrete
|
|
33
|
+
*/
|
|
34
|
+
export class UAMultiStateDiscreteImpl<T, DT extends DataType> extends UAVariableImpl implements UAMultiStateDiscreteEx<T, DT> {
|
|
35
|
+
public getValue(): number {
|
|
36
|
+
return this.readValue().value.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public getValueAsString(): string {
|
|
40
|
+
const index = this.getValue();
|
|
41
|
+
const arr = this.enumStrings.readValue().value.value;
|
|
42
|
+
assert(Array.isArray(arr));
|
|
43
|
+
return arr[index].text ? arr[index].text!.toString() : "????";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public getIndex(value: string): number {
|
|
47
|
+
const arr = this.enumStrings.readValue().value.value;
|
|
48
|
+
assert(Array.isArray(arr));
|
|
49
|
+
const index = arr.findIndex((a: LocalizedText) => a.text === value);
|
|
50
|
+
return index;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public setValue(value: string | number): void {
|
|
54
|
+
if (typeof value === "string") {
|
|
55
|
+
const index = this.getIndex(value);
|
|
56
|
+
if (index < 0) {
|
|
57
|
+
throw new Error("UAMultiStateDiscrete#setValue invalid multi state value provided : " + value);
|
|
58
|
+
}
|
|
59
|
+
return this.setValue(index);
|
|
60
|
+
}
|
|
61
|
+
const arrayEnumStrings = this.enumStrings.readValue().value.value;
|
|
62
|
+
if (value >= arrayEnumStrings.length) {
|
|
63
|
+
throw new Error("UAMultiStateDiscrete#setValue BadOutOfRange " + value);
|
|
64
|
+
}
|
|
65
|
+
assert(isFinite(value));
|
|
66
|
+
return this.setValueFromSource(new Variant({ dataType: DataType.UInt32, value }));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public checkVariantCompatibility(value: Variant): StatusCode {
|
|
70
|
+
if (!this._validate_DataType(value.dataType)) {
|
|
71
|
+
return StatusCodes.BadTypeMismatch;
|
|
72
|
+
}
|
|
73
|
+
if (this.enumStrings) {
|
|
74
|
+
const arrayEnumStrings = this.enumStrings.readValue().value.value;
|
|
75
|
+
// MultiStateDiscreteType
|
|
76
|
+
assert(value.dataType === DataType.UInt32);
|
|
77
|
+
if (value.value >= arrayEnumStrings.length) {
|
|
78
|
+
return StatusCodes.BadOutOfRange;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return StatusCodes.Good;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public _post_initialize(): void {
|
|
85
|
+
/* empty */
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public clone<T, DT extends DataType>(options1: any, optionalFilter: any, extraInfo: any): UAMultiStateDiscreteImpl<T, DT> {
|
|
89
|
+
const variable1 = UAVariableImpl.prototype.clone.call(this, options1, optionalFilter, extraInfo);
|
|
90
|
+
return promoteToMultiStateDiscrete(variable1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function promoteToMultiStateDiscrete<T, DT extends DataType>(node: UAVariable): UAMultiStateDiscreteImpl<T, DT> {
|
|
95
|
+
if (node instanceof UAMultiStateDiscreteImpl) {
|
|
96
|
+
return node; // already promoted
|
|
97
|
+
}
|
|
98
|
+
Object.setPrototypeOf(node, UAMultiStateDiscreteImpl.prototype);
|
|
99
|
+
assert(node instanceof UAMultiStateDiscreteImpl, "should now be a State Machine");
|
|
100
|
+
const _node = node as UAMultiStateDiscreteImpl<T, DT>;
|
|
101
|
+
|
|
102
|
+
_node._post_initialize();
|
|
103
|
+
|
|
104
|
+
assert(_node.enumStrings.browseName.toString() === "EnumStrings");
|
|
105
|
+
const handler = _node.handle_semantic_changed.bind(_node);
|
|
106
|
+
_node.enumStrings.on("value_changed", handler);
|
|
107
|
+
_node.install_extra_properties();
|
|
108
|
+
return node as UAMultiStateDiscreteImpl<T, DT>;
|
|
109
|
+
}
|
|
110
|
+
registerNodePromoter(VariableTypeIds.MultiStateDiscreteType, promoteToMultiStateDiscrete);
|
|
111
|
+
|
|
112
|
+
export function _addMultiStateDiscrete<T,DT extends DataType>(namespace: INamespace, options: AddMultiStateDiscreteOptions): UAMultiStateDiscreteImpl<T,DT> {
|
|
113
|
+
const addressSpace = namespace.addressSpace;
|
|
114
|
+
assert(Object.prototype.hasOwnProperty.call(options,"enumStrings"));
|
|
115
|
+
assert(!Object.prototype.hasOwnProperty.call(options,"ValuePrecision"));
|
|
116
|
+
|
|
117
|
+
const multiStateDiscreteType = addressSpace.findVariableType("MultiStateDiscreteType");
|
|
118
|
+
if (!multiStateDiscreteType) {
|
|
119
|
+
throw new Error("Cannot find MultiStateDiscreteType");
|
|
120
|
+
}
|
|
121
|
+
// todo : if options.typeDefinition is specified, check that type is SubTypeOf MultiStateDiscreteType
|
|
122
|
+
|
|
123
|
+
options.value = options.value === undefined ? 0 : options.value;
|
|
124
|
+
|
|
125
|
+
let value: undefined | BindVariableOptions;
|
|
126
|
+
if (typeof options.value === "number") {
|
|
127
|
+
value = new Variant({
|
|
128
|
+
dataType: DataType.UInt32,
|
|
129
|
+
value: options.value
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
value = options.value;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const variable = namespace.addVariable({
|
|
136
|
+
...options,
|
|
137
|
+
|
|
138
|
+
dataType: "Number",
|
|
139
|
+
typeDefinition: multiStateDiscreteType.nodeId,
|
|
140
|
+
value,
|
|
141
|
+
|
|
142
|
+
valueRank: -2
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
add_dataItem_stuff(variable, options);
|
|
146
|
+
|
|
147
|
+
const enumStrings = options.enumStrings.map((value: string) => {
|
|
148
|
+
return coerceLocalizedText(value);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const enumStringsNode = namespace.addVariable({
|
|
152
|
+
accessLevel: "CurrentRead", // | CurrentWrite",
|
|
153
|
+
browseName: { name: "EnumStrings", namespaceIndex: 0 },
|
|
154
|
+
dataType: "LocalizedText",
|
|
155
|
+
minimumSamplingInterval: 0,
|
|
156
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
157
|
+
propertyOf: variable,
|
|
158
|
+
typeDefinition: "PropertyType",
|
|
159
|
+
userAccessLevel: "CurrentRead", // CurrentWrite",
|
|
160
|
+
value: new Variant({
|
|
161
|
+
arrayType: VariantArrayType.Array,
|
|
162
|
+
dataType: DataType.LocalizedText,
|
|
163
|
+
value: enumStrings
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
return promoteToMultiStateDiscrete(variable);
|
|
168
|
+
}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.DataAccess
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { DataType, Variant, VariantArrayType } from "node-opcua-variant";
|
|
6
|
+
import { coerceInt32, coerceUInt64, Int64, isValidUInt64 } from "node-opcua-basic-types";
|
|
7
|
+
import { coerceLocalizedText, LocalizedText, QualifiedNameLike } from "node-opcua-data-model";
|
|
8
|
+
import { DataValue, DataValueT } from "node-opcua-data-value";
|
|
9
|
+
import { StatusCodes } from "node-opcua-status-code";
|
|
10
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
11
|
+
import { NumericRange } from "node-opcua-numeric-range";
|
|
12
|
+
import { DTEnumValue } from "node-opcua-nodeset-ua";
|
|
13
|
+
import { BindVariableOptions, INamespace, UAVariable, UAProperty, ISessionContext } from "node-opcua-address-space-base";
|
|
14
|
+
import { VariableTypeIds } from "node-opcua-constants";
|
|
15
|
+
|
|
16
|
+
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
17
|
+
import { coerceEnumValues } from "../../source/helpers/coerce_enum_value";
|
|
18
|
+
import { UAMultiStateValueDiscreteEx } from "../../source/interfaces/data_access/ua_multistate_value_discrete_ex";
|
|
19
|
+
import { AddMultiStateValueDiscreteOptions } from "../../source/address_space_ts";
|
|
20
|
+
import { UAVariableImpl } from "../ua_variable_impl";
|
|
21
|
+
|
|
22
|
+
import { add_dataItem_stuff } from "./add_dataItem_stuff";
|
|
23
|
+
|
|
24
|
+
function install_synchronization<T, DT extends DataType>(variable: UAMultiStateValueDiscreteEx<T, DT>) {
|
|
25
|
+
const _variable = variable as UAMultiStateValueDiscreteEx<T, DT>;
|
|
26
|
+
_variable.on("value_changed", (value: DataValue) => {
|
|
27
|
+
const valueAsTextNode = variable.valueAsText || (_variable.getComponentByName("ValueAsText") as UAVariable);
|
|
28
|
+
if (!valueAsTextNode) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const valueAsText1 = _variable.findValueAsText(value.value.value);
|
|
32
|
+
valueAsTextNode.setValueFromSource(valueAsText1);
|
|
33
|
+
});
|
|
34
|
+
_variable.emit("value_changed", _variable.readValue());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface UAMultiStateValueDiscreteImpl<T, DT extends DataType> {
|
|
38
|
+
enumValues: UAProperty<DTEnumValue[], DataType.ExtensionObject>;
|
|
39
|
+
valueAsText: UAProperty<LocalizedText, DataType.LocalizedText>;
|
|
40
|
+
|
|
41
|
+
readValue(
|
|
42
|
+
context?: ISessionContext | null,
|
|
43
|
+
indexRange?: NumericRange,
|
|
44
|
+
dataEncoding?: QualifiedNameLike | null
|
|
45
|
+
): DataValueT<T, DT>;
|
|
46
|
+
|
|
47
|
+
readValueAsync(context: ISessionContext | null, callback?: any): any;
|
|
48
|
+
}
|
|
49
|
+
export class UAMultiStateValueDiscreteImpl<T, DT extends DataType>
|
|
50
|
+
extends UAVariableImpl
|
|
51
|
+
implements UAMultiStateValueDiscreteEx<T, DT>
|
|
52
|
+
{
|
|
53
|
+
public setValue(value: string | number | Int64): void {
|
|
54
|
+
if (typeof value === "string") {
|
|
55
|
+
const enumValues = this.enumValues.readValue().value.value;
|
|
56
|
+
const selected = enumValues.filter((a: any) => a.displayName.text === value)[0];
|
|
57
|
+
if (selected) {
|
|
58
|
+
this._setValue(selected.value);
|
|
59
|
+
} else {
|
|
60
|
+
throw new Error("cannot find enum string " + value + " in " + enumValues.toString());
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
this._setValue(coerceUInt64(value));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public getValueAsString(): string {
|
|
68
|
+
return this.valueAsText.readValue().value.value.text || "";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public getValueAsNumber(): number {
|
|
72
|
+
return this.readValue().value.value as unknown as number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public checkVariantCompatibility(value: Variant): StatusCode {
|
|
76
|
+
if (this.enumValues) {
|
|
77
|
+
if (!this._isValueInRange(coerceInt32(value.value))) {
|
|
78
|
+
return StatusCodes.BadOutOfRange;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return StatusCodes.Good;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public clone<T, DT extends DataType>(options1: any, optionalFilter: any, extraInfo: any): UAMultiStateValueDiscreteImpl<T, DT> {
|
|
85
|
+
const variable1 = UAVariableImpl.prototype.clone.call(this, options1, optionalFilter, extraInfo);
|
|
86
|
+
return promoteToMultiStateValueDiscrete(variable1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
public _isValueInRange(value: number): boolean {
|
|
93
|
+
// MultiStateValueDiscreteType
|
|
94
|
+
const enumValues = this.enumValues.readValue().value.value as DTEnumValue[];
|
|
95
|
+
const e = enumValues.findIndex((x: DTEnumValue) => coerceInt32(x.value) === value);
|
|
96
|
+
return !(e === -1);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
public _enumValueIndex(): any {
|
|
103
|
+
// construct an index to quickly find a EnumValue from a value
|
|
104
|
+
const enumValues = this.enumValues.readValue().value.value;
|
|
105
|
+
const enumValueIndex: any = {};
|
|
106
|
+
if (!enumValues || !enumValues.forEach) {
|
|
107
|
+
return enumValueIndex;
|
|
108
|
+
}
|
|
109
|
+
enumValues.forEach((e: any) => {
|
|
110
|
+
enumValueIndex[e.value[1]] = e;
|
|
111
|
+
});
|
|
112
|
+
return enumValueIndex;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
public _setValue(value: Int64): void {
|
|
120
|
+
// check that value is in bound
|
|
121
|
+
if (!this._isValueInRange(coerceInt32(value))) {
|
|
122
|
+
throw new Error("UAMultiStateValueDiscrete#_setValue out of range " + value);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const dataType = this._getDataType();
|
|
126
|
+
if (dataType === DataType.Int64 || dataType === DataType.UInt64) {
|
|
127
|
+
this.setValueFromSource({ dataType, value });
|
|
128
|
+
} else {
|
|
129
|
+
const valueN = value[1];
|
|
130
|
+
this.setValueFromSource({ dataType, value: valueN });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
*
|
|
136
|
+
* @private
|
|
137
|
+
*/
|
|
138
|
+
public findValueAsText(value?: number | Int64): Variant {
|
|
139
|
+
const enumValueIndex = this._enumValueIndex();
|
|
140
|
+
|
|
141
|
+
if (value === undefined) {
|
|
142
|
+
throw new Error("Unexpected undefined value");
|
|
143
|
+
}
|
|
144
|
+
if (value instanceof Array) {
|
|
145
|
+
value = value[1];
|
|
146
|
+
}
|
|
147
|
+
assert(!((value as any) instanceof Variant));
|
|
148
|
+
let valueAsText1 = "Invalid";
|
|
149
|
+
if (enumValueIndex[value]) {
|
|
150
|
+
valueAsText1 = enumValueIndex[value].displayName;
|
|
151
|
+
}
|
|
152
|
+
const result = new Variant({
|
|
153
|
+
dataType: DataType.LocalizedText,
|
|
154
|
+
value: coerceLocalizedText(valueAsText1)
|
|
155
|
+
});
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
public _getDataType(): DataType {
|
|
159
|
+
if (this.dataType.value === 26 /* Number */) {
|
|
160
|
+
return DataType.UInt32;
|
|
161
|
+
}
|
|
162
|
+
const dataTypeStr = DataType[this.dataType.value as number] as string;
|
|
163
|
+
return (DataType as any)[dataTypeStr] as DataType;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
public _post_initialize():void {
|
|
171
|
+
// MultiStateValueDiscrete Variables can have any numeric Data Type;
|
|
172
|
+
// this includes signed and unsigned integers from 8 to 64 Bit length.
|
|
173
|
+
|
|
174
|
+
// istanbul ignore next
|
|
175
|
+
if (
|
|
176
|
+
typeof this.dataType.value !== "number" ||
|
|
177
|
+
[
|
|
178
|
+
DataType.UInt64,
|
|
179
|
+
DataType.Int64,
|
|
180
|
+
DataType.UInt32,
|
|
181
|
+
DataType.Int32,
|
|
182
|
+
DataType.UInt16,
|
|
183
|
+
DataType.Int16,
|
|
184
|
+
DataType.Byte,
|
|
185
|
+
DataType.Byte,
|
|
186
|
+
DataType.SByte,
|
|
187
|
+
26 /*Number*/
|
|
188
|
+
].indexOf(this.dataType.value as number) <= 0
|
|
189
|
+
) {
|
|
190
|
+
throw new Error("Invalid DataType in UAMultiStateValueDiscrete =>" + this.dataType.toString());
|
|
191
|
+
}
|
|
192
|
+
// find the enum value type
|
|
193
|
+
install_synchronization(this);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function promoteToMultiStateValueDiscrete<T, DT extends DataType>(node: UAVariable): UAMultiStateValueDiscreteImpl<T, DT> {
|
|
198
|
+
if (node instanceof UAMultiStateValueDiscreteImpl) {
|
|
199
|
+
return node; // already promoted
|
|
200
|
+
}
|
|
201
|
+
Object.setPrototypeOf(node, UAMultiStateValueDiscreteImpl.prototype);
|
|
202
|
+
assert(node instanceof UAMultiStateValueDiscreteImpl, "should now be a State Machine");
|
|
203
|
+
(node as UAMultiStateValueDiscreteImpl<T, DT>)._post_initialize();
|
|
204
|
+
return node as UAMultiStateValueDiscreteImpl<T, DT>;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
registerNodePromoter(VariableTypeIds.MultiStateValueDiscreteType, promoteToMultiStateValueDiscrete);
|
|
208
|
+
|
|
209
|
+
export function _addMultiStateValueDiscrete<T, DT extends DataType>(
|
|
210
|
+
namespace: INamespace,
|
|
211
|
+
options: AddMultiStateValueDiscreteOptions
|
|
212
|
+
): UAMultiStateValueDiscreteEx<T, DT> {
|
|
213
|
+
assert(Object.prototype.hasOwnProperty.call(options, "enumValues"));
|
|
214
|
+
assert(!Object.prototype.hasOwnProperty.call(options, "ValuePrecision"));
|
|
215
|
+
|
|
216
|
+
const addressSpace = namespace.addressSpace;
|
|
217
|
+
|
|
218
|
+
const multiStateValueDiscreteType = addressSpace.findVariableType("MultiStateValueDiscreteType");
|
|
219
|
+
if (!multiStateValueDiscreteType) {
|
|
220
|
+
throw new Error("expecting MultiStateValueDiscreteType to be defined , check nodeset xml file");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// todo : if options.typeDefinition is specified, check that type is SubTypeOf MultiStateDiscreteType
|
|
224
|
+
|
|
225
|
+
// EnumValueType
|
|
226
|
+
// value: Int64, displayName: LocalizedText, Description: LocalizedText
|
|
227
|
+
const enumValues = coerceEnumValues(options.enumValues);
|
|
228
|
+
|
|
229
|
+
if (options.value === undefined && enumValues[0]) {
|
|
230
|
+
options.value = enumValues[0].value; // Int64
|
|
231
|
+
}
|
|
232
|
+
let value: undefined | BindVariableOptions;
|
|
233
|
+
if (typeof options.value === "number" || isValidUInt64(options.value as number | number[])) {
|
|
234
|
+
if (isValidUInt64(options.value as number | number[])) {
|
|
235
|
+
value = new Variant({
|
|
236
|
+
dataType: DataType.UInt32,
|
|
237
|
+
value: (options.value as Int64)[1] // Low word
|
|
238
|
+
});
|
|
239
|
+
} else {
|
|
240
|
+
value = new Variant({
|
|
241
|
+
dataType: DataType.UInt32,
|
|
242
|
+
value: options.value
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
value = options.value as any;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const cloned_options = {
|
|
250
|
+
...options,
|
|
251
|
+
dataType: DataType.UInt32,
|
|
252
|
+
typeDefinition: multiStateValueDiscreteType.nodeId,
|
|
253
|
+
// valueRank:
|
|
254
|
+
// note : OPCUA Spec 1.03 specifies -1:Scalar (part 8 page 8) but nodeset file specifies -2:Any
|
|
255
|
+
value,
|
|
256
|
+
valueRank: -1 // -1 : Scalar
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const variable = namespace.addVariable(cloned_options) as UAMultiStateValueDiscreteEx<T, DT>;
|
|
260
|
+
|
|
261
|
+
add_dataItem_stuff(variable, options);
|
|
262
|
+
|
|
263
|
+
namespace.addVariable({
|
|
264
|
+
accessLevel: "CurrentRead",
|
|
265
|
+
browseName: { name: "EnumValues", namespaceIndex: 0 },
|
|
266
|
+
dataType: "EnumValueType",
|
|
267
|
+
minimumSamplingInterval: 0,
|
|
268
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
269
|
+
propertyOf: variable,
|
|
270
|
+
typeDefinition: "PropertyType",
|
|
271
|
+
userAccessLevel: "CurrentRead",
|
|
272
|
+
value: new Variant({
|
|
273
|
+
arrayType: VariantArrayType.Array,
|
|
274
|
+
dataType: DataType.ExtensionObject,
|
|
275
|
+
value: enumValues
|
|
276
|
+
})
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
namespace.addVariable({
|
|
280
|
+
accessLevel: "CurrentRead",
|
|
281
|
+
browseName: { name: "ValueAsText", namespaceIndex: 0 },
|
|
282
|
+
dataType: DataType.LocalizedText,
|
|
283
|
+
minimumSamplingInterval: 0,
|
|
284
|
+
modellingRule: options.modellingRule ? "Mandatory" : undefined,
|
|
285
|
+
propertyOf: variable,
|
|
286
|
+
typeDefinition: "PropertyType",
|
|
287
|
+
userAccessLevel: "CurrentRead"
|
|
288
|
+
// value: valueAsText
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// install additional helpers methods
|
|
292
|
+
variable.install_extra_properties();
|
|
293
|
+
|
|
294
|
+
promoteToMultiStateValueDiscrete(variable);
|
|
295
|
+
|
|
296
|
+
assert(variable.enumValues.browseName.toString() === "EnumValues");
|
|
297
|
+
assert(variable.valueAsText.browseName.toString() === "ValueAsText");
|
|
298
|
+
return variable;
|
|
299
|
+
}
|