(*
   $Id$
   ISO TC184/SC4/WG12 N3888 - ISO/TS 10303-1647 Assembly physical interface requirement - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3360
*)

SCHEMA Assembly_physical_interface_requirement_arm;

USE FROM Assembly_functional_interface_requirement_arm;	-- ISO/TS 10303-1635
USE FROM Layered_3d_shape_arm;	-- ISO/TS 10303-1694
USE FROM Printed_physical_layout_template_arm; -- ISO/TS 10303-1737

REFERENCE FROM Requirement_decomposition_arm(get_rvd);	-- ISO/TS 10303-1740	

  TYPE apir_requirement_assignment_item = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON requirement_assignment_item WITH 
    (Mating_connector_termination,
     Termination_constraint);
  END_TYPE; 

  TYPE mating_connector_definition_select = SELECT
    (Packaged_part_terminal,
     Printed_part_template_terminal);
  END_TYPE;

  TYPE three_dimensional_shape = SELECT
    (Advanced_brep_shape_representation,
     Curve_swept_solid,
     Geometrically_bounded_surface_shape_representation);
  END_TYPE;

  ENTITY Interface_requirement_occurrence
    SUBTYPE OF (Predefined_requirement_view_definition);
      interface_to_next_higher_assembly : OPTIONAL Next_higher_assembly_interface_requirement;
      reference_protocol                : OPTIONAL Protocol_physical_layer_definition;
   WHERE    
      WR1: SELF\Product_view_definition.initial_context.life_cycle_stage = 'design'; 
  END_ENTITY;

  ENTITY Mating_connector_usage
    SUBTYPE OF (Product_view_definition);
      definition            : Product_view_definition;
      reference_designation : OPTIONAL STRING; 
    INVERSE
      placement_context : mating_connector_placement_relationship FOR placed_connector;
  END_ENTITY;

  ENTITY Mating_connector_placement_relationship;
      placed_connector    : Mating_connector_usage;
      interface_context   : Next_higher_assembly_interface_requirement;
      connector_placement : Axis_placement;
  END_ENTITY;

  ENTITY Mating_connector_termination;
      name               : STRING;
      definition         : mating_connector_definition_select;
      accessed_connector : Mating_connector_usage;
	DERIVE
      signal_definition: SET[0:?] OF Requirement_view_definition := get_rvd(SELF, 'signal definition');
    UNIQUE
      UR1 : definition, accessed_connector;
	WHERE
      WR1 : (SIZEOF(signal_definition) <= 1);
  END_ENTITY;

  ENTITY Next_higher_assembly_interface_requirement;
    shape                           : three_dimensional_shape;
    version_of_next_higher_assembly : Product_version;
  END_ENTITY;

  ENTITY Protocol_requirement_allocation_to_part_terminal
    SUBTYPE OF (Requirement_assignment);
      SELF\Requirement_assignment.assigned_to : Part_terminal;
      protocol_signal                                   : Functional_unit_usage_view_terminal_definition;
      SELF\Requirement_assignment.assigned_requirement RENAMED assigned_requirement_property  : Interface_requirement_occurrence;
    WHERE
      WR1 : EXISTS(assigned_requirement_property\Interface_requirement_occurrence.reference_protocol);
      WR2 : protocol_signal IN assigned_requirement_property\Interface_requirement_occurrence.reference_protocol.host_functional_definition\Functional_unit_usage_view.access_mechanism;
  END_ENTITY;

  ENTITY Termination_constraint
  	SUBTYPE OF (Constraint_occurrence);
      constrained_termination      : SET[2:?] OF Mating_connector_termination;
	DERIVE
  		termination_usage_constraint: SET[0:?] OF Requirement_view_definition :=
  		get_rvd(SELF, 'termination usage constraint');
	WHERE
   		WR1 : (SIZEOF(termination_usage_constraint) <= 1);
  END_ENTITY;

END_SCHEMA;
