Opened 8 years ago

Last modified 3 years ago

#4238 assigned defect

OMEdit shows strange behavior when loading system libraries automatically

Reported by: Rüdiger Franke Owned by: Adrian Pop
Priority: high Milestone:
Component: Interactive Environment Version: v1.11.0
Keywords: Cc: Martin Sjölund

Description

OMEdit ships with numerous so called System Libraries. They are currently loaded when invoking "Check Model". A couple of problems show up. This is why the automatic loading should happen earlier, e.g. when a model is loaded.

See the attached file ControlledMixingUnit2.mo.
So far OMEdit just reports upon file open:

[1] 13:34:35 Übersetzung Fehler
[ControlledMixingUnit2: 3:3-4:50]: Klasse Modelica_Synchronous.Examples.Systems.ControlledMixingUnit konnte nicht im Geltungsbereich von <global scope> gefunden werden.

Check model reports:

[1] 13:43:56 Skripting Meldung
Automatically loaded package Modelica_Synchronous 0.92.1 due to uses annotation.

[2] 13:43:57 Skripting Fehler
Unable to find component feedback.y while parsing connection {feedback.y,gain.u, ""}.

[3] 13:43:57 Skripting Fehler
Unable to find component gain.y while parsing connection {gain.y,add.u2, ""}.

[4] 13:43:57 Skripting Fehler
Unable to find component inverseBlockConstraints.y2 while parsing connection {inverseBlockConstraints.y2,invMixingUnit.T_c, ""}.

[5] 13:43:57 Skripting Fehler
Unable to find component invMixingUnit.c while parsing connection {invMixingUnit.c,inverseBlockConstraints.u2, ""}.

[6] 13:43:57 Skripting Fehler
Unable to find component invMixingUnit.T while parsing connection {invMixingUnit.T,feedback.u1, ""}.

[7] 13:43:57 Skripting Fehler
Unable to find component filter.y while parsing connection {filter.y,inverseBlockConstraints.u1, ""}.

[8] 13:43:57 Skripting Fehler
Unable to find component hold1.y while parsing connection {hold1.y,mixingUnit.T_c, ""}.

[9] 13:43:57 Skripting Fehler
Unable to find component add.y while parsing connection {add.y,hold1.u, ""}.

[10] 13:43:57 Skripting Fehler
Unable to find component sample1.u while parsing connection {sample1.u,mixingUnit.T, ""}.

[11] 13:43:57 Skripting Fehler
Unable to find component sample1.y while parsing connection {sample1.y,feedback.u2, ""}.

[12] 13:43:57 Skripting Fehler
Unable to find component inverseBlockConstraints.y1 while parsing connection {inverseBlockConstraints.y1,add.u1, ""}.

[13] 13:43:57 Skripting Fehler
Unable to find component sample2.u while parsing connection {sample2.u,step.y, ""}.

[14] 13:43:57 Skripting Fehler
Unable to find component filter.u while parsing connection {filter.u,sample2.y, ""}.

[15] 13:43:57 Skripting Fehler
Unable to find component periodicClock1.y while parsing connection {periodicClock1.y,sample2.clock, ""}.

[16] 13:43:57 Skripting Meldung
Check of ControlledMixingUnit2 completed successfully.

Simulation works afterwards. The model graphics remains wrong though.

Attachments (4)

ControlledMixingUnit2.mo (251 bytes ) - added by Rüdiger Franke 8 years ago.
ControlledMixingUnit2.mos (113 bytes ) - added by Adeel Asghar 8 years ago.
ControlledMixingUnit2_Error.mos (208 bytes ) - added by Adeel Asghar 7 years ago.
ControlledMixingUnit2_Success.mos (261 bytes ) - added by Adeel Asghar 7 years ago.

Download all attachments as: .zip

Change History (14)

by Rüdiger Franke, 8 years ago

Attachment: ControlledMixingUnit2.mo added

comment:1 by Adeel Asghar, 8 years ago

Its omc that does the automatic loading not OMEdit.

Btw I am getting this error,

[C:/OpenModelica/build/lib/omlibrary/Modelica_Synchronous 0.92.1/ClockSignals.mo:675:3-707:11:writable] Error: Class Clock not found in scope Modelica_Synchronous.ClockSignals.Interfaces.
Error: Error occurred while flattening model ControlledMixingUnit2

Perhaps you have a different version of Modelica_Synchronous. Mine is Modelica_Synchronous 0.92.1.

by Adeel Asghar, 8 years ago

Attachment: ControlledMixingUnit2.mos added

comment:2 by Rüdiger Franke, 8 years ago

Your error "Class Clock not found" is because omc requires the flag "+std=3.3" for synchronous features.

When omc runs on command line, it does not make a difference if it loads dependend libaries early during model load or late during model translation. OMEdit appears to require early load, before it builds up caches for model graphics and the like.

comment:3 by Adeel Asghar, 8 years ago

Milestone: 1.11.01.12.0

Milestone changed to 1.12.0 since 1.11.0 was released.

by Adeel Asghar, 7 years ago

by Adeel Asghar, 7 years ago

comment:4 by Adeel Asghar, 7 years ago

Cc: Martin Sjölund added
Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Adrian Pop
Status: newassigned

I debugged a bit more into this and the issue is that the getComponents API fails depending on the order of loaded libraries.

I attached two script files that demonstrates the problem.

comment:5 by Francesco Casella, 7 years ago

Milestone: 1.12.01.13.0

Milestone moved to 1.13.0 due to 1.12.0 already being released.

comment:6 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:7 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:8 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:9 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:10 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.