node-opcua-address-space 2.169.0 → 2.172.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/address_space_ts.d.ts +13 -13
- package/dist/source/address_space_ts.js +4 -0
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/continuation_points/continuation_point_manager.d.ts +6 -3
- package/dist/source/continuation_points/continuation_point_manager.js +4 -4
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -1
- package/dist/source/helpers/adjust_browse_direction.d.ts +1 -1
- package/dist/source/helpers/argument_list.d.ts +13 -11
- package/dist/source/helpers/argument_list.js +24 -15
- package/dist/source/helpers/argument_list.js.map +1 -1
- package/dist/source/helpers/call_helpers.d.ts +6 -3
- package/dist/source/helpers/call_helpers.js +5 -6
- package/dist/source/helpers/call_helpers.js.map +1 -1
- package/dist/source/helpers/coerce_enum_value.d.ts +2 -2
- package/dist/source/helpers/coerce_enum_value.js +2 -2
- package/dist/source/helpers/coerce_enum_value.js.map +1 -1
- package/dist/source/helpers/dump_tools.d.ts +3 -3
- package/dist/source/helpers/dump_tools.js +2 -2
- package/dist/source/helpers/dump_tools.js.map +1 -1
- package/dist/source/helpers/ensure_secure_access.d.ts +1 -1
- package/dist/source/helpers/ensure_secure_access.js +1 -1
- package/dist/source/helpers/ensure_secure_access.js.map +1 -1
- package/dist/source/helpers/make_optionals_map.js +0 -5
- package/dist/source/helpers/make_optionals_map.js.map +1 -1
- package/dist/source/helpers/multiform_func.d.ts +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.d.ts +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js +1 -1
- package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -1
- package/dist/source/index.d.ts +38 -38
- package/dist/source/index.js +53 -54
- package/dist/source/index.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +11 -11
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +6 -6
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.d.ts +4 -4
- package/dist/source/interfaces/alarms_and_conditions/instantiate_condition_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +4 -3
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.d.ts +10 -13
- package/dist/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +11 -11
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.d.ts +11 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_base_event_ex.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +21 -29
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.d.ts +3 -7
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js +0 -23
- package/dist/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +3 -3
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.d.ts +8 -10
- package/dist/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +4 -6
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +5 -5
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.d.ts +3 -3
- package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +7 -7
- package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +5 -8
- package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +5 -5
- package/dist/source/interfaces/data_access/ua_y_array_item_ex.d.ts +3 -3
- package/dist/source/interfaces/extension_object_constructor.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_finite_state_machine_type.d.ts +2 -2
- package/dist/source/interfaces/state_machine/ua_program_state_machine_type.d.ts +3 -3
- package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +6 -6
- package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +7 -6
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js +4 -0
- package/dist/source/interfaces/state_machine/ua_state_machine_type.js.map +1 -1
- package/dist/source/interfaces/state_machine/ua_transition_ex.d.ts +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.d.ts +2 -2
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js +3 -0
- package/dist/source/interfaces/ua_subscription_diagnostics_variable_ex.js.map +1 -1
- package/dist/source/loader/decode_xml_extension_object.d.ts +4 -4
- package/dist/source/loader/decode_xml_extension_object.js +3 -3
- package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
- package/dist/source/loader/ensure_datatype_extracted.d.ts +2 -2
- package/dist/source/loader/ensure_datatype_extracted.js +5 -5
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +3 -3
- package/dist/source/loader/generateAddressSpaceRaw.js +6 -6
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/loader/make_xml_extension_object_parser.d.ts +2 -2
- package/dist/source/loader/make_xml_extension_object_parser.js +19 -19
- package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
- package/dist/source/loader/namespace_post_step.d.ts +1 -1
- package/dist/source/loader/namespace_post_step.js.map +1 -1
- package/dist/source/loader/parsers/extension_object_parser.d.ts +4 -4
- package/dist/source/loader/parsers/extension_object_parser.js +22 -23
- package/dist/source/loader/parsers/extension_object_parser.js.map +1 -1
- package/dist/source/loader/parsers/localized_text_parser.d.ts +2 -2
- package/dist/source/loader/parsers/localized_text_parser.js.map +1 -1
- package/dist/source/loader/parsers/nodeid_parser.d.ts +1 -1
- package/dist/source/loader/parsers/nodeid_parser.js.map +1 -1
- package/dist/source/loader/parsers/qualified_name_parser.d.ts +3 -3
- package/dist/source/loader/parsers/qualified_name_parser.js.map +1 -1
- package/dist/source/loader/parsers/variant_parser.d.ts +5 -5
- package/dist/source/loader/parsers/variant_parser.js +13 -13
- package/dist/source/loader/parsers/variant_parser.js.map +1 -1
- package/dist/source/loader/register_node_promoter.d.ts +1 -1
- package/dist/source/loader/register_node_promoter.js.map +1 -1
- package/dist/source/namespace.d.ts +4 -4
- package/dist/source/namespace_alarm_and_condition.d.ts +22 -21
- package/dist/source/namespace_data_access.d.ts +11 -11
- package/dist/source/namespace_machine_state.d.ts +4 -4
- package/dist/source/pseudo_session.d.ts +8 -5
- package/dist/source/pseudo_session.js +28 -28
- package/dist/source/pseudo_session.js.map +1 -1
- package/dist/source/session_context.js +1 -1
- package/dist/source/session_context.js.map +1 -1
- package/dist/source/set_namespace_meta_data.d.ts +1 -1
- package/dist/source/set_namespace_meta_data.js +1 -1
- package/dist/source/set_namespace_meta_data.js.map +1 -1
- package/dist/source/ua_addin.d.ts +3 -3
- package/dist/source/ua_addin.js +1 -1
- package/dist/source/ua_addin.js.map +1 -1
- package/dist/source/ua_interface.d.ts +2 -3
- package/dist/source/ua_interface.js +13 -33
- package/dist/source/ua_interface.js.map +1 -1
- package/dist/source/ua_root_folder.d.ts +1 -1
- package/dist/source/ua_two_state_variable_ex.d.ts +5 -5
- package/dist/src/_instantiate_helpers.d.ts +1 -1
- package/dist/src/_instantiate_helpers.js +32 -9
- package/dist/src/_instantiate_helpers.js.map +1 -1
- package/dist/src/_mandatory_child_or_requested_optional_filter.d.ts +2 -2
- package/dist/src/_mandatory_child_or_requested_optional_filter.js +9 -10
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -1
- package/dist/src/address_space.d.ts +2 -2
- package/dist/src/address_space.js +13 -15
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/address_space_change_event_tools.d.ts +3 -3
- package/dist/src/address_space_change_event_tools.js +8 -10
- package/dist/src/address_space_change_event_tools.js.map +1 -1
- package/dist/src/address_space_private.d.ts +11 -11
- package/dist/src/address_space_private.js +3 -0
- package/dist/src/address_space_private.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +6 -6
- package/dist/src/alarms_and_conditions/condition_info_impl.js +6 -15
- package/dist/src/alarms_and_conditions/condition_info_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +10 -10
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +77 -48
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +8 -5
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +15 -9
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/src/alarms_and_conditions/index.d.ts +3 -3
- package/dist/src/alarms_and_conditions/index.js +3 -3
- package/dist/src/alarms_and_conditions/index.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +21 -14
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +26 -21
- package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.d.ts +6 -7
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +30 -28
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +9 -11
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js +10 -10
- package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +3 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +6 -5
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +16 -42
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +100 -82
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.d.ts +12 -7
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js +9 -8
- package/dist/src/alarms_and_conditions/ua_discrete_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +18 -18
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +16 -18
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.d.ts +4 -4
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js +2 -2
- package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +10 -9
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +20 -19
- package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.d.ts +2 -4
- package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +12 -38
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +50 -65
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +15 -17
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +15 -11
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +22 -15
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +35 -24
- package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +15 -16
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +19 -14
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.d.ts +4 -4
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/apply_condition_refresh.d.ts +4 -4
- package/dist/src/apply_condition_refresh.js +1 -1
- package/dist/src/apply_condition_refresh.js.map +1 -1
- package/dist/src/base_node_impl.d.ts +5 -7
- package/dist/src/base_node_impl.js +3 -3
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.d.ts +10 -7
- package/dist/src/base_node_private.js +73 -50
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/check_value_rank_compatibility.js +11 -7
- package/dist/src/check_value_rank_compatibility.js.map +1 -1
- package/dist/src/data_access/add_dataItem_stuff.d.ts +1 -1
- package/dist/src/data_access/add_dataItem_stuff.js +2 -22
- package/dist/src/data_access/add_dataItem_stuff.js.map +1 -1
- package/dist/src/data_access/adjust_datavalue_status_code.d.ts +6 -3
- package/dist/src/data_access/adjust_datavalue_status_code.js +3 -3
- package/dist/src/data_access/adjust_datavalue_status_code.js.map +1 -1
- package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +13 -11
- package/dist/src/data_access/ua_multistate_discrete_impl.js +28 -23
- package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +19 -23
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js +31 -31
- package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
- package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +10 -16
- package/dist/src/data_access/ua_two_state_discrete_impl.js +18 -14
- package/dist/src/data_access/ua_two_state_discrete_impl.js.map +1 -1
- package/dist/src/event_data.d.ts +8 -21
- package/dist/src/event_data.js +24 -19
- package/dist/src/event_data.js.map +1 -1
- package/dist/src/extension_object_array_node.d.ts +5 -2
- package/dist/src/extension_object_array_node.js +21 -24
- package/dist/src/extension_object_array_node.js.map +1 -1
- package/dist/src/get_basic_datatype.d.ts +2 -2
- package/dist/src/get_basic_datatype.js.map +1 -1
- package/dist/src/historical_access/address_space_historical_data_node.d.ts +3 -3
- package/dist/src/historical_access/address_space_historical_data_node.js +24 -17
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/idx_iterator.js +1 -1
- package/dist/src/idx_iterator.js.map +1 -1
- package/dist/src/index_current.d.ts +31 -31
- package/dist/src/index_current.js +45 -45
- package/dist/src/index_current.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +4 -3
- package/dist/src/namespace_impl.js +17 -14
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/namespace_private.js.map +1 -1
- package/dist/src/nodeid_manager.d.ts +3 -3
- package/dist/src/nodeid_manager.js +19 -16
- package/dist/src/nodeid_manager.js.map +1 -1
- package/dist/src/nodeset_tools/adjust_namespace_array.d.ts +1 -1
- package/dist/src/nodeset_tools/construct_namespace_dependency.d.ts +2 -2
- package/dist/src/nodeset_tools/construct_namespace_dependency.js +7 -7
- package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.d.ts +1 -1
- package/dist/src/nodeset_tools/dump_to_bsd.js +15 -11
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +5 -3
- package/dist/src/nodeset_tools/nodeset_to_xml.js +64 -67
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/private_namespace.d.ts +2 -2
- package/dist/src/private_namespace.js.map +1 -1
- package/dist/src/reference_impl.d.ts +2 -2
- package/dist/src/reference_impl.js +9 -11
- package/dist/src/reference_impl.js.map +1 -1
- package/dist/src/role_permissions.d.ts +1 -1
- package/dist/src/role_permissions.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +11 -14
- package/dist/src/state_machine/finite_state_machine.js +36 -30
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +8 -6
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js +16 -18
- package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.d.ts +12 -11
- package/dist/src/state_machine/ua_two_state_variable.js +24 -29
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/tool_isSubtypeOf.d.ts +5 -5
- package/dist/src/tool_isSubtypeOf.js +21 -18
- package/dist/src/tool_isSubtypeOf.js.map +1 -1
- package/dist/src/ua_condition_type.d.ts +1 -1
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.d.ts +9 -5
- package/dist/src/ua_method_impl.js +1 -1
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.d.ts +10 -7
- package/dist/src/ua_object_impl.js +43 -15
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.d.ts +7 -5
- package/dist/src/ua_object_type_impl.js +6 -7
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.d.ts +6 -8
- package/dist/src/ua_reference_type_impl.js +16 -14
- package/dist/src/ua_reference_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.d.ts +44 -45
- package/dist/src/ua_variable_impl.js +177 -83
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_impl_ext_obj.d.ts +3 -3
- package/dist/src/ua_variable_impl_ext_obj.js +37 -29
- package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
- package/dist/src/ua_variable_type_impl.d.ts +11 -11
- package/dist/src/ua_variable_type_impl.js +13 -21
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/src/ua_view_impl.d.ts +3 -4
- package/dist/src/ua_view_impl.js +5 -6
- package/dist/src/ua_view_impl.js.map +1 -1
- package/dist/src/validate_data_type_correctness.d.ts +2 -2
- package/dist/src/validate_data_type_correctness.js +12 -3
- package/dist/src/validate_data_type_correctness.js.map +1 -1
- package/dist/tsconfig_base.tsbuildinfo +1 -1
- package/distHelpers/add_event_generator_object.d.ts +5 -2
- package/distHelpers/add_event_generator_object.js +2 -2
- package/distHelpers/add_event_generator_object.js.map +1 -1
- package/distHelpers/alarms_and_conditions_demo.d.ts +1 -1
- package/distHelpers/alarms_and_conditions_demo.js +4 -6
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -1
- package/distHelpers/assertHasMatchingReference.d.ts +1 -1
- package/distHelpers/assertHasMatchingReference.js +2 -2
- package/distHelpers/assertHasMatchingReference.js.map +1 -1
- package/distHelpers/boiler_system.d.ts +6 -3
- package/distHelpers/boiler_system.js +44 -42
- package/distHelpers/boiler_system.js.map +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.d.ts +1 -1
- package/distHelpers/create_minimalist_address_space_nodeset.js +25 -27
- package/distHelpers/create_minimalist_address_space_nodeset.js.map +1 -1
- package/distHelpers/get_address_space_fixture.js +15 -15
- package/distHelpers/get_address_space_fixture.js.map +1 -1
- package/distHelpers/index.d.ts +2 -2
- package/distHelpers/index.js +2 -2
- package/distHelpers/index.js.map +1 -1
- package/distHelpers/mock_session.d.ts +7 -7
- package/distHelpers/mock_session.js +4 -4
- package/distHelpers/mock_session.js.map +1 -1
- package/distNodeJS/generate_address_space.d.ts +2 -2
- package/distNodeJS/generate_address_space.js +2 -2
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/package.json +36 -36
- package/source/address_space_ts.ts +29 -30
- package/source/continuation_points/continuation_point_manager.ts +8 -7
- package/source/helpers/adjust_browse_direction.ts +1 -1
- package/source/helpers/argument_list.ts +37 -25
- package/source/helpers/call_helpers.ts +10 -15
- package/source/helpers/coerce_enum_value.ts +4 -4
- package/source/helpers/dump_tools.ts +6 -11
- package/source/helpers/ensure_secure_access.ts +2 -2
- package/source/helpers/make_optionals_map.ts +3 -10
- package/source/helpers/multiform_func.ts +1 -1
- package/source/helpers/resolve_opaque_on_address_space.ts +2 -2
- package/source/index.ts +44 -54
- package/source/interfaces/alarms_and_conditions/condition_info_i.ts +3 -4
- package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +13 -13
- package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +8 -10
- package/source/interfaces/alarms_and_conditions/install_setpoint_options.ts +4 -5
- package/source/interfaces/alarms_and_conditions/instantiate_alarm_condition_options.ts +4 -6
- package/source/interfaces/alarms_and_conditions/instantiate_condition_options.ts +3 -3
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +6 -3
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +11 -11
- package/source/interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex.ts +11 -25
- package/source/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +16 -13
- package/source/interfaces/alarms_and_conditions/ua_base_event_ex.ts +12 -0
- package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +5 -5
- package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +30 -54
- package/source/interfaces/alarms_and_conditions/ua_discrete_alarm_ex.ts +3 -34
- package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +18 -22
- package/source/interfaces/alarms_and_conditions/ua_exclusive_limit_alarm_ex.ts +8 -15
- package/source/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +4 -7
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +5 -6
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex.ts +3 -3
- package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +9 -16
- package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +5 -8
- package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +5 -5
- package/source/interfaces/data_access/ua_y_array_item_ex.ts +3 -3
- package/source/interfaces/extension_object_constructor.ts +3 -4
- package/source/interfaces/i_condition_variable_type_setter_options.ts +1 -3
- package/source/interfaces/state_machine/ua_exclusive_limit_state_machine_type_ex.ts +3 -3
- package/source/interfaces/state_machine/ua_finite_state_machine_type.ts +2 -2
- package/source/interfaces/state_machine/ua_program_state_machine_type.ts +3 -3
- package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +10 -7
- package/source/interfaces/state_machine/ua_state_machine_type.ts +11 -8
- package/source/interfaces/state_machine/ua_transition_ex.ts +2 -2
- package/source/interfaces/ua_subscription_diagnostics_variable_ex.ts +3 -2
- package/source/loader/decode_xml_extension_object.ts +7 -7
- package/source/loader/ensure_datatype_extracted.ts +14 -19
- package/source/loader/generateAddressSpaceRaw.ts +12 -13
- package/source/loader/load_nodeset2.ts +3 -3
- package/source/loader/make_xml_extension_object_parser.ts +55 -39
- package/source/loader/namespace_post_step.ts +3 -4
- package/source/loader/parsers/extension_object_parser.ts +63 -62
- package/source/loader/parsers/localized_text_parser.ts +3 -3
- package/source/loader/parsers/nodeid_parser.ts +2 -3
- package/source/loader/parsers/qualified_name_parser.ts +6 -7
- package/source/loader/parsers/variant_parser.ts +48 -55
- package/source/loader/register_node_promoter.ts +2 -2
- package/source/namespace.ts +4 -4
- package/source/namespace_alarm_and_condition.ts +22 -22
- package/source/namespace_data_access.ts +12 -13
- package/source/namespace_machine_state.ts +10 -5
- package/source/pseudo_session.ts +53 -50
- package/source/session_context.ts +1 -1
- package/source/set_namespace_meta_data.ts +3 -3
- package/source/ua_addin.ts +10 -11
- package/source/ua_interface.ts +27 -38
- package/source/ua_root_folder.ts +1 -1
- package/source/ua_two_state_variable_ex.ts +5 -5
- package/source_nodejs/generate_address_space.ts +5 -9
- package/src/_instantiate_helpers.ts +78 -25
- package/src/_mandatory_child_or_requested_optional_filter.ts +20 -19
- package/src/address_space.ts +36 -45
- package/src/address_space_change_event_tools.ts +25 -30
- package/src/address_space_private.ts +20 -21
- package/src/alarms_and_conditions/condition.ts +0 -2
- package/src/alarms_and_conditions/condition_info_impl.ts +11 -19
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +109 -85
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +20 -15
- package/src/alarms_and_conditions/index.ts +3 -3
- package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +44 -32
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +35 -34
- package/src/alarms_and_conditions/ua_base_event_impl.ts +15 -19
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +6 -2
- package/src/alarms_and_conditions/ua_condition_impl.ts +140 -130
- package/src/alarms_and_conditions/ua_discrete_alarm_impl.ts +20 -12
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +40 -43
- package/src/alarms_and_conditions/ua_exclusive_level_alarm_impl.ts +7 -7
- package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +28 -30
- package/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm_impl.ts +3 -6
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +59 -90
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +31 -27
- package/src/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +57 -36
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +31 -27
- package/src/alarms_and_conditions/ua_system_off_normal_alarm_impl.ts +6 -6
- package/src/apply_condition_refresh.ts +7 -8
- package/src/base_node_impl.ts +64 -45
- package/src/base_node_private.ts +171 -139
- package/src/check_value_rank_compatibility.ts +19 -15
- package/src/data_access/add_dataItem_stuff.ts +3 -4
- package/src/data_access/adjust_datavalue_status_code.ts +7 -7
- package/src/data_access/ua_multistate_discrete_impl.ts +44 -28
- package/src/data_access/ua_multistate_value_discrete_impl.ts +77 -66
- package/src/data_access/ua_two_state_discrete_impl.ts +29 -36
- package/src/event_data.ts +29 -26
- package/src/extension_object_array_node.ts +27 -28
- package/src/get_basic_datatype.ts +4 -5
- package/src/historical_access/address_space_historical_data_node.ts +65 -50
- package/src/idx_iterator.ts +4 -12
- package/src/index_current.ts +33 -45
- package/src/namespace_impl.ts +75 -62
- package/src/namespace_private.ts +2 -8
- package/src/nodeid_manager.ts +30 -27
- package/src/nodeset_tools/adjust_namespace_array.ts +1 -1
- package/src/nodeset_tools/construct_namespace_dependency.ts +15 -16
- package/src/nodeset_tools/dump_to_bsd.ts +27 -22
- package/src/nodeset_tools/nodeset_to_xml.ts +95 -114
- package/src/private_namespace.ts +3 -6
- package/src/reference_impl.ts +11 -14
- package/src/role_permissions.ts +1 -1
- package/src/state_machine/finite_state_machine.ts +60 -61
- package/src/state_machine/ua_shelving_state_machine_ex.ts +23 -23
- package/src/state_machine/ua_two_state_variable.ts +34 -31
- package/src/tool_isSubtypeOf.ts +48 -33
- package/src/ua_condition_type.ts +1 -1
- package/src/ua_data_type_impl.ts +12 -13
- package/src/ua_method_impl.ts +17 -12
- package/src/ua_object_impl.ts +73 -39
- package/src/ua_object_type_impl.ts +25 -25
- package/src/ua_reference_type_impl.ts +19 -19
- package/src/ua_variable_impl.ts +316 -219
- package/src/ua_variable_impl_ext_obj.ts +63 -50
- package/src/ua_variable_type_impl.ts +43 -49
- package/src/ua_view_impl.ts +5 -5
- package/src/validate_data_type_correctness.ts +17 -8
|
@@ -2,43 +2,44 @@
|
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
import {
|
|
5
|
+
import type { BaseNode, UAMethod, UAObject, UAObjectType, UAVariable } from "node-opcua-address-space-base";
|
|
6
6
|
import { assert } from "node-opcua-assert";
|
|
7
7
|
import { ObjectTypeIds } from "node-opcua-constants";
|
|
8
8
|
import {
|
|
9
|
+
AttributeIds,
|
|
9
10
|
BrowseDirection,
|
|
10
11
|
coerceLocalizedText,
|
|
11
12
|
coerceQualifiedName,
|
|
12
|
-
LocalizedText,
|
|
13
13
|
NodeClass,
|
|
14
|
-
QualifiedName
|
|
14
|
+
type QualifiedName
|
|
15
15
|
} from "node-opcua-data-model";
|
|
16
|
-
import { AttributeIds } from "node-opcua-data-model";
|
|
17
16
|
import { make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
18
17
|
import { NodeId, sameNodeId } from "node-opcua-nodeid";
|
|
18
|
+
import type { UAState, UATransition } from "node-opcua-nodeset-ua";
|
|
19
19
|
import { StatusCodes } from "node-opcua-status-code";
|
|
20
20
|
import { DataType, Variant, VariantArrayType } from "node-opcua-variant";
|
|
21
|
-
import {
|
|
22
|
-
import { BaseNode, UAMethod, UAObject, UAObjectType, UAProperty, UAVariable, UAVariableT } from "node-opcua-address-space-base";
|
|
23
|
-
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
UAStateMachineEx,
|
|
21
|
+
import type {
|
|
27
22
|
TransitionSelector,
|
|
23
|
+
UAStateMachineEx,
|
|
28
24
|
UAStateMachineTypeHelper
|
|
29
25
|
} from "../../source/interfaces/state_machine/ua_state_machine_type";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
26
|
+
import type { UATransitionEx } from "../../source/interfaces/state_machine/ua_transition_ex";
|
|
27
|
+
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
32
28
|
import { BaseNodeImpl } from "../base_node_impl";
|
|
29
|
+
import { UAObjectImpl } from "../ua_object_impl";
|
|
33
30
|
import { UAObjectTypeImpl } from "../ua_object_type_impl";
|
|
34
31
|
|
|
35
32
|
const warningLog = make_warningLog(__filename);
|
|
36
33
|
|
|
37
34
|
const doDebug = false;
|
|
38
|
-
const debugLog = make_debugLog(__filename);
|
|
35
|
+
const debugLog = make_debugLog(__filename);
|
|
36
|
+
|
|
37
|
+
export class UATransitionImplBase extends BaseNodeImpl {
|
|
38
|
+
/* intentionnaly empty */
|
|
39
|
+
}
|
|
40
|
+
export type UATransitionImpl = UATransitionImplBase & UATransitionEx;
|
|
41
|
+
export const UATransitionImpl = UATransitionImplBase as unknown as new () => UATransitionImpl;
|
|
39
42
|
|
|
40
|
-
export declare interface UATransitionImpl extends UATransition, UATransitionEx {}
|
|
41
|
-
export class UATransitionImpl implements UATransition, UATransitionEx {}
|
|
42
43
|
|
|
43
44
|
function getComponentOfType(typeDef: UAObjectType, typedefinition: UAObjectType): UAObject[] {
|
|
44
45
|
const get = (typeDef: UAObjectType) =>
|
|
@@ -61,13 +62,7 @@ function getComponentOfType(typeDef: UAObjectType, typedefinition: UAObjectType)
|
|
|
61
62
|
return components_parts as UAObject[];
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
export interface UAStateMachineImpl {
|
|
65
|
-
currentState: UAStateVariable<LocalizedText>;
|
|
66
|
-
lastTransition?: UATransitionVariable<LocalizedText>;
|
|
67
65
|
|
|
68
|
-
// Extra
|
|
69
|
-
_currentStateNode: UAState | null;
|
|
70
|
-
}
|
|
71
66
|
|
|
72
67
|
const defaultPredicate = (transitions: UATransition[], fromState: UAState, toState: UAState) => {
|
|
73
68
|
if (transitions.length === 0) {
|
|
@@ -123,19 +118,20 @@ export function getFiniteStateMachineTypeTransitions(uaFiniteStateMachineType: U
|
|
|
123
118
|
|
|
124
119
|
export function getFiniteStateMachineTypeStateByName(uaFiniteStateMachineType: UAObjectType, stateName: string): UAState | null {
|
|
125
120
|
let states = getFiniteStateMachineTypeStates(uaFiniteStateMachineType);
|
|
126
|
-
states = states.filter((s
|
|
121
|
+
states = states.filter((s) => {
|
|
127
122
|
return s.browseName.name === stateName;
|
|
128
123
|
});
|
|
129
124
|
assert(states.length <= 1);
|
|
130
|
-
return states.length === 1 ? (states[0]
|
|
125
|
+
return states.length === 1 ? (states[0]) : null;
|
|
131
126
|
}
|
|
132
127
|
|
|
128
|
+
const $ = (uaObject: UAStateMachineImplBase) => uaObject as unknown as UAStateMachineEx;
|
|
133
129
|
/*
|
|
134
130
|
*
|
|
135
131
|
* @class StateMachine
|
|
136
132
|
*
|
|
137
133
|
*/
|
|
138
|
-
export class
|
|
134
|
+
export class UAStateMachineImplBase extends UAObjectImpl {
|
|
139
135
|
public getStates(): UAState[] {
|
|
140
136
|
const typeDef = this.typeDefinitionObj;
|
|
141
137
|
return getFiniteStateMachineTypeStates(typeDef);
|
|
@@ -169,7 +165,8 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
169
165
|
get initialState(): UAState | null {
|
|
170
166
|
const addressSpace = this.addressSpace;
|
|
171
167
|
|
|
172
|
-
const initialStateType = addressSpace.findObjectType("InitialStateType")
|
|
168
|
+
const initialStateType = addressSpace.findObjectType("InitialStateType");
|
|
169
|
+
if (!initialStateType) throw new Error("cannot find InitialStateType");
|
|
173
170
|
const typeDef = this.typeDefinitionObj;
|
|
174
171
|
|
|
175
172
|
const comp = getComponentOfType(typeDef, initialStateType);
|
|
@@ -190,9 +187,9 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
190
187
|
return node;
|
|
191
188
|
} else if (node instanceof NodeId) {
|
|
192
189
|
const addressSpace = this.addressSpace;
|
|
193
|
-
return addressSpace.findNode(node)
|
|
190
|
+
return addressSpace.findNode(node);
|
|
194
191
|
} else if (typeof node === "string") {
|
|
195
|
-
return this.getStateByName(node)
|
|
192
|
+
return this.getStateByName(node);
|
|
196
193
|
}
|
|
197
194
|
return null;
|
|
198
195
|
}
|
|
@@ -204,7 +201,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
204
201
|
if (!this.currentStateNode) {
|
|
205
202
|
return true;
|
|
206
203
|
}
|
|
207
|
-
const
|
|
204
|
+
const _n = $(this).currentState.readValue();
|
|
208
205
|
|
|
209
206
|
// to be executed there must be a transition from currentState to toState
|
|
210
207
|
const transition = this.findTransitionNode(this.currentStateNode, toStateNode, predicate);
|
|
@@ -247,18 +244,18 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
247
244
|
}
|
|
248
245
|
|
|
249
246
|
const stateType = addressSpace.findObjectType("StateType");
|
|
250
|
-
|
|
247
|
+
|
|
251
248
|
// c8 ignore next
|
|
252
249
|
if (!stateType) {
|
|
253
250
|
throw new Error("Cannot find StateType");
|
|
254
251
|
}
|
|
255
|
-
assert(
|
|
256
|
-
assert(
|
|
252
|
+
assert(_fromStateNode.typeDefinitionObj.isSubtypeOf(stateType));
|
|
253
|
+
assert(_toStateNode.typeDefinitionObj.isSubtypeOf(stateType));
|
|
257
254
|
|
|
258
255
|
let transitions = _fromStateNode.findReferencesAsObject("FromState", false) as UATransitionImpl[];
|
|
259
256
|
|
|
260
|
-
transitions = transitions.filter((transition
|
|
261
|
-
assert(transition.toStateNode
|
|
257
|
+
transitions = transitions.filter((transition) => {
|
|
258
|
+
assert(transition.toStateNode?.nodeClass === NodeClass.Object);
|
|
262
259
|
return transition.toStateNode === _toStateNode;
|
|
263
260
|
});
|
|
264
261
|
if (transitions.length === 0) {
|
|
@@ -278,7 +275,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
278
275
|
}
|
|
279
276
|
|
|
280
277
|
public get currentStateNode(): UAState | null {
|
|
281
|
-
return this._currentStateNode;
|
|
278
|
+
return $(this)._currentStateNode;
|
|
282
279
|
}
|
|
283
280
|
|
|
284
281
|
/**
|
|
@@ -286,7 +283,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
286
283
|
* @type BaseNode
|
|
287
284
|
*/
|
|
288
285
|
public set currentStateNode(value: UAState | null) {
|
|
289
|
-
this._currentStateNode = value;
|
|
286
|
+
$(this)._currentStateNode = value;
|
|
290
287
|
}
|
|
291
288
|
|
|
292
289
|
/**
|
|
@@ -305,7 +302,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
305
302
|
public setState(toStateNode: string | UAState | null, predicate?: TransitionSelector): void {
|
|
306
303
|
if (!toStateNode) {
|
|
307
304
|
this.currentStateNode = null;
|
|
308
|
-
this.currentState.setValueFromSource({ dataType: DataType.LocalizedText, value: null }, StatusCodes.BadStateNotActive);
|
|
305
|
+
$(this).currentState.setValueFromSource({ dataType: DataType.LocalizedText, value: null }, StatusCodes.BadStateNotActive);
|
|
309
306
|
return;
|
|
310
307
|
}
|
|
311
308
|
|
|
@@ -313,19 +310,19 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
313
310
|
const state = this.getStateByName(toStateNode);
|
|
314
311
|
// c8 ignore next
|
|
315
312
|
if (!state) {
|
|
316
|
-
throw new Error(
|
|
313
|
+
throw new Error(`Cannot find state with name ${toStateNode}`);
|
|
317
314
|
}
|
|
318
315
|
toStateNode = state;
|
|
319
316
|
}
|
|
320
317
|
const fromStateNode = this.currentStateNode;
|
|
321
318
|
|
|
322
|
-
toStateNode = this._coerceNode(toStateNode) as
|
|
319
|
+
toStateNode = this._coerceNode(toStateNode) as UAState;
|
|
323
320
|
assert(toStateNode.nodeClass === NodeClass.Object);
|
|
324
321
|
|
|
325
|
-
this.currentState.setValueFromSource(
|
|
322
|
+
$(this).currentState.setValueFromSource(
|
|
326
323
|
{
|
|
327
324
|
dataType: DataType.LocalizedText,
|
|
328
|
-
value: coerceLocalizedText(toStateNode.displayName[0] || toStateNode.browseName.name
|
|
325
|
+
value: coerceLocalizedText(toStateNode.displayName[0] || toStateNode.browseName.name || "")
|
|
329
326
|
},
|
|
330
327
|
StatusCodes.Good
|
|
331
328
|
);
|
|
@@ -333,7 +330,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
333
330
|
this.currentStateNode = toStateNode;
|
|
334
331
|
|
|
335
332
|
const applyCurrentStateOptionalProps = () => {
|
|
336
|
-
const uaId = this.currentState.getPropertyByName("Id")
|
|
333
|
+
const uaId = $(this).currentState.getPropertyByName("Id") as UAVariable;
|
|
337
334
|
if (uaId) {
|
|
338
335
|
uaId.setValueFromSource({
|
|
339
336
|
dataType: DataType.NodeId,
|
|
@@ -341,7 +338,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
341
338
|
});
|
|
342
339
|
}
|
|
343
340
|
|
|
344
|
-
const uaName = this.currentState.getPropertyByName("Name")
|
|
341
|
+
const uaName = $(this).currentState.getPropertyByName("Name") as UAVariable;
|
|
345
342
|
if (uaName) {
|
|
346
343
|
uaName.setValueFromSource({
|
|
347
344
|
dataType: DataType.QualifiedName,
|
|
@@ -349,22 +346,22 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
349
346
|
});
|
|
350
347
|
}
|
|
351
348
|
|
|
352
|
-
const uaNumber = this.currentState.getPropertyByName("Number")
|
|
349
|
+
const uaNumber = $(this).currentState.getPropertyByName("Number") as UAVariable;
|
|
353
350
|
if (uaNumber) {
|
|
354
351
|
if (!this.currentStateNode) {
|
|
355
|
-
const
|
|
352
|
+
const _n = uaNumber.setValueFromSource({
|
|
356
353
|
dataType: DataType.UInt32,
|
|
357
354
|
value: 0 // may be wrong !
|
|
358
355
|
});
|
|
359
356
|
} else {
|
|
360
|
-
const
|
|
357
|
+
const _n = uaNumber.setValueFromSource({
|
|
361
358
|
dataType: DataType.UInt32,
|
|
362
359
|
value: this.currentStateNode.stateNumber.readValue().value.value
|
|
363
360
|
});
|
|
364
361
|
}
|
|
365
362
|
}
|
|
366
363
|
|
|
367
|
-
const uaEffectiveDisplayName = this.currentState.getPropertyByName("EffectiveDisplayName")
|
|
364
|
+
const uaEffectiveDisplayName = $(this).currentState.getPropertyByName("EffectiveDisplayName") as UAVariable;
|
|
368
365
|
if (uaEffectiveDisplayName) {
|
|
369
366
|
uaEffectiveDisplayName.setValueFromSource({
|
|
370
367
|
dataType: DataType.LocalizedText,
|
|
@@ -404,13 +401,15 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
404
401
|
| null;
|
|
405
402
|
if (!ms) return;
|
|
406
403
|
if (ms.nodeClass !== NodeClass.Object) return;
|
|
407
|
-
const stateMachineType = this.addressSpace.findObjectType("StateMachineType")
|
|
404
|
+
const stateMachineType = this.addressSpace.findObjectType("StateMachineType");
|
|
405
|
+
if (!stateMachineType) throw new Error("cannot find StateMachineType");
|
|
406
|
+
|
|
408
407
|
if (!ms.typeDefinitionObj.isSubtypeOf(stateMachineType)) return;
|
|
409
408
|
|
|
410
409
|
const find = (node: UAObjectType, browseName: QualifiedName): UAObject | UAVariable | null => {
|
|
411
410
|
const r = node
|
|
412
411
|
.getAggregates()
|
|
413
|
-
.filter((x) => x.browseName.name
|
|
412
|
+
.filter((x) => x.browseName.name === browseName.name && x.namespaceIndex === browseName.namespaceIndex);
|
|
414
413
|
if (r.length === 0) {
|
|
415
414
|
// look in subType
|
|
416
415
|
const subType = node.subtypeOfObj;
|
|
@@ -442,7 +441,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
442
441
|
if (uaLastTransitionMain) {
|
|
443
442
|
const uaEffectiveTransitionTimeMain = uaLastTransitionMain.getPropertyByName(
|
|
444
443
|
"EffectiveTransitionTime"
|
|
445
|
-
)
|
|
444
|
+
) as UAVariable;
|
|
446
445
|
if (uaEffectiveTransitionTimeMain) {
|
|
447
446
|
uaEffectiveTransitionTimeMain.setValueFromSource({
|
|
448
447
|
dataType: DataType.DateTime,
|
|
@@ -462,13 +461,13 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
462
461
|
uaLastTransition.setValueFromSource(
|
|
463
462
|
{
|
|
464
463
|
dataType: DataType.LocalizedText,
|
|
465
|
-
value: transitionNode.displayName[0] || transitionNode.browseName.name
|
|
464
|
+
value: transitionNode.displayName[0] || transitionNode.browseName.name || ""
|
|
466
465
|
},
|
|
467
466
|
StatusCodes.Good,
|
|
468
467
|
transitionTime
|
|
469
468
|
);
|
|
470
469
|
|
|
471
|
-
const uaId = uaLastTransition.getPropertyByName("Id")
|
|
470
|
+
const uaId = uaLastTransition.getPropertyByName("Id") as UAVariable;
|
|
472
471
|
if (uaId) {
|
|
473
472
|
uaId.setValueFromSource({
|
|
474
473
|
dataType: DataType.NodeId,
|
|
@@ -476,7 +475,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
476
475
|
});
|
|
477
476
|
}
|
|
478
477
|
|
|
479
|
-
const uaLastTransitionTime = uaLastTransition.getPropertyByName("TransitionTime")
|
|
478
|
+
const uaLastTransitionTime = uaLastTransition.getPropertyByName("TransitionTime") as UAVariable;
|
|
480
479
|
if (uaLastTransitionTime) {
|
|
481
480
|
uaLastTransitionTime.setValueFromSource({
|
|
482
481
|
dataType: DataType.DateTime,
|
|
@@ -489,7 +488,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
489
488
|
* SubA and SubB, then the TransitionTime stays at the point in time where StateA became active whereas the *
|
|
490
489
|
* EffectiveTransitionTime changes with each change of a sub-state.
|
|
491
490
|
*/
|
|
492
|
-
const uaEffectiveTransitionTime = uaLastTransition.getPropertyByName("EffectiveTransitionTime")
|
|
491
|
+
const uaEffectiveTransitionTime = uaLastTransition.getPropertyByName("EffectiveTransitionTime") as UAVariable;
|
|
493
492
|
if (uaEffectiveTransitionTime) {
|
|
494
493
|
uaEffectiveTransitionTime.setValueFromSource({
|
|
495
494
|
dataType: DataType.DateTime,
|
|
@@ -497,14 +496,14 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
497
496
|
});
|
|
498
497
|
}
|
|
499
498
|
//
|
|
500
|
-
const uaName = uaLastTransition.getPropertyByName("Name")
|
|
499
|
+
const uaName = uaLastTransition.getPropertyByName("Name") as UAVariable;
|
|
501
500
|
if (uaName) {
|
|
502
501
|
uaName.setValueFromSource({
|
|
503
502
|
dataType: DataType.QualifiedName,
|
|
504
503
|
value: transitionNode.browseName
|
|
505
504
|
});
|
|
506
505
|
}
|
|
507
|
-
const uaNumber = uaLastTransition.getPropertyByName("Number")
|
|
506
|
+
const uaNumber = uaLastTransition.getPropertyByName("Number") as UAVariable;
|
|
508
507
|
if (uaNumber) {
|
|
509
508
|
uaNumber.setValueFromSource({
|
|
510
509
|
dataType: DataType.UInt32,
|
|
@@ -557,7 +556,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
557
556
|
if (doDebug) {
|
|
558
557
|
const f = fromStateNode.browseName.toString();
|
|
559
558
|
const t = toStateNode.browseName.toString();
|
|
560
|
-
warningLog(chalk.red("Warning"),
|
|
559
|
+
warningLog(chalk.red("Warning"), ` cannot raise event : transition ${f} to ${t} is missing`);
|
|
561
560
|
}
|
|
562
561
|
}
|
|
563
562
|
}
|
|
@@ -575,7 +574,7 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
575
574
|
public _post_initialize(): void {
|
|
576
575
|
const addressSpace = this.addressSpace;
|
|
577
576
|
const finiteStateMachineType = addressSpace.findObjectType("FiniteStateMachineType");
|
|
578
|
-
|
|
577
|
+
|
|
579
578
|
// c8 ignore next
|
|
580
579
|
if (!finiteStateMachineType) {
|
|
581
580
|
throw new Error("cannot find FiniteStateMachineType");
|
|
@@ -585,13 +584,12 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
585
584
|
// xx assert(!this.typeDefinitionObj || this.typeDefinitionObj.isSubtypeOf(finiteStateMachineType));
|
|
586
585
|
// get current Status
|
|
587
586
|
|
|
588
|
-
const d = this.currentState.readValue();
|
|
587
|
+
const d = $(this).currentState.readValue();
|
|
589
588
|
|
|
590
589
|
if (d.statusCode.isNotGood()) {
|
|
591
590
|
this.setState(null);
|
|
592
591
|
} else {
|
|
593
|
-
const txt =
|
|
594
|
-
d.value && d.value.value ? (d.value.value.text ? d.value.value.text.toString() : d.value.value.toString()) : "";
|
|
592
|
+
const txt = d.value?.value ? (d.value.value.text ? d.value.value.text.toString() : d.value.value.toString()) : "";
|
|
595
593
|
this.currentStateNode = this.getStateByName(txt);
|
|
596
594
|
}
|
|
597
595
|
|
|
@@ -628,7 +626,8 @@ export class UAStateMachineImpl extends UAObjectImpl implements UAStateMachineEx
|
|
|
628
626
|
}
|
|
629
627
|
}
|
|
630
628
|
}
|
|
631
|
-
|
|
629
|
+
export type UAStateMachineImpl = UAStateMachineImplBase & UAStateMachineEx;
|
|
630
|
+
export const UAStateMachineImpl = UAStateMachineImplBase as unknown as new () => UAStateMachineImpl;
|
|
632
631
|
export function promoteToStateMachine(node: UAObject): UAStateMachineEx {
|
|
633
632
|
if (node instanceof UAStateMachineImpl) {
|
|
634
633
|
return node; // already promoted
|
|
@@ -6,19 +6,17 @@
|
|
|
6
6
|
// ShelvingStateMachine
|
|
7
7
|
// --------------------------------------------------------------------------------------------------
|
|
8
8
|
|
|
9
|
+
import type { ISessionContext, UAMethod, UAObject, UAProperty } from "node-opcua-address-space-base";
|
|
9
10
|
import { assert } from "node-opcua-assert";
|
|
10
|
-
import { CallbackT, StatusCodes } from "node-opcua-status-code";
|
|
11
|
-
import { DataType, Variant, VariantLike } from "node-opcua-variant";
|
|
12
|
-
|
|
13
|
-
import { UAProperty, ISessionContext, UAMethod, UAObject } from "node-opcua-address-space-base";
|
|
14
|
-
import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
|
|
15
|
-
import { UAState, UATransition } from "node-opcua-nodeset-ua";
|
|
16
|
-
import { CallMethodResultOptions } from "node-opcua-service-call";
|
|
17
11
|
import { DataValue } from "node-opcua-data-value";
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
12
|
+
import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
|
|
13
|
+
import type { UAState } from "node-opcua-nodeset-ua";
|
|
14
|
+
import type { CallMethodResultOptions } from "node-opcua-service-call";
|
|
15
|
+
import { type CallbackT, StatusCodes } from "node-opcua-status-code";
|
|
16
|
+
import { DataType, Variant, type VariantLike } from "node-opcua-variant";
|
|
17
|
+
import type { UAShelvedStateMachineEx } from "../../source/interfaces/state_machine/ua_shelved_state_machine_ex";
|
|
18
|
+
import type { UATransitionEx } from "../../source/interfaces/state_machine/ua_transition_ex";
|
|
19
|
+
import { UAAlarmConditionImpl, UAAlarmConditionImplBase } from "../alarms_and_conditions/ua_alarm_condition_impl";
|
|
22
20
|
|
|
23
21
|
import { promoteToStateMachine, UAStateMachineImpl } from "./finite_state_machine";
|
|
24
22
|
|
|
@@ -32,8 +30,8 @@ export interface UAShelvedStateMachineHelper {
|
|
|
32
30
|
_duration: number;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
export interface
|
|
36
|
-
|
|
33
|
+
export interface UAShelvedStateMachineHelper2 extends UAShelvedStateMachineHelper {
|
|
34
|
+
unshelveTime: UAProperty<number, /*z*/ DataType.Double>;
|
|
37
35
|
unshelved: UAState;
|
|
38
36
|
timedShelved: UAState;
|
|
39
37
|
oneShotShelved: UAState;
|
|
@@ -51,7 +49,7 @@ export interface UAShelvedStateMachineExImpl extends UAShelvedStateMachineHelper
|
|
|
51
49
|
oneShotShelve2?: UAMethod;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
export class
|
|
52
|
+
export class UAShelvedStateMachineExImplBase extends UAStateMachineImpl {
|
|
55
53
|
public static promote(object: UAObject): UAShelvedStateMachineEx {
|
|
56
54
|
const shelvingState = object as UAShelvedStateMachineExImpl;
|
|
57
55
|
promoteToStateMachine(shelvingState);
|
|
@@ -83,6 +81,8 @@ export class UAShelvedStateMachineExImpl extends UAStateMachineImpl implements U
|
|
|
83
81
|
return shelvingState;
|
|
84
82
|
}
|
|
85
83
|
}
|
|
84
|
+
export type UAShelvedStateMachineExImpl = UAShelvedStateMachineExImplBase & UAShelvedStateMachineEx;
|
|
85
|
+
export const UAShelvedStateMachineExImpl = UAShelvedStateMachineExImplBase as unknown as new () => UAShelvedStateMachineExImpl;
|
|
86
86
|
|
|
87
87
|
// The Unshelve Method sets the AlarmCondition to the Unshelved state. Normally, the MethodId found
|
|
88
88
|
// the Shelving child of the Condition instance and the NodeId of the Shelving object as the ObjectId
|
|
@@ -102,7 +102,7 @@ function _unshelve_method(inputArguments: VariantLike[], context: ISessionContex
|
|
|
102
102
|
// return callback(null, {statusCode: StatusCodes.BadConditionDisabled});
|
|
103
103
|
// }
|
|
104
104
|
|
|
105
|
-
const shelvingState = context.object
|
|
105
|
+
const shelvingState = context.object as UAShelvedStateMachineExImpl;
|
|
106
106
|
promoteToStateMachine(shelvingState);
|
|
107
107
|
|
|
108
108
|
if (shelvingState.getCurrentState() === "Unshelved") {
|
|
@@ -149,8 +149,8 @@ function _automatically_unshelve(shelvingState: UAShelvedStateMachineExImpl) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
function _start_timer_for_automatic_unshelve(shelvingState: UAShelvedStateMachineExImpl, duration: number) {
|
|
152
|
-
if (duration < 10 || duration >=
|
|
153
|
-
throw new Error(
|
|
152
|
+
if (duration < 10 || duration >= 2 ** 31) {
|
|
153
|
+
throw new Error(` Invalid maxTimeShelved duration: ${duration} must be [10,2**31] `);
|
|
154
154
|
}
|
|
155
155
|
assert(!shelvingState._timer);
|
|
156
156
|
|
|
@@ -162,7 +162,7 @@ function _start_timer_for_automatic_unshelve(shelvingState: UAShelvedStateMachin
|
|
|
162
162
|
debugLog("shelvingState._duration", shelvingState._duration);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
if (duration !==
|
|
165
|
+
if (duration !== UAAlarmConditionImplBase.MaxDuration) {
|
|
166
166
|
assert(!shelvingState._timer);
|
|
167
167
|
shelvingState._timer = setTimeout(_automatically_unshelve.bind(null, shelvingState), shelvingState._duration);
|
|
168
168
|
}
|
|
@@ -213,7 +213,7 @@ function _timedShelve_method(
|
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
const maxTimeShelved = alarmNode.getMaxTimeShelved();
|
|
216
|
-
assert(isFinite(maxTimeShelved));
|
|
216
|
+
assert(Number.isFinite(maxTimeShelved));
|
|
217
217
|
|
|
218
218
|
assert(inputArguments[0].dataType === DataType.Double); // Duration
|
|
219
219
|
assert(inputArguments[0] instanceof Variant);
|
|
@@ -271,8 +271,8 @@ function _oneShotShelve_method(
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
const maxTimeShelved = alarmNode.getMaxTimeShelved();
|
|
274
|
-
assert(isFinite(maxTimeShelved));
|
|
275
|
-
assert(maxTimeShelved !==
|
|
274
|
+
assert(Number.isFinite(maxTimeShelved));
|
|
275
|
+
assert(maxTimeShelved !== UAAlarmConditionImplBase.MaxDuration);
|
|
276
276
|
|
|
277
277
|
// set automatic un-shelving timer
|
|
278
278
|
_clear_timer_if_any(shelvingState);
|
|
@@ -305,12 +305,12 @@ function _unShelveTimeFunc(shelvingState: UAShelvedStateMachineExImpl): DataValu
|
|
|
305
305
|
value: { dataType: DataType.Double, value: 0 }
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
if (shelvingState.getCurrentState() === "OneShotShelved" && shelvingState._duration ===
|
|
308
|
+
if (shelvingState.getCurrentState() === "OneShotShelved" && shelvingState._duration === UAAlarmConditionImplBase.MaxDuration) {
|
|
309
309
|
return new DataValue({
|
|
310
310
|
statusCode: StatusCodes.Good,
|
|
311
311
|
value: {
|
|
312
312
|
dataType: DataType.Double,
|
|
313
|
-
value:
|
|
313
|
+
value: UAAlarmConditionImplBase.MaxDuration
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
}
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* @module node-opcua-address-space
|
|
3
3
|
*/
|
|
4
|
-
import { assert } from "node-opcua-assert";
|
|
5
4
|
|
|
5
|
+
import type {
|
|
6
|
+
BaseNode,
|
|
7
|
+
BindVariableOptions,
|
|
8
|
+
INamespace,
|
|
9
|
+
ISessionContext,
|
|
10
|
+
UAReference,
|
|
11
|
+
UAVariable
|
|
12
|
+
} from "node-opcua-address-space-base";
|
|
13
|
+
import { assert } from "node-opcua-assert";
|
|
6
14
|
import { VariableTypeIds } from "node-opcua-constants";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
15
|
+
import {
|
|
16
|
+
BrowseDirection,
|
|
17
|
+
coerceLocalizedText,
|
|
18
|
+
type LocalizedText,
|
|
19
|
+
type LocalizedTextLike,
|
|
20
|
+
type QualifiedNameLike
|
|
21
|
+
} from "node-opcua-data-model";
|
|
22
|
+
import type { DataValueT } from "node-opcua-data-value";
|
|
23
|
+
import { type NodeId, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
24
|
+
import type { NumericRange } from "node-opcua-numeric-range";
|
|
25
|
+
import { type StatusCode, type StatusCodeCallback, StatusCodes } from "node-opcua-status-code";
|
|
26
|
+
import { DataType, Variant, type VariantLike, type VariantT } from "node-opcua-variant";
|
|
27
|
+
import type { AddTwoStateVariableOptions } from "../../source/address_space_ts";
|
|
28
|
+
import type { ISetStateOptions } from "../../source/interfaces/i_set_state_options";
|
|
18
29
|
// public interfaces
|
|
19
30
|
import { registerNodePromoter } from "../../source/loader/register_node_promoter";
|
|
20
|
-
import {
|
|
21
|
-
import { UATwoStateVariableEx } from "../../source/ua_two_state_variable_ex";
|
|
31
|
+
import type { UATwoStateVariableEx } from "../../source/ua_two_state_variable_ex";
|
|
22
32
|
// private types
|
|
23
33
|
import { UAVariableImpl, UAVariableImplT } from "../ua_variable_impl";
|
|
24
|
-
import { ISetStateOptions } from "../../source/interfaces/i_set_state_options";
|
|
25
|
-
|
|
26
34
|
|
|
27
35
|
const hasTrueSubState_ReferenceTypeNodeId = resolveNodeId("HasTrueSubState");
|
|
28
36
|
const hasFalseSubState_ReferenceTypeNodeId = resolveNodeId("HasFalseSubState");
|
|
@@ -64,9 +72,8 @@ function _updateTransitionTime(node: UATwoStateVariableEx, _subState?: UAVariabl
|
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
74
|
|
|
67
|
-
function _updateEffectiveTransitionTime(node: UATwoStateVariableImpl,options?: ISetStateOptions) {
|
|
75
|
+
function _updateEffectiveTransitionTime(node: UATwoStateVariableImpl, options?: ISetStateOptions) {
|
|
68
76
|
if (node.effectiveTransitionTime) {
|
|
69
|
-
|
|
70
77
|
const effectiveTransitionTime = options?.effectiveTransitionTime || new Date();
|
|
71
78
|
|
|
72
79
|
// because subStateNode ",subStateNode.browseName.toString());
|
|
@@ -77,7 +84,7 @@ function _updateEffectiveTransitionTime(node: UATwoStateVariableImpl,options?: I
|
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
function _getEffectiveDisplayName<
|
|
87
|
+
function _getEffectiveDisplayName<_T, _DT extends DataType>(
|
|
81
88
|
node: UATwoStateVariableImpl
|
|
82
89
|
): DataValueT<LocalizedText, DataType.LocalizedText> {
|
|
83
90
|
const humanReadableString = _getHumanReadableString(node);
|
|
@@ -92,7 +99,7 @@ function _getEffectiveDisplayName<T, DT extends DataType>(
|
|
|
92
99
|
} else {
|
|
93
100
|
subStateNodes = node.findReferencesExAsObject("HasFalseSubState", BrowseDirection.Forward);
|
|
94
101
|
}
|
|
95
|
-
const
|
|
102
|
+
const _states = subStateNodes.forEach((_n: any) => {
|
|
96
103
|
// todo happen
|
|
97
104
|
});
|
|
98
105
|
|
|
@@ -133,7 +140,7 @@ export function _install_TwoStateVariable_machinery(
|
|
|
133
140
|
assert(node.minimumSamplingInterval === 0);
|
|
134
141
|
assert(node.typeDefinitionObj.browseName.toString() === "TwoStateVariableType");
|
|
135
142
|
assert(node.dataTypeObj.browseName.toString() === "LocalizedText");
|
|
136
|
-
assert(Object.
|
|
143
|
+
assert(Object.hasOwn(node, "valueRank") && (node.valueRank === -1 || node.valueRank === 0));
|
|
137
144
|
|
|
138
145
|
// promote node into a UATwoStateVariable
|
|
139
146
|
const _node = promoteToTwoStateVariable(node);
|
|
@@ -196,10 +203,6 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
|
|
|
196
203
|
private _trueState?: string;
|
|
197
204
|
private _falseState?: string;
|
|
198
205
|
|
|
199
|
-
public constructor(opts: any) {
|
|
200
|
-
super(opts);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
206
|
get isFalseSubStateOf(): UATwoStateVariableEx {
|
|
204
207
|
return super.isFalseSubStateOf as UATwoStateVariableEx;
|
|
205
208
|
}
|
|
@@ -219,7 +222,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
|
|
|
219
222
|
value: coerceLocalizedText(options.falseState)
|
|
220
223
|
});
|
|
221
224
|
} else {
|
|
222
|
-
this._trueState = coerceLocalizedText(options.trueState)
|
|
225
|
+
this._trueState = coerceLocalizedText(options.trueState)?.text!;
|
|
223
226
|
}
|
|
224
227
|
if (this.trueState) {
|
|
225
228
|
this.trueState.setValueFromSource({
|
|
@@ -227,7 +230,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
|
|
|
227
230
|
value: coerceLocalizedText(options.trueState)
|
|
228
231
|
});
|
|
229
232
|
} else {
|
|
230
|
-
this._falseState = coerceLocalizedText(options.falseState)
|
|
233
|
+
this._falseState = coerceLocalizedText(options.falseState)?.text!;
|
|
231
234
|
}
|
|
232
235
|
}
|
|
233
236
|
|
|
@@ -264,7 +267,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
|
|
|
264
267
|
},
|
|
265
268
|
StatusCodes.Good
|
|
266
269
|
);
|
|
267
|
-
} else if (Object.
|
|
270
|
+
} else if (Object.hasOwn(options.value, "dataType")) {
|
|
268
271
|
assert((options.value as VariantLike).dataType === DataType.Boolean);
|
|
269
272
|
this.id.setValueFromSource(options.value as VariantLike, StatusCodes.Good);
|
|
270
273
|
} else {
|
|
@@ -312,7 +315,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
|
|
|
312
315
|
*/
|
|
313
316
|
public setValue(boolValue: boolean, options?: ISetStateOptions): void {
|
|
314
317
|
assert(typeof boolValue === "boolean");
|
|
315
|
-
const dataValue = this.id
|
|
318
|
+
const dataValue = this.id?.readValue();
|
|
316
319
|
const oldValue = dataValue.value.value;
|
|
317
320
|
if (dataValue.statusCode.isGood() && boolValue === oldValue) {
|
|
318
321
|
return; // nothing to do
|
|
@@ -326,7 +329,7 @@ export class UATwoStateVariableImpl extends UAVariableImplT<LocalizedText, DataT
|
|
|
326
329
|
/**
|
|
327
330
|
*/
|
|
328
331
|
public getValue(): boolean {
|
|
329
|
-
const dataValue = this.id
|
|
332
|
+
const dataValue = this.id?.readValue();
|
|
330
333
|
assert(dataValue.statusCode.isGood());
|
|
331
334
|
assert(dataValue.value.dataType === DataType.Boolean);
|
|
332
335
|
return dataValue.value.value;
|