FUNCTION plane_angle_for_pair_in_radian

(* SCHEMA AUTOMOTIVE_DESIGN; *)
 
FUNCTION plane_angle_for_pair_in_radian(pair : kinematic_pair; angle : 
  plane_angle_measure) : plane_angle_measure;
LOCAL
  converted_angle : plane_angle_measure := angle;
  link_rep : kinematic_link_representation := representation_of_link(pair.joint
  .first_link);
  link_cntxt : representation_context;
  pa_units : SET OF unit := [];
  pau : unit;
END_LOCAL;
  link_cntxt := link_rep\representation.context_of_items;
  IF NOT ('AUTOMOTIVE_DESIGN.GLOBAL_UNIT_ASSIGNED_CONTEXT' IN TYPEOF(
  link_cntxt)) THEN
    RETURN (?);
  END_IF;
  pa_units := QUERY(unit <* link_cntxt\global_unit_assigned_context.units | 
  'AUTOMOTIVE_DESIGN.PLANE_ANGLE_UNIT' IN TYPEOF(unit));
  IF SIZEOF(pa_units) <> 1 THEN
    RETURN (?);
  END_IF;
  pau := pa_units[1];
  IF NOT ('AUTOMOTIVE_DESIGN.SI_UNIT' IN TYPEOF(pau)) AND NOT (
  'AUTOMOTIVE_DESIGN.CONVERSION_BASED_UNIT' IN TYPEOF(pau)) THEN
    RETURN (?);
  END_IF;
  REPEAT WHILE 'AUTOMOTIVE_DESIGN.CONVERSION_BASED_UNIT' IN TYPEOF(pau);
    converted_angle := converted_angle * pau\conversion_based_unit.
    conversion_factor.value_component;
    pau := pau\conversion_based_unit.conversion_factor.unit_component;
    IF NOT ('AUTOMOTIVE_DESIGN.SI_UNIT' IN TYPEOF(pau)) AND NOT (
    'AUTOMOTIVE_DESIGN.CONVERSION_BASED_UNIT' IN TYPEOF(pau)) OR NOT (
    'AUTOMOTIVE_DESIGN.PLANE_ANGLE_UNIT' IN TYPEOF(pau)) THEN
      RETURN (?);
    END_IF;
  END_REPEAT;
  IF pau\si_unit.name <> si_unit_name.radian THEN
    RETURN (?);
  END_IF;
  CASE pau\si_unit.prefix OF 
     si_prefix.exa : 
    RETURN (1.E18 * converted_angle);
     si_prefix.peta : 
    RETURN (1.E15 * converted_angle);
     si_prefix.tera : 
    RETURN (1.E12 * converted_angle);
     si_prefix.giga : 
    RETURN (1.E9 * converted_angle);
     si_prefix.mega : 
    RETURN (1.E6 * converted_angle);
     si_prefix.kilo : 
    RETURN (1.E3 * converted_angle);
     si_prefix.hecto : 
    RETURN (1.E2 * converted_angle);
     si_prefix.deca : 
    RETURN (1.E1 * converted_angle);
     si_prefix.deci : 
    RETURN (1.E-1 * converted_angle);
     si_prefix.centi : 
    RETURN (1.E-2 * converted_angle);
     si_prefix.milli : 
    RETURN (1.E-3 * converted_angle);
     si_prefix.micro : 
    RETURN (1.E-6 * converted_angle);
     si_prefix.nano : 
    RETURN (1.E-9 * converted_angle);
     si_prefix.pico : 
    RETURN (1.E-12 * converted_angle);
     si_prefix.femto : 
    RETURN (1.E-15 * converted_angle);
     si_prefix.atto : 
    RETURN (1.E-18 * converted_angle);
    OTHERWISE  : RETURN (converted_angle);
  END_CASE;
END_FUNCTION; -- 10303-105: kinematic_structure_schema

Referenced By

Defintion plane_angle_for_pair_in_radian is references by the following definitions:
DefinitionType
 convert_spatial_to_ypr_rotation FUNCTION
 screw_pair_value ENTITY
 universal_pair ENTITY


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:16:12-04:00