(*
 * $Id$
 *
 * JSDAI(TM), a way to implement STEP, ISO 10303
 * Copyright (C) 1997-2008, LKSoftWare GmbH, Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License
 * version 3 as published by the Free Software Foundation (AGPL v3).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * JSDAI is a registered trademark of LKSoftWare GmbH, Germany
 * This software is also available under commercial licenses.
 * See also http://www.jsdai.net/
 *)

(*
   Derived from ISO TC184/SC4/WG12 N - ISO/CD-TS 10303-xxxx Fabrication requirement - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

SCHEMA Fabrication_requirement_xim; 

USE FROM Fabrication_technology_xim;

USE FROM presentation_appearance_schema(
  presentation_style_assignment,
  styled_item);

  TYPE metal_or_dielectric = ENUMERATION OF
    (over_finished_conductor,
     over_finished_dielectric);
  END_TYPE;

  ENTITY Fabrication_thickness_requirement_occurrence
    (* CONNOTATIONAL *) SUBTYPE OF (Predefined_requirement_view_definition_armx);
      characterized_class_range 															: Range_characteristic_armx;
      tolerance                 															: Tolerance_characteristic;
      characterized_class																	: metal_or_dielectric;
    WHERE    
      WR1: SELF\Product_view_definition.initial_context.life_cycle_stage = 'test'; 
      WR2: NOT EXISTS(SELF\Product_view_definition.id);  
  END_ENTITY;

  ENTITY Layout_land_width_tolerance_requirement_occurrence
    (* CONNOTATIONAL *) SUBTYPE OF (Predefined_requirement_view_definition_armx);
      mating_feature_pitch_class : Pitch_class;
      maximum_negative_deviation : length_measure_with_unit;
    WHERE    
      WR1: SELF\Product_view_definition.initial_context.life_cycle_stage = 'test';   
  END_ENTITY;

  ENTITY Layout_line_width_tolerance_requirement_occurrence
    (* CONNOTATIONAL *) SUBTYPE OF (Predefined_requirement_view_definition_armx);
      characterized_stratum_technology : Stratum_technology_armx;
      tolerance_line_width_class       : Line_width_class;
      maximum_negative_deviation       : length_measure_with_unit;
      maximum_positive_deviation       : length_measure_with_unit;
   WHERE    
      WR1: SELF\Product_view_definition.initial_context.life_cycle_stage = 'test';       
  END_ENTITY;

  ENTITY Line_width_class
  	(* CONNOTATIONAL *) SUBTYPE OF (styled_item);
      class_member 																			: Range_characteristic_armx;
      SELF\representation_item.name RENAMED class_name	: label;
    DERIVE
      SELF\styled_item.item : representation_item := ?;
      SELF\styled_item.styles : SET [1:?] OF presentation_style_assignment := ?;
    WHERE
      WR1 : SIZEOF(QUERY(np <* class_member\Representation.items | NOT ('FABRICATION_REQUIREMENT_xim.length_measure_with_unit' IN TYPEOF(np)))) = 0;
  END_ENTITY;

  ENTITY Pitch_class
  	(* CONNOTATIONAL *) SUBTYPE OF (representation);
      class_member : Range_characteristic_armx;
      class_name   : STRING; 
    DERIVE
    	SELF\representation.description : text := class_name;
    	(* Conflict with class_member *)
    	SELF\representation.items : SET[1:?] OF representation_item := ?;
        SELF\representation.context_of_items : representation_context := ?;
        SELF\representation.name : label := ?;
    WHERE
      WR1 : SIZEOF(QUERY(np <* class_member\Representation.items | NOT ('VALUE_WITH_UNIT_EXTENSION_XIM.LENGTH_MEASURE_WITH_UNIT' IN TYPEOF(np)))) = 0;
  END_ENTITY;

	SUBTYPE_CONSTRAINT fr_predefined_requirement_view_definition_subtypes FOR Predefined_requirement_view_definition_armx;     
	    (ONEOF (Layout_line_width_tolerance_requirement_occurrence,
	 Layout_land_width_tolerance_requirement_occurrence,
	 Fabrication_thickness_requirement_occurrence));
	END_SUBTYPE_CONSTRAINT;    

END_SCHEMA;


