Changeset 1091 for trunk/Modelica

Show
Ignore:
Timestamp:
02/27/08 22:08:57 (9 months ago)
Author:
otter
Message:

- Fixed bug in MultiBody.Visualizers.Advanced.Shape.Color

(Integer instead of Real type) introduced by the unit-bug fixes in one of the last commits

- Fixed bugs in MultiBody.Senors related to units

(TransformAbsoluteVector, TransformRelativeVector work on every type of vector,

but unit was given for Position; Wrong unit in RelativeSensor.a_rel)

Location:
trunk/Modelica/Mechanics/MultiBody
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/Modelica/Mechanics/MultiBody/Sensors.mo

    r1050 r1091  
    66    import SI = Modelica.SIunits; 
    77 
    8     Blocks.Interfaces.RealOutput r[3](each final quantity="Position", each final unit = "m") if get_r 
     8    Blocks.Interfaces.RealOutput r[3](each final quantity="Position", each 
     9        final unit =                                                                    "m") if get_r 
    910      "Absolute position vector frame_a.r_0 resolved in frame defined by resolveInFrame" 
    1011      annotation (Placement(transformation( 
     
    1213          extent={{10,-10},{-10,10}}, 
    1314          rotation=90))); 
    14     Blocks.Interfaces.RealOutput v[3](each final quantity="Velocity", each final unit = "m/s") if get_v "Absolute velocity vector"  
     15    Blocks.Interfaces.RealOutput v[3](each final quantity="Velocity", each 
     16        final unit =                                                                    "m/s") if get_v 
     17      "Absolute velocity vector"  
    1518      annotation (Placement(transformation( 
    1619          origin={-60,-110}, 
    1720          extent={{10,-10},{-10,10}}, 
    1821          rotation=90))); 
    19     Blocks.Interfaces.RealOutput a[3](each final quantity="Acceleration", each final unit = "m/s2") if get_a "Absolute acceleration vector"  
     22    Blocks.Interfaces.RealOutput a[3](each final quantity="Acceleration", each 
     23        final unit =                                                                        "m/s2") if get_a 
     24      "Absolute acceleration vector"  
    2025      annotation (Placement(transformation( 
    2126          origin={-20,-110}, 
    2227          extent={{10,-10},{-10,10}}, 
    2328          rotation=90))); 
    24     Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each final unit = "rad", each displayUnit="deg") if get_angles 
     29    Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each 
     30        final unit =                                                                       "rad", each 
     31        displayUnit =                                                                                              "deg") if get_angles 
    2532      "Angles to rotate world frame into frame_a via 'sequence'"  
    2633      annotation (Placement(transformation( 
     
    2835          extent={{10,-10},{-10,10}}, 
    2936          rotation=90))); 
    30     Blocks.Interfaces.RealOutput w[3](each final quantity="AngularVelocity", each final unit = "1/s") if get_w 
     37    Blocks.Interfaces.RealOutput w[3](each final quantity="AngularVelocity", each 
     38        final unit =                                                                           "1/s") if get_w 
    3139      "Absolute angular velocity vector"  
    3240      annotation (Placement(transformation( 
     
    3442          extent={{10,-10},{-10,10}}, 
    3543          rotation=90))); 
    36     Blocks.Interfaces.RealOutput z[3](each final quantity="AngularAcceleration", each final unit = "1/s2") if get_z 
     44    Blocks.Interfaces.RealOutput z[3](each final quantity="AngularAcceleration", each 
     45        final unit =                                                                               "1/s2") if get_z 
    3746      "Absolute angular acceleration vector"  
    3847      annotation (Placement(transformation( 
     
    537546      annotation(Dialog(tab="Advanced", group="if get_v_rel or get_a_rel or get_z_rel", enable=get_v_rel or get_a_rel or get_z_rel)); 
    538547 
    539     Blocks.Interfaces.RealOutput r_rel[3](each final quantity="Position", each final unit = "m") if get_r_rel 
     548    Blocks.Interfaces.RealOutput r_rel[3](each final quantity="Position", each 
     549        final unit =                                                                        "m") if get_r_rel 
    540550      "Relative position vector frame_b.r_0 - frame_a.r_0 resolved in frame defined by resolveInFrame" 
    541551      annotation (Placement(transformation( 
     
    543553          extent={{10,-10},{-10,10}}, 
    544554          rotation=90))); 
    545     Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each final unit = "m/s") if get_v_rel 
     555    Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each 
     556        final unit =                                                                        "m/s") if get_v_rel 
    546557      "Relative velocity vector"  
    547558      annotation (Placement(transformation( 
     
    549560          extent={{10,-10},{-10,10}}, 
    550561          rotation=90))); 
    551     Blocks.Interfaces.RealOutput a_rel[3](each final quantity="Position", each final unit = "m") if get_a_rel 
     562    Blocks.Interfaces.RealOutput a_rel[3](each final quantity="Acceleration", 
     563        each final unit="m/s2") if                                                                  get_a_rel 
    552564      "Relative acceleration vector"  
    553565      annotation (Placement(transformation( 
     
    555567          extent={{10,-10},{-10,10}}, 
    556568          rotation=90))); 
    557     Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each final unit = "rad", each displayUnit="deg") if get_angles 
     569    Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each 
     570        final unit =                                                                       "rad", each 
     571        displayUnit =                                                                                              "deg") if get_angles 
    558572      "Angles to rotate frame_a into frame_b via 'sequence'"  
    559573      annotation (Placement(transformation( 
     
    561575          extent={{10,-10},{-10,10}}, 
    562576          rotation=90))); 
    563     Blocks.Interfaces.RealOutput w_rel[3](each final quantity="AngularVelocity", each final unit = "1/s") if get_w_rel 
     577    Blocks.Interfaces.RealOutput w_rel[3](each final quantity="AngularVelocity", each 
     578        final unit =                                                                               "1/s") if get_w_rel 
    564579      "Relative angular velocity vector"  
    565580      annotation (Placement(transformation( 
     
    567582          extent={{10,-10},{-10,10}}, 
    568583          rotation=90))); 
    569     Blocks.Interfaces.RealOutput z_rel[3](each final quantity="AngularAcceleration", each final unit = "1/s2") if get_z_rel 
     584    Blocks.Interfaces.RealOutput z_rel[3](each final quantity="AngularAcceleration", each 
     585        final unit =                                                                                   "1/s2") if get_z_rel 
    570586      "Relative angular acceleration vector"  
    571587      annotation (Placement(transformation( 
     
    9871003    "Measure absolute position vector of the origin of a frame connector" 
    9881004    extends Internal.PartialAbsoluteSensor; 
    989     Blocks.Interfaces.RealOutput r[3](each final quantity="Position", each final unit = "m") 
     1005    Blocks.Interfaces.RealOutput r[3](each final quantity="Position", each 
     1006        final unit =                                                                    "m") 
    9901007      "Absolute position vector resolved in frame defined by resolveInFrame"  
    9911008      annotation (Placement(transformation( 
     
    10151032    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
    10161033              -100},{100,100}}), graphics), Icon(coordinateSystem( 
    1017             preserveAspectRatio=true, extent={{-100,-100},{100,100}}), 
    1018           graphics={ 
     1034            preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics 
     1035          ={ 
    10191036          Line( 
    10201037            points={{70,0},{100,0}}, 
     
    11071124    "Measure absolute velocity vector of origin of frame connector" 
    11081125    extends Internal.PartialAbsoluteSensor; 
    1109     Blocks.Interfaces.RealOutput v[3](each final quantity="Velocity", each final unit = "m/s") 
     1126    Blocks.Interfaces.RealOutput v[3](each final quantity="Velocity", each 
     1127        final unit =                                                                    "m/s") 
    11101128      "Absolute velocity vector resolved in frame defined by resolveInFrame"  
    11111129      annotation (Placement(transformation( 
     
    12421260          transformation(extent={{-116,-16},{-84,16}}, rotation=0))); 
    12431261 
    1244     Modelica.Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each final unit = "rad", each displayUnit="deg") 
     1262    Modelica.Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each 
     1263        final unit =                                                                                "rad", each 
     1264        displayUnit =                                                                                                    "deg") 
    12451265      "Angles to rotate world frame into frame_a via 'sequence'"  
    12461266      annotation (Placement(transformation( 
     
    13261346    "Measure absolute angular velocity of frame connector" 
    13271347    extends Internal.PartialAbsoluteSensor; 
    1328     Blocks.Interfaces.RealOutput w[3](each final quantity="AngularVelocity", each final unit = "1/s") 
     1348    Blocks.Interfaces.RealOutput w[3](each final quantity="AngularVelocity", each 
     1349        final unit =                                                                           "1/s") 
    13291350      "Absolute angular velocity vector of frame_a with respect to world frame, resolved in frame defined by resolveInFrame" 
    13301351      annotation (Placement(transformation( 
     
    14731494    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
    14741495              -100},{100,100}}), graphics), Icon(coordinateSystem( 
    1475             preserveAspectRatio=true, extent={{-100,-100},{100,100}}), 
    1476           graphics={ 
     1496            preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics 
     1497          ={ 
    14771498          Line( 
    14781499            points={{0,-70},{0,-100}}, 
     
    15641585    "Measure relative velocity vector between the origins of two frame connectors" 
    15651586    extends Internal.PartialRelativeSensor; 
    1566     Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each final unit = "m/s") 
     1587    Blocks.Interfaces.RealOutput v_rel[3](each final quantity="Velocity", each 
     1588        final unit =                                                                        "m/s") 
    15671589      "Relative velocity vector resolved in frame defined by resolveInFrame"  
    15681590      annotation (Placement(transformation( 
     
    16961718          transformation(extent={{84,-16},{116,16}}, rotation=0))); 
    16971719 
    1698     Modelica.Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each final unit = "rad", displayUnit="deg") 
     1720    Modelica.Blocks.Interfaces.RealOutput angles[3](each final quantity="Angles", each 
     1721        final unit =                                                                                "rad", displayUnit="deg") 
    16991722      "Angles to rotate frame_a into frame_b via 'sequence'"  
    17001723      annotation (Placement(transformation( 
     
    17931816    "Measure relative angular velocity between two frame connectors" 
    17941817    extends Internal.PartialRelativeSensor; 
    1795     Blocks.Interfaces.RealOutput w_rel[3](each final quantity="AngularVelocity", each final unit = "1/s") 
     1818    Blocks.Interfaces.RealOutput w_rel[3](each final quantity="AngularVelocity", each 
     1819        final unit =                                                                               "1/s") 
    17961820      "Relative angular velocity vector between frame_a and frame_b resolved in frame defined by resolveInFrame" 
    17971821      annotation (Placement(transformation( 
     
    18171841    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
    18181842              -100},{100,100}}), graphics), Icon(coordinateSystem( 
    1819             preserveAspectRatio=true, extent={{-100,-100},{100,100}}), 
    1820           graphics={ 
     1843            preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics 
     1844          ={ 
    18211845          Line( 
    18221846            points={{0,-70},{0,-100}}, 
     
    20302054    import SI = Modelica.SIunits; 
    20312055 
    2032     Modelica.Blocks.Interfaces.RealOutput force[3](final quantity="Force", final unit="N") 
     2056    Modelica.Blocks.Interfaces.RealOutput force[3](final quantity="Force", final unit 
     2057        =                                                                             "N") 
    20332058      "Cut force resolved in frame defined by resolveInFrame"  
    20342059         annotation (Placement(transformation( 
     
    22902315    import Modelica.Mechanics.MultiBody.Types; 
    22912316 
    2292     Modelica.Blocks.Interfaces.RealOutput force[3](final quantity="Force", final unit="N") 
     2317    Modelica.Blocks.Interfaces.RealOutput force[3](final quantity="Force", final unit 
     2318        =                                                                             "N") 
    22932319      "Cut force resolved in frame defined by resolveInFrame"  
    22942320         annotation (Placement(transformation( 
     
    25382564          iconTransformation(extent={{84,-15},{116,17}}))); 
    25392565 
    2540     Blocks.Interfaces.RealInput r_in[3](each final quantity="Position", each final unit = "m") 
     2566    Blocks.Interfaces.RealInput r_in[3] 
    25412567      "Input vector resolved in frame defined by frame_r_in"  
    25422568      annotation (Placement(transformation(extent={{-20,-20},{20,20}}, 
    25432569          rotation=-90, 
    25442570          origin={0,120}))); 
    2545     Blocks.Interfaces.RealOutput r_out[3](each final quantity="Position", each final unit = "m") 
     2571    Blocks.Interfaces.RealOutput r_out[3] 
    25462572      "Input vector r_in resolved in frame defined by frame_r_out"  
    25472573      annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 
     
    26482674          iconTransformation(extent={{84,65},{116,97}}))); 
    26492675 
    2650     Blocks.Interfaces.RealInput r_in[3](each final quantity="Position", each final unit = "m") 
     2676    Blocks.Interfaces.RealInput r_in[3] 
    26512677      "Input vector resolved in frame defined by frame_r_in"  
    26522678      annotation (Placement(transformation(extent={{-20,-20},{20,20}}, 
    26532679          rotation=-90, 
    26542680          origin={0,120}))); 
    2655     Blocks.Interfaces.RealOutput r_out[3](each final quantity="Position", each final unit = "m") 
     2681    Blocks.Interfaces.RealOutput r_out[3] 
    26562682      "Input vector r_in resolved in frame defined by frame_r_out"  
    26572683      annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 
     
    26722698    annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, 
    26732699              -100},{100,100}}), graphics), Icon(coordinateSystem( 
    2674             preserveAspectRatio=true, extent={{-100,-100},{100,100}}), 
    2675           graphics={ 
     2700            preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics 
     2701          ={ 
    26762702          Line( 
    26772703            points={{0,-70},{0,-100}}, 
     
    31183144            origin={100,0}))); 
    31193145 
    3120       Blocks.Interfaces.RealInput r_in[3](each final quantity="Position", each final unit = "m") 
     3146      Blocks.Interfaces.RealInput r_in[3] 
    31213147        "Input vector resolved in frame defined by frame_r_in"  
    31223148        annotation (Placement(transformation(extent={{-20,-20},{20,20}}, 
    31233149            rotation=-90, 
    31243150            origin={0,120}))); 
    3125       Blocks.Interfaces.RealOutput r_out[3](each final quantity="Position", each final unit = "m") 
     3151      Blocks.Interfaces.RealOutput r_out[3] 
    31263152        "Input vector r_in resolved in frame defined by frame_r_out"  
    31273153        annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 
     
    32213247        "Frame in which vector r_out (= r_in in other frame) is resolved (1: world, 2: frame_a, 3: frame_b, 4: frame_resolve)"; 
    32223248 
    3223       Blocks.Interfaces.RealInput r_in[3](each final quantity="Position", each final unit = "m") 
     3249      Blocks.Interfaces.RealInput r_in[3] 
    32243250        "Input vector resolved in frame defined by frame_r_in"  
    32253251        annotation (Placement(transformation(extent={{-20,-20},{20,20}}, 
    32263252            rotation=-90, 
    32273253            origin={0,120}))); 
    3228       Blocks.Interfaces.RealOutput r_out[3](each final quantity="Position", each final unit = "m") 
     3254      Blocks.Interfaces.RealOutput r_out[3] 
    32293255        "Input vector r_in resolved in frame defined by frame_r_out"  
    32303256        annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 
     
    33163342 
    33173343      annotation ( 
    3318          
    33193344        Documentation(info=" 
    33203345<HTML> 
     
    33913416 
    33923417      annotation ( 
    3393          
    33943418        Documentation(info=" 
    33953419<HTML> 
     
    34623486      extends 
    34633487        Modelica.Mechanics.MultiBody.Sensors.Internal.PartialCutForceBaseSensor; 
    3464       Modelica.Blocks.Interfaces.RealOutput force[3](final quantity="Force", final unit="N") 
     3488      Modelica.Blocks.Interfaces.RealOutput force[3](final quantity="Force", final unit 
     3489          =                                                                             "N") 
    34653490        "Cut force resolved in frame defined by resolveInFrame"  
    34663491           annotation (Placement(transformation( 
  • trunk/Modelica/Mechanics/MultiBody/Visualizers.mo

    r1050 r1091  
    8787      annotation (Dialog(group="if animation = true", enable=animation)); 
    8888    annotation ( 
    89        
    9089      Documentation(info="<HTML> 
    9190<p> 
     
    171170            fillPattern=FillPattern.Solid), 
    172171          Polygon( 
    173             points={{-98,34},{-64,46},{0,30},{74,56},{50,32},{-10,12},{-98,34}}, 
     172            points={{-98,34},{-64,46},{0,30},{74,56},{50,32},{-10,12},{-98,34}},  
     173 
    174174            lineColor={255,255,255}, 
    175175            fillColor={160,160,164}, 
     
    259259 
    260260    annotation ( 
    261        
    262261      Icon(coordinateSystem( 
    263262          preserveAspectRatio=true, 
     
    754753      annotation (Dialog(group="if animation = true", enable=animation)); 
    755754 
    756     Modelica.Blocks.Interfaces.RealInput r_head[3](each final quantity="Position", each final unit="m") 
     755    Modelica.Blocks.Interfaces.RealInput r_head[3](each final quantity="Position", each 
     756        final unit =                                                                               "m") 
    757757      "Position vector from origin of frame_a to head of arrow, resolved in frame_a" 
    758758      annotation (Placement(transformation( 
     
    11051105      input Types.ShapeExtra extra=0.0 
    11061106        "Additional size data for some of the shape types"                                 annotation(Dialog); 
    1107       input Integer color[3]={255,0,0} "Color of shape"            annotation(Dialog); 
     1107      input Real color[3]={255,0,0} "Color of shape"               annotation(Dialog); 
    11081108      input Types.SpecularCoefficient specularCoefficient = 0.7 
    11091109        "Reflection of ambient light (= 0: light is completely absorbed)" annotation(Dialog); 
     
    11621162              extent={{-132,160},{128,100}}, 
    11631163              textString="%name", 
    1164               lineColor={0,0,255})}) 
    1165         , 
     1164              lineColor={0,0,255})}), 
    11661165        Documentation(info="<HTML> 
    11671166<p>