FUNCTION convert_plane_angle_for_pair_from_radian

(* SCHEMA AUTOMOTIVE_DESIGN; *)
 
FUNCTION convert_plane_angle_for_pair_from_radian(pair : kinematic_pair; 
  angle_expr : REAL) : plane_angle_measure;
LOCAL
  link_rep : kinematic_link_representation := representation_of_link(pair.joint
  .first_link);
  link_cntxt : representation_context;
  pa_units : SET OF unit := [];
  pau : unit;
  conv_factor : REAL := 1.0;
  result : plane_angle_measure;
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);
    conv_factor := conv_factor * 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 : 
    conv_factor := 1.E18 * conv_factor;
     si_prefix.peta : 
    conv_factor := 1.E15 * conv_factor;
     si_prefix.tera : 
    conv_factor := 1.E12 * conv_factor;
     si_prefix.giga : 
    conv_factor := 1.E9 * conv_factor;
     si_prefix.mega : 
    conv_factor := 1.E6 * conv_factor;
     si_prefix.kilo : 
    conv_factor := 1.E3 * conv_factor;
     si_prefix.hecto : 
    conv_factor := 1.E2 * conv_factor;
     si_prefix.deca : 
    conv_factor := 1.E1 * conv_factor;
     si_prefix.deci : 
    conv_factor := 1.E-1 * conv_factor;
     si_prefix.centi : 
    conv_factor := 1.E-2 * conv_factor;
     si_prefix.milli : 
    conv_factor := 1.E-3 * conv_factor;
     si_prefix.micro : 
    conv_factor := 1.E-6 * conv_factor;
     si_prefix.nano : 
    conv_factor := 1.E-9 * conv_factor;
     si_prefix.pico : 
    conv_factor := 1.E-12 * conv_factor;
     si_prefix.femto : 
    conv_factor := 1.E-15 * conv_factor;
     si_prefix.atto : 
    conv_factor := 1.E-18 * conv_factor;
  END_CASE;
  result := angle_expr/conv_factor;
  RETURN (result);
END_FUNCTION; -- 10303-105: kinematic_structure_schema

Referenced By

Defintion convert_plane_angle_for_pair_from_radian is references by the following definitions:
DefinitionType
 rack_and_pinion_pair_value ENTITY


[Top Level Definitions] [Exit]

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