Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#3783 closed defect (fixed)

OMEdit parameter changes overwrite existing arguments

Reported by: Christoph <buchner@…> Owned by: adrpo
Priority: blocker Milestone:
Component: Interactive Environment Version:
Keywords: Cc:

Description

Let's say I start putting together a simple Modelica.Fluid system, with just a source for now (annotations omitted):

model test_overwritten_args
  replaceable package liquid = Modelica.Media.Water.StandardWater;
  Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid)
end test_overwritten_args;

Checking the model works fine. Now, let's use OMEdit to change the FixedBoundary pressure to what we actually need: Diagram view - double-click - put 10e5 into the p field - OK - save - Check model.

Funny, we get an error message:

[2] 11:18:17 Translation Error
[test_overwritten_args: 3:3-3:204]: component boundary contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.

[3] 11:18:17 Translation Error
Error occurred while flattening model test_overwritten_args

Let's check the source:

  Modelica.Fluid.Sources.FixedBoundary boundary(p = 10e5)

The pressure was added, but surprisingly, the medium redeclaration was deleted!
This happens on every change of a parameter, as far as I can see, so on every change I have to go into text view and re-do the redeclare argument, which is very annoying!

Using OMEdit 1.9.4 on Windows 10 64bit.

Change History (9)

comment:1 Changed 8 years ago by adrpo

  • Component changed from *unknown* to Interactive Environment
  • Milestone changed from Future to 1.10.0
  • Owner changed from somebody to adrpo
  • Status changed from new to accepted

Yes, the OMC API that OMEdit is using does not handle redeclare modifications. We will fix that.

comment:2 Changed 8 years ago by Christoph <buchner@…>

Thank you.
Would it be possible to even make that settable with the UI? Maybe even a dropdown or whatever.
I tried doing this via the modifiers tab, but that didn't seem possible.

comment:3 Changed 8 years ago by adrpo

Of course, that would be the goal to have a dropdown list for the replaceable classes based on choicesAllMatching annotation. But will probably do this in phases, first we should fix so we don't remove the redeclares when we change the other modifiers.

comment:4 Changed 8 years ago by Christoph <buchner@…>

first we should fix so we don't remove the redeclares when we change the other modifiers.

I know about the vagaries of time estimates, but can you maybe at least guess when this could be fixed? I'm currently putting together a Medium-using model, and constantly re-adding the redeclares is frustrating. :-/

comment:5 Changed 8 years ago by Christoph <buchner@…>

Can we put this on at least critical (o priority for 1.10.0? I think OMEdit mangling user code should warrant priorization of this issue.

comment:6 Changed 8 years ago by adrpo

  • Priority changed from high to blocker

I already started looking into this one and then I'll continue with #2079.

comment:7 Changed 8 years ago by adrpo

  • Resolution set to fixed
  • Status changed from accepted to closed

This should be fixed by a21da84/OMCompiler, 43d1b0b/OMEdit and tested in 131a472/OpenModelica-testsuite.

comment:8 Changed 8 years ago by Christoph <buchner@…>

Thank you, confirmed fixed!

comment:9 Changed 6 years ago by sjoelund.se

  • Milestone 1.10.0 deleted

Milestone deleted

Note: See TracTickets for help on using tickets.