#4381 closed defect (fixed)
OMEdit: A for loop in equations leads to vanishing of connection annotations (wires)
Reported by: | Jan Kokert | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | normal | Milestone: | 1.12.0 |
Component: | OMEdit | Version: | |
Keywords: | for loop connection annotations | Cc: |
Description (last modified by )
We just figured out another very strange bug in OMEdit. Consider the following example:
model test Modelica.Electrical.Analog.Basic.Ground ground1 annotation( Placement(visible = true, transformation(origin = {-30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); Modelica.Electrical.Analog.Basic.Ground ground2 annotation( Placement(visible = true, transformation(origin = {30, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); Modelica.Electrical.Analog.Basic.Resistor resistor1 annotation( Placement(visible = true, transformation(origin = {30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90))); Modelica.Electrical.Analog.Basic.Capacitor capacitor1 annotation( Placement(visible = true, transformation(origin = {-30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90))); Real a,b; equation for i in 1:2 loop a = b; end for; connect(resistor1.n, ground2.p) annotation( Line(points = {{30, 0}, {30, 0}, {30, -20}, {30, -20}}, color = {0, 0, 255})); connect(capacitor1.p, resistor1.p) annotation( Line(points = {{-30, 20}, {-30, 20}, {-30, 30}, {30, 30}, {30, 20}, {30, 20}}, color = {0, 0, 255})); connect(capacitor1.n, ground1.p) annotation( Line(points = {{-30, 0}, {-30, 0}, {-30, -20}, {-30, -20}}, color = {0, 0, 255})); annotation( uses(Modelica(version = "3.2.2"))); end test;
The connection annotation between capacitor1 and ground1 is not shown. You can put a /* ... */
comment around the for loop
block and the connection will be displayed corretly.
It is always the annotation of the last connection statement, which is not evaluated. I guess, that the internal iterator which evaluates the connection annotations somehow interprets also the for
statement and then one annotation is missing in the end.
I hope this analysis helps to fix this issue.
Attachments (1)
Change History (4)
by , 8 years ago
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Milestone: | Future → 1.12.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Fixed in e3fdafb/OMCompiler.