(*
 * $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 N4269 - ISO/TS 10303-1106 Extended measure representation - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

(* It is taken from ARM *)


SCHEMA Extended_measure_representation_xim;

USE FROM Qualified_measure_xim; -- ISO/CD-TS 10303-1782

USE FROM Extended_measure_representation_mim;

USE FROM representation_schema(compound_representation_item);

USE FROM qualified_measure_schema(
  qualified_representation_item,
  value_qualifier);

ENTITY Measure_item_with_precision
  (* CONNOTATIONAL *) SUBTYPE OF (measure_representation_item);
  significant_digits : INTEGER;
END_ENTITY;

ENTITY Value_limit
  SUBTYPE OF (measure_representation_item, qualified_representation_item);
    SELF\qualified_representation_item.qualifiers : SET[1:1] OF Pre_defined_type_qualifier;
  WHERE
    WR1:SELF\Qualified_representation_item.qualifiers[1]\type_qualifier.name in ['minimum', 'maximum'];    
END_ENTITY;   

ENTITY Value_list
  (* CONNOTATIONAL *) SUBTYPE OF (compound_representation_item);
  values : LIST[1:?] OF measure_representation_item;
DERIVE
  SELF\compound_representation_item.item_element : compound_item_definition := ?;
END_ENTITY;

ENTITY Value_range_armx
  (* CONNOTATIONAL *) SUBTYPE OF (value_range);
  lower_limit : measure_representation_item;
  upper_limit : measure_representation_item;
DERIVE
  SELF\compound_representation_item.item_element : compound_item_definition := ?;
END_ENTITY;

ENTITY Value_range_with_global_unit
  (* CONNOTATIONAL *) SUBTYPE OF (value_range);
  lower_limit : value_representation_item;
  upper_limit : value_representation_item;
DERIVE
  SELF\compound_representation_item.item_element : compound_item_definition := ?;
END_ENTITY;

ENTITY Value_set
  (* CONNOTATIONAL *) SUBTYPE OF (compound_representation_item);
  values : SET[1:?] OF measure_representation_item;
DERIVE
  SELF\compound_representation_item.item_element : compound_item_definition := ?;
END_ENTITY;

ENTITY Value_with_tolerances
  (* CONNOTATIONAL *) SUBTYPE OF (qualified_representation_item, measure_representation_item);
  lower_limit : REAL;
  upper_limit : REAL;
DERIVE
	item_value : measure_with_unit := SELF;
(* Those attributes MUST be SET !!! *)	
--  SELF\measure_with_unit.value_component : measure_value := ?;
--  SELF\measure_with_unit.unit_component : unit := ?;
 (* Overlaps with attributes lower_limit and upper_limit *)
  SELF\qualified_representation_item.qualifiers : SET [1:?] OF value_qualifier := ?;
END_ENTITY;

SUBTYPE_CONSTRAINT alternate_measure_representation_item FOR measure_representation_item;
  ABSTRACT SUPERTYPE;
  ONEOF (Measure_item_with_precision,
         value_representation_item,
         measure_representation_item,
         Value_limit,
         Value_list,
         Value_range,
         Value_range_with_global_unit,
         Value_set,
         Value_with_tolerances);
END_SUBTYPE_CONSTRAINT;

END_SCHEMA;  -- Extended_measure_representation_xim

