Opened 11 years ago

Closed 11 years ago

#2650 closed defect (fixed)

same instance name in several hierachical levels generate wrong crefs

Reported by: Peter Aronsson Owned by: Adrian Pop
Priority: high Milestone: 1.9.1
Component: Frontend Version: trunk
Keywords: Cc: Adrian Pop

Description

Consider this simple example:

model A
  B pendulum annotation(Placement(visible = true, transformation(origin = {-22.679,7.56}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  model B
    inner Modelica.Mechanics.MultiBody.World world annotation(Placement(visible = true, transformation(origin = {-72.44499999999999,5}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Mechanics.MultiBody.Parts.BodyCylinder pendulum annotation(Placement(visible = true, transformation(origin = {0,2.165}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Mechanics.MultiBody.Joints.Revolute revolute annotation(Placement(visible = true, transformation(origin = {-41.811,5}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  equation
    connect(revolute.frame_b,pendulum.frame_a) annotation(Line(visible = true, origin = {-16.959,3.583}, points = {{-14.852,1.417},{3.946,1.417},{3.946,-1.417},{6.959,-1.417}}));
    connect(world.frame_b,revolute.frame_a) annotation(Line(visible = true, origin = {-57.128,5}, points = {{-5.317,0},{5.317,0}}));
    annotation(Diagram(coordinateSystem(extent = {{-148.5,-105},{148.5,105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5,5})));
  end B;
  annotation(Diagram(coordinateSystem(extent = {{-148.5,-105},{148.5,105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5,5})));
end A;

It fails to generate code because it appends an extra 'pendulum' to a variable. If the outermost instance name is changed to something else than 'pendulum' it works fine.

Tested on 1.9.1+dev (r18826)

Change History (3)

comment:1 by Martin Sjölund, 11 years ago

Cc: Adrian Pop added

comment:2 by Adrian Pop, 11 years ago

Owner: changed from somebody to Adrian Pop
Status: newaccepted

This is an issue with inner outer that is a qualified cref.
I'll have a look at it.

comment:3 by Adrian Pop, 11 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in r19984.

Note: See TracTickets for help on using tickets.